5 #ifndef __pinocchio_motion_ref_hpp__ 6 #define __pinocchio_motion_ref_hpp__ 11 template<
typename Vector6ArgType>
14 typedef typename Vector6ArgType::Scalar Scalar;
15 typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(Vector6ArgType) Vector6;
19 Options = Vector6::Options
21 typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
22 typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
23 typedef Matrix6 ActionMatrixType;
24 typedef typename Vector6ArgType::template FixedSegmentReturnType<3>::Type LinearType;
25 typedef typename Vector6ArgType::template FixedSegmentReturnType<3>::Type AngularType;
26 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
27 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
29 typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) DataRefType;
30 typedef DataRefType ToVectorReturnType;
31 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) ConstDataRefType;
32 typedef ConstDataRefType ToVectorConstReturnType;
39 template<
typename Vector6ArgType>
40 struct SE3GroupAction< MotionRef<Vector6ArgType> >
45 template<
typename Vector6ArgType,
typename MotionDerived>
46 struct MotionAlgebraAction< MotionRef<Vector6ArgType>, MotionDerived >
51 template<
typename Vector6ArgType>
55 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
60 using Base::operator=;
65 using Base::__opposite__;
66 using Base::__minus__;
71 MotionRef(
typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) v_like)
74 EIGEN_STATIC_ASSERT(Vector6ArgType::ColsAtCompileTime == 1,
75 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
76 assert(v_like.size() == 6);
79 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
80 ToVectorReturnType toVector_impl() {
return m_ref; }
83 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
84 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
85 AngularType angular_impl() {
return m_ref.template segment<3> (ANGULAR); }
86 LinearType linear_impl() {
return m_ref.template segment<3> (LINEAR); }
89 void angular_impl(
const Eigen::MatrixBase<V3> & w)
91 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
96 void linear_impl(
const Eigen::MatrixBase<V3> & v)
98 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
103 template<
typename S1,
int O1>
107 template<
typename Vector6Like>
111 template<
typename S1,
int O1>
115 template<
typename Vector6Like>
119 template<
typename S1,
int O1>
121 { m_ref += v.toVector();
return *
this; }
123 template<
typename Vector6Like>
125 { m_ref += v.toVector();
return *
this; }
127 template<
typename S1,
int O1>
129 { m_ref -= v.toVector();
return *
this; }
131 template<
typename Vector6Like>
133 { m_ref -= v.toVector();
return *
this; }
135 template<
typename OtherScalar>
136 MotionPlain __mult__(
const OtherScalar & alpha)
const 146 template<
typename Vector6ArgType>
148 :
public MotionDense< MotionRef<const Vector6ArgType> >
151 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
156 using Base::operator=;
160 using Base::__plus__;
161 using Base::__opposite__;
162 using Base::__minus__;
163 using Base::__mult__;
165 MotionRef(
typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) v_like)
168 EIGEN_STATIC_ASSERT(Vector6ArgType::ColsAtCompileTime == 1,
169 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
170 assert(v_like.size() == 6);
173 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
176 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
177 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
180 template<
typename S1,
int O1>
182 {
return MotionPlain(m_ref+v.toVector()); }
184 template<
typename Vector6Like>
186 {
return MotionPlain(m_ref+v.toVector()); }
188 template<
typename S1,
int O1>
190 {
return MotionPlain(m_ref-v.toVector()); }
192 template<
typename Vector6Like>
194 {
return MotionPlain(m_ref-v.toVector()); }
196 template<
typename OtherScalar>
197 MotionPlain __mult__(
const OtherScalar & alpha)
const 198 {
return MotionPlain(alpha*m_ref); }
200 const MotionRef & ref()
const {
return *
this; }
209 #endif // ifndef __pinocchio_motion_ref_hpp__
Main pinocchio namespace.
Common traits structure to fully define base classes for CRTP.