5 #ifndef __pinocchio_force_ref_hpp__ 6 #define __pinocchio_force_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< ForceRef<Vector6ArgType> >
45 template<
typename Vector6ArgType,
typename MotionDerived>
46 struct MotionAlgebraAction< ForceRef<Vector6ArgType>, MotionDerived >
52 template<
typename Vector6ArgType>
56 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
61 using Base::operator=;
63 ForceRef(
typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) f_like)
66 EIGEN_STATIC_ASSERT(Vector6ArgType::ColsAtCompileTime == 1,
67 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
68 assert(f_like.size() == 6);
71 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
72 ToVectorReturnType toVector_impl() {
return m_ref; }
75 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
76 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
77 AngularType angular_impl() {
return m_ref.template segment<3> (ANGULAR); }
78 LinearType linear_impl() {
return m_ref.template segment<3> (LINEAR); }
81 void angular_impl(
const Eigen::MatrixBase<V3> & w)
83 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
88 void linear_impl(
const Eigen::MatrixBase<V3> & v)
90 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
101 template<
typename Vector6ArgType>
103 :
public ForceDense< ForceRef<const Vector6ArgType> >
106 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
111 ForceRef(
typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) f_like)
114 EIGEN_STATIC_ASSERT(Vector6ArgType::ColsAtCompileTime == 1,
115 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
116 assert(f_like.size() == 6);
119 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
122 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
123 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
125 const ForceRef & ref()
const {
return *
this; }
134 #endif // ifndef __pinocchio_force_ref_hpp__
Main pinocchio namespace.
Common traits structure to fully define base classes for CRTP.