|
robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
KKT residual split into each time stage. More...
#include <split_kkt_residual.hpp>
Public Member Functions | |
| SplitKKTResidual (const Robot &robot) | |
| Construct a split KKT residual. More... | |
| SplitKKTResidual () | |
| Default constructor. More... | |
| ~SplitKKTResidual ()=default | |
| Default destructor. More... | |
| SplitKKTResidual (const SplitKKTResidual &)=default | |
| Default copy constructor. More... | |
| SplitKKTResidual & | operator= (const SplitKKTResidual &)=default |
| Default copy operator. More... | |
| SplitKKTResidual (SplitKKTResidual &&) noexcept=default | |
| Default move constructor. More... | |
| SplitKKTResidual & | operator= (SplitKKTResidual &&) noexcept=default |
| Default move assign operator. More... | |
| void | setContactDimension (const int dimf) |
| Sets contact status, i.e., set dimension of the contact forces. More... | |
| void | setSwitchingConstraintDimension (const int dims) |
| Sets the dimension of the switching constraint. More... | |
| Eigen::VectorBlock< Eigen::VectorXd > | Fq () |
| Residual in the state equation w.r.t. the configuration q. More... | |
| const Eigen::VectorBlock< const Eigen::VectorXd > | Fq () const |
| const version of SplitKKTResidual::Fq(). More... | |
| Eigen::VectorBlock< Eigen::VectorXd > | Fv () |
| Residual in the state equation w.r.t. the velocity v. More... | |
| const Eigen::VectorBlock< const Eigen::VectorXd > | Fv () const |
| const version of SplitKKTResidual::Fq(). More... | |
| Eigen::VectorBlock< Eigen::VectorXd > | P () |
| Residual in the switching constraint. More... | |
| const Eigen::VectorBlock< const Eigen::VectorXd > | P () const |
| const version of SplitKKTResidual::P(). More... | |
| Eigen::VectorBlock< Eigen::VectorXd > | lq () |
| KKT residual w.r.t. the configuration q. More... | |
| const Eigen::VectorBlock< const Eigen::VectorXd > | lq () const |
| const version of SplitKKTResidual::lq(). More... | |
| Eigen::VectorBlock< Eigen::VectorXd > | lv () |
| KKT residual w.r.t. the joint velocity v. More... | |
| const Eigen::VectorBlock< const Eigen::VectorXd > | lv () const |
| const version of SplitKKTResidual::lv(). More... | |
| Eigen::VectorBlock< Eigen::VectorXd > | lf () |
| KKT residual w.r.t. the stack of the contact forces f. More... | |
| const Eigen::VectorBlock< const Eigen::VectorXd > | lf () const |
| const version of SplitKKTResidual::lf(). More... | |
| double | KKTError () const |
| Returns the squared norm of the KKT residual, that is, the primal and dual residual. More... | |
| template<int p = 1> | |
| double | primalFeasibility () const |
| Returns the lp norm of the primal feasibility, i.e., the constraint violation. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter. More... | |
| template<int p = 1> | |
| double | dualFeasibility () const |
| Returns the lp norm of the dual feasibility. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter. More... | |
| void | setZero () |
| Sets the split KKT residual zero. More... | |
| int | dimf () const |
| Returns the dimension of the stack of the contact forces at the current contact status. More... | |
| int | dims () const |
| Returns the dimension of the stack of the contact forces at the current contact status. More... | |
| bool | isDimensionConsistent () const |
| Checks dimensional consistency of each component. More... | |
| bool | isApprox (const SplitKKTResidual &other) const |
| Checks the equivalence of two SplitKKTResidual. More... | |
| bool | hasNaN () const |
| Checks this has at least one NaN. More... | |
| void | setRandom () |
| Set by random value based on the current contact status. More... | |
| void | setRandom (const ContactStatus &contact_status) |
| Set by random value. Contact status is reset. More... | |
| void | setRandom (const ImpactStatus &impact_status) |
| Set by random value. Contact status is reset. More... | |
| void | disp (std::ostream &os) const |
| Displays the split KKT residual onto a ostream. More... | |
Static Public Member Functions | |
| static SplitKKTResidual | Random (const Robot &robot) |
| Generates split KKT residual filled randomly. More... | |
| static SplitKKTResidual | Random (const Robot &robot, const ContactStatus &contact_status) |
| Generates split KKT residual filled randomly. More... | |
| static SplitKKTResidual | Random (const Robot &robot, const ImpactStatus &impact_status) |
| Generates split KKT residual filled randomly. More... | |
Public Attributes | |
| Eigen::VectorXd | Fx |
| Residual in the state equation. Size is 2 * Robot::dimv(). More... | |
| Eigen::VectorXd | lx |
| KKT Residual w.r.t. the state x. Size is 2 * Robot::dimv(). More... | |
| Eigen::VectorXd | la |
| KKT residual w.r.t. the acceleration a. Size is Robot::dimv(). More... | |
| Eigen::VectorXd | ldv |
| KKT residual w.r.t. the impact change in the velocity ddv. Size is Robot::dimv(). More... | |
| Eigen::VectorXd | lu |
| KKT residual w.r.t. the control input torques u. Size is Robot::dimu(). More... | |
| double | h |
| KKT residual w.r.t. the switching time, that is, this is the value of the Hamiltonian. More... | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const SplitKKTResidual &kkt_residual) |
KKT residual split into each time stage.
| robotoc::SplitKKTResidual::SplitKKTResidual | ( | const Robot & | robot | ) |
Construct a split KKT residual.
| [in] | robot | Robot model. |
| robotoc::SplitKKTResidual::SplitKKTResidual | ( | ) |
Default constructor.
|
default |
Default destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
|
inline |
Returns the dimension of the stack of the contact forces at the current contact status.
|
inline |
Returns the dimension of the stack of the contact forces at the current contact status.
| void robotoc::SplitKKTResidual::disp | ( | std::ostream & | os | ) | const |
Displays the split KKT residual onto a ostream.
|
inline |
Returns the lp norm of the dual feasibility. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter.
| p | Index of norm. Default is 1 (l1-norm). |
|
inline |
Residual in the state equation w.r.t. the configuration q.
|
inline |
const version of SplitKKTResidual::Fq().
|
inline |
Residual in the state equation w.r.t. the velocity v.
|
inline |
const version of SplitKKTResidual::Fq().
| bool robotoc::SplitKKTResidual::hasNaN | ( | ) | const |
Checks this has at least one NaN.
| bool robotoc::SplitKKTResidual::isApprox | ( | const SplitKKTResidual & | other | ) | const |
Checks the equivalence of two SplitKKTResidual.
| [in] | other | Other object. |
| bool robotoc::SplitKKTResidual::isDimensionConsistent | ( | ) | const |
Checks dimensional consistency of each component.
|
inline |
Returns the squared norm of the KKT residual, that is, the primal and dual residual.
|
inline |
KKT residual w.r.t. the stack of the contact forces f.
|
inline |
const version of SplitKKTResidual::lf().
|
inline |
KKT residual w.r.t. the configuration q.
|
inline |
const version of SplitKKTResidual::lq().
|
inline |
KKT residual w.r.t. the joint velocity v.
|
inline |
const version of SplitKKTResidual::lv().
|
default |
Default copy operator.
|
defaultnoexcept |
Default move assign operator.
|
inline |
Residual in the switching constraint.
|
inline |
const version of SplitKKTResidual::P().
|
inline |
Returns the lp norm of the primal feasibility, i.e., the constraint violation. Default norm is l1-norm. You can also specify l-infty norm by passing Eigen::Infinity as the template parameter.
| p | Index of norm. Default is 1 (l1-norm). |
|
static |
Generates split KKT residual filled randomly.
| [in] | robot | Robot model. |
|
static |
Generates split KKT residual filled randomly.
| [in] | robot | Robot model. |
| [in] | contact_status | Contact status. |
|
static |
Generates split KKT residual filled randomly.
| [in] | robot | Robot model. |
| [in] | impact_status | Contact status. |
|
inline |
Sets contact status, i.e., set dimension of the contact forces.
| [in] | dimf | The dimension of the contact. Must be non-negative. |
| void robotoc::SplitKKTResidual::setRandom | ( | ) |
Set by random value based on the current contact status.
| void robotoc::SplitKKTResidual::setRandom | ( | const ContactStatus & | contact_status | ) |
Set by random value. Contact status is reset.
| [in] | contact_status | Contact status. |
| void robotoc::SplitKKTResidual::setRandom | ( | const ImpactStatus & | impact_status | ) |
Set by random value. Contact status is reset.
| [in] | impact_status | Contact status. |
|
inline |
Sets the dimension of the switching constraint.
| [in] | dims | The dimension of the switching constraint. Must be non-negative. |
|
inline |
Sets the split KKT residual zero.
|
friend |
| Eigen::VectorXd robotoc::SplitKKTResidual::Fx |
Residual in the state equation. Size is 2 * Robot::dimv().
| double robotoc::SplitKKTResidual::h |
KKT residual w.r.t. the switching time, that is, this is the value of the Hamiltonian.
| Eigen::VectorXd robotoc::SplitKKTResidual::la |
KKT residual w.r.t. the acceleration a. Size is Robot::dimv().
| Eigen::VectorXd robotoc::SplitKKTResidual::ldv |
KKT residual w.r.t. the impact change in the velocity ddv. Size is Robot::dimv().
| Eigen::VectorXd robotoc::SplitKKTResidual::lu |
KKT residual w.r.t. the control input torques u. Size is Robot::dimu().
| Eigen::VectorXd robotoc::SplitKKTResidual::lx |
KKT Residual w.r.t. the state x. Size is 2 * Robot::dimv().