pinocchio  2.2.1-dirty
motion-zero.hpp
1 //
2 // Copyright (c) 2015-2019 CNRS, INRIA
3 // Copyright (c) 2015-2016 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4 //
5 
6 #ifndef __pinocchio_motion_zero_hpp__
7 #define __pinocchio_motion_zero_hpp__
8 
9 namespace pinocchio
10 {
11 
12  template<typename Scalar, int Options>
13  struct SE3GroupAction< BiasZeroTpl<Scalar,Options> >
14  {
16  };
17 
18  template<typename Scalar, int Options, typename MotionDerived>
19  struct MotionAlgebraAction< BiasZeroTpl<Scalar,Options>, MotionDerived>
20  {
22  };
23 
24  template<typename _Scalar, int _Options>
25  struct traits< BiasZeroTpl<_Scalar,_Options> >
26  {
27  enum {
28  Options = _Options,
29  LINEAR = 0,
30  ANGULAR = 3
31  };
32  typedef _Scalar Scalar;
33  typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
34  typedef Eigen::Matrix<Scalar,6,1,Options> Vector6;
35  typedef Eigen::Matrix<Scalar,3,3,Options> Matrix3;
36  typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
37  typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6) ToVectorConstReturnType;
38  typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
39  typedef Matrix6 ActionMatrixType;
40  typedef Vector3 AngularType;
41  typedef const Vector3 ConstAngularType;
42  typedef Vector3 LinearType;
43  typedef const Vector3 ConstLinearType;
44  typedef Motion MotionPlain;
45  typedef MotionPlain PlainReturnType;
46 
47  }; // traits BiasZeroTpl
48 
49  template<typename Scalar, int Options>
50  struct BiasZeroTpl
51  : public MotionBase< BiasZeroTpl<Scalar,Options> >
52  {
55 
56  static PlainReturnType plain() { return MotionPlain::Zero(); }
57 
58  template<typename D2>
59  static bool isEqual_impl(const MotionDense<D2> & other)
60  { return other.linear().isZero() && other.angular().isZero(); }
61 
62  template<typename D2>
63  static void addTo(const MotionBase<D2> &) {}
64 
65  template<typename D2>
66  static void setTo(MotionBase<D2> & other)
67  {
68  other.setZero();
69  }
70 
71  template<typename M1>
72  BiasZeroTpl motionAction(const MotionBase<M1> &) const
73  {
74  return BiasZeroTpl();
75  }
76 
77  template<typename S2, int O2, typename D2>
78  void se3Action_impl(const SE3Tpl<S2,O2> &, MotionDense<D2> & v) const
79  {
80  v.setZero();
81  }
82 
83  template<typename S2, int O2>
84  BiasZeroTpl se3Action_impl(const SE3Tpl<S2,O2> &) const
85  {
86  return BiasZeroTpl();
87  }
88 
89  template<typename S2, int O2, typename D2>
90  void se3ActionInverse_impl(const SE3Tpl<S2,O2> &, MotionDense<D2> & v) const
91  {
92  v.setZero();
93  }
94 
95  template<typename S2, int O2>
96  BiasZeroTpl se3ActionInverse_impl(const SE3Tpl<S2,O2> &) const
97  {
98  return BiasZeroTpl();
99  }
100 
101  }; // struct BiasZeroTpl
102 
103  template<typename M1, typename Scalar, int Options>
104  inline const M1 & operator+(const MotionBase<M1> & v,
106  { return v.derived(); }
107 
108  template<typename Scalar, int Options, typename M1>
109  inline const M1 & operator+(const BiasZeroTpl<Scalar,Options> &,
110  const MotionBase<M1> & v)
111  { return v.derived(); }
112 
113 } // namespace pinocchio
114 
115 #endif // ifndef __pinocchio_motion_zero_hpp__
Return type of the ation of a Motion onto an object of type D.
Main pinocchio namespace.
Definition: treeview.dox:24
Common traits structure to fully define base classes for CRTP.
Definition: spatial/fwd.hpp:32