crocoddyl 1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
 
Loading...
Searching...
No Matches
IntegratedActionModelEulerTpl< _Scalar > Class Template Reference

Symplectic Euler integrator. More...

#include <crocoddyl/core/integrator/euler.hpp>

Inheritance diagram for IntegratedActionModelEulerTpl< _Scalar >:
Collaboration diagram for IntegratedActionModelEulerTpl< _Scalar >:

Public Types

typedef ActionDataAbstractTpl< Scalar > ActionDataAbstract
 
typedef IntegratedActionModelAbstractTpl< Scalar > Base
 
typedef ControlParametrizationDataAbstractTpl< Scalar > ControlParametrizationDataAbstract
 
typedef ControlParametrizationModelAbstractTpl< Scalar > ControlParametrizationModelAbstract
 
typedef IntegratedActionDataEulerTpl< Scalar > Data
 
typedef DifferentialActionModelAbstractTpl< Scalar > DifferentialActionModelAbstract
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef MathBase::MatrixXs MatrixXs
 
typedef MathBase::VectorXs VectorXs
 
- Public Types inherited from IntegratedActionModelAbstractTpl< _Scalar >
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
 
- Public Types inherited from ActionModelAbstractTpl< _Scalar >
typedef ActionDataAbstractTpl< Scalar > ActionDataAbstract
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef StateAbstractTpl< Scalar > StateAbstract
 
typedef MathBase::VectorXs VectorXs
 

Public Member Functions

 IntegratedActionModelEulerTpl (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 symplectic Euler integrator. More...
 
 IntegratedActionModelEulerTpl (boost::shared_ptr< DifferentialActionModelAbstract > model, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true)
 Initialize the symplectic Euler integrator. More...
 
virtual void calc (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
 Integrate the total cost value for nodes that depends only on the state using symplectic Euler scheme. More...
 
virtual void calc (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
 Integrate the differential action model using symplectic Euler scheme. More...
 
virtual void calcDiff (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
 Compute the partial derivatives of the cost. More...
 
virtual void calcDiff (const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
 Compute the partial derivatives of the symplectic Euler integrator. More...
 
virtual bool checkData (const boost::shared_ptr< ActionDataAbstract > &data)
 Checks that a specific data belongs to this model. More...
 
virtual boost::shared_ptr< ActionDataAbstractcreateData ()
 Create the symplectic Euler data. More...
 
virtual void print (std::ostream &os) const
 Print relevant information of the Euler integrator 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...
 
- Public Member Functions inherited from IntegratedActionModelAbstractTpl< _Scalar >
 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< ActionDataAbstractcreateData ()
 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.
 
- Public Member Functions inherited from ActionModelAbstractTpl< _Scalar >
 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< ActionDataAbstractcreateData ()
 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
 
- Public Attributes inherited from IntegratedActionModelAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 
- Public Attributes inherited from ActionModelAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 

Protected Attributes

boost::shared_ptr< ControlParametrizationModelAbstractcontrol_
 Model of the control parametrization. More...
 
boost::shared_ptr< DifferentialActionModelAbstractdifferential_
 < Control parametrization More...
 
std::size_t nu_
 < Differential action model More...
 
boost::shared_ptr< StateAbstractstate_
 < Dimension of the control More...
 
Scalar time_step2_
 < Model of the state More...
 
Scalar time_step_
 < Square of the time step used for integration More...
 
bool with_cost_residual_
 < Time step used for integration More...
 
- Protected Attributes inherited from IntegratedActionModelAbstractTpl< _Scalar >
boost::shared_ptr< ControlParametrizationModelAbstractcontrol_
 Model of the control parametrization. More...
 
boost::shared_ptr< DifferentialActionModelAbstractdifferential_
 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< StateAbstractstate_
 < 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...
 
- Protected Attributes inherited from ActionModelAbstractTpl< _Scalar >
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< StateAbstractstate_
 Model of the state. More...
 
VectorXs u_lb_
 Lower control limits. More...
 
VectorXs u_ub_
 Upper control limits. More...
 
VectorXs unone_
 Neutral state. More...
 

Additional Inherited Members

- Protected Member Functions inherited from IntegratedActionModelAbstractTpl< _Scalar >
void init ()
 < Neutral state
 
- Protected Member Functions inherited from ActionModelAbstractTpl< _Scalar >
void update_has_control_limits ()
 Update the status of the control limits (i.e. if there are defined limits)
 

Detailed Description

template<typename _Scalar>
class crocoddyl::IntegratedActionModelEulerTpl< _Scalar >

Symplectic Euler integrator.

It applies a symplectic Euler integration scheme to a differential (i.e., continuous time) action model.

This symplectic Euler scheme 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. Note that the zero-order (e.g., ControlParametrizationModelPolyZeroTpl) are the only ones that make sense to use within this integrator.

See also
calc(), calcDiff(), createData()

Definition at line 32 of file euler.hpp.

Member Typedef Documentation

◆ MathBase

typedef MathBaseTpl<Scalar> MathBase

Definition at line 37 of file euler.hpp.

◆ Base

Definition at line 38 of file euler.hpp.

◆ Data

Definition at line 39 of file euler.hpp.

◆ ActionDataAbstract

Definition at line 40 of file euler.hpp.

◆ DifferentialActionModelAbstract

◆ ControlParametrizationModelAbstract

◆ ControlParametrizationDataAbstract

◆ VectorXs

typedef MathBase::VectorXs VectorXs

Definition at line 44 of file euler.hpp.

◆ MatrixXs

typedef MathBase::MatrixXs MatrixXs

Definition at line 45 of file euler.hpp.

Constructor & Destructor Documentation

◆ IntegratedActionModelEulerTpl() [1/2]

IntegratedActionModelEulerTpl ( 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 symplectic Euler integrator.

Parameters
[in]modelDifferential action model
[in]controlControl parametrization
[in]time_stepStep time (default 1e-3)
[in]with_cost_residualCompute cost residual (default true)

◆ IntegratedActionModelEulerTpl() [2/2]

IntegratedActionModelEulerTpl ( boost::shared_ptr< DifferentialActionModelAbstract model,
const Scalar  time_step = Scalar(1e-3),
const bool  with_cost_residual = true 
)

Initialize the symplectic Euler integrator.

This initialization uses ControlParametrizationPolyZeroTpl for the control parametrization.

Parameters
[in]modelDifferential action model
[in]time_stepStep time (default 1e-3)
[in]with_cost_residualCompute cost residual (default true)

Member Function Documentation

◆ calc() [1/2]

virtual void calc ( const boost::shared_ptr< ActionDataAbstract > &  data,
const Eigen::Ref< const VectorXs > &  x,
const Eigen::Ref< const VectorXs > &  u 
)
virtual

Integrate the differential action model using symplectic Euler scheme.

Parameters
[in]dataSymplectic Euler data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
[in]uControl input \(\mathbf{u}\in\mathbb{R}^{nu}\)

Implements ActionModelAbstractTpl< _Scalar >.

◆ calc() [2/2]

virtual void calc ( const boost::shared_ptr< ActionDataAbstract > &  data,
const Eigen::Ref< const VectorXs > &  x 
)
virtual

Integrate the total cost value for nodes that depends only on the state using symplectic Euler scheme.

It computes the total cost and defines the next state as the current one. This function is used in the terminal nodes of an optimal control problem.

Parameters
[in]dataSymplectic Euler data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

Reimplemented from ActionModelAbstractTpl< _Scalar >.

◆ calcDiff() [1/2]

virtual void calcDiff ( const boost::shared_ptr< ActionDataAbstract > &  data,
const Eigen::Ref< const VectorXs > &  x,
const Eigen::Ref< const VectorXs > &  u 
)
virtual

Compute the partial derivatives of the symplectic Euler integrator.

Parameters
[in]dataSymplectic Euler data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
[in]uControl input \(\mathbf{u}\in\mathbb{R}^{nu}\)

Implements ActionModelAbstractTpl< _Scalar >.

◆ calcDiff() [2/2]

virtual void calcDiff ( const boost::shared_ptr< ActionDataAbstract > &  data,
const Eigen::Ref< const VectorXs > &  x 
)
virtual

Compute the partial derivatives of the cost.

It updates the derivatives of the cost function with respect to the state only. This function is used in the terminal nodes of an optimal control problem.

Parameters
[in]dataSymplectic Euler data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

Reimplemented from ActionModelAbstractTpl< _Scalar >.

◆ createData()

virtual boost::shared_ptr< ActionDataAbstract > createData ( )
virtual

Create the symplectic Euler data.

Returns
the symplectic Euler data

Reimplemented from IntegratedActionModelAbstractTpl< _Scalar >.

◆ checkData()

virtual bool checkData ( const boost::shared_ptr< ActionDataAbstract > &  data)
virtual

Checks that a specific data belongs to this model.

Reimplemented from ActionModelAbstractTpl< _Scalar >.

◆ quasiStatic()

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) 
)
virtual

Computes the quasic static commands.

The quasic static commands are the ones produced for a the reference posture as an equilibrium point, i.e. for \(\mathbf{f^q_x}\delta\mathbf{q}+\mathbf{f_u}\delta\mathbf{u}=\mathbf{0}\)

Parameters
[in]dataSymplectic Euler data
[out]uQuasic static commands
[in]xState point (velocity has to be zero)
[in]maxiterMaximum allowed number of iterations
[in]tolTolerance

Reimplemented from ActionModelAbstractTpl< _Scalar >.

◆ print()

virtual void print ( std::ostream &  os) const
virtual

Print relevant information of the Euler integrator model.

Parameters
[out]osOutput stream object

Reimplemented from ActionModelAbstractTpl< _Scalar >.

Member Data Documentation

◆ Scalar

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Definition at line 36 of file euler.hpp.

◆ control_

boost::shared_ptr<ControlParametrizationModelAbstract> control_
protected

Model of the control parametrization.

Definition at line 118 of file integ-action-base.hpp.

◆ differential_

boost::shared_ptr<DifferentialActionModelAbstract> differential_
protected

< Control parametrization

Definition at line 117 of file integ-action-base.hpp.

◆ nu_

std::size_t nu_
protected

< Differential action model

Definition at line 109 of file action-base.hpp.

◆ state_

boost::shared_ptr<StateAbstract> state_
protected

< Dimension of the control

Definition at line 110 of file action-base.hpp.

◆ time_step2_

Scalar time_step2_
protected

< Model of the state

Definition at line 121 of file integ-action-base.hpp.

◆ time_step_

Scalar time_step_
protected

< Square of the time step used for integration

Definition at line 120 of file integ-action-base.hpp.

◆ with_cost_residual_

bool with_cost_residual_
protected

< Time step used for integration

Definition at line 122 of file integ-action-base.hpp.


The documentation for this class was generated from the following files: