9 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_CONTROL_GRAVITY_HPP_
10 #define CROCODDYL_MULTIBODY_RESIDUALS_CONTROL_GRAVITY_HPP_
12 #include "crocoddyl/core/residual-base.hpp"
13 #include "crocoddyl/core/utils/exception.hpp"
14 #include "crocoddyl/multibody/data/multibody.hpp"
15 #include "crocoddyl/multibody/states/multibody.hpp"
35 template <
typename _Scalar>
38 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40 typedef _Scalar Scalar;
47 typedef typename MathBase::VectorXs VectorXs;
48 typedef typename MathBase::MatrixXs MatrixXs;
57 const std::size_t nu);
76 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract> &data,
77 const Eigen::Ref<const VectorXs> &x,
78 const Eigen::Ref<const VectorXs> &u);
84 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract> &data,
85 const Eigen::Ref<const VectorXs> &x);
94 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract> &data,
95 const Eigen::Ref<const VectorXs> &x,
96 const Eigen::Ref<const VectorXs> &u);
103 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract> &data,
104 const Eigen::Ref<const VectorXs> &x);
114 virtual void print(std::ostream &os)
const;
122 typename StateMultibody::PinocchioModel
126 template <
typename _Scalar>
128 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
130 typedef _Scalar Scalar;
135 typedef pinocchio::DataTpl<Scalar> PinocchioData;
137 template <
template <
typename Scalar>
class Model>
140 :
Base(model, data) {
146 "Invalid argument: the shared data should be derived from "
147 "DataCollectorActMultibodyTpl");
157 boost::shared_ptr<ActuationDataAbstractTpl<Scalar> >
170 #include "crocoddyl/multibody/residuals/control-gravity.hxx"
Abstract class for residual models.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
Control gravity residual.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x)
virtual void print(std::ostream &os) const
Print relevant information of the control-grav residual.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the control gravity residual.
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the Jacobians of the control gravity residual.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the residual data.
ResidualModelControlGravTpl(boost::shared_ptr< StateMultibody > state, const std::size_t nu)
Initialize the control gravity residual model.
ResidualModelControlGravTpl(boost::shared_ptr< StateMultibody > state)
Initialize the control gravity residual model.
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.
PinocchioData pinocchio
Pinocchio data.
boost::shared_ptr< ActuationDataAbstractTpl< Scalar > > actuation
Actuation data.
DataCollectorAbstract * shared
Shared data allocated by the action model.