9 #ifndef CROCODDYL_MULTIBODY_ACTUATIONS_FULL_HPP_
10 #define CROCODDYL_MULTIBODY_ACTUATIONS_FULL_HPP_
12 #include "crocoddyl/multibody/fwd.hpp"
13 #include "crocoddyl/core/actuation-base.hpp"
14 #include "crocoddyl/core/state-base.hpp"
27 template <
typename _Scalar>
30 typedef _Scalar Scalar;
35 typedef typename MathBase::VectorXs VectorXs;
36 typedef typename MathBase::MatrixXs MatrixXs;
53 virtual void calc(
const boost::shared_ptr<Data>& data,
const Eigen::Ref<const VectorXs>& ,
54 const Eigen::Ref<const VectorXs>& u) {
55 if (
static_cast<std::size_t
>(u.size()) !=
nu_) {
56 throw_pretty(
"Invalid argument: "
57 <<
"u has wrong dimension (it should be " + std::to_string(
nu_) +
")");
70 virtual void calcDiff(
const boost::shared_ptr<Data>& data,
const Eigen::Ref<const VectorXs>& ,
71 const Eigen::Ref<const VectorXs>&) {
73 virtual void calcDiff(
const boost::shared_ptr<Data>&,
const Eigen::Ref<const VectorXs>& ,
74 const Eigen::Ref<const VectorXs>&) {
77 assert_pretty(data->dtau_dx.isZero(),
"dtau_dx has wrong value");
78 assert_pretty(MatrixXs(data->dtau_du).isApprox(MatrixXs::Identity(
state_->get_nv(),
nu_)),
79 "dtau_du has wrong value");
89 boost::shared_ptr<Data> data = boost::allocate_shared<Data>(Eigen::aligned_allocator<Data>(),
this);
90 data->dtau_du.diagonal().setOnes();
Abstract class for the actuation-mapping model.
boost::shared_ptr< StateAbstract > state_
Model of the state.
std::size_t nu_
Control dimension.
ActuationModelFullTpl(boost::shared_ptr< StateAbstract > state)
Initialize the full actuation model.
boost::shared_ptr< StateAbstract > state_
Model of the state.
std::size_t nu_
Control dimension.
virtual void calc(const boost::shared_ptr< Data > &data, const Eigen::Ref< const VectorXs > &, const Eigen::Ref< const VectorXs > &u)
Compute the full actuation.
virtual void calcDiff(const boost::shared_ptr< Data > &data, const Eigen::Ref< const VectorXs > &, const Eigen::Ref< const VectorXs > &)
Compute the Jacobians of the full actuation model.
virtual boost::shared_ptr< Data > createData()
Create the full actuation data.
Abstract class for the state representation.