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 == MatrixXs::Zero(state_->get_nv(), state_->get_ndx()),
"dtau_dx has wrong value");
78 assert_pretty(data->dtau_du == MatrixXs::Identity(state_->get_nv(), nu_),
"dtau_du has wrong value");
88 boost::shared_ptr<Data> data = boost::allocate_shared<Data>(Eigen::aligned_allocator<Data>(),
this);
89 data->dtau_du.diagonal().fill((Scalar)1);
100 #endif // CROCODDYL_MULTIBODY_ACTUATIONS_FULL_HPP_ ActuationModelFullTpl(boost::shared_ptr< StateAbstract > state)
Initialize the full actuation model.
Abstract class for the state representation.
virtual boost::shared_ptr< Data > createData()
Create the full actuation data.
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 void calc(const boost::shared_ptr< Data > &data, const Eigen::Ref< const VectorXs > &, const Eigen::Ref< const VectorXs > &u)
Compute the full actuation.