10 #ifndef CROCODDYL_MULTIBODY_IMPULSE_BASE_HPP_
11 #define CROCODDYL_MULTIBODY_IMPULSE_BASE_HPP_
13 #include "crocoddyl/core/utils/deprecate.hpp"
14 #include "crocoddyl/multibody/force-base.hpp"
15 #include "crocoddyl/multibody/fwd.hpp"
16 #include "crocoddyl/multibody/states/multibody.hpp"
20 template <
typename _Scalar>
23 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
25 typedef _Scalar Scalar;
29 typedef typename MathBase::VectorXs VectorXs;
30 typedef typename MathBase::MatrixXs MatrixXs;
33 const pinocchio::ReferenceFrame type,
34 const std::size_t nc);
37 "Use constructor that passes the type type of contact, this assumes is "
40 const std::size_t nc);)
43 virtual void calc(
const boost::shared_ptr<ImpulseDataAbstract>& data,
44 const Eigen::Ref<const VectorXs>& x) = 0;
45 virtual void calcDiff(
const boost::shared_ptr<ImpulseDataAbstract>& data,
46 const Eigen::Ref<const VectorXs>& x) = 0;
48 virtual void updateForce(
const boost::shared_ptr<ImpulseDataAbstract>& data,
49 const VectorXs& force) = 0;
50 void updateForceDiff(
const boost::shared_ptr<ImpulseDataAbstract>& data,
51 const MatrixXs& df_dx)
const;
52 void setZeroForce(
const boost::shared_ptr<ImpulseDataAbstract>& data)
const;
53 void setZeroForceDiff(
54 const boost::shared_ptr<ImpulseDataAbstract>& data)
const;
56 virtual boost::shared_ptr<ImpulseDataAbstract> createData(
57 pinocchio::DataTpl<Scalar>*
const data);
59 const boost::shared_ptr<StateMultibody>& get_state()
const;
60 std::size_t get_nc()
const;
61 DEPRECATED(
"Use get_nc().", std::size_t get_ni()
const;)
62 std::size_t get_nu()
const;
67 pinocchio::FrameIndex
get_id()
const;
72 void set_id(
const pinocchio::FrameIndex
id);
77 void set_type(
const pinocchio::ReferenceFrame type);
87 template <
class Scalar>
96 virtual void print(std::ostream& os)
const;
99 boost::shared_ptr<StateMultibody> state_;
101 pinocchio::FrameIndex
id_;
105 template <
typename _Scalar>
107 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
109 typedef _Scalar Scalar;
112 typedef typename MathBase::VectorXs VectorXs;
113 typedef typename MathBase::MatrixXs MatrixXs;
114 typedef typename pinocchio::SE3Tpl<Scalar> SE3;
116 template <
template <
typename Scalar>
class Model>
118 pinocchio::DataTpl<Scalar>*
const data)
120 dv0_dq(model->get_nc(), model->get_state()->get_nv()),
121 dtau_dq(model->get_state()->get_nv(), model->get_state()->get_nv()) {
134 typename SE3::ActionMatrixType fXj;
144 #include "crocoddyl/multibody/impulse-base.hxx"
virtual void print(std::ostream &os) const
Print relevant information of the impulse model.
void set_id(const pinocchio::FrameIndex id)
Modify the reference frame id.
pinocchio::ReferenceFrame type_
Type of contact.
DEPRECATED("Use get_nc().", std::size_t get_ni() const ;) std pinocchio::FrameIndex get_id() const
Return the reference frame id.
void set_type(const pinocchio::ReferenceFrame type)
Modify the type of contact.
pinocchio::ReferenceFrame get_type() const
Return the type of contact.
pinocchio::FrameIndex id_
Reference frame id of the contact.
friend std::ostream & operator<<(std::ostream &os, const ImpulseModelAbstractTpl< Scalar > &model)
Print information on the impulse model.
State multibody representation.
PinocchioData * pinocchio
Pinocchio data.
pinocchio::FrameIndex frame
Frame index of the contact frame.
SE3 jMf
Local frame placement of the contact frame.
MatrixXs Jc
Contact Jacobian.
Force f
Contact force expressed in the coordinate defined by type.