11#ifndef CROCODDYL_CORE_INTEGRATED_ACTION_BASE_HPP_ 12#define CROCODDYL_CORE_INTEGRATED_ACTION_BASE_HPP_ 14#include "crocoddyl/core/action-base.hpp" 15#include "crocoddyl/core/control-base.hpp" 16#include "crocoddyl/core/diff-action-base.hpp" 17#include "crocoddyl/core/fwd.hpp" 18#include "crocoddyl/core/utils/deprecate.hpp" 40template <
typename _Scalar>
44 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46 typedef _Scalar Scalar;
52 DifferentialActionModelAbstract;
54 ControlParametrizationModelAbstract;
55 typedef typename MathBase::VectorXs VectorXs;
56 typedef typename MathBase::MatrixXs MatrixXs;
67 std::shared_ptr<DifferentialActionModelAbstract> model,
68 std::shared_ptr<ControlParametrizationModelAbstract> control,
69 const Scalar time_step = Scalar(1e-3),
70 const bool with_cost_residual =
true);
83 std::shared_ptr<DifferentialActionModelAbstract> model,
84 const Scalar time_step = Scalar(1e-3),
85 const bool with_cost_residual =
true);
93 virtual std::shared_ptr<ActionDataAbstract>
createData()
override;
98 virtual std::size_t
get_ng()
const override;
103 virtual std::size_t
get_nh()
const override;
136 const std::shared_ptr<ControlParametrizationModelAbstract>&
get_control()
149 DEPRECATED(
"The DifferentialActionModel should be set at construction time",
150 void set_differential(
151 std::shared_ptr<DifferentialActionModelAbstract> model));
170 std::shared_ptr<DifferentialActionModelAbstract>
172 std::shared_ptr<ControlParametrizationModelAbstract>
181template <
typename _Scalar>
182struct IntegratedActionDataAbstractTpl :
public ActionDataAbstractTpl<_Scalar> {
183 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
185 typedef _Scalar Scalar;
187 typedef ActionDataAbstractTpl<Scalar> Base;
188 typedef typename MathBase::VectorXs VectorXs;
189 typedef typename MathBase::MatrixXs MatrixXs;
191 template <
template <
typename Scalar>
class Model>
192 explicit IntegratedActionDataAbstractTpl(Model<Scalar>*
const model)
194 virtual ~IntegratedActionDataAbstractTpl() =
default;
213#include "crocoddyl/core/integ-action-base.hxx" 215CROCODDYL_DECLARE_EXTERN_TEMPLATE_CLASS(
217CROCODDYL_DECLARE_EXTERN_TEMPLATE_STRUCT(
std::shared_ptr< StateAbstract > state_
ActionModelAbstractTpl(std::shared_ptr< StateAbstract > state, const std::size_t nu, const std::size_t nr=0, const std::size_t ng=0, const std::size_t nh=0, const std::size_t ng_T=0, const std::size_t nh_T=0)
Initialize the action model.
Abstract class for the control trajectory parametrization.
Abstract class for differential action model.
Abstract class for an integrated action model.
const Scalar get_dt() const
Return the time step used for the integration.
virtual const VectorXs & get_g_lb() const override
Return the lower bound of the inequality constraints.
virtual const VectorXs & get_g_ub() const override
Return the upper bound of the inequality constraints.
virtual std::shared_ptr< ActionDataAbstract > createData() override
Create the integrator data.
const std::shared_ptr< DifferentialActionModelAbstract > & get_differential() const
Return the differential action model associated to this integrated action model.
IntegratedActionModelAbstractTpl()
< Upper control limits
void set_dt(const Scalar dt)
Set the time step for the integration.
virtual std::size_t get_ng() const override
Return the number of inequality constraints.
std::shared_ptr< ControlParametrizationModelAbstract > control_
virtual std::size_t get_nh_T() const override
Return the number of equality terminal constraints.
const std::shared_ptr< ControlParametrizationModelAbstract > & get_control() const
Return the control parametrization model associated to this integrated action model.
virtual std::size_t get_nh() const override
Return the number of equality constraints.
std::shared_ptr< DifferentialActionModelAbstract > differential_
virtual std::size_t get_ng_T() const override
Return the number of inequality terminal constraints.
IntegratedActionModelAbstractTpl(std::shared_ptr< DifferentialActionModelAbstract > model, std::shared_ptr< ControlParametrizationModelAbstract > control, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true)
Initialize the integrator.
IntegratedActionModelAbstractTpl(std::shared_ptr< DifferentialActionModelAbstract > model, const Scalar time_step=Scalar(1e-3), const bool with_cost_residual=true)
Initialize the integrator.