9 #ifndef CROCODDYL_MULTIBODY_RESIDUALS_IMPULSE_COM_HPP_
10 #define CROCODDYL_MULTIBODY_RESIDUALS_IMPULSE_COM_HPP_
12 #include "crocoddyl/core/residual-base.hpp"
13 #include "crocoddyl/core/utils/exception.hpp"
14 #include "crocoddyl/multibody/data/impulses.hpp"
15 #include "crocoddyl/multibody/fwd.hpp"
16 #include "crocoddyl/multibody/impulse-base.hpp"
17 #include "crocoddyl/multibody/states/multibody.hpp"
37 template <
typename _Scalar>
40 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
42 typedef _Scalar Scalar;
50 typedef typename MathBase::VectorXs VectorXs;
67 virtual void calc(
const std::shared_ptr<ResidualDataAbstract>& data,
68 const Eigen::Ref<const VectorXs>& x,
69 const Eigen::Ref<const VectorXs>& u);
78 virtual void calcDiff(
const std::shared_ptr<ResidualDataAbstract>& data,
79 const Eigen::Ref<const VectorXs>& x,
80 const Eigen::Ref<const VectorXs>& u);
85 virtual std::shared_ptr<ResidualDataAbstract>
createData(
93 virtual void print(std::ostream& os)
const;
101 std::shared_ptr<typename StateMultibody::PinocchioModel> pin_model_;
104 template <
typename _Scalar>
106 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
108 typedef _Scalar Scalar;
113 typedef typename MathBase::MatrixXs MatrixXs;
114 typedef typename MathBase::Matrix3xs Matrix3xs;
116 template <
template <
typename Scalar>
class Model>
120 dvc_dq(3, model->get_state()->get_nv()),
121 ddv_dv(model->get_state()->get_nv(), model->get_state()->get_nv()) {
124 const std::shared_ptr<StateMultibody>& state =
125 std::static_pointer_cast<StateMultibody>(model->get_state());
127 pinocchio::DataTpl<Scalar>(*state->get_pinocchio().get());
133 "Invalid argument: the shared data should be derived from "
134 "DataCollectorMultibodyInImpulse");
141 std::shared_ptr<crocoddyl::ImpulseDataMultipleTpl<Scalar> >
145 pinocchio::DataTpl<Scalar>
158 #include "crocoddyl/multibody/residuals/impulse-com.hxx"
Abstract class for residual models.
std::shared_ptr< StateAbstract > state_
State description.
std::size_t nu_
Control dimension.
virtual void calcDiff(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the Jacobians of the impulse CoM residual.
ResidualModelImpulseCoMTpl(std::shared_ptr< StateMultibody > state)
Initialize the impulse CoM residual model.
virtual void print(std::ostream &os) const
Print relevant information of the impulse-com residual.
virtual void calc(const std::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the impulse CoM residual.
virtual std::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.
std::shared_ptr< crocoddyl::ImpulseDataMultipleTpl< Scalar > > impulses
Impulses data.
DataCollectorAbstract * shared
Shared data allocated by the action model.
pinocchio::DataTpl< Scalar > * pinocchio
Pinocchio data.