Symplectic Euler integrator. More...
#include <crocoddyl/core/integrator/euler.hpp>
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 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. | |
virtual boost::shared_ptr< ActionDataAbstract > | createData () |
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 Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
Protected Attributes | |
boost::shared_ptr< ControlParametrizationModelAbstract > | control_ |
Model of the control parametrization. | |
boost::shared_ptr< DifferentialActionModelAbstract > | differential_ |
< Control parametrization | |
std::size_t | nu_ |
< Differential action model | |
boost::shared_ptr< StateAbstract > | state_ |
< 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 | |
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.
calc()
, calcDiff()
, createData()
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.
[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) |
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.
[in] | model | Differential action model |
[in] | time_step | Step time (default 1e-3) |
[in] | with_cost_residual | Compute cost residual (default true) |
|
virtual |
Integrate the differential action model using symplectic Euler scheme.
[in] | data | Symplectic Euler data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
[in] | u | Control input \(\mathbf{u}\in\mathbb{R}^{nu}\) |
|
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.
[in] | data | Symplectic Euler data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
|
virtual |
Compute the partial derivatives of the symplectic Euler integrator.
[in] | data | Symplectic Euler data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
[in] | u | Control input \(\mathbf{u}\in\mathbb{R}^{nu}\) |
|
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.
[in] | data | Symplectic Euler data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
|
virtual |
Create the symplectic Euler data.
|
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}\)
[in] | data | Symplectic Euler data |
[out] | u | Quasic static commands |
[in] | x | State point (velocity has to be zero) |
[in] | maxiter | Maximum allowed number of iterations |
[in] | tol | Tolerance |
|
virtual |
Print relevant information of the Euler integrator model.
[out] | os | Output stream object |