crocoddyl  1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
IntegratedActionModelRKTpl< _Scalar > Class Template Reference

Standard RK integrator. More...

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

Public Types

typedef ActionDataAbstractTpl< Scalar > ActionDataAbstract
 
typedef IntegratedActionModelAbstractTpl< Scalar > Base
 
typedef ControlParametrizationModelAbstractTpl< Scalar > ControlParametrizationModelAbstract
 
typedef IntegratedActionDataRKTpl< Scalar > Data
 
typedef DifferentialActionModelAbstractTpl< Scalar > DifferentialActionModelAbstract
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef MathBase::MatrixXs MatrixXs
 
typedef MathBase::VectorXs VectorXs
 

Public Member Functions

 IntegratedActionModelRKTpl (boost::shared_ptr< DifferentialActionModelAbstract > model, boost::shared_ptr< ControlParametrizationModelAbstract > control, const RKType rktype, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true)
 Initialize the RK integrator. More...
 
 IntegratedActionModelRKTpl (boost::shared_ptr< DifferentialActionModelAbstract > model, const RKType rktype, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true)
 Initialize the RK 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 RK 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 RK 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 RK integrator. More...
 
virtual bool checkData (const boost::shared_ptr< ActionDataAbstract > &data)
 Checks that a specific data belongs to this model.
 
virtual boost::shared_ptr< ActionDataAbstractcreateData ()
 Create the RK integrator data. More...
 
std::size_t get_ni () const
 Return the number of nodes of the integrator.
 
virtual void print (std::ostream &os) const
 Print relevant information of the RK 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 Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 

Protected Attributes

boost::shared_ptr< ControlParametrizationModelAbstractcontrol_
 Model of the control parametrization.
 
boost::shared_ptr< DifferentialActionModelAbstractdifferential_
 < Control parametrization
 
std::size_t nu_
 < Differential action model
 
boost::shared_ptr< StateAbstractstate_
 < Dimension of the control
 
Scalar time_step2_
 < Model of the state
 
Scalar time_step_
 < Square of the time step used for integration
 
bool with_cost_residual_
 < Time step used for integration
 

Detailed Description

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

Standard RK integrator.

It applies a standard RK integration schemes to a differential (i.e., continuous time) action model. The available integrators are: RK2, RK3, and RK4.

This standard RK 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.

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

Definition at line 65 of file fwd.hpp.

Constructor & Destructor Documentation

◆ IntegratedActionModelRKTpl() [1/2]

IntegratedActionModelRKTpl ( boost::shared_ptr< DifferentialActionModelAbstract model,
boost::shared_ptr< ControlParametrizationModelAbstract control,
const RKType  rktype,
const Scalar  time_step = Scalar(1e-3),
const bool  with_cost_residual = true 
)

Initialize the RK integrator.

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

◆ IntegratedActionModelRKTpl() [2/2]

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

Initialize the RK integrator.

This initialization uses ControlParametrizationPolyZeroTpl for the control parametrization.

Parameters
[in]modelDifferential action model
[in]rktypeType of RK integrator
[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 RK scheme.

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

◆ 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 RK 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]dataRK integrator data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

◆ 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 RK integrator.

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

◆ 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]dataRK integrator data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

◆ createData()

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

Create the RK integrator data.

Returns
the RK integrator data

◆ 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]dataRK integrator data
[out]uQuasic static commands
[in]xState point (velocity has to be zero)
[in]maxiterMaximum allowed number of iterations
[in]tolTolerance

◆ print()

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

Print relevant information of the RK integrator model.

Parameters
[out]osOutput stream object

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