6 #ifndef __pinocchio_motion_tpl_hpp__ 7 #define __pinocchio_motion_tpl_hpp__ 11 template<
typename _Scalar,
int _Options>
15 typedef Eigen::Matrix<Scalar,3,1,_Options>
Vector3;
16 typedef Eigen::Matrix<Scalar,6,1,_Options>
Vector6;
17 typedef Eigen::Matrix<Scalar,6,6,_Options>
Matrix6;
21 typedef typename Vector6::template FixedSegmentReturnType<3>::Type
LinearType;
22 typedef typename Vector6::template FixedSegmentReturnType<3>::Type
AngularType;
23 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type
ConstLinearType;
24 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type
ConstAngularType;
36 template<
typename _Scalar,
int _Options>
40 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
45 using Base::operator=;
50 using Base::__opposite__;
51 using Base::__minus__;
59 template<
typename V1,
typename V2>
60 MotionTpl(
const Eigen::MatrixBase<V1> &
v,
const Eigen::MatrixBase<V2> &
w)
62 assert(v.size() == 3);
63 assert(w.size() == 3);
64 linear() =
v; angular() =
w;
71 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V6);
72 assert(v.size() == 6);
77 : m_data(clone.toVector())
92 inline PlainReturnType
plain()
const {
return *
this; }
98 ConstAngularType
angular_impl()
const {
return m_data.template segment<3> (ANGULAR); }
99 ConstLinearType
linear_impl()
const {
return m_data.template segment<3> (LINEAR); }
100 AngularType
angular_impl() {
return m_data.template segment<3> (ANGULAR); }
101 LinearType
linear_impl() {
return m_data.template segment<3> (LINEAR); }
103 template<
typename V3>
106 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
109 template<
typename V3>
112 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
119 {
return MotionPlain(m_data+v.
toVector()); }
121 template<
typename Vector6ArgType>
123 {
return MotionPlain(m_data+v.
toVector()); }
127 {
return MotionPlain(m_data-v.
toVector()); }
129 template<
typename Vector6ArgType>
131 {
return MotionPlain(m_data-v.
toVector()); }
135 { m_data += v.
toVector();
return *
this; }
137 template<
typename Vector6ArgType>
139 { m_data += v.
toVector();
return *
this; }
143 { m_data -= v.
toVector();
return *
this; }
145 template<
typename Vector6ArgType>
147 { m_data -= v.
toVector();
return *
this; }
149 template<
typename OtherScalar>
150 MotionPlain
__mult__(
const OtherScalar & alpha)
const 151 {
return MotionPlain(alpha*m_data); }
156 template<
typename NewScalar>
160 ReturnType
res(linear().
template cast<NewScalar>(),
161 angular().
template cast<NewScalar>());
172 #endif // ifndef __pinocchio_motion_tpl_hpp__
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
MotionTpl & __pequ__(const MotionRef< Vector6ArgType > &v)
MotionTpl(const MotionTpl< Scalar, O2 > &clone)
MotionTpl & __mequ__(const MotionTpl< Scalar, O2 > &v)
Eigen::Matrix< Scalar, 6, 1, _Options > Vector6
void angular_impl(const Eigen::MatrixBase< V3 > &w)
MotionTpl(const MotionBase< M2 > &clone)
#define MOTION_TYPEDEF_TPL(Derived)
PINOCCHIO_EIGEN_REF_CONST_TYPE(Matrix6Like) operator*(const Eigen
MotionTpl & __mequ__(const MotionRef< Vector6ArgType > &v)
MotionPlain __plus__(const MotionRef< Vector6ArgType > &v) const
ToVectorReturnType toVector_impl()
MotionPlain __minus__(const MotionTpl< Scalar, O2 > &v) const
MotionPlain __plus__(const MotionTpl< Scalar, O2 > &v) const
Vector6::template ConstFixedSegmentReturnType< 3 >::Type ConstAngularType
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef MotionDense< MotionTpl > Base
Eigen::Matrix< Scalar, 3, 1, _Options > Vector3
ConstLinearType linear() const
ToVectorConstReturnType toVector_impl() const
MotionPlain __minus__(const MotionRef< Vector6ArgType > &v) const
Vector6::template ConstFixedSegmentReturnType< 3 >::Type ConstLinearType
Vector6::template FixedSegmentReturnType< 3 >::Type LinearType
Vector6::template FixedSegmentReturnType< 3 >::Type AngularType
MotionTpl(const Eigen::MatrixBase< V1 > &v, const Eigen::MatrixBase< V2 > &w)
#define PINOCCHIO_EIGEN_REF_TYPE(D)
void linear_impl(const Eigen::MatrixBase< V3 > &v)
PlainReturnType plain() const
Main pinocchio namespace.
MotionPlain __mult__(const OtherScalar &alpha) const
MotionTpl(const Eigen::MatrixBase< V6 > &v)
MotionRef< Vector6 > ref()
MotionRef< Vector6 > MotionRefType
ToVectorConstReturnType toVector() const
Common traits structure to fully define base classes for CRTP.
ConstAngularType angular() const
MotionTpl & __pequ__(const MotionTpl< Scalar, O2 > &v)
static MotionTpl Random()
AngularType angular_impl()
ConstAngularType angular_impl() const
MotionTpl< NewScalar, Options > cast() const
ConstLinearType linear_impl() const
Eigen::Matrix< Scalar, 6, 6, _Options > Matrix6
MotionTpl(const MotionDense< M2 > &clone)