5 #ifndef __pinocchio_spatial_force_ref_hpp__
6 #define __pinocchio_spatial_force_ref_hpp__
11 template<
typename Vector6ArgType>
14 typedef typename Vector6ArgType::Scalar Scalar;
15 typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(Vector6ArgType) Vector6;
20 Options = Vector6::Options
22 typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
23 typedef Eigen::Matrix<Scalar, 4, 4, Options> Matrix4;
24 typedef Eigen::Matrix<Scalar, 6, 6, Options> Matrix6;
25 typedef Matrix6 ActionMatrixType;
26 typedef Matrix4 HomogeneousMatrixType;
27 typedef typename Vector6ArgType::template FixedSegmentReturnType<3>::Type LinearType;
28 typedef typename Vector6ArgType::template FixedSegmentReturnType<3>::Type AngularType;
29 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
30 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
32 typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) DataRefType;
33 typedef DataRefType ToVectorReturnType;
34 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) ConstDataRefType;
35 typedef ConstDataRefType ToVectorConstReturnType;
40 template<
typename Vector6ArgType>
46 template<
typename Vector6ArgType,
typename MotionDerived>
52 template<
typename Vector6ArgType>
56 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
61 using Base::operator=;
62 using Base::operator==;
63 using Base::operator!=;
66 ForceRef(
typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) f_like)
70 Vector6ArgType::ColsAtCompileTime == 1, YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
71 assert(f_like.size() == 6);
80 ToVectorConstReturnType toVector_impl()
const
84 ToVectorReturnType toVector_impl()
90 ConstAngularType angular_impl()
const
92 return ConstAngularType(m_ref.derived(), ANGULAR);
94 ConstLinearType linear_impl()
const
96 return ConstLinearType(m_ref.derived(), LINEAR);
98 AngularType angular_impl()
100 return m_ref.template segment<3>(ANGULAR);
102 LinearType linear_impl()
104 return m_ref.template segment<3>(LINEAR);
107 template<
typename V3>
108 void angular_impl(
const Eigen::MatrixBase<V3> & w)
110 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);
131 template<
typename Vector6ArgType>
134 typedef typename Vector6ArgType::Scalar Scalar;
135 typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(Vector6ArgType) Vector6;
140 Options = Vector6::Options
142 typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
143 typedef Eigen::Matrix<Scalar, 6, 6, Options> Matrix6;
144 typedef Matrix6 ActionMatrixType;
145 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
146 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
147 typedef ConstLinearType LinearType;
148 typedef ConstAngularType AngularType;
151 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) ConstDataRefType;
152 typedef ConstDataRefType ToVectorConstReturnType;
153 typedef ConstDataRefType DataRefType;
154 typedef DataRefType ToVectorReturnType;
159 template<
typename Vector6ArgType>
163 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
168 ForceRef(
typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) f_like)
172 Vector6ArgType::ColsAtCompileTime == 1, YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
173 assert(f_like.size() == 6);
176 ToVectorConstReturnType toVector_impl()
const
182 ConstAngularType angular_impl()
const
184 return ConstAngularType(m_ref.derived(), ANGULAR);
186 ConstLinearType linear_impl()
const
188 return ConstLinearType(m_ref.derived(), LINEAR);
ForceRef(const ForceRef &other)
Copy constructor from another ForceRef.
ForceRef(typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) f_like)
Default constructor from a 6 dimensional vector.
Main pinocchio namespace.
Return type of the ation of a Motion onto an object of type D.
Common traits structure to fully define base classes for CRTP.