9 #ifndef CROCODDYL_CORE_INTEGRATOR_EULER_HPP_
10 #define CROCODDYL_CORE_INTEGRATOR_EULER_HPP_
12 #include "crocoddyl/core/fwd.hpp"
13 #include "crocoddyl/core/action-base.hpp"
14 #include "crocoddyl/core/diff-action-base.hpp"
18 template <
typename _Scalar>
21 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 typedef _Scalar Scalar;
29 typedef typename MathBase::VectorXs VectorXs;
30 typedef typename MathBase::MatrixXs MatrixXs;
33 const Scalar time_step = Scalar(1e-3),
const bool with_cost_residual =
true);
36 virtual void calc(
const boost::shared_ptr<ActionDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
37 const Eigen::Ref<const VectorXs>& u);
38 virtual void calcDiff(
const boost::shared_ptr<ActionDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
39 const Eigen::Ref<const VectorXs>& u);
40 virtual boost::shared_ptr<ActionDataAbstract>
createData();
41 virtual bool checkData(
const boost::shared_ptr<ActionDataAbstract>& data);
43 virtual void quasiStatic(
const boost::shared_ptr<ActionDataAbstract>& data, Eigen::Ref<VectorXs> u,
44 const Eigen::Ref<const VectorXs>& x,
const std::size_t maxiter = 100,
45 const Scalar tol = Scalar(1e-9));
47 const boost::shared_ptr<DifferentialActionModelAbstract>& get_differential()
const;
48 const Scalar get_dt()
const;
50 void set_dt(
const Scalar dt);
51 void set_differential(boost::shared_ptr<DifferentialActionModelAbstract> model);
58 virtual void print(std::ostream& os)
const;
67 boost::shared_ptr<DifferentialActionModelAbstract> differential_;
70 bool with_cost_residual_;
71 bool enable_integration_;
74 template <
typename _Scalar>
76 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
78 typedef _Scalar Scalar;
81 typedef typename MathBase::VectorXs VectorXs;
82 typedef typename MathBase::MatrixXs MatrixXs;
84 template <
template <
typename Scalar>
class Model>
86 differential = model->get_differential()->createData();
87 const std::size_t ndx = model->get_state()->get_ndx();
88 dx = VectorXs::Zero(ndx);
92 boost::shared_ptr<DifferentialActionDataAbstractTpl<Scalar> > differential;
112 #include "crocoddyl/core/integrator/euler.hxx"
Abstract class for action model.
boost::shared_ptr< StateAbstract > state_
Model of the state.
std::size_t nu_
Control dimension.
VectorXs unone_
Neutral state.
std::size_t nr_
Dimension of the cost residual.
Abstract class for differential action model.
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)
Compute the next state and cost value.
virtual void calcDiff(const boost::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the dynamics and cost functions.
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 action 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.
MatrixXs Fu
Jacobian of the dynamics.
MatrixXs Luu
Hessian of the cost function.
VectorXs Lx
Jacobian of the cost function.
MatrixXs Lxx
Hessian of the cost function.
VectorXs Lu
Jacobian of the cost function.
MatrixXs Lxu
Hessian of the cost function.