10 #ifndef CROCODDYL_MULTIBODY_CONTACTS_CONTACT_6D_HPP_
11 #define CROCODDYL_MULTIBODY_CONTACTS_CONTACT_6D_HPP_
13 #include <pinocchio/multibody/data.hpp>
14 #include <pinocchio/spatial/motion.hpp>
16 #include "crocoddyl/core/utils/deprecate.hpp"
17 #include "crocoddyl/multibody/contact-base.hpp"
18 #include "crocoddyl/multibody/fwd.hpp"
22 template <
typename _Scalar>
25 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
27 typedef _Scalar Scalar;
33 typedef pinocchio::SE3Tpl<Scalar> SE3;
34 typedef typename MathBase::Vector2s Vector2s;
35 typedef typename MathBase::Vector3s Vector3s;
36 typedef typename MathBase::VectorXs VectorXs;
37 typedef typename MathBase::Matrix3s Matrix3s;
55 const pinocchio::FrameIndex
id,
const SE3& pref,
56 const pinocchio::ReferenceFrame type,
const std::size_t nu,
57 const Vector2s& gains = Vector2s::Zero());
75 const pinocchio::FrameIndex
id,
const SE3& pref,
76 const pinocchio::ReferenceFrame type,
77 const Vector2s& gains = Vector2s::Zero());
80 "Use constructor that passes the type type of contact, this assumes is "
83 const pinocchio::FrameIndex
id,
const SE3& pref,
85 const Vector2s& gains = Vector2s::Zero());)
87 "Use constructor that passes the type type of contact, this assumes is "
90 const pinocchio::FrameIndex
id,
const SE3& pref,
91 const Vector2s& gains = Vector2s::Zero());)
101 virtual void calc(
const boost::shared_ptr<ContactDataAbstract>& data,
102 const Eigen::Ref<const VectorXs>& x);
111 virtual void calcDiff(
const boost::shared_ptr<ContactDataAbstract>& data,
112 const Eigen::Ref<const VectorXs>& x);
120 virtual void updateForce(
const boost::shared_ptr<ContactDataAbstract>& data,
121 const VectorXs& force);
127 pinocchio::DataTpl<Scalar>*
const data);
149 virtual void print(std::ostream& os)
const;
163 template <
typename _Scalar>
165 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
167 typedef _Scalar Scalar;
170 typedef typename MathBase::Matrix3s Matrix3s;
171 typedef typename MathBase::Matrix6xs Matrix6xs;
172 typedef typename MathBase::Matrix6s Matrix6s;
173 typedef typename MathBase::MatrixXs MatrixXs;
174 typedef typename pinocchio::SE3Tpl<Scalar> SE3;
175 typedef typename pinocchio::MotionTpl<Scalar> Motion;
176 typedef typename pinocchio::ForceTpl<Scalar> Force;
178 template <
template <
typename Scalar>
class Model>
180 pinocchio::DataTpl<Scalar>*
const data)
182 rMf(SE3::Identity()),
183 lwaMl(SE3::Identity()),
185 a0_local(Motion::Zero()),
186 f_local(Force::Zero()),
187 da0_local_dx(6, model->get_state()->get_ndx()),
188 fJf(6, model->get_state()->get_nv()),
189 v_partial_dq(6, model->get_state()->get_nv()),
190 a_partial_dq(6, model->get_state()->get_nv()),
191 a_partial_dv(6, model->get_state()->get_nv()),
192 a_partial_da(6, model->get_state()->get_nv()),
193 fJf_df(6, model->get_state()->get_nv()) {
194 frame = model->get_id();
195 jMf = model->get_state()->get_pinocchio()->frames[
frame].placement;
196 fXj =
jMf.inverse().toActionMatrix();
197 da0_local_dx.setZero();
199 v_partial_dq.setZero();
200 a_partial_dq.setZero();
201 a_partial_dv.setZero();
202 a_partial_da.setZero();
203 av_world_skew.setZero();
204 aw_world_skew.setZero();
229 Matrix6xs da0_local_dx;
231 Matrix6xs v_partial_dq;
232 Matrix6xs a_partial_dq;
233 Matrix6xs a_partial_dv;
234 Matrix6xs a_partial_da;
235 Matrix3s av_world_skew;
236 Matrix3s aw_world_skew;
249 #include "crocoddyl/multibody/contacts/contact-6d.hxx"
State multibody representation.