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!=;
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);
76 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
77 ToVectorReturnType toVector_impl() {
return m_ref; }
80 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
81 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
82 AngularType angular_impl() {
return m_ref.template segment<3> (ANGULAR); }
83 LinearType linear_impl() {
return m_ref.template segment<3> (LINEAR); }
86 void angular_impl(
const Eigen::MatrixBase<V3> & w)
88 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
93 void linear_impl(
const Eigen::MatrixBase<V3> & v)
95 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3,3);
106 template<
typename Vector6ArgType>
109 typedef typename Vector6ArgType::Scalar Scalar;
110 typedef typename PINOCCHIO_EIGEN_PLAIN_TYPE(Vector6ArgType) Vector6;
114 Options = Vector6::Options
116 typedef Eigen::Matrix<Scalar,3,1,Options> Vector3;
117 typedef Eigen::Matrix<Scalar,6,6,Options> Matrix6;
118 typedef Matrix6 ActionMatrixType;
119 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
120 typedef typename Vector6ArgType::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
121 typedef ConstLinearType LinearType;
122 typedef ConstAngularType AngularType;
125 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) ConstDataRefType;
126 typedef ConstDataRefType ToVectorConstReturnType;
127 typedef ConstDataRefType DataRefType;
128 typedef DataRefType ToVectorReturnType;
133 template<
typename Vector6ArgType>
135 :
public ForceDense< ForceRef<const Vector6ArgType> >
138 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
143 ForceRef(
typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6ArgType) f_like)
146 EIGEN_STATIC_ASSERT(Vector6ArgType::ColsAtCompileTime == 1,
147 YOU_TRIED_CALLING_A_VECTOR_METHOD_ON_A_MATRIX);
148 assert(f_like.size() == 6);
151 ToVectorConstReturnType toVector_impl()
const {
return m_ref; }
154 ConstAngularType angular_impl()
const {
return ConstAngularType(m_ref.derived(),ANGULAR); }
155 ConstLinearType linear_impl()
const {
return ConstLinearType(m_ref.derived(),LINEAR); }
157 const ForceRef & ref()
const {
return *
this; }
166 #endif // ifndef __pinocchio_force_ref_hpp__
Return type of the ation of a Motion onto an object of type D.
ForceRef(typename PINOCCHIO_EIGEN_REF_TYPE(Vector6ArgType) f_like)
Default constructor from a 6 dimensional vector.
Main pinocchio namespace.
Common traits structure to fully define base classes for CRTP.
ForceRef(const ForceRef &other)
Copy constructor from another ForceRef.