9 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_IMPULSE_COM_HPP_
10 #define CROCODDYL_MULTIBODY_RESIDUALS_IMPULSE_COM_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/impulse-base.hpp"
16 #include "crocoddyl/multibody/data/impulses.hpp"
17 #include "crocoddyl/core/utils/exception.hpp"
35 template <
typename _Scalar>
38 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
40 typedef _Scalar Scalar;
48 typedef typename MathBase::VectorXs VectorXs;
65 virtual void calc(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
66 const Eigen::Ref<const VectorXs>& u);
75 virtual void calcDiff(
const boost::shared_ptr<ResidualDataAbstract>& data,
const Eigen::Ref<const VectorXs>& x,
76 const Eigen::Ref<const VectorXs>& u);
88 virtual void print(std::ostream& os)
const;
97 boost::shared_ptr<typename StateMultibody::PinocchioModel> pin_model_;
100 template <
typename _Scalar>
102 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
104 typedef _Scalar Scalar;
109 typedef typename MathBase::MatrixXs MatrixXs;
110 typedef typename MathBase::Matrix3xs Matrix3xs;
112 template <
template <
typename Scalar>
class Model>
115 dvc_dq(3, model->get_state()->get_nv()),
116 ddv_dv(model->get_state()->get_nv(), model->get_state()->get_nv()) {
119 const boost::shared_ptr<StateMultibody>& state = boost::static_pointer_cast<StateMultibody>(model->get_state());
124 throw_pretty(
"Invalid argument: the shared data should be derived from DataCollectorMultibodyInImpulse");
131 boost::shared_ptr<crocoddyl::ImpulseDataMultipleTpl<Scalar> >
impulses;
146 #include "crocoddyl/multibody/residuals/impulse-com.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.
virtual void print(std::ostream &os) const
Print relevant information of the impulse-com residual.
ResidualModelImpulseCoMTpl(boost::shared_ptr< StateMultibody > state)
Initialize the impulse CoM residual model.
virtual void calc(const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the impulse CoM 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 impulse CoM residual.
virtual boost::shared_ptr< ResidualDataAbstract > createData(DataCollectorAbstract *const data)
Create the impulse CoM residual data.
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.
pinocchio::DataTpl< Scalar > pinocchio_internal
Pinocchio data for internal computation.
MatrixXs ddv_dv
Jacobian of the CoM velocity.
Matrix3xs dvc_dq
Jacobian of the CoM velocity.
DataCollectorAbstract * shared
Shared data allocated by the action model.
boost::shared_ptr< crocoddyl::ImpulseDataMultipleTpl< Scalar > > impulses
Impulses data.
pinocchio::DataTpl< Scalar > * pinocchio
Pinocchio data.