Abstract class for an integrated action model. More...
#include <crocoddyl/core/integ-action-base.hpp>
Public Types | |
typedef ActionDataAbstractTpl< Scalar > | ActionDataAbstract |
typedef ActionModelAbstractTpl< Scalar > | Base |
typedef ControlParametrizationModelAbstractTpl< Scalar > | ControlParametrizationModelAbstract |
typedef IntegratedActionDataAbstractTpl< Scalar > | Data |
typedef DifferentialActionModelAbstractTpl< Scalar > | DifferentialActionModelAbstract |
typedef MathBaseTpl< Scalar > | MathBase |
typedef MathBase::MatrixXs | MatrixXs |
typedef MathBase::VectorXs | VectorXs |
![]() | |
typedef ActionDataAbstractTpl< Scalar > | ActionDataAbstract |
typedef MathBaseTpl< Scalar > | MathBase |
typedef StateAbstractTpl< Scalar > | StateAbstract |
typedef MathBase::VectorXs | VectorXs |
Public Member Functions | |
IntegratedActionModelAbstractTpl (boost::shared_ptr< DifferentialActionModelAbstract > model, boost::shared_ptr< ControlParametrizationModelAbstract > control, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true) | |
Initialize the integrator. More... | |
IntegratedActionModelAbstractTpl (boost::shared_ptr< DifferentialActionModelAbstract > model, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true) | |
Initialize the integrator. More... | |
virtual boost::shared_ptr< ActionDataAbstract > | createData () |
Create the integrator data. More... | |
DEPRECATED ("The DifferentialActionModel should be set at construction time", void set_differential(boost::shared_ptr< DifferentialActionModelAbstract > model)) | |
const boost::shared_ptr< ControlParametrizationModelAbstract > & | get_control () const |
Return the control parametrization model associated to this integrated action model. | |
const boost::shared_ptr< DifferentialActionModelAbstract > & | get_differential () const |
Return the differential action model associated to this integrated action model. | |
const Scalar | get_dt () const |
Return the time step used for the integration. | |
void | set_dt (const Scalar dt) |
Set the time step for the integration. | |
![]() | |
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) |
Compute the total cost value for nodes that depends only on the state. 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... | |
virtual void | calcDiff (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) |
Compute the derivatives of the cost functions with respect to the state only. More... | |
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... | |
virtual bool | checkData (const boost::shared_ptr< ActionDataAbstract > &data) |
Checks that a specific data belongs to this model. More... | |
virtual boost::shared_ptr< ActionDataAbstract > | createData () |
Create the action data. More... | |
bool | get_has_control_limits () const |
Indicates if there are defined control limits. | |
std::size_t | get_nr () const |
Return the dimension of the cost-residual vector. | |
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 | print (std::ostream &os) const |
Print relevant information of the action model. More... | |
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. | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
![]() | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
Protected Member Functions | |
void | init () |
< Neutral state | |
![]() | |
void | update_has_control_limits () |
Update the status of the control limits (i.e. if there are defined limits) | |
Protected Attributes | |
boost::shared_ptr< ControlParametrizationModelAbstract > | control_ |
Model of the control parametrization. More... | |
boost::shared_ptr< DifferentialActionModelAbstract > | differential_ |
Differential action model that is integrated. More... | |
bool | has_control_limits_ |
Indicates whether any of the control limits is finite. More... | |
std::size_t | nr_ |
< Indicates whether any of the control limits are active More... | |
std::size_t | nu_ |
< Dimension of the cost residual More... | |
boost::shared_ptr< StateAbstract > | state_ |
< Dimension of the control More... | |
Scalar | time_step2_ |
Square of the time step used for integration. More... | |
Scalar | time_step_ |
Time step used for integration. More... | |
VectorXs | u_lb_ |
< Model of the state More... | |
VectorXs | u_ub_ |
< Lower control limits More... | |
VectorXs | unone_ |
< Upper control limits More... | |
bool | with_cost_residual_ |
Flag indicating whether a cost residual is used. More... | |
![]() | |
bool | has_control_limits_ |
Indicates whether any of the control limits is finite. More... | |
std::size_t | nr_ |
Dimension of the cost residual. More... | |
std::size_t | nu_ |
Control dimension. More... | |
boost::shared_ptr< StateAbstract > | state_ |
Model of the state. More... | |
VectorXs | u_lb_ |
Lower control limits. More... | |
VectorXs | u_ub_ |
Upper control limits. More... | |
VectorXs | unone_ |
Neutral state. More... | |
Abstract class for an integrated action model.
An integrated action model is a special kind of action model that is obtained by applying a numerical integration scheme to a differential (i.e., continuous time) action model. Different integration schemes can be implemented inheriting from this base class.
The numerical integration introduces also the possibility to parametrize the control trajectory inside an integration step, for instance using polynomials. This requires introducing some notation to clarify the difference between the control inputs of the differential model and the control inputs to the integrated model. We have decided to use \(\mathbf{w}\) to refer to the control inputs of the differential model and \(\mathbf{u}\) for the control inputs of the integrated action model.
calc()
, calcDiff()
, createData()
Definition at line 37 of file integ-action-base.hpp.
typedef MathBaseTpl<Scalar> MathBase |
Definition at line 42 of file integ-action-base.hpp.
typedef ActionModelAbstractTpl<Scalar> Base |
Definition at line 43 of file integ-action-base.hpp.
typedef IntegratedActionDataAbstractTpl<Scalar> Data |
Definition at line 44 of file integ-action-base.hpp.
typedef ActionDataAbstractTpl<Scalar> ActionDataAbstract |
Definition at line 45 of file integ-action-base.hpp.
typedef DifferentialActionModelAbstractTpl<Scalar> DifferentialActionModelAbstract |
Definition at line 46 of file integ-action-base.hpp.
Definition at line 47 of file integ-action-base.hpp.
typedef MathBase::VectorXs VectorXs |
Definition at line 48 of file integ-action-base.hpp.
typedef MathBase::MatrixXs MatrixXs |
Definition at line 49 of file integ-action-base.hpp.
IntegratedActionModelAbstractTpl | ( | boost::shared_ptr< DifferentialActionModelAbstract > | model, |
boost::shared_ptr< ControlParametrizationModelAbstract > | control, | ||
const Scalar | time_step = Scalar(1e-3) , |
||
const bool | with_cost_residual = true |
||
) |
Initialize the integrator.
[in] | model | Differential action model |
[in] | control | Control parametrization |
[in] | time_step | Step time (default 1e-3) |
[in] | with_cost_residual | Compute cost residual (default true) |
IntegratedActionModelAbstractTpl | ( | boost::shared_ptr< DifferentialActionModelAbstract > | model, |
const Scalar | time_step = Scalar(1e-3) , |
||
const bool | with_cost_residual = true |
||
) |
Initialize the integrator.
This initialization uses ControlParametrizationPolyZeroTpl
for the control parametrization.
[in] | model | Differential action model |
[in] | time_step | Step time (default 1e-3) |
[in] | with_cost_residual | Compute cost residual (default true) |
|
virtual |
Create the integrator data.
Reimplemented from ActionModelAbstractTpl< _Scalar >.
Reimplemented in IntegratedActionModelEulerTpl< _Scalar >, IntegratedActionModelRKTpl< _Scalar >, and IntegratedActionModelRK4Tpl< _Scalar >.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 41 of file integ-action-base.hpp.
|
protected |
Differential action model that is integrated.
Definition at line 117 of file integ-action-base.hpp.
|
protected |
Model of the control parametrization.
Definition at line 118 of file integ-action-base.hpp.
|
protected |
Time step used for integration.
Definition at line 120 of file integ-action-base.hpp.
|
protected |
Square of the time step used for integration.
Definition at line 121 of file integ-action-base.hpp.
|
protected |
Flag indicating whether a cost residual is used.
Definition at line 122 of file integ-action-base.hpp.
|
protected |
Indicates whether any of the control limits is finite.
Definition at line 227 of file action-base.hpp.
|
protected |
< Indicates whether any of the control limits are active
Definition at line 222 of file action-base.hpp.
|
protected |
< Dimension of the cost residual
Definition at line 221 of file action-base.hpp.
|
protected |
< Dimension of the control
Definition at line 223 of file action-base.hpp.
|
protected |
< Model of the state
Definition at line 225 of file action-base.hpp.
|
protected |
< Lower control limits
Definition at line 226 of file action-base.hpp.
|
protected |
< Upper control limits
Definition at line 224 of file action-base.hpp.