|
| ActionModelNumDiffTpl (boost::shared_ptr< Base > model, bool with_gauss_approx=false) |
| Construct a new ActionModelNumDiff object. More...
|
|
virtual | ~ActionModelNumDiffTpl () |
| Destroy the ActionModelNumDiff object.
|
|
virtual void | calc (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
| Compute the next state and cost value. More...
|
|
virtual void | calcDiff (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
| Compute the derivatives of the dynamics and cost functions. More...
|
|
virtual boost::shared_ptr< ActionDataAbstract > | createData () |
| Create a Data object from the given model. More...
|
|
const Scalar & | get_disturbance () const |
| Get the disturbance_ object. More...
|
|
const boost::shared_ptr< Base > & | get_model () const |
| Get the model_ object. More...
|
|
bool | get_with_gauss_approx () |
| Identify if the Gauss approximation is going to be used or not. More...
|
|
void | set_disturbance (const Scalar &disturbance) |
| Set the disturbance_ object. More...
|
|
| ActionModelAbstractTpl (boost::shared_ptr< StateAbstract > state, const std::size_t &nu, const std::size_t &nr=0) |
| Initialize the action model. More...
|
|
virtual void | calc (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)=0 |
| Compute the next state and cost value. More...
|
|
void | calc (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
|
virtual void | calcDiff (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)=0 |
| Compute the derivatives of the dynamics and cost functions. More...
|
|
void | calcDiff (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
|
virtual bool | checkData (const boost::shared_ptr< ActionDataAbstract > &data) |
| Checks that a specific data belongs to this model.
|
|
bool const & | get_has_control_limits () const |
| Indicates if there are defined control limits.
|
|
const std::size_t & | get_nr () const |
| Return the dimension of the cost-residual vector.
|
|
const std::size_t & | get_nu () const |
| Return the dimension of the control input.
|
|
const boost::shared_ptr< StateAbstract > & | get_state () const |
| Return the state.
|
|
const VectorXs & | get_u_lb () const |
| Return the control lower bound.
|
|
const VectorXs & | get_u_ub () const |
| Return the control upper bound.
|
|
virtual void | quasiStatic (const boost::shared_ptr< ActionDataAbstract > &data, Eigen::Ref< VectorXs > u, const Eigen::Ref< const VectorXs > &x, const std::size_t &maxiter=100, const Scalar &tol=Scalar(1e-9)) |
| Computes the quasic static commands. More...
|
|
VectorXs | quasiStatic_x (const boost::shared_ptr< ActionDataAbstract > &data, const VectorXs &x, const std::size_t &maxiter=100, const Scalar &tol=Scalar(1e-9)) |
|
void | set_u_lb (const VectorXs &u_lb) |
| Modify the control lower bounds.
|
|
void | set_u_ub (const VectorXs &u_ub) |
| Modify the control upper bounds.
|
|
template<typename _Scalar>
class crocoddyl::ActionModelNumDiffTpl< _Scalar >
This class computes the numerical differentiation of an ActionModel.
It computes the same quantity as a normal model would do but using numerical differentiation. The subtility is in the computation of the Hessian of the cost. Let us consider that the ActionModel owns a cost residual. This means that the cost is the square of a residual \( l(x,u) = .5 r(x,u)**2 \), with \( r(x,u) \) being the residual vector. Therefore the derivatives of the cost \( l \) can be expressed in function of the derivatives of the residuals (Jacobians), denoted by \( R_x \) and \( R_u \). Which would be:
\begin{eqnarray*} L_x &=& R_x^T r \\ L_u &=& R_u^T r \\ L_{xx} &=& R_x^T R_x + R_{xx} r \end{eqnarray*}
with \( R_{xx} \) the derivatives of the Jacobian (i.e. not a matrix, but a dim-3 tensor). The Gauss approximation consists in neglecting these. So \( L_{xx} \sim R_x^T R_x \). Similarly for \( L_{xu} \sim R_x^T R_u \) and \( L_{uu} \sim R_u^T R_u \). The above set of equations becomes:
\begin{eqnarray*} L_x &=& R_x^T r \\ L_u &=& R_u^T r \\ L_{xx} &\sim& R_x^T R_x \\ L_{xu} &\sim& R_x^T R_u \\ L_{uu} &\sim& R_u^T R_u \end{eqnarray*}
In the case that the cost does not have a residual we set the Hessian to \( 0 \), i.e. \( L_{xx} = L_{xu} = L_{uu} = 0 \).
Definition at line 160 of file fwd.hpp.