|
| ConstraintModelResidualTpl (boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ResidualModelAbstract > residual) |
| Initialize the residual constraint model as an equality constraint. More...
|
|
| ConstraintModelResidualTpl (boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ResidualModelAbstract > residual, const VectorXs &lower, const VectorXs &upper) |
| Initialize the residual constraint model as an inequality constraint. More...
|
|
virtual void | calc (const boost::shared_ptr< ConstraintDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the residual constraint based on state only. More...
|
|
virtual void | calc (const boost::shared_ptr< ConstraintDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
| Compute the residual constraint. More...
|
|
virtual void | calcDiff (const boost::shared_ptr< ConstraintDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the derivatives of the residual constraint with respect to the state only. More...
|
|
virtual void | calcDiff (const boost::shared_ptr< ConstraintDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
| Compute the derivatives of the residual constraint. More...
|
|
virtual boost::shared_ptr< ConstraintDataAbstract > | createData (DataCollectorAbstract *const data) |
| Create the residual constraint data.
|
|
virtual void | print (std::ostream &os) const |
| Print relevant information of the cost-residual model. More...
|
|
| ConstraintModelAbstractTpl (boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ResidualModelAbstract > residual, const std::size_t ng, const std::size_t nh) |
| Initialize the constraint model. More...
|
|
| ConstraintModelAbstractTpl (boost::shared_ptr< StateAbstract > state, const std::size_t ng, const std::size_t nh) |
| Initialize the constraint model. More...
|
|
| ConstraintModelAbstractTpl (boost::shared_ptr< StateAbstract > state, const std::size_t nu, const std::size_t ng, const std::size_t nh) |
| the constraint model More...
|
|
const VectorXs & | get_lb () const |
| Return the lower bound of the constraint.
|
|
std::size_t | get_ng () const |
| Return the number of inequality constraints.
|
|
std::size_t | get_nh () const |
| Return the number of equality constraints.
|
|
std::size_t | get_nu () const |
| Return the dimension of the control input.
|
|
const boost::shared_ptr< ResidualModelAbstract > & | get_residual () const |
| Return the residual model.
|
|
const boost::shared_ptr< StateAbstract > & | get_state () const |
| Return the state.
|
|
ConstraintType | get_type () const |
| Return the type of constraint.
|
|
const VectorXs & | get_ub () const |
| Return the upper bound of the constraint.
|
|
void | remove_bounds () |
| Remove the bounds of the constraint.
|
|
void | update_bounds (const VectorXs &lower, const VectorXs &upper) |
| Update the lower and upper bounds the upper bound of constraint.
|
|
|
VectorXs | lb_ |
| Lower bound of the constraint.
|
|
std::size_t | ng_ |
| Number of inequality constraints.
|
|
std::size_t | nh_ |
| Number of equality constraints.
|
|
std::size_t | nu_ |
| Control dimension.
|
|
boost::shared_ptr< ResidualModelAbstract > | residual_ |
| Residual model.
|
|
boost::shared_ptr< StateAbstract > | state_ |
| State description.
|
|
ConstraintType | type_ |
| Type of constraint: inequality=0, equality=1, both=2.
|
|
VectorXs | ub_ |
| Upper bound of the constraint.
|
|
VectorXs | unone_ |
| No control vector.
|
|
VectorXs | lb_ |
| Lower bound of the constraint.
|
|
std::size_t | ng_ |
| Number of inequality constraints.
|
|
std::size_t | nh_ |
| Number of equality constraints.
|
|
std::size_t | nu_ |
| Control dimension.
|
|
boost::shared_ptr< ResidualModelAbstract > | residual_ |
| Residual model.
|
|
boost::shared_ptr< StateAbstract > | state_ |
| State description.
|
|
ConstraintType | type_ |
| Type of constraint: inequality=0, equality=1, both=2.
|
|
VectorXs | ub_ |
| Upper bound of the constraint.
|
|
VectorXs | unone_ |
| No control vector.
|
|
template<typename _Scalar>
class crocoddyl::ConstraintModelResidualTpl< _Scalar >
Residual-based constraint.
This constraint function uses a residual model to define equality / inequality constraint as
\[ \mathbf{\underline{r}} \leq \mathbf{r}(\mathbf{x}, \mathbf{u}) \leq \mathbf{\bar{r}} \]
where \(\mathbf{r}(\cdot)\) describes the residual function, and \(\mathbf{\underline{r}}\), \(\mathbf{\bar{r}}\) are the lower and upper bounds, respectively. We can define element-wise equality constraints by defining the same value for both: lower and upper values. Additionally, if we do not define the bounds, then it is assumed that \(\mathbf{\underline{r}}=\mathbf{\bar{r}}=\mathbf{0}\).
The main computations are carring out in calc
and calcDiff
routines. calc
computes the constraint residual and calcDiff
computes the Jacobians of the constraint function. Concretely speaking, calcDiff
builds a linear approximation of the constraint function with the form: \(\mathbf{g_x}\in\mathbb{R}^{ng\times ndx}\), \(\mathbf{g_u}\in\mathbb{R}^{ng\times nu}\), \(\mathbf{h_x}\in\mathbb{R}^{nh\times ndx}\) \(\mathbf{h_u}\in\mathbb{R}^{nh\times nu}\). Additionally, it is important to note that calcDiff()
computes the derivatives using the latest stored values by calc()
. Thus, we need to run first calc()
.
- See also
ConstraintModelAbstractTpl
, calc()
, calcDiff()
, createData()
Definition at line 47 of file residual.hpp.