6 #ifndef __pinocchio_spatial_force_tpl_hpp__
7 #define __pinocchio_spatial_force_tpl_hpp__
11 template<
typename _Scalar,
int _Options>
14 typedef _Scalar Scalar;
15 typedef Eigen::Matrix<Scalar, 3, 1, _Options> Vector3;
16 typedef Eigen::Matrix<Scalar, 6, 1, _Options> Vector6;
17 typedef Eigen::Matrix<Scalar, 6, 6, _Options> Matrix6;
18 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6) ToVectorConstReturnType;
19 typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
20 typedef typename Vector6::template FixedSegmentReturnType<3>::Type LinearType;
21 typedef typename Vector6::template FixedSegmentReturnType<3>::Type AngularType;
22 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstLinearType;
23 typedef typename Vector6::template ConstFixedSegmentReturnType<3>::Type ConstAngularType;
35 template<
typename _Scalar,
int _Options>
39 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
47 using Base::operator=;
48 using Base::operator!=;
57 template<
typename V1,
typename V2>
58 ForceTpl(
const Eigen::MatrixBase<V1> & v,
const Eigen::MatrixBase<V2> & w)
60 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V1);
61 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V2);
67 explicit ForceTpl(
const Eigen::MatrixBase<V6> & v)
70 EIGEN_STATIC_ASSERT_VECTOR_ONLY(V6);
78 template<
typename S2,
int O2>
81 *
this = other.template cast<Scalar>();
102 template<
typename M2>
119 ToVectorConstReturnType toVector_impl()
const
123 ToVectorReturnType toVector_impl()
129 ConstAngularType angular_impl()
const
131 return m_data.template segment<3>(ANGULAR);
133 ConstLinearType linear_impl()
const
135 return m_data.template segment<3>(LINEAR);
137 AngularType angular_impl()
139 return m_data.template segment<3>(ANGULAR);
141 LinearType linear_impl()
143 return m_data.template segment<3>(LINEAR);
146 template<
typename V3>
147 void angular_impl(
const Eigen::MatrixBase<V3> & w)
149 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3, 3);
152 template<
typename V3>
153 void linear_impl(
const Eigen::MatrixBase<V3> & v)
155 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(V3, 3);
165 template<
typename NewScalar>
169 ReturnType res(
linear().
template cast<NewScalar>(),
angular().
template cast<NewScalar>());
Base interface for forces representation.
ToVectorConstReturnType toVector() const
Return the force as an Eigen vector.
ConstAngularType angular() const
Return the angular part of the force vector.
ConstLinearType linear() const
Return the linear part of the force vector.
ConstAngularType angular() const
Return the angular part of the force vector.
ForceTpl< NewScalar, Options > cast() const
ConstLinearType linear() const
Return the linear part of the force vector.
Main pinocchio namespace.
Common traits structure to fully define base classes for CRTP.