pinocchio  2.1.3
joint-revolute.hpp
1 //
2 // Copyright (c) 2015-2018 CNRS
3 // Copyright (c) 2015-2016 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4 //
5 
6 #ifndef __pinocchio_joint_revolute_hpp__
7 #define __pinocchio_joint_revolute_hpp__
8 
9 #include "pinocchio/math/sincos.hpp"
10 #include "pinocchio/spatial/inertia.hpp"
11 #include "pinocchio/multibody/constraint.hpp"
12 #include "pinocchio/multibody/joint/joint-base.hpp"
13 #include "pinocchio/spatial/spatial-axis.hpp"
14 #include "pinocchio/utils/axis-label.hpp"
15 
16 namespace pinocchio
17 {
18 
19  template<typename Scalar, int Options, int axis> struct MotionRevoluteTpl;
20 
21  namespace internal
22  {
23  template<typename Scalar, int Options, int axis>
24  struct SE3GroupAction< MotionRevoluteTpl<Scalar,Options,axis> >
25  {
26  typedef MotionTpl<Scalar,Options> ReturnType;
27  };
28 
29  template<typename Scalar, int Options, int axis, typename MotionDerived>
30  struct MotionAlgebraAction< MotionRevoluteTpl<Scalar,Options,axis>, MotionDerived>
31  {
32  typedef MotionTpl<Scalar,Options> ReturnType;
33  };
34  }
35 
36  template<typename _Scalar, int _Options, int axis>
37  struct traits< MotionRevoluteTpl<_Scalar,_Options,axis> >
38  {
39  typedef _Scalar Scalar;
40  enum { Options = _Options };
41  typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
42  typedef Eigen::Matrix<Scalar,6,1,Options> Vector6;
43  typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
44  typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6) ToVectorConstReturnType;
45  typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
46  typedef Vector3 AngularType;
47  typedef Vector3 LinearType;
48  typedef const Vector3 ConstAngularType;
49  typedef const Vector3 ConstLinearType;
50  typedef Matrix6 ActionMatrixType;
52  enum {
53  LINEAR = 0,
54  ANGULAR = 3
55  };
56  }; // traits MotionRevoluteTpl
57 
58  template<typename Scalar, int Options, int axis> struct TransformRevoluteTpl;
59 
60  template<typename _Scalar, int _Options, int _axis>
61  struct traits< TransformRevoluteTpl<_Scalar,_Options,_axis> >
62  {
63  enum {
64  axis = _axis,
65  Options = _Options,
66  LINEAR = 0,
67  ANGULAR = 3
68  };
69  typedef _Scalar Scalar;
71  typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
72  typedef Eigen::Matrix<Scalar,3,3,Options> Matrix3;
73  typedef Matrix3 AngularType;
74  typedef Matrix3 AngularRef;
75  typedef Matrix3 ConstAngularRef;
76  typedef typename Vector3::ConstantReturnType LinearType;
77  typedef typename Vector3::ConstantReturnType LinearRef;
78  typedef const typename Vector3::ConstantReturnType ConstLinearRef;
79  typedef typename traits<PlainType>::ActionMatrixType ActionMatrixType;
80  typedef typename traits<PlainType>::HomogeneousMatrixType HomogeneousMatrixType;
81  }; // traits TransformRevoluteTpl
82 
83  namespace internal
84  {
85  template<typename Scalar, int Options, int axis>
86  struct SE3GroupAction< TransformRevoluteTpl<Scalar,Options,axis> >
87  { typedef typename traits <TransformRevoluteTpl<Scalar,Options,axis> >::PlainType ReturnType; };
88  }
89 
90  template<typename _Scalar, int _Options, int axis>
91  struct TransformRevoluteTpl : SE3Base< TransformRevoluteTpl<_Scalar,_Options,axis> >
92  {
93  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
94  PINOCCHIO_SE3_TYPEDEF_TPL(TransformRevoluteTpl);
96 
98  TransformRevoluteTpl(const Scalar & sin, const Scalar & cos)
99  : m_sin(sin), m_cos(cos)
100  {}
101 
102  PlainType plain() const
103  {
104  PlainType res(PlainType::Identity());
105  _setRotation (res.rotation());
106  return res;
107  }
108 
109  operator PlainType() const { return plain(); }
110 
111  template<typename S2, int O2>
113  se3action(const SE3Tpl<S2,O2> & m) const
114  {
116  ReturnType res;
117  switch(axis)
118  {
119  case 0:
120  {
121  res.rotation().col(0) = m.rotation().col(0);
122  res.rotation().col(1).noalias() = m_cos * m.rotation().col(1) + m_sin * m.rotation().col(2);
123  res.rotation().col(2).noalias() = res.rotation().col(0).cross(res.rotation().col(1));
124  break;
125  }
126  case 1:
127  {
128  res.rotation().col(1) = m.rotation().col(1);
129  res.rotation().col(2).noalias() = m_cos * m.rotation().col(2) + m_sin * m.rotation().col(0);
130  res.rotation().col(0).noalias() = res.rotation().col(1).cross(res.rotation().col(2));
131  break;
132  }
133  case 2:
134  {
135  res.rotation().col(2) = m.rotation().col(2);
136  res.rotation().col(0).noalias() = m_cos * m.rotation().col(0) + m_sin * m.rotation().col(1);
137  res.rotation().col(1).noalias() = res.rotation().col(2).cross(res.rotation().col(0));
138  break;
139  }
140  default:
141  {
142  assert(false && "must nerver happened");
143  break;
144  }
145  }
146  res.translation() = m.translation();
147  return res;
148  }
149 
150  const Scalar & sin() const { return m_sin; }
151  const Scalar & cos() const { return m_cos; }
152 
153  template<typename OtherScalar>
154  void setValues(const OtherScalar & sin, const OtherScalar & cos)
155  { m_sin = sin; m_cos = cos; }
156 
157  LinearType translation() const { return LinearType::PlainObject::Zero(3); };
158  AngularType rotation() const {
159  AngularType m(AngularType::Identity(3));
160  _setRotation (m);
161  return m;
162  }
163 
164  protected:
165 
166  Scalar m_sin, m_cos;
167  inline void _setRotation (typename PlainType::AngularRef& rot) const
168  {
169  switch(axis)
170  {
171  case 0:
172  {
173  rot.coeffRef(1,1) = m_cos; rot.coeffRef(1,2) = -m_sin;
174  rot.coeffRef(2,1) = m_sin; rot.coeffRef(2,2) = m_cos;
175  break;
176  }
177  case 1:
178  {
179  rot.coeffRef(0,0) = m_cos; rot.coeffRef(0,2) = m_sin;
180  rot.coeffRef(2,0) = -m_sin; rot.coeffRef(2,2) = m_cos;
181  break;
182  }
183  case 2:
184  {
185  rot.coeffRef(0,0) = m_cos; rot.coeffRef(0,1) = -m_sin;
186  rot.coeffRef(1,0) = m_sin; rot.coeffRef(1,1) = m_cos;
187  break;
188  }
189  default:
190  {
191  assert(false && "must nerver happened");
192  break;
193  }
194  }
195  }
196  };
197 
198  template<typename _Scalar, int _Options, int axis>
199  struct MotionRevoluteTpl : MotionBase< MotionRevoluteTpl<_Scalar,_Options,axis> >
200  {
201  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
202 
203  MOTION_TYPEDEF_TPL(MotionRevoluteTpl);
204  typedef SpatialAxis<axis+ANGULAR> Axis;
205  typedef typename Axis::CartesianAxis3 CartesianAxis3;
206 
207  MotionRevoluteTpl() {}
208 
209  template<typename OtherScalar>
210  MotionRevoluteTpl(const OtherScalar & w) : w(w) {}
211 
212 // operator MotionPlain() const { return Axis() * w; }
213 
214  template<typename MotionDerived>
215  void setTo(MotionDense<MotionDerived> & m) const
216  {
217  m.linear().setZero();
218  for(Eigen::DenseIndex k = 0; k < 3; ++k)
219  m.angular()[k] = k == axis ? w : (Scalar)0;
220  }
221 
222  template<typename MotionDerived>
223  void addTo(MotionDense<MotionDerived> & v) const
224  {
225  typedef typename MotionDense<MotionDerived>::Scalar OtherScalar;
226  v.angular()[axis] += (OtherScalar)w;
227  }
228 
229  template<typename S2, int O2, typename D2>
230  void se3Action_impl(const SE3Tpl<S2,O2> & m, MotionDense<D2> & v) const
231  {
232  v.angular().noalias() = m.rotation().col(axis) * w;
233  v.linear().noalias() = m.translation().cross(v.angular());
234  }
235 
236  template<typename S2, int O2>
237  MotionPlain se3Action_impl(const SE3Tpl<S2,O2> & m) const
238  {
239  MotionPlain res;
240  se3Action_impl(m,res);
241  return res;
242  }
243 
244  template<typename S2, int O2, typename D2>
245  void se3ActionInverse_impl(const SE3Tpl<S2,O2> & m, MotionDense<D2> & v) const
246  {
247  // Linear
248  // TODO: use v.angular() as temporary variable
249  Vector3 v3_tmp;
250  CartesianAxis3::alphaCross(w,m.translation(),v3_tmp);
251  v.linear().noalias() = m.rotation().transpose() * v3_tmp;
252 
253  // Angular
254  v.angular().noalias() = m.rotation().transpose().col(axis) * w;
255  }
256 
257  template<typename S2, int O2>
258  MotionPlain se3ActionInverse_impl(const SE3Tpl<S2,O2> & m) const
259  {
260  MotionPlain res;
261  se3ActionInverse_impl(m,res);
262  return res;
263  }
264 
265  template<typename M1, typename M2>
266  EIGEN_STRONG_INLINE
267  void motionAction(const MotionDense<M1> & v, MotionDense<M2> & mout) const
268  {
269  // Linear
270  CartesianAxis3::alphaCross(-w,v.linear(),mout.linear());
271 
272  // Angular
273  CartesianAxis3::alphaCross(-w,v.angular(),mout.angular());
274  }
275 
276  template<typename M1>
277  MotionPlain motionAction(const MotionDense<M1> & v) const
278  {
279  MotionPlain res;
280  motionAction(v,res);
281  return res;
282  }
283 
284  // data
285  Scalar w;
286  }; // struct MotionRevoluteTpl
287 
288  template<typename S1, int O1, int axis, typename MotionDerived>
289  typename MotionDerived::MotionPlain
290  operator+(const MotionRevoluteTpl<S1,O1,axis> & m1,
291  const MotionDense<MotionDerived> & m2)
292  {
293  typename MotionDerived::MotionPlain res(m2);
294  res += m1;
295  return res;
296  }
297 
298  template<typename MotionDerived, typename S2, int O2, int axis>
299  EIGEN_STRONG_INLINE
300  typename MotionDerived::MotionPlain
301  operator^(const MotionDense<MotionDerived> & m1, const MotionRevoluteTpl<S2,O2,axis>& m2)
302  {
303  return m2.motionAction(m1);
304  }
305 
306  template<typename Scalar, int Options, int axis> struct ConstraintRevoluteTpl;
307 
308  namespace internal
309  {
310  template<typename Scalar, int Options, int axis>
311  struct SE3GroupAction< ConstraintRevoluteTpl<Scalar,Options,axis> >
312  { typedef Eigen::Matrix<Scalar,6,1,Options> ReturnType; };
313 
314  template<typename Scalar, int Options, int axis, typename MotionDerived>
315  struct MotionAlgebraAction< ConstraintRevoluteTpl<Scalar,Options,axis>, MotionDerived >
316  { typedef Eigen::Matrix<Scalar,6,1,Options> ReturnType; };
317  }
318 
319  template<typename _Scalar, int _Options, int axis>
320  struct traits< ConstraintRevoluteTpl<_Scalar,_Options,axis> >
321  {
322  typedef _Scalar Scalar;
323  enum { Options = _Options };
324  typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
325  typedef Eigen::Matrix<Scalar,4,1,Options> Vector4;
326  typedef Eigen::Matrix<Scalar,6,1,Options> Vector6;
327  typedef Eigen::Matrix<Scalar,3,3,Options> Matrix3;
328  typedef Eigen::Matrix<Scalar,4,4,Options> Matrix4;
329  typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
330  typedef Matrix3 Angular_t;
331  typedef Vector3 Linear_t;
332  typedef const Matrix3 ConstAngular_t;
333  typedef const Vector3 ConstLinear_t;
334  typedef Matrix6 ActionMatrix_t;
335  typedef Eigen::Quaternion<Scalar,0> Quaternion_t;
336  typedef SE3Tpl<Scalar,Options> SE3;
340  enum {
341  LINEAR = 0,
342  ANGULAR = 3
343  };
345  typedef Eigen::Matrix<Scalar,1,1,Options> JointForce;
346  typedef Eigen::Matrix<Scalar,6,1,Options> DenseBase;
347  typedef DenseBase MatrixReturnType;
348  typedef const DenseBase ConstMatrixReturnType;
349  }; // traits ConstraintRevoluteTpl
350 
351  template<typename _Scalar, int _Options, int axis>
352  struct ConstraintRevoluteTpl
353  : ConstraintBase< ConstraintRevoluteTpl<_Scalar,_Options,axis> >
354  {
355  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
356 
357  SPATIAL_TYPEDEF_TEMPLATE(ConstraintRevoluteTpl);
358  enum { NV = 1, Options = _Options };
359 
361  typedef typename traits<ConstraintRevoluteTpl>::JointForce JointForce;
362  typedef typename traits<ConstraintRevoluteTpl>::DenseBase DenseBase;
363  typedef SpatialAxis<ANGULAR+axis> Axis;
364 
365  template<typename Vector1Like>
366  JointMotion __mult__(const Eigen::MatrixBase<Vector1Like> & v) const
367  { return JointMotion(v[0]); }
368 
369  template<typename S1, int O1>
370  Eigen::Matrix<Scalar,6,1,Options>
371  se3Action(const SE3Tpl<S1,O1> & m) const
372  {
373  Eigen::Matrix<Scalar,6,1,Options> res;
374  res.template head<3>() = m.translation().cross(m.rotation().col(axis));
375  res.template tail<3>() = m.rotation().col(axis);
376  return res;
377  }
378 
379  int nv_impl() const { return NV; }
380 
382  {
383  const ConstraintRevoluteTpl & ref;
384  TransposeConst(const ConstraintRevoluteTpl & ref) : ref(ref) {}
385 
386  template<typename Derived>
387  typename ForceDense<Derived>::ConstAngularType::template ConstFixedSegmentReturnType<1>::Type
388  operator* (const ForceDense<Derived> & f) const
389  { return f.angular().template segment<1>(axis); }
390 
392  template<typename D>
393  typename Eigen::MatrixBase<D>::ConstRowXpr
394  operator*(const Eigen::MatrixBase<D> & F) const
395  {
396  assert(F.rows()==6);
397  return F.row(ANGULAR + axis);
398  }
399  }; // struct TransposeConst
400 
401  TransposeConst transpose() const { return TransposeConst(*this); }
402 
403  /* CRBA joint operators
404  * - ForceSet::Block = ForceSet
405  * - ForceSet operator* (Inertia Y,Constraint S)
406  * - MatrixBase operator* (Constraint::Transpose S, ForceSet::Block)
407  * - SE3::act(ForceSet::Block)
408  */
409  DenseBase matrix_impl() const
410  {
411  DenseBase S;
413  v << Axis();
414  return S;
415  }
416 
417  template<typename MotionDerived>
418  DenseBase motionAction(const MotionDense<MotionDerived> & m) const
419  {
420  DenseBase res;
421  MotionRef<DenseBase> v(res);
422  v = m.cross(Axis());
423  return res;
424  }
425  }; // struct ConstraintRevoluteTpl
426 
427  template<typename _Scalar, int _Options, int _axis>
429  {
430  typedef _Scalar Scalar;
431 
432  enum
433  {
434  Options = _Options,
435  axis = _axis
436  };
437  };
438 
439  /* [CRBA] ForceSet operator* (Inertia Y,Constraint S) */
440  template<typename S1, int O1, typename S2, int O2>
441  inline Eigen::Matrix<S2,6,1,O2>
442  operator*(const InertiaTpl<S1,O1> & Y,const ConstraintRevoluteTpl<S2,O2,0> &)
443  {
444  typedef InertiaTpl<S1,O1> Inertia;
445  /* Y(:,3) = ( 0,-z, y, I00+yy+zz, I01-xy , I02-xz ) */
446  const S1
447  &m = Y.mass(),
448  &x = Y.lever()[0],
449  &y = Y.lever()[1],
450  &z = Y.lever()[2];
451  const typename Inertia::Symmetric3 & I = Y.inertia();
452 
453  Eigen::Matrix<S2,6,1,O2> res;
454  res << (S2)0,-m*z,m*y,
455  I(0,0)+m*(y*y+z*z),
456  I(0,1)-m*x*y,
457  I(0,2)-m*x*z ;
458  return res;
459  }
460  /* [CRBA] ForceSet operator* (Inertia Y,Constraint S) */
461  template<typename S1, int O1, typename S2, int O2>
462  inline Eigen::Matrix<S2,6,1,O2>
463  operator*(const InertiaTpl<S1,O1> & Y,const ConstraintRevoluteTpl<S2,O2,1> &)
464  {
465  typedef InertiaTpl<S1,O1> Inertia;
466  /* Y(:,4) = ( z, 0,-x, I10-xy , I11+xx+zz, I12-yz ) */
467  const S1
468  &m = Y.mass(),
469  &x = Y.lever()[0],
470  &y = Y.lever()[1],
471  &z = Y.lever()[2];
472  const typename Inertia::Symmetric3 & I = Y.inertia();
473  Eigen::Matrix<S2,6,1,O2> res;
474  res << m*z,(S2)0,-m*x,
475  I(1,0)-m*x*y,
476  I(1,1)+m*(x*x+z*z),
477  I(1,2)-m*y*z ;
478  return res;
479  }
480  /* [CRBA] ForceSet operator* (Inertia Y,Constraint S) */
481  template<typename S1, int O1, typename S2, int O2>
482  inline Eigen::Matrix<S2,6,1,O2>
483  operator*(const InertiaTpl<S1,O1> & Y,const ConstraintRevoluteTpl<S2,O2,2> &)
484  {
485  typedef InertiaTpl<S1,O1> Inertia;
486  /* Y(:,5) = (-y, x, 0, I20-xz , I21-yz , I22+xx+yy) */
487  const S1
488  &m = Y.mass(),
489  &x = Y.lever()[0],
490  &y = Y.lever()[1],
491  &z = Y.lever()[2];
492  const typename Inertia::Symmetric3 & I = Y.inertia();
493  Eigen::Matrix<S2,6,1,O2> res; res << -m*y,m*x,(S2)0,
494  I(2,0)-m*x*z,
495  I(2,1)-m*y*z,
496  I(2,2)+m*(x*x+y*y) ;
497  return res;
498  }
499 
500  /* [ABA] I*S operator (Inertia Y,Constraint S) */
501  template<typename M6Like, typename S2, int O2,int axis>
502  inline const typename M6Like::ConstColXpr
503  operator*(const Eigen::MatrixBase<M6Like> & Y, const ConstraintRevoluteTpl<S2,O2,axis> &)
504  {
505  EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(M6Like,6,6);
506  return Y.col(Inertia::ANGULAR + axis);
507  }
508 
509  template<typename _Scalar, int _Options, int axis>
510  struct traits< JointRevoluteTpl<_Scalar,_Options,axis> >
511  {
512  enum {
513  NQ = 1,
514  NV = 1
515  };
516  typedef _Scalar Scalar;
517  enum { Options = _Options };
524  typedef Eigen::Matrix<Scalar,6,NV,Options> F_t;
525 
526  // [ABA]
527  typedef Eigen::Matrix<Scalar,6,NV,Options> U_t;
528  typedef Eigen::Matrix<Scalar,NV,NV,Options> D_t;
529  typedef Eigen::Matrix<Scalar,6,NV,Options> UD_t;
530 
531  PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE
532 
533  typedef Eigen::Matrix<Scalar,NQ,1,Options> ConfigVector_t;
534  typedef Eigen::Matrix<Scalar,NV,1,Options> TangentVector_t;
535  };
536 
537  template<typename Scalar, int Options, int axis>
538  struct traits< JointDataRevoluteTpl<Scalar,Options,axis> >
540 
541  template<typename Scalar, int Options, int axis>
542  struct traits< JointModelRevoluteTpl<Scalar,Options,axis> >
544 
545  template<typename _Scalar, int _Options, int axis>
546  struct JointDataRevoluteTpl : public JointDataBase< JointDataRevoluteTpl<_Scalar,_Options,axis> >
547  {
548  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
550  PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE;
551  PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
552 
553  Constraint_t S;
554  Transformation_t M;
555  Motion_t v;
556  Bias_t c;
557  F_t F;
558 
559  // [ABA] specific data
560  U_t U;
561  D_t Dinv;
562  UD_t UDinv;
563 
565 
566  static std::string classname() { return std::string("JointDataRevolute"); }
567  std::string shortname() const { return classname(); }
568 
569  }; // struct JointDataRevoluteTpl
570 
571  template<typename NewScalar, typename Scalar, int Options, int axis>
572  struct CastType< NewScalar, JointModelRevoluteTpl<Scalar,Options,axis> >
573  {
575  };
576 
577  template<typename _Scalar, int _Options, int axis>
578  struct JointModelRevoluteTpl : public JointModelBase< JointModelRevoluteTpl<_Scalar,_Options,axis> >
579  {
580  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
581  typedef JointRevoluteTpl<_Scalar,_Options,axis> JointDerived;
582  PINOCCHIO_JOINT_TYPEDEF_TEMPLATE;
583 
585  using Base::id;
586  using Base::idx_q;
587  using Base::idx_v;
588  using Base::setIndexes;
589 
590  JointDataDerived createData() const { return JointDataDerived(); }
591 
592  template<typename ConfigVector>
593  EIGEN_DONT_INLINE
594  void calc(JointDataDerived & data,
595  const typename Eigen::MatrixBase<ConfigVector> & qs) const
596  {
597  typedef typename ConfigVector::Scalar OtherScalar;
598 
599  const OtherScalar & q = qs[idx_q()];
600  OtherScalar ca,sa; SINCOS(q,&sa,&ca);
601  data.M.setValues(sa,ca);
602  }
603 
604  template<typename ConfigVector, typename TangentVector>
605  EIGEN_DONT_INLINE
606  void calc(JointDataDerived & data,
607  const typename Eigen::MatrixBase<ConfigVector> & qs,
608  const typename Eigen::MatrixBase<TangentVector> & vs) const
609  {
610  calc(data,qs.derived());
611 
612  data.v.w = (Scalar)vs[idx_v()];
613  }
614 
615  template<typename Matrix6Like>
616  void calc_aba(JointDataDerived & data, const Eigen::MatrixBase<Matrix6Like> & I, const bool update_I) const
617  {
618  data.U = I.col(Inertia::ANGULAR + axis);
619  data.Dinv[0] = Scalar(1)/I(Inertia::ANGULAR + axis,Inertia::ANGULAR + axis);
620  data.UDinv.noalias() = data.U * data.Dinv[0];
621 
622  if (update_I)
623  PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like,I) -= data.UDinv * data.U.transpose();
624  }
625 
626  Scalar finiteDifferenceIncrement() const
627  {
628  using math::sqrt;
629  return 2.*sqrt(sqrt(Eigen::NumTraits<Scalar>::epsilon()));
630  }
631 
632  static std::string classname()
633  {
634  return std::string("JointModelR") + axisLabel<axis>();
635  }
636  std::string shortname() const { return classname(); }
637 
639  template<typename NewScalar>
641  {
643  ReturnType res;
644  res.setIndexes(id(),idx_q(),idx_v());
645  return res;
646  }
647 
648  }; // struct JointModelRevoluteTpl
649 
653 
657 
661 
662 } //namespace pinocchio
663 
664 #include <boost/type_traits.hpp>
665 
666 namespace boost
667 {
668  template<typename Scalar, int Options, int axis>
669  struct has_nothrow_constructor< ::pinocchio::JointModelRevoluteTpl<Scalar,Options,axis> >
670  : public integral_constant<bool,true> {};
671 
672  template<typename Scalar, int Options, int axis>
673  struct has_nothrow_copy< ::pinocchio::JointModelRevoluteTpl<Scalar,Options,axis> >
674  : public integral_constant<bool,true> {};
675 
676  template<typename Scalar, int Options, int axis>
677  struct has_nothrow_constructor< ::pinocchio::JointDataRevoluteTpl<Scalar,Options,axis> >
678  : public integral_constant<bool,true> {};
679 
680  template<typename Scalar, int Options, int axis>
681  struct has_nothrow_copy< ::pinocchio::JointDataRevoluteTpl<Scalar,Options,axis> >
682  : public integral_constant<bool,true> {};
683 }
684 
685 #endif // ifndef __pinocchio_joint_revolute_hpp__
int idx_q(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxQVisitor to get the index in the full model configuration space...
int idx_v(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointIdxVVisitor to get the index in the full model tangent space corre...
JointDataTpl< Scalar, Options, JointCollectionTpl > createData(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through CreateData visitor to create a JointDataTpl.
ModelTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType finiteDifferenceIncrement(const ModelTpl< Scalar, Options, JointCollectionTpl > &model)
Computes the finite difference increments for each degree of freedom according to the current joint c...
JointModelRevoluteTpl< NewScalar, Options, axis > cast() const
void SINCOS(const Scalar &a, Scalar *sa, Scalar *ca)
Computes sin/cos values of a given input scalar.
Definition: sincos.hpp:28
Eigen::MatrixBase< D >::ConstRowXpr operator*(const Eigen::MatrixBase< D > &F) const
[CRBA] MatrixBase operator* (Constraint::Transpose S, ForceSet::Block)
std::string shortname(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointShortnameVisitor to get the shortname of the derived joint model...
ConstAngularType angular() const
Return the angular part of the force vector.
Definition: force-base.hpp:40
Main pinocchio namespace.
Definition: treeview.dox:24
Common traits structure to fully define base classes for CRTP.
Definition: spatial/fwd.hpp:29
Type of the cast of a class C templated by Scalar and Options, to a new NewScalar type...
Definition: spatial/fwd.hpp:35
void calc_aba(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel, JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata, const Eigen::MatrixBase< Matrix6Type > &I, const bool update_I)
Visit a JointModelTpl and the corresponding JointDataTpl through JointCalcAbaVisitor to...