10 #ifndef CROCODDYL_MULTIBODY_CONTACTS_CONTACT_3D_HPP_
11 #define CROCODDYL_MULTIBODY_CONTACTS_CONTACT_3D_HPP_
13 #include <pinocchio/algorithm/frames.hpp>
14 #include <pinocchio/algorithm/kinematics-derivatives.hpp>
15 #include <pinocchio/multibody/data.hpp>
16 #include <pinocchio/spatial/motion.hpp>
18 #include "crocoddyl/core/utils/deprecate.hpp"
19 #include "crocoddyl/core/utils/exception.hpp"
20 #include "crocoddyl/multibody/contact-base.hpp"
21 #include "crocoddyl/multibody/fwd.hpp"
25 template <
typename _Scalar>
28 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
30 typedef _Scalar Scalar;
36 typedef typename MathBase::Matrix3s Matrix3s;
37 typedef typename MathBase::Vector2s Vector2s;
38 typedef typename MathBase::Vector3s Vector3s;
39 typedef typename MathBase::VectorXs VectorXs;
57 const pinocchio::FrameIndex
id,
const Vector3s& xref,
58 const pinocchio::ReferenceFrame type,
const std::size_t nu,
59 const Vector2s& gains = Vector2s::Zero());
77 const pinocchio::FrameIndex
id,
const Vector3s& xref,
78 const pinocchio::ReferenceFrame type,
79 const Vector2s& gains = Vector2s::Zero());
82 "Use constructor that passes the type type of contact, this assumes is "
85 const pinocchio::FrameIndex
id,
const Vector3s& xref,
87 const Vector2s& gains = Vector2s::Zero());)
89 "Use constructor that passes the type type of contact, this assumes is "
92 const pinocchio::FrameIndex
id,
const Vector3s& xref,
93 const Vector2s& gains = Vector2s::Zero());)
103 virtual void calc(
const boost::shared_ptr<ContactDataAbstract>& data,
104 const Eigen::Ref<const VectorXs>& x);
113 virtual void calcDiff(
const boost::shared_ptr<ContactDataAbstract>& data,
114 const Eigen::Ref<const VectorXs>& x);
122 virtual void updateForce(
const boost::shared_ptr<ContactDataAbstract>& data,
123 const VectorXs& force);
129 pinocchio::DataTpl<Scalar>*
const data);
151 virtual void print(std::ostream& os)
const;
165 template <
typename _Scalar>
167 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
169 typedef _Scalar Scalar;
172 typedef typename MathBase::Vector3s Vector3s;
173 typedef typename MathBase::Matrix3s Matrix3s;
174 typedef typename MathBase::Matrix3xs Matrix3xs;
175 typedef typename MathBase::Matrix6xs Matrix6xs;
176 typedef typename pinocchio::MotionTpl<Scalar> Motion;
177 typedef typename pinocchio::ForceTpl<Scalar> Force;
179 template <
template <
typename Scalar>
class Model>
181 pinocchio::DataTpl<Scalar>*
const data)
184 f_local(Force::Zero()),
185 da0_local_dx(3, model->get_state()->get_ndx()),
186 fJf(6, model->get_state()->get_nv()),
187 v_partial_dq(6, model->get_state()->get_nv()),
188 a_partial_dq(6, model->get_state()->get_nv()),
189 a_partial_dv(6, model->get_state()->get_nv()),
190 a_partial_da(6, model->get_state()->get_nv()),
191 fXjdv_dq(6, model->get_state()->get_nv()),
192 fXjda_dq(6, model->get_state()->get_nv()),
193 fXjda_dv(6, model->get_state()->get_nv()),
194 fJf_df(3, model->get_state()->get_nv()) {
195 frame = model->get_id();
196 jMf = model->get_state()->get_pinocchio()->frames[
frame].placement;
197 fXj =
jMf.inverse().toActionMatrix();
201 da0_local_dx.setZero();
203 v_partial_dq.setZero();
204 a_partial_dq.setZero();
205 a_partial_dv.setZero();
206 a_partial_da.setZero();
210 a0_world_skew.setZero();
235 Matrix3xs da0_local_dx;
237 Matrix6xs v_partial_dq;
238 Matrix6xs a_partial_dq;
239 Matrix6xs a_partial_dv;
240 Matrix6xs a_partial_da;
244 Matrix3s a0_world_skew;
258 #include "crocoddyl/multibody/contacts/contact-3d.hxx"
State multibody representation.