9 #ifndef CROCODDYL_CORE_ACTUATION_BASE_HPP_ 10 #define CROCODDYL_CORE_ACTUATION_BASE_HPP_ 13 #include <boost/shared_ptr.hpp> 14 #include <boost/make_shared.hpp> 16 #include "crocoddyl/core/fwd.hpp" 17 #include "crocoddyl/core/mathbase.hpp" 18 #include "crocoddyl/core/state-base.hpp" 19 #include "crocoddyl/core/utils/exception.hpp" 38 template <
typename _Scalar>
41 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
43 typedef _Scalar Scalar;
47 typedef typename MathBase::VectorXs VectorXs;
48 typedef typename MathBase::MatrixXs MatrixXs;
67 virtual void calc(
const boost::shared_ptr<ActuationDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
68 const Eigen::Ref<const VectorXs>& u) = 0;
79 void calc(
const boost::shared_ptr<ActuationDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x);
88 virtual void calcDiff(
const boost::shared_ptr<ActuationDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
89 const Eigen::Ref<const VectorXs>& u) = 0;
100 void calcDiff(
const boost::shared_ptr<ActuationDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x);
107 virtual boost::shared_ptr<ActuationDataAbstract>
createData();
112 std::size_t
get_nu()
const;
117 const boost::shared_ptr<StateAbstract>&
get_state()
const;
122 template <
class Scalar>
123 friend std::ostream& operator<<(std::ostream& os, const ResidualModelAbstractTpl<Scalar>& model);
130 virtual void print(std::ostream& os)
const;
137 template <
typename _Scalar>
139 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
141 typedef _Scalar Scalar;
143 typedef typename MathBase::VectorXs VectorXs;
144 typedef typename MathBase::MatrixXs MatrixXs;
146 template <
template <
typename Scalar>
class Model>
148 : tau(model->get_state()->get_nv()),
149 dtau_dx(model->get_state()->get_nv(), model->get_state()->get_ndx()),
150 dtau_du(model->get_state()->get_nv(), model->get_nu()) {
155 virtual ~ActuationDataAbstractTpl() {}
167 #include "crocoddyl/core/actuation-base.hxx" 169 #endif // CROCODDYL_CORE_ACTUATION_BASE_HPP_ Abstract class for the state representation.
virtual void calc(const boost::shared_ptr< ActuationDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)=0
Compute the actuation signal from the state point and control input .
std::size_t nu_
Control dimension.
boost::shared_ptr< StateAbstract > state_
Model of the state.
virtual void calcDiff(const boost::shared_ptr< ActuationDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)=0
Compute the Jacobians of the actuation function.
ActuationModelAbstractTpl(boost::shared_ptr< StateAbstract > state, const std::size_t nu)
Initialize the actuation model.
MatrixXs dtau_du
Partial derivatives of the actuation model w.r.t. the control input.
VectorXs tau
Actuation (generalized force) signal.
virtual void print(std::ostream &os) const
Print relevant information of the residual model.
std::size_t get_nu() const
Return the dimension of the control input.
Abstract class for the actuation-mapping model.
const boost::shared_ptr< StateAbstract > & get_state() const
Return the state.
MatrixXs dtau_dx
Partial derivatives of the actuation model w.r.t. the state point.
virtual boost::shared_ptr< ActuationDataAbstract > createData()
Create the actuation data.