|
| CostModelResidualTpl (boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, boost::shared_ptr< ResidualModelAbstract > residual) |
| Initialize the residual cost model. More...
|
|
| CostModelResidualTpl (boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ResidualModelAbstract > residual) |
| Initialize the residual cost model. More...
|
|
virtual void | calc (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
| Compute the residual cost. More...
|
|
virtual void | calc (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the residual cost based on state only. More...
|
|
virtual void | calcDiff (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
| Compute the derivatives of the residual cost. More...
|
|
virtual void | calcDiff (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the derivatives of the residual cost with respect to the state only. More...
|
|
virtual boost::shared_ptr< CostDataAbstract > | createData (DataCollectorAbstract *const data) |
| Create the residual cost data.
|
|
virtual void | print (std::ostream &os) const |
| Print relevant information of the cost-residual model. More...
|
|
| CostModelAbstractTpl (boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, boost::shared_ptr< ResidualModelAbstract > residual) |
| Initialize the cost model. More...
|
|
| CostModelAbstractTpl (boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, const std::size_t nu) |
| Initialize the cost model. More...
|
|
| CostModelAbstractTpl (boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation) |
|
| CostModelAbstractTpl (boost::shared_ptr< StateAbstract > state, boost::shared_ptr< ResidualModelAbstract > residual) |
|
| CostModelAbstractTpl (boost::shared_ptr< StateAbstract > state, const std::size_t nr, const std::size_t nu) |
|
| CostModelAbstractTpl (boost::shared_ptr< StateAbstract > state, const std::size_t nr) |
|
virtual void | calc (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)=0 |
| Compute the cost value and its residual vector. More...
|
|
virtual void | calc (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the total cost value for nodes that depends only on the state. More...
|
|
virtual void | calcDiff (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)=0 |
| Compute the Jacobian and Hessian of cost and its residual vector. More...
|
|
virtual void | calcDiff (const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
| Compute the Jacobian and Hessian of the cost functions with respect to the state only. More...
|
|
const boost::shared_ptr< ActivationModelAbstract > & | get_activation () const |
| Return the activation model.
|
|
std::size_t | get_nu () const |
| Return the dimension of the control input.
|
|
template<class ReferenceType > |
ReferenceType | get_reference () |
| Return the cost reference.
|
|
const boost::shared_ptr< ResidualModelAbstract > & | get_residual () const |
| Return the residual model.
|
|
const boost::shared_ptr< StateAbstract > & | get_state () const |
| Return the state.
|
|
template<class ReferenceType > |
void | set_reference (ReferenceType ref) |
| Modify the cost reference.
|
|
template<typename _Scalar>
class crocoddyl::CostModelResidualTpl< _Scalar >
Residual-based cost.
This cost function uses a residual model to compute the cost, i.e.,
\[ cost = a(\mathbf{r}(\mathbf{x}, \mathbf{u})), \]
where \(\mathbf{r}(\cdot)\) and \(a(\cdot)\) define the residual and activation functions, respectively.
Note that we only compute the Jacobians of the residual function. Therefore, this cost model computes its Hessians through a Gauss-Newton approximation, e.g., \(\mathbf{l_{xu}} = \mathbf{R_x}^T \mathbf{A_{rr}} \mathbf{R_u} \), where \(\mathbf{R_x}\) and \(\mathbf{R_u}\) are the Jacobians of the residual function, and \(\mathbf{A_{rr}}\) is the Hessian of the activation model.
As described in CostModelAbstractTpl()
, the cost value and its derivatives are calculated by calc
and calcDiff
, respectively.
- See also
CostModelAbstractTpl
, calc()
, calcDiff()
, createData()
Definition at line 36 of file residual.hpp.