19 #ifndef __se3_force_tpl_hpp__ 20 #define __se3_force_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 typename EIGEN_REF_CONSTTYPE(Vector6) ToVectorConstReturnType;
32 typedef typename EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
33 typedef typename Vector6::template FixedSegmentReturnType<3>::Type LinearType;
34 typedef typename Vector6::template FixedSegmentReturnType<3>::Type AngularType;
35 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
36 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
47 template<
typename _Scalar,
int _Options>
51 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
55 using Base::operator=;
62 template<
typename V1,
typename V2>
63 ForceTpl(
const Eigen::MatrixBase<V1> & v,
const Eigen::MatrixBase<V2> & w)
65 assert(v.size() == 3);
66 assert(w.size() == 3);
71 explicit ForceTpl(
const Eigen::MatrixBase<V6> & v)
74 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V6);
75 assert(v.size() == 6);
78 template<
typename S2,
int O2>
88 static ForceTpl Zero() {
return ForceTpl(Vector6::Zero()); }
89 static ForceTpl Random() {
return ForceTpl(Vector6::Random()); }
91 ToVectorConstReturnType toVector_impl()
const {
return data; }
92 ToVectorReturnType toVector_impl() {
return data; }
95 ConstAngularType angular_impl()
const {
return data.template segment<3> (ANGULAR); }
96 ConstLinearType linear_impl()
const {
return data.template segment<3> (LINEAR); }
97 AngularType angular_impl() {
return data.template segment<3> (ANGULAR); }
98 LinearType linear_impl() {
return data.template segment<3> (LINEAR); }
100 template<
typename V3>
101 void angular_impl(
const Eigen::MatrixBase<V3> & w)
103 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
106 template<
typename V3>
107 void linear_impl(
const Eigen::MatrixBase<V3> & v)
109 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
122 #endif // ifndef __se3_force_tpl_hpp__
ConstAngularType angular() const
Return the angular part of the force vector.
ConstLinearType linear() const
Return the linear part of the force vector.
Base interface for forces representation.
ToVectorConstReturnType toVector() const
Return the force as an Eigen vector.