motion-zero.hpp
Go to the documentation of this file.
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_spatial_motion_zero_hpp__
7 #define __pinocchio_spatial_motion_zero_hpp__
8 
9 namespace pinocchio
10 {
11 
12  template<typename Scalar, int Options>
14  {
16  };
17 
18  template<typename Scalar, int Options, typename MotionDerived>
20  {
22  };
23 
24  template<typename _Scalar, int _Options>
25  struct traits<MotionZeroTpl<_Scalar, _Options>>
26  {
27  enum
28  {
29  Options = _Options,
30  LINEAR = 0,
31  ANGULAR = 3
32  };
33  typedef _Scalar Scalar;
34  typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
35  typedef Eigen::Matrix<Scalar, 6, 1, Options> Vector6;
36  typedef Eigen::Matrix<Scalar, 3, 3, Options> Matrix3;
37  typedef Eigen::Matrix<Scalar, 4, 4, Options> Matrix4;
38  typedef Eigen::Matrix<Scalar, 6, 6, Options> Matrix6;
39  typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6) ToVectorConstReturnType;
40  typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
44  typedef const Vector3 ConstAngularType;
46  typedef const Vector3 ConstLinearType;
49 
50  }; // traits MotionZeroTpl
51 
52  template<typename Scalar, int Options>
53  struct MotionZeroTpl : public MotionBase<MotionZeroTpl<Scalar, Options>>
54  {
57 
59  {
60  return MotionPlain::Zero();
61  }
62 
63  template<typename D2>
64  static bool isEqual_impl(const MotionDense<D2> & other)
65  {
66  return other.linear().isZero(0) && other.angular().isZero(0);
67  }
68 
69  static bool isEqual_impl(const MotionZeroTpl &)
70  {
71  return true;
72  }
73 
74  template<typename D2>
75  static void addTo(const MotionBase<D2> &)
76  {
77  }
78 
79  template<typename D2>
80  static void setTo(MotionBase<D2> & other)
81  {
82  other.setZero();
83  }
84 
85  template<typename M1>
87  {
88  return MotionZeroTpl();
89  }
90 
91  template<typename S2, int O2, typename D2>
93  {
94  v.setZero();
95  }
96 
97  template<typename S2, int O2>
99  {
100  return MotionZeroTpl();
101  }
102 
103  template<typename S2, int O2, typename D2>
105  {
106  v.setZero();
107  }
108 
109  template<typename S2, int O2>
111  {
112  return MotionZeroTpl();
113  }
114 
115  }; // struct MotionZeroTpl
116 
117  template<typename M1, typename Scalar, int Options>
118  inline const M1 & operator+(const MotionBase<M1> & v, const MotionZeroTpl<Scalar, Options> &)
119  {
120  return v.derived();
121  }
122 
123  template<typename Scalar, int Options, typename M1>
124  inline const M1 & operator+(const MotionZeroTpl<Scalar, Options> &, const MotionBase<M1> & v)
125  {
126  return v.derived();
127  }
128 
129 } // namespace pinocchio
130 
131 #endif // ifndef __pinocchio_spatial_motion_zero_hpp__
pinocchio::MotionZeroTpl::PlainReturnType
traits< MotionZeroTpl >::PlainReturnType PlainReturnType
Definition: motion-zero.hpp:56
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::AngularType
Vector3 AngularType
Definition: motion-zero.hpp:43
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::Matrix3
Eigen::Matrix< Scalar, 3, 3, Options > Matrix3
Definition: motion-zero.hpp:36
pinocchio::MotionAlgebraAction< MotionZeroTpl< Scalar, Options >, MotionDerived >::ReturnType
MotionZeroTpl< Scalar, Options > ReturnType
Definition: motion-zero.hpp:21
pinocchio::Options
Options
Definition: joint-configuration.hpp:1082
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::Matrix4
Eigen::Matrix< Scalar, 4, 4, Options > Matrix4
Definition: motion-zero.hpp:37
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::HomogeneousMatrixType
Matrix4 HomogeneousMatrixType
Definition: motion-zero.hpp:42
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::PlainReturnType
MotionPlain PlainReturnType
Definition: motion-zero.hpp:48
pinocchio::SE3Tpl
Definition: context/casadi.hpp:29
pinocchio::MotionZeroTpl::plain
static PlainReturnType plain()
Definition: motion-zero.hpp:58
pinocchio::PINOCCHIO_EIGEN_REF_CONST_TYPE
PINOCCHIO_EIGEN_REF_CONST_TYPE(Matrix6Like) operator*(const Eigen
Definition: joint-free-flyer.hpp:144
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::Matrix6
Eigen::Matrix< Scalar, 6, 6, Options > Matrix6
Definition: motion-zero.hpp:38
pinocchio::MotionZeroTpl::isEqual_impl
static bool isEqual_impl(const MotionDense< D2 > &other)
Definition: motion-zero.hpp:64
pinocchio::MotionDense
Definition: context/casadi.hpp:36
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
pinocchio::MotionBase::setZero
void setZero()
Definition: motion-base.hpp:114
pinocchio::operator+
MotionDerived::MotionPlain operator+(const MotionHelicalUnalignedTpl< S1, O1 > &m1, const MotionDense< MotionDerived > &m2)
Definition: joint-helical-unaligned.hpp:211
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::ConstLinearType
const typedef Vector3 ConstLinearType
Definition: motion-zero.hpp:46
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::Vector3
Eigen::Matrix< Scalar, 3, 1, Options > Vector3
Definition: motion-zero.hpp:34
pinocchio::MotionAlgebraAction
Return type of the ation of a Motion onto an object of type D.
Definition: spatial/motion.hpp:45
pinocchio::MotionZeroTpl::se3ActionInverse_impl
MotionZeroTpl se3ActionInverse_impl(const SE3Tpl< S2, O2 > &) const
Definition: motion-zero.hpp:110
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::ActionMatrixType
Matrix6 ActionMatrixType
Definition: motion-zero.hpp:41
pinocchio::MotionDense::linear
ConstLinearType linear() const
Definition: motion-base.hpp:36
pinocchio::MotionBase
Definition: spatial/fwd.hpp:42
pinocchio::SE3GroupAction
Definition: spatial/se3.hpp:39
pinocchio::MotionZeroTpl::setTo
static void setTo(MotionBase< D2 > &other)
Definition: motion-zero.hpp:80
pinocchio::MotionZeroTpl
Definition: context/casadi.hpp:23
pinocchio::SE3GroupAction< MotionZeroTpl< Scalar, Options > >::ReturnType
MotionZeroTpl< Scalar, Options > ReturnType
Definition: motion-zero.hpp:15
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::ConstAngularType
const typedef Vector3 ConstAngularType
Definition: motion-zero.hpp:44
pinocchio::MotionZeroTpl::MotionPlain
traits< MotionZeroTpl >::MotionPlain MotionPlain
Definition: motion-zero.hpp:55
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::LinearType
Vector3 LinearType
Definition: motion-zero.hpp:45
pinocchio::MotionZeroTpl::se3Action_impl
void se3Action_impl(const SE3Tpl< S2, O2 > &, MotionDense< D2 > &v) const
Definition: motion-zero.hpp:92
pinocchio::MotionZeroTpl::se3Action_impl
MotionZeroTpl se3Action_impl(const SE3Tpl< S2, O2 > &) const
Definition: motion-zero.hpp:98
pinocchio::v
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
Definition: joint-configuration.hpp:1084
pinocchio::MotionZeroTpl::isEqual_impl
static bool isEqual_impl(const MotionZeroTpl &)
Definition: motion-zero.hpp:69
pinocchio::MotionZeroTpl::motionAction
MotionZeroTpl motionAction(const MotionBase< M1 > &) const
Definition: motion-zero.hpp:86
pinocchio::MotionZeroTpl::addTo
static void addTo(const MotionBase< D2 > &)
Definition: motion-zero.hpp:75
pinocchio::MotionZeroTpl::se3ActionInverse_impl
void se3ActionInverse_impl(const SE3Tpl< S2, O2 > &, MotionDense< D2 > &v) const
Definition: motion-zero.hpp:104
pinocchio::traits
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:71
PINOCCHIO_EIGEN_REF_TYPE
#define PINOCCHIO_EIGEN_REF_TYPE(D)
Definition: eigen-macros.hpp:32
pinocchio::MotionTpl
Definition: context/casadi.hpp:27
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::Vector6
Eigen::Matrix< Scalar, 6, 1, Options > Vector6
Definition: motion-zero.hpp:35
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::MotionPlain
Motion MotionPlain
Definition: motion-zero.hpp:47
pinocchio::MotionDense::angular
ConstAngularType angular() const
Definition: motion-base.hpp:32
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27
pinocchio::traits< MotionZeroTpl< _Scalar, _Options > >::Scalar
_Scalar Scalar
Definition: motion-zero.hpp:33


pinocchio
Author(s):
autogenerated on Mon Dec 16 2024 03:41:04