10 #ifndef CROCODDYL_MULTIBODY_CONTACT_BASE_HPP_
11 #define CROCODDYL_MULTIBODY_CONTACT_BASE_HPP_
13 #include <pinocchio/multibody/fwd.hpp>
15 #include "crocoddyl/core/mathbase.hpp"
16 #include "crocoddyl/core/utils/deprecate.hpp"
17 #include "crocoddyl/multibody/force-base.hpp"
18 #include "crocoddyl/multibody/fwd.hpp"
19 #include "crocoddyl/multibody/states/multibody.hpp"
23 template <
typename _Scalar>
26 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
28 typedef _Scalar Scalar;
32 typedef typename MathBase::VectorXs VectorXs;
33 typedef typename MathBase::MatrixXs MatrixXs;
44 const pinocchio::ReferenceFrame type,
45 const std::size_t nc,
const std::size_t nu);
47 const pinocchio::ReferenceFrame type,
48 const std::size_t nc);
51 "Use constructor that passes the type type of contact, this assumes is "
54 const std::size_t nc,
const std::size_t nu);)
56 "Use constructor that passes the type type of contact, this assumes is "
59 const std::size_t nc);)
69 virtual void calc(
const boost::shared_ptr<ContactDataAbstract>& data,
70 const Eigen::Ref<const VectorXs>& x) = 0;
79 virtual void calcDiff(
const boost::shared_ptr<ContactDataAbstract>& data,
80 const Eigen::Ref<const VectorXs>& x) = 0;
88 virtual void updateForce(
const boost::shared_ptr<ContactDataAbstract>& data,
89 const VectorXs& force) = 0;
98 const MatrixXs& df_dx,
const MatrixXs& df_du)
const;
105 void setZeroForce(
const boost::shared_ptr<ContactDataAbstract>& data)
const;
113 const boost::shared_ptr<ContactDataAbstract>& data)
const;
119 pinocchio::DataTpl<Scalar>*
const data);
124 const boost::shared_ptr<StateMultibody>&
get_state()
const;
144 void set_id(
const pinocchio::FrameIndex
id);
149 void set_type(
const pinocchio::ReferenceFrame type);
159 template <
class Scalar>
168 virtual void print(std::ostream& os)
const;
171 boost::shared_ptr<StateMultibody> state_;
174 pinocchio::FrameIndex
id_;
178 template <
typename _Scalar>
180 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
182 typedef _Scalar Scalar;
185 typedef typename MathBase::VectorXs VectorXs;
186 typedef typename MathBase::MatrixXs MatrixXs;
187 typedef typename pinocchio::SE3Tpl<Scalar> SE3;
189 template <
template <
typename Scalar>
class Model>
191 pinocchio::DataTpl<Scalar>*
const data)
193 fXj(
jMf.inverse().toActionMatrix()),
195 da0_dx(model->get_nc(), model->get_state()->get_ndx()),
196 dtau_dq(model->get_state()->get_nv(), model->get_state()->get_nv()) {
211 typename SE3::ActionMatrixType fXj;
222 #include "crocoddyl/multibody/contact-base.hxx"
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.