9 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_CONTACT_CONTROL_GRAVITY_HPP_
10 #define CROCODDYL_MULTIBODY_RESIDUALS_CONTACT_CONTROL_GRAVITY_HPP_
12 #include "crocoddyl/core/residual-base.hpp"
13 #include "crocoddyl/multibody/states/multibody.hpp"
14 #include "crocoddyl/multibody/data/contacts.hpp"
15 #include "crocoddyl/core/utils/exception.hpp"
34 template <
typename _Scalar>
37 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39 typedef _Scalar Scalar;
47 typedef typename MathBase::VectorXs VectorXs;
48 typedef typename MathBase::MatrixXs MatrixXs;
75 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract> &data,
const Eigen::Ref<const VectorXs> &x,
76 const Eigen::Ref<const VectorXs> &u);
85 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract> &data,
const Eigen::Ref<const VectorXs> &x,
86 const Eigen::Ref<const VectorXs> &u);
95 virtual void print(std::ostream &os)
const;
104 typename StateMultibody::PinocchioModel pin_model_;
107 template <
typename _Scalar>
109 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
111 typedef _Scalar Scalar;
116 typedef pinocchio::DataTpl<Scalar> PinocchioData;
118 template <
template <
typename Scalar>
class Model>
120 :
Base(model, data) {
129 "Invalid argument: the shared data should be derived from "
130 "DataCollectorActMultibodyInContactTpl");
134 fext = d->contacts->fext;
139 boost::shared_ptr<ActuationDataAbstractTpl<Scalar> >
actuation;
140 pinocchio::container::aligned_vector<pinocchio::ForceTpl<Scalar> >
fext;
152 #include "crocoddyl/multibody/residuals/contact-control-gravity.hxx"
Abstract class for residual models.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
VectorXs unone_
No control vector.
bool v_dependent_
Label that indicates if the residual function depends on v.
State multibody representation.
const boost::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.