10 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_COM_POSITION_HPP_
11 #define CROCODDYL_MULTIBODY_RESIDUALS_COM_POSITION_HPP_
13 #include "crocoddyl/core/residual-base.hpp"
14 #include "crocoddyl/multibody/data/multibody.hpp"
15 #include "crocoddyl/multibody/fwd.hpp"
16 #include "crocoddyl/multibody/states/multibody.hpp"
35 template <
typename _Scalar>
38 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40 typedef _Scalar Scalar;
47 typedef typename MathBase::Vector3s Vector3s;
48 typedef typename MathBase::VectorXs VectorXs;
58 const Vector3s& cref,
const std::size_t nu);
69 const Vector3s& cref);
79 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
80 const Eigen::Ref<const VectorXs>& x,
81 const Eigen::Ref<const VectorXs>& u);
90 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
91 const Eigen::Ref<const VectorXs>& x,
92 const Eigen::Ref<const VectorXs>& u);
93 virtual boost::shared_ptr<ResidualDataAbstract>
createData(
111 virtual void print(std::ostream& os)
const;
123 template <
typename _Scalar>
125 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
127 typedef _Scalar Scalar;
131 typedef typename MathBase::Matrix3xs Matrix3xs;
133 template <
template <
typename Scalar>
class Model>
136 :
Base(model, data) {
142 "Invalid argument: the shared data should be derived from "
143 "DataCollectorMultibody");
162 #include "crocoddyl/multibody/residuals/com-position.hxx"
Abstract class for residual models.
boost::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
ResidualModelCoMPositionTpl(boost::shared_ptr< StateMultibody > state, const Vector3s &cref)
Initialize the CoM position residual model.
const Vector3s & get_reference() const
Return the CoM position reference.
virtual void print(std::ostream &os) const
Print relevant information of the com-position residual.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the CoM position residual.
void set_reference(const Vector3s &cref)
Modify the CoM position reference.
virtual void calcDiff(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the CoM position residual.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the residual data.
ResidualModelCoMPositionTpl(boost::shared_ptr< StateMultibody > state, const Vector3s &cref, const std::size_t nu)
Initialize the CoM position residual model.
State multibody representation.
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.
DataCollectorAbstract * shared
Shared data allocated by the action model.
pinocchio::DataTpl< Scalar > * pinocchio
Pinocchio data.