6 #ifndef __pinocchio_spatial_motion_base_hpp__
7 #define __pinocchio_spatial_motion_base_hpp__
12 template<
class Derived>
16 MOTION_TYPEDEF_TPL(Derived);
20 return *
static_cast<Derived *
>(
this);
22 const Derived & derived()
const
24 return *
static_cast<const Derived *
>(
this);
27 Derived & const_cast_derived()
const
29 return *
const_cast<Derived *
>(&derived());
32 ConstAngularType angular()
const
34 return derived().angular_impl();
36 ConstLinearType linear()
const
38 return derived().linear_impl();
42 return derived().angular_impl();
46 return derived().linear_impl();
49 template<
typename V3Like>
50 void angular(
const Eigen::MatrixBase<V3Like> & w)
52 derived().angular_impl(w.derived());
55 template<
typename V3Like>
56 void linear(
const Eigen::MatrixBase<V3Like> & v)
58 derived().linear_impl(v.derived());
61 operator PlainReturnType()
const
63 return derived().plain();
65 PlainReturnType plain()
const
67 return derived().plain();
70 ToVectorConstReturnType toVector()
const
72 return derived().toVector_impl();
74 ToVectorReturnType toVector()
76 return derived().toVector_impl();
78 operator Vector6()
const
83 ActionMatrixType toActionMatrix()
const
85 return derived().toActionMatrix_impl();
87 ActionMatrixType toDualActionMatrix()
const
89 return derived().toDualActionMatrix_impl();
91 operator Matrix6()
const
93 return toActionMatrix();
111 return derived().toHomogeneousMatrix_impl();
119 template<
typename M2>
120 bool operator==(
const MotionBase<M2> & other)
const
122 return derived().isEqual_impl(other.derived());
125 template<
typename M2>
126 bool operator!=(
const MotionBase<M2> & other)
const
128 return !(derived() == other.derived());
131 Derived operator-()
const
133 return derived().__opposite__();
135 Derived operator+(
const MotionBase<Derived> & v)
const
137 return derived().__plus__(v.derived());
139 Derived operator-(
const MotionBase<Derived> & v)
const
141 return derived().__minus__(v.derived());
143 Derived & operator+=(
const MotionBase<Derived> & v)
145 return derived().__pequ__(v.derived());
147 Derived & operator-=(
const MotionBase<Derived> & v)
149 return derived().__mequ__(v.derived());
152 template<
typename OtherScalar>
153 typename internal::RHSScalarMultiplication<Derived, OtherScalar>::ReturnType
154 operator*(
const OtherScalar & alpha)
const
156 return derived().__mult__(alpha);
159 template<
typename OtherScalar>
160 Derived operator/(
const OtherScalar & alpha)
const
162 return derived().__div__(alpha);
165 template<
typename OtherSpatialType>
166 typename MotionAlgebraAction<OtherSpatialType, Derived>::ReturnType
167 cross(
const OtherSpatialType & d)
const
169 return derived().cross_impl(d);
173 const Derived & other,
174 const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
176 return derived().isApprox_impl(other, prec);
179 bool isZero(
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const
181 return derived().isZero_impl(prec);
184 template<
typename S2,
int O2>
185 typename SE3GroupAction<Derived>::ReturnType se3Action(
const SE3Tpl<S2, O2> & m)
const
187 return derived().se3Action_impl(m);
190 template<
typename S2,
int O2>
191 typename SE3GroupAction<Derived>::ReturnType se3ActionInverse(
const SE3Tpl<S2, O2> & m)
const
193 return derived().se3ActionInverse_impl(m);
196 template<
typename ForceDerived>
197 Scalar dot(
const ForceDense<ForceDerived> & f)
const
199 return derived().dot(f.derived());
202 void disp(std::ostream & os)
const
204 derived().disp_impl(os);
206 friend std::ostream & operator<<(std::ostream & os,
const MotionBase<Derived> & v)
214 template<
typename MotionDerived>
215 typename internal::RHSScalarMultiplication<
217 typename MotionDerived::Scalar>::ReturnType
218 operator*(
const typename MotionDerived::Scalar & alpha,
const MotionBase<MotionDerived> &
motion)
HomogeneousMatrixType toHomogeneousMatrix() const
The homogeneous representation of the motion vector .
Main pinocchio namespace.
MotionTpl< Scalar, Options > motion(const JointDataTpl< Scalar, Options, JointCollectionTpl > &jdata)
Visit a JointDataTpl through JointMotionVisitor to get the joint internal motion as a dense motion.