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"
34template <
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);
87 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x);
96 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
97 const Eigen::Ref<const VectorXs>& u);
108 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x);
120 virtual void print(std::ostream& os)
const;
129 typename StateMultibody::PinocchioModel pin_model_;
132template <
typename _Scalar>
134 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
136 typedef _Scalar Scalar;
141 typedef pinocchio::DataTpl<Scalar> PinocchioData;
143 template <
template <
typename Scalar>
class Model>
145 :
Base(model, data) {
154 "Invalid argument: the shared data should be derived from "
155 "DataCollectorActMultibodyInContactTpl");
159 fext = d->contacts->fext;
164 boost::shared_ptr<ActuationDataAbstractTpl<Scalar> >
actuation;
165 pinocchio::container::aligned_vector<pinocchio::ForceTpl<Scalar> >
fext;
177#include "crocoddyl/multibody/residuals/contact-control-gravity.hxx"
Abstract class for the actuation-mapping model.
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.