9#ifndef CROCODDYL_MULTIBODY_RESIDUALS_COM_POSITION_HPP_
10#define CROCODDYL_MULTIBODY_RESIDUALS_COM_POSITION_HPP_
12#include "crocoddyl/multibody/fwd.hpp"
13#include "crocoddyl/core/residual-base.hpp"
14#include "crocoddyl/multibody/states/multibody.hpp"
15#include "crocoddyl/multibody/data/multibody.hpp"
32template <
typename _Scalar>
35 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
37 typedef _Scalar Scalar;
44 typedef typename MathBase::Vector3s Vector3s;
45 typedef typename MathBase::VectorXs VectorXs;
74 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
75 const Eigen::Ref<const VectorXs>& u);
84 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
85 const Eigen::Ref<const VectorXs>& u);
103 virtual void print(std::ostream& os)
const;
116template <
typename _Scalar>
118 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
120 typedef _Scalar Scalar;
124 typedef typename MathBase::Matrix3xs Matrix3xs;
126 template <
template <
typename Scalar>
class Model>
131 throw_pretty(
"Invalid argument: the shared data should be derived from DataCollectorMultibody");
150#include "crocoddyl/multibody/residuals/com-position.hxx"
Abstract class for residual models.
bool u_dependent_
Label that indicates if the residual function depends on u.
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.
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 boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the residual data.
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.
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.