robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
Solution to the optimal control problem split into a time stage. More...
#include <split_solution.hpp>
Public Types | |
using | Vector6d = Eigen::Matrix< double, 6, 1 > |
Public Member Functions | |
SplitSolution (const Robot &robot) | |
Construct a split solution. More... | |
SplitSolution () | |
Default constructor. More... | |
~SplitSolution ()=default | |
Default destructor. More... | |
SplitSolution (const SplitSolution &)=default | |
Default copy constructor. More... | |
SplitSolution & | operator= (const SplitSolution &)=default |
Default copy assign operator. More... | |
SplitSolution (SplitSolution &&) noexcept=default | |
Default move constructor. More... | |
SplitSolution & | operator= (SplitSolution &&) noexcept=default |
Default move assign operator. More... | |
void | setContactStatus (const ContactStatus &contact_status) |
Set contact status, i.e., set the dimension of the contacts. More... | |
void | setContactStatus (const ImpactStatus &contact_status) |
Set contact status, i.e., set the dimension of the contacts. More... | |
void | setContactStatus (const SplitSolution &other) |
Set contact status, i.e., set the dimension of the contacts. More... | |
void | setSwitchingConstraintDimension (const int dims) |
Sets the dimension of the switching constraint. More... | |
Eigen::VectorBlock< Eigen::VectorXd > | f_stack () |
Stack of the active contact forces. Size is ContactStatus::dimf(). More... | |
const Eigen::VectorBlock< const Eigen::VectorXd > | f_stack () const |
Const version of SplitSolution::f_stack(). More... | |
void | set_f_stack () |
Sets SplitSolution::f_stack() from SplitSolution::f. More... | |
void | set_f_vector () |
Sets SplitSolution::f from SplitSolution::f_stack(). More... | |
Eigen::VectorBlock< Eigen::VectorXd > | mu_stack () |
Stack of the Lagrange multipliers w.r.t. the acceleration-level contact constraints that is active at the current contact status. Size is SplitSolution::dimf(). More... | |
const Eigen::VectorBlock< const Eigen::VectorXd > | mu_stack () const |
Const version of SplitSolution::mu_stack(). More... | |
void | set_mu_stack () |
Set SplitSolution::mu_stack() from SplitSolution::mu. More... | |
void | set_mu_vector () |
Set SplitSolution::mu from SplitSolution::mu_stack(). More... | |
Eigen::VectorBlock< Eigen::VectorXd > | xi_stack () |
Stack of the Lagrange multipliers w.r.t. the switching constraints that is active at the future impact status. Size is SplitSolution::dimf(). More... | |
const Eigen::VectorBlock< const Eigen::VectorXd > | xi_stack () const |
const version of SplitSolution::xi_stack(). More... | |
int | dimf () const |
Returns the dimension of the contact at the current contact status. More... | |
int | dims () const |
Returns the dimension of the switching constraint. More... | |
bool | isContactActive (const int contact_index) const |
Return true if contact is active and false if not. More... | |
std::vector< bool > | isContactActive () const |
Return activities of contacts. More... | |
void | integrate (const Robot &robot, const double step_size, const SplitDirection &d, const bool impact=false) |
Integrates the solution based on step size and direction. More... | |
void | copyPrimal (const SplitSolution &other) |
Copies the primal solution from another solution. More... | |
void | copyDual (const SplitSolution &other) |
Copies the dual solution from another solution. More... | |
bool | isApprox (const SplitSolution &other) const |
Return true if two SplitSolution have the same value and false if not. More... | |
double | lagrangeMultiplierLinfNorm () const |
Return L-infinity Norm of the lagrange multipliers. Used in line search. More... | |
void | setRandom (const Robot &robot) |
Set each component vector by random value based on the current contact status. More... | |
void | setRandom (const Robot &robot, const ContactStatus &contact_status) |
Set each component vector by random value. Contact status is reset. More... | |
void | setRandom (const Robot &robot, const ImpactStatus &impact_status) |
Set each component vector by random value. Impact status is reset. More... | |
void | setRandom (const Robot &robot, const ContactStatus &contact_status, const ImpactStatus &impact_status) |
Set each component vector by random value. Contact status and impact status are reset. More... | |
void | disp (std::ostream &os) const |
Displays the split solution onto a ostream. More... | |
Static Public Member Functions | |
static SplitSolution | Random (const Robot &robot) |
Generates split solution filled randomly. More... | |
static SplitSolution | Random (const Robot &robot, const ContactStatus &contact_status) |
Generates split solution filled randomly. More... | |
static SplitSolution | Random (const Robot &robot, const ImpactStatus &impact_status) |
Generates split solution filled randomly. More... | |
static SplitSolution | Random (const Robot &robot, const ContactStatus &contact_status, const ImpactStatus &impact_status) |
Generates split solution filled randomly. More... | |
Public Attributes | |
Eigen::VectorXd | q |
Configuration. Size is Robot::dimq(). More... | |
Eigen::VectorXd | v |
Generalized velocity. Size is Robot::dimv(). More... | |
Eigen::VectorXd | a |
Generalized acceleration. Size is Robot::dimv(). More... | |
Eigen::VectorXd | dv |
Generalized acceleration. Size is Robot::dimv(). More... | |
Eigen::VectorXd | u |
Control input torques. Size is Robot::dimu(). More... | |
std::vector< Vector6d > | f |
Contact wrenches. Upper 3 elements are linear contact force and the lower 3 elements are the angular momentum. Size is Robot::maxNumContacts(). More... | |
Eigen::VectorXd | lmd |
Lagrange multiplier w.r.t. the state equation w.r.t. q. Size is Robot::dimv(). More... | |
Eigen::VectorXd | gmm |
Lagrange multiplier w.r.t. the state equation w.r.t. v. Size is Robot::dimv(). More... | |
Eigen::VectorXd | beta |
Lagrange multiplier w.r.t. the inverse dynamics constraint. Size is Robot::dimv(). More... | |
std::vector< Vector6d > | mu |
Lagrange multiplier w.r.t. the acceleration-level contact constraint. Upper 3 elements are w.r.t. the linear contact acceleration and the lower 3 elements are w.r.t. the angular contact acceleration. Size is Robot::maxNumContacts(). More... | |
Eigen::VectorXd | nu_passive |
Lagrange multiplier w.r.t. the passive joint constraint. Size is Robot::dim_passive(). More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SplitSolution &s) |
Solution to the optimal control problem split into a time stage.
using robotoc::SplitSolution::Vector6d = Eigen::Matrix<double, 6, 1> |
robotoc::SplitSolution::SplitSolution | ( | const Robot & | robot | ) |
Construct a split solution.
[in] | robot | Robot model. |
robotoc::SplitSolution::SplitSolution | ( | ) |
Default constructor.
|
default |
Default destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
void robotoc::SplitSolution::copyDual | ( | const SplitSolution & | other | ) |
Copies the dual solution from another solution.
[in] | other | Another split solution. |
void robotoc::SplitSolution::copyPrimal | ( | const SplitSolution & | other | ) |
Copies the primal solution from another solution.
[in] | other | Another split solution. |
|
inline |
Returns the dimension of the contact at the current contact status.
|
inline |
Returns the dimension of the switching constraint.
void robotoc::SplitSolution::disp | ( | std::ostream & | os | ) | const |
Displays the split solution onto a ostream.
|
inline |
Stack of the active contact forces. Size is ContactStatus::dimf().
|
inline |
Const version of SplitSolution::f_stack().
void robotoc::SplitSolution::integrate | ( | const Robot & | robot, |
const double | step_size, | ||
const SplitDirection & | d, | ||
const bool | impact = false |
||
) |
Integrates the solution based on step size and direction.
[in] | robot | Robot model. |
[in] | step_size | Step size. |
[in] | d | Split direction. |
[in] | impact | Flaf if this is impact stage or not. |
bool robotoc::SplitSolution::isApprox | ( | const SplitSolution & | other | ) | const |
Return true if two SplitSolution have the same value and false if not.
[in] | other | Split solution that is compared with this object. |
|
inline |
Return activities of contacts.
|
inline |
Return true if contact is active and false if not.
[in] | contact_index | Index of a contact of interedted. |
double robotoc::SplitSolution::lagrangeMultiplierLinfNorm | ( | ) | const |
Return L-infinity Norm of the lagrange multipliers. Used in line search.
|
inline |
Stack of the Lagrange multipliers w.r.t. the acceleration-level contact constraints that is active at the current contact status. Size is SplitSolution::dimf().
|
inline |
Const version of SplitSolution::mu_stack().
|
default |
Default copy assign operator.
|
defaultnoexcept |
Default move assign operator.
|
static |
Generates split solution filled randomly.
[in] | robot | Robot model. |
|
static |
Generates split solution filled randomly.
[in] | robot | Robot model. |
[in] | contact_status | Contact status. |
|
static |
Generates split solution filled randomly.
[in] | robot | Robot model. |
[in] | contact_status | Contact status. |
[in] | impact_status | Impact status. |
|
static |
Generates split solution filled randomly.
[in] | robot | Robot model. |
[in] | impact_status | Impact status. |
|
inline |
Sets SplitSolution::f_stack() from SplitSolution::f.
|
inline |
Sets SplitSolution::f from SplitSolution::f_stack().
|
inline |
Set SplitSolution::mu_stack() from SplitSolution::mu.
|
inline |
Set SplitSolution::mu from SplitSolution::mu_stack().
|
inline |
Set contact status, i.e., set the dimension of the contacts.
[in] | contact_status | Contact status. |
|
inline |
Set contact status, i.e., set the dimension of the contacts.
[in] | contact_status | Contact status. |
|
inline |
Set contact status, i.e., set the dimension of the contacts.
[in] | other | Other split solution. |
void robotoc::SplitSolution::setRandom | ( | const Robot & | robot | ) |
Set each component vector by random value based on the current contact status.
[in] | robot | Robot model. |
void robotoc::SplitSolution::setRandom | ( | const Robot & | robot, |
const ContactStatus & | contact_status | ||
) |
Set each component vector by random value. Contact status is reset.
[in] | robot | Robot model. |
[in] | contact_status | Contact status. |
void robotoc::SplitSolution::setRandom | ( | const Robot & | robot, |
const ContactStatus & | contact_status, | ||
const ImpactStatus & | impact_status | ||
) |
Set each component vector by random value. Contact status and impact status are reset.
[in] | robot | Robot model. |
[in] | contact_status | Contact status. |
[in] | impact_status | Impact status. |
void robotoc::SplitSolution::setRandom | ( | const Robot & | robot, |
const ImpactStatus & | impact_status | ||
) |
Set each component vector by random value. Impact status is reset.
[in] | robot | Robot model. |
[in] | impact_status | Impact status. |
|
inline |
Sets the dimension of the switching constraint.
[in] | dims | The dimension of the switching constraint. Must be non-negative. |
|
inline |
Stack of the Lagrange multipliers w.r.t. the switching constraints that is active at the future impact status. Size is SplitSolution::dimf().
|
inline |
const version of SplitSolution::xi_stack().
|
friend |
Eigen::VectorXd robotoc::SplitSolution::a |
Generalized acceleration. Size is Robot::dimv().
Eigen::VectorXd robotoc::SplitSolution::beta |
Lagrange multiplier w.r.t. the inverse dynamics constraint. Size is Robot::dimv().
Eigen::VectorXd robotoc::SplitSolution::dv |
Generalized acceleration. Size is Robot::dimv().
std::vector<Vector6d> robotoc::SplitSolution::f |
Contact wrenches. Upper 3 elements are linear contact force and the lower 3 elements are the angular momentum. Size is Robot::maxNumContacts().
Eigen::VectorXd robotoc::SplitSolution::gmm |
Lagrange multiplier w.r.t. the state equation w.r.t. v. Size is Robot::dimv().
Eigen::VectorXd robotoc::SplitSolution::lmd |
Lagrange multiplier w.r.t. the state equation w.r.t. q. Size is Robot::dimv().
std::vector<Vector6d> robotoc::SplitSolution::mu |
Lagrange multiplier w.r.t. the acceleration-level contact
constraint. Upper 3 elements are w.r.t. the linear contact acceleration and the lower 3 elements are w.r.t. the angular contact acceleration. Size is Robot::maxNumContacts().
Eigen::VectorXd robotoc::SplitSolution::nu_passive |
Lagrange multiplier w.r.t. the passive joint constraint. Size is Robot::dim_passive().
Eigen::VectorXd robotoc::SplitSolution::q |
Configuration. Size is Robot::dimq().
Eigen::VectorXd robotoc::SplitSolution::u |
Control input torques. Size is Robot::dimu().
Eigen::VectorXd robotoc::SplitSolution::v |
Generalized velocity. Size is Robot::dimv().