10 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_CONTACT_CONTROL_GRAVITY_HPP_
11 #define CROCODDYL_MULTIBODY_RESIDUALS_CONTACT_CONTROL_GRAVITY_HPP_
13 #include "crocoddyl/core/residual-base.hpp"
14 #include "crocoddyl/multibody/data/contacts.hpp"
15 #include "crocoddyl/multibody/states/multibody.hpp"
38 template <
typename _Scalar>
42 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 typedef _Scalar Scalar;
53 typedef typename MathBase::VectorXs VectorXs;
54 typedef typename MathBase::MatrixXs MatrixXs;
63 const std::size_t nu);
73 std::shared_ptr<StateMultibody> state);
83 virtual void calc(
const std::shared_ptr<ResidualDataAbstract>& data,
84 const Eigen::Ref<const VectorXs>& x,
85 const Eigen::Ref<const VectorXs>& u)
override;
97 virtual void calc(
const std::shared_ptr<ResidualDataAbstract>& data,
98 const Eigen::Ref<const VectorXs>& x)
override;
108 virtual void calcDiff(
const std::shared_ptr<ResidualDataAbstract>& data,
109 const Eigen::Ref<const VectorXs>& x,
110 const Eigen::Ref<const VectorXs>& u)
override;
123 virtual void calcDiff(
const std::shared_ptr<ResidualDataAbstract>& data,
124 const Eigen::Ref<const VectorXs>& x)
override;
142 template <
typename NewScalar>
150 virtual void print(std::ostream& os)
const override;
158 typename StateMultibody::PinocchioModel pin_model_;
161 template <
typename _Scalar>
164 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
166 typedef _Scalar Scalar;
171 typedef pinocchio::DataTpl<Scalar> PinocchioData;
173 template <
template <
typename Scalar>
class Model>
176 :
Base(model, data) {
185 "Invalid argument: the shared data should be derived from "
186 "DataCollectorActMultibodyInContactTpl");
190 fext = d->contacts->fext;
196 std::shared_ptr<ActuationDataAbstractTpl<Scalar> >
198 pinocchio::container::aligned_vector<pinocchio::ForceTpl<Scalar> >
211 #include "crocoddyl/multibody/residuals/contact-control-gravity.hxx"
213 CROCODDYL_DECLARE_EXTERN_TEMPLATE_CLASS(
215 CROCODDYL_DECLARE_EXTERN_TEMPLATE_STRUCT(
Abstract class for the actuation-mapping model.
Abstract class for residual models.
std::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
State multibody representation.
const std::shared_ptr< PinocchioModel > & get_pinocchio() const
Return the Pinocchio model (i.e., model of the rigid body system)
MatrixXs Ru
Jacobian of the residual vector with respect the control.
MatrixXs Rx
Jacobian of the residual vector with respect the state.
DataCollectorAbstract * shared
Shared data allocated by the action model.
VectorXs r
Residual vector.