19 #ifndef __se3_motion_base_hpp__ 20 #define __se3_motion_base_hpp__ 25 template<
class Derived>
29 MOTION_TYPEDEF_TPL(Derived);
31 Derived & derived() {
return *
static_cast<Derived*
>(
this); }
32 const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
34 ConstAngularType angular()
const {
return derived().angular_impl(); }
35 ConstLinearType linear()
const {
return derived().linear_impl(); }
36 AngularType angular() {
return derived().angular_impl(); }
37 LinearType linear() {
return derived().linear_impl(); }
39 template<
typename V3Like>
40 void angular(
const Eigen::MatrixBase<V3Like> & w)
41 { derived().angular_impl(w.derived()); }
43 template<
typename V3Like>
44 void linear(
const Eigen::MatrixBase<V3Like> & v)
45 { derived().linear_impl(v.derived()); }
47 ToVectorConstReturnType toVector()
const {
return derived().toVector_impl(); }
48 ToVectorReturnType toVector() {
return derived().toVector_impl(); }
49 operator Vector6()
const {
return toVector(); }
51 ActionMatrixType toActionMatrix()
const {
return derived().toActionMatrix_impl(); }
52 ActionMatrixType toDualActionMatrix()
const {
return derived().toDualActionMatrix_impl(); }
53 operator Matrix6()
const {
return toActionMatrix(); }
56 bool operator==(
const MotionBase<M2> & other)
const 57 {
return derived().isEqual_impl(other.derived()); }
60 bool operator!=(
const MotionBase<M2> & other)
const 61 {
return !(derived() == other.derived()); }
63 MotionPlain operator-()
const {
return derived().__opposite__(); }
64 MotionPlain operator+(
const Derived & v)
const {
return derived().__plus__(v); }
65 MotionPlain operator-(
const Derived & v)
const {
return derived().__minus__(v); }
66 Derived & operator+=(
const Derived & v) {
return derived().__pequ__(v); }
67 Derived & operator-=(
const Derived & v) {
return derived().__mequ__(v); }
69 template<
typename OtherScalar>
70 MotionPlain operator*(
const OtherScalar & alpha)
const 71 {
return derived().__mult__(alpha); }
72 template<
typename OtherScalar>
73 MotionPlain operator/(
const OtherScalar & alpha)
const 74 {
return derived().__div__(alpha); }
76 template<
typename OtherSpatialType>
77 typename internal::MotionAlgebraAction<OtherSpatialType,Derived>::ReturnType
78 cross(
const OtherSpatialType & d)
const 80 return derived().cross_impl(d);
83 bool isApprox(
const Derived & other,
const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision())
const 84 {
return derived().isApprox_impl(other, prec);}
86 template<
typename S2,
int O2>
87 MotionPlain se3Action(
const SE3Tpl<S2,O2> & m)
const 88 {
return derived().se3Action_impl(m); }
90 template<
typename S2,
int O2>
91 MotionPlain se3ActionInverse(
const SE3Tpl<S2,O2> & m)
const 92 {
return derived().se3ActionInverse_impl(m); }
94 Scalar dot(
const Force & f)
const {
return derived().dot(f); }
96 void disp(std::ostream & os)
const { derived().disp_impl(os); }
97 friend std::ostream & operator << (std::ostream & os, const MotionBase<Derived> & v)
107 #endif // ifndef __se3_motion_base_hpp__