19 #ifndef __se3_motion_tpl_hpp__ 20 #define __se3_motion_tpl_hpp__ 24 template<
typename _Scalar,
int _Options>
27 typedef _Scalar Scalar;
28 typedef Eigen::Matrix<Scalar,3,1,_Options> Vector3;
29 typedef Eigen::Matrix<Scalar,6,1,_Options> Vector6;
30 typedef Eigen::Matrix<Scalar,6,6,_Options> Matrix6;
31 typedef Matrix6 ActionMatrixType;
32 typedef typename EIGEN_REF_CONSTTYPE(Vector6) ToVectorConstReturnType;
33 typedef typename EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
34 typedef typename Vector6::template FixedSegmentReturnType<3>::Type LinearType;
35 typedef typename Vector6::template FixedSegmentReturnType<3>::Type AngularType;
36 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
37 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
48 template<
typename _Scalar,
int _Options>
52 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
56 using Base::operator=;
61 using Base::__opposite__;
62 using Base::__minus__;
70 template<
typename V1,
typename V2>
71 MotionTpl(
const Eigen::MatrixBase<V1> & v,
const Eigen::MatrixBase<V2> & w)
73 assert(v.size() == 3);
74 assert(w.size() == 3);
79 explicit MotionTpl(
const Eigen::MatrixBase<V6> & v)
82 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V6);
83 assert(v.size() == 6);
86 template<
typename S2,
int O2>
88 : data(clone.toVector())
93 { linear() = clone.linear(); angular() = clone.angular(); }
96 static MotionTpl Zero() {
return MotionTpl(Vector6::Zero()); }
97 static MotionTpl Random() {
return MotionTpl(Vector6::Random()); }
99 ToVectorConstReturnType toVector_impl()
const {
return data; }
100 ToVectorReturnType toVector_impl() {
return data; }
103 ConstAngularType angular_impl()
const {
return data.template segment<3> (ANGULAR); }
104 ConstLinearType linear_impl()
const {
return data.template segment<3> (LINEAR); }
105 AngularType angular_impl() {
return data.template segment<3> (ANGULAR); }
106 LinearType linear_impl() {
return data.template segment<3> (LINEAR); }
108 template<
typename V3>
109 void angular_impl(
const Eigen::MatrixBase<V3> & w)
111 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
114 template<
typename V3>
115 void linear_impl(
const Eigen::MatrixBase<V3> & v)
117 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
122 template<
typename S2,
int O2>
126 template<
typename Vector6ArgType>
130 template<
typename S2,
int O2>
134 template<
typename Vector6ArgType>
138 template<
typename S2,
int O2>
140 { data += v.toVector();
return *
this; }
142 template<
typename Vector6ArgType>
144 { data += v.toVector();
return *
this; }
146 template<
typename S2,
int O2>
148 { data -= v.toVector();
return *
this; }
150 template<
typename Vector6ArgType>
152 { data -= v.toVector();
return *
this; }
154 template<
typename OtherScalar>
155 MotionPlain __mult__(
const OtherScalar & alpha)
const 167 #endif // ifndef __se3_motion_tpl_hpp__