10 #ifndef CROCODDYL_CORE_INTEGRATOR_EULER_HPP_
11 #define CROCODDYL_CORE_INTEGRATOR_EULER_HPP_
13 #include "crocoddyl/core/fwd.hpp"
14 #include "crocoddyl/core/integ-action-base.hpp"
36 template <
typename _Scalar>
40 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42 typedef _Scalar Scalar;
53 typedef typename MathBase::VectorXs VectorXs;
54 typedef typename MathBase::MatrixXs MatrixXs;
65 boost::shared_ptr<DifferentialActionModelAbstract> model,
66 boost::shared_ptr<ControlParametrizationModelAbstract> control,
67 const Scalar time_step = Scalar(1e-3),
68 const bool with_cost_residual =
true);
81 boost::shared_ptr<DifferentialActionModelAbstract> model,
82 const Scalar time_step = Scalar(1e-3),
83 const bool with_cost_residual =
true);
94 virtual void calc(
const boost::shared_ptr<ActionDataAbstract>& data,
95 const Eigen::Ref<const VectorXs>& x,
96 const Eigen::Ref<const VectorXs>& u);
108 virtual void calc(
const boost::shared_ptr<ActionDataAbstract>& data,
109 const Eigen::Ref<const VectorXs>& x);
118 virtual void calcDiff(
const boost::shared_ptr<ActionDataAbstract>& data,
119 const Eigen::Ref<const VectorXs>& x,
120 const Eigen::Ref<const VectorXs>& u);
132 virtual void calcDiff(
const boost::shared_ptr<ActionDataAbstract>& data,
133 const Eigen::Ref<const VectorXs>& x);
145 virtual bool checkData(
const boost::shared_ptr<ActionDataAbstract>& data);
160 virtual void quasiStatic(
const boost::shared_ptr<ActionDataAbstract>& data,
161 Eigen::Ref<VectorXs> u,
162 const Eigen::Ref<const VectorXs>& x,
163 const std::size_t maxiter = 100,
164 const Scalar tol = Scalar(1e-9));
171 virtual void print(std::ostream& os)
const;
186 template <
typename _Scalar>
189 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
191 typedef _Scalar Scalar;
198 typedef typename MathBase::VectorXs VectorXs;
199 typedef typename MathBase::MatrixXs MatrixXs;
201 template <
template <
typename Scalar>
class Model>
205 control = model->get_control()->createData();
206 const std::size_t ndx = model->get_state()->get_ndx();
207 const std::size_t nv = model->get_state()->get_nv();
208 dx = VectorXs::Zero(ndx);
209 da_du = MatrixXs::Zero(nv, model->get_nu());
210 Lwu = MatrixXs::Zero(model->get_control()->get_nw(), model->get_nu());
214 boost::shared_ptr<DifferentialActionDataAbstract>
216 boost::shared_ptr<ControlParametrizationDataAbstract>
240 #include "crocoddyl/core/integrator/euler.hxx"
Abstract class for action model.
std::size_t nh_
Number of equality constraints.
std::size_t ng_
Number of inequality constraints.
Abstract class for the control trajectory parametrization.
Abstract class for differential action model.
Abstract class for an integrated action model.
bool with_cost_residual_
Flag indicating whether a cost residual is used.
Scalar time_step_
Time step used for integration.
boost::shared_ptr< DifferentialActionModelAbstract > differential_
Differential action model that is integrated.
boost::shared_ptr< ControlParametrizationModelAbstract > control_
Model of the control parametrization.
boost::shared_ptr< StateAbstract > state_
< Dimension of the control
std::size_t nu_
< Dimension of the cost residual
Scalar time_step2_
Square of the time step used for integration.
Symplectic Euler integrator.
IntegratedActionModelEulerTpl(boost::shared_ptr< DifferentialActionModelAbstract > model, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true)
Initialize the symplectic Euler integrator.
virtual void print(std::ostream &os) const
Print relevant information of the Euler integrator model.
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.
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.
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.
virtual bool checkData(const boost::shared_ptr< ActionDataAbstract > &data)
Checks that a specific data belongs to this model.
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...
virtual void calcDiff(const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
Compute the partial derivatives of the cost.
virtual boost::shared_ptr< ActionDataAbstract > createData()
Create the symplectic Euler data.
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.
VectorXs xnext
evolution state
MatrixXs Fx
Jacobian of the dynamics w.r.t. the state .
MatrixXs Fu
Jacobian of the dynamics w.r.t. the control .
MatrixXs Luu
Hessian of the cost w.r.t. the control .
VectorXs Lx
Jacobian of the cost w.r.t. the state .
MatrixXs Lxx
Hessian of the cost w.r.t. the state .
VectorXs Lu
Jacobian of the cost w.r.t. the control .
boost::shared_ptr< DifferentialActionDataAbstract > differential
Differential model data.
boost::shared_ptr< ControlParametrizationDataAbstract > control
Control parametrization data.