1#ifndef ROBOTOC_SPLIT_SOLUTION_HXX_
2#define ROBOTOC_SPLIT_SOLUTION_HXX_
12 assert(contact_status.
maxNumContacts() == is_contact_active_.size());
14 dimf_ = contact_status.
dimf();
20 assert(contact_status.
maxNumContacts() == is_contact_active_.size());
22 dimf_ = contact_status.
dimf();
35 assert(
dims <= xi_stack_.size());
36 dims_ = std::max(
dims, 0);
41 return f_stack_.head(dimf_);
45inline const Eigen::VectorBlock<const Eigen::VectorXd>
47 return f_stack_.head(dimf_);
52 int segment_begin = 0;
53 for (
int i=0; i<max_num_contacts_; ++i) {
54 if (is_contact_active_[i]) {
55 switch (contact_types_[i]) {
57 f_stack_.template segment<3>(segment_begin) =
f[i].template head<3>();
61 f_stack_.template segment<6>(segment_begin) =
f[i];
73 int segment_begin = 0;
74 for (
int i=0; i<max_num_contacts_; ++i) {
75 if (is_contact_active_[i]) {
76 switch (contact_types_[i]) {
78 f[i].template head<3>() = f_stack_.template segment<3>(segment_begin);
82 f[i] = f_stack_.template segment<6>(segment_begin);
94 return mu_stack_.head(dimf_);
98inline const Eigen::VectorBlock<const Eigen::VectorXd>
100 return mu_stack_.head(dimf_);
105 int segment_begin = 0;
106 for (
int i=0; i<max_num_contacts_; ++i) {
107 if (is_contact_active_[i]) {
108 switch (contact_types_[i]) {
110 mu_stack_.template segment<3>(segment_begin) =
mu[i].template head<3>();
114 mu_stack_.template segment<6>(segment_begin) =
mu[i];
126 int segment_begin = 0;
127 for (
int i=0; i<max_num_contacts_; ++i) {
128 if (is_contact_active_[i]) {
129 switch (contact_types_[i]) {
131 mu[i].template head<3>() = mu_stack_.template segment<3>(segment_begin);
135 mu[i] = mu_stack_.template segment<6>(segment_begin);
147 return xi_stack_.head(dims_);
151inline const Eigen::VectorBlock<const Eigen::VectorXd>
153 return xi_stack_.head(dims_);
168 assert(!is_contact_active_.empty());
169 assert(contact_index >= 0);
170 assert(contact_index < is_contact_active_.size());
171 return is_contact_active_[contact_index];
176 return is_contact_active_;
Impact status of robot model. Wrapper of ContactStatus to treat impacts.
Definition: impact_status.hpp:21
int dimf() const
Returns the dimension of the active impact forces.
Definition: impact_status.hxx:70
int maxNumContacts() const
Returns the maximum number of the contacts.
Definition: impact_status.hxx:75
bool isImpactActive(const int contact_index) const
Returns true if a contact is active and false if not.
Definition: impact_status.hxx:55
Solution to the optimal control problem split into a time stage.
Definition: split_solution.hpp:20
bool isContactActive(const int contact_index) const
Return true if contact is active and false if not.
Definition: split_solution.hxx:167
Eigen::VectorBlock< Eigen::VectorXd > f_stack()
Stack of the active contact forces. Size is ContactStatus::dimf().
Definition: split_solution.hxx:40
Eigen::VectorBlock< Eigen::VectorXd > xi_stack()
Stack of the Lagrange multipliers w.r.t. the switching constraints that is active at the future impac...
Definition: split_solution.hxx:146
void set_f_stack()
Sets SplitSolution::f_stack() from SplitSolution::f.
Definition: split_solution.hxx:51
int dimf() const
Returns the dimension of the contact at the current contact status.
Definition: split_solution.hxx:157
int dims() const
Returns the dimension of the switching constraint.
Definition: split_solution.hxx:162
void setSwitchingConstraintDimension(const int dims)
Sets the dimension of the switching constraint.
Definition: split_solution.hxx:33
std::vector< bool > isContactActive() const
Return activities of contacts.
Definition: split_solution.hxx:175
void set_mu_vector()
Set SplitSolution::mu from SplitSolution::mu_stack().
Definition: split_solution.hxx:125
Eigen::VectorBlock< Eigen::VectorXd > mu_stack()
Stack of the Lagrange multipliers w.r.t. the acceleration-level contact constraints that is active at...
Definition: split_solution.hxx:93
void set_mu_stack()
Set SplitSolution::mu_stack() from SplitSolution::mu.
Definition: split_solution.hxx:104
void set_f_vector()
Sets SplitSolution::f from SplitSolution::f_stack().
Definition: split_solution.hxx:72
std::vector< Vector6d > mu
Lagrange multiplier w.r.t. the acceleration-level contact constraint. Upper 3 elements are w....
Definition: split_solution.hpp:163
void setContactStatus(const ContactStatus &contact_status)
Set contact status, i.e., set the dimension of the contacts.
Definition: split_solution.hxx:10
std::vector< Vector6d > f
Contact wrenches. Upper 3 elements are linear contact force and the lower 3 elements are the angular ...
Definition: split_solution.hpp:116
Definition: constraint_component_base.hpp:17