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;
37 template<
typename Vector6ArgType>
43 template<
typename Vector6ArgType,
typename MotionDerived>
49 template<
typename Vector6ArgType>
53 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
58 using Base::operator=;
59 using Base::operator==;
60 using Base::operator!=;
62 ForceRef(
typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) f_like)
65 EIGEN_STATIC_ASSERT(Vector6ArgType::ColsAtCompileTime == 1,
66 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
67 assert(f_like.size() == 6);
70 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
71 ToVectorReturnType toVector_impl() {
return m_ref; }
74 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
75 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
76 AngularType angular_impl() {
return m_ref.template segment<3> (ANGULAR); }
77 LinearType linear_impl() {
return m_ref.template segment<3> (LINEAR); }
80 void angular_impl(
const Eigen::MatrixBase<V3> & w)
82 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
87 void linear_impl(
const Eigen::MatrixBase<V3> & v)
89 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
100 template<
typename Vector6ArgType>
103 typedef typename Vector6ArgType::Scalar Scalar;
104 typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(Vector6ArgType) Vector6;
108 Options = Vector6::Options
110 typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
111 typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
112 typedef Matrix6 ActionMatrixType;
113 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
114 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
115 typedef ConstLinearType LinearType;
116 typedef ConstAngularType AngularType;
119 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) ConstDataRefType;
120 typedef ConstDataRefType ToVectorConstReturnType;
121 typedef ConstDataRefType DataRefType;
122 typedef DataRefType ToVectorReturnType;
127 template<
typename Vector6ArgType>
129 :
public ForceDense< ForceRef<const Vector6ArgType> >
132 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
137 ForceRef(
typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) f_like)
140 EIGEN_STATIC_ASSERT(Vector6ArgType::ColsAtCompileTime == 1,
141 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
142 assert(f_like.size() == 6);
145 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
148 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
149 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
151 const ForceRef & ref()
const {
return *
this; }
160 #endif // ifndef __pinocchio_force_ref_hpp__
Return type of the ation of a Motion onto an object of type D.
Main pinocchio namespace.
Common traits structure to fully define base classes for CRTP.