6 #ifndef __pinocchio_multibody_constraint_generic_hpp__
7 #define __pinocchio_multibody_constraint_generic_hpp__
12 template<
int _Dim,
typename _Scalar,
int _Options>
15 typedef _Scalar Scalar;
25 typedef Eigen::Matrix<Scalar, Dim, 1, Options> JointForce;
26 typedef Eigen::Matrix<Scalar, 6, Dim, Options> DenseBase;
27 typedef Eigen::Matrix<Scalar, Dim, Dim, Options> ReducedSquaredMatrix;
29 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(DenseBase) ConstMatrixReturnType;
30 typedef typename PINOCCHIO_EIGEN_REF_TYPE(DenseBase) MatrixReturnType;
32 typedef ReducedSquaredMatrix StDiagonalMatrixSOperationReturnType;
35 template<
int Dim,
typename Scalar,
int Options>
38 typedef Eigen::Matrix<Scalar, 6, Dim> ReturnType;
41 template<
int Dim,
typename Scalar,
int Options,
typename MotionDerived>
44 typedef Eigen::Matrix<Scalar, 6, Dim> ReturnType;
47 template<
int _Dim,
typename _Scalar,
int _Options>
51 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
72 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(DenseBase, D);
79 _Dim != Eigen::Dynamic, YOU_CALLED_A_DYNAMIC_SIZE_METHOD_ON_A_FIXED_SIZE_MATRIX_OR_VECTOR)
87 _Dim == Eigen::Dynamic, YOU_CALLED_A_FIXED_SIZE_METHOD_ON_A_DYNAMIC_SIZE_MATRIX_OR_VECTOR)
95 template<
typename VectorLike>
96 JointMotion __mult__(
const Eigen::MatrixBase<VectorLike> & vj)
const
98 return JointMotion(S * vj);
109 template<
typename Derived>
112 return (ref.S.transpose() * f.
toVector()).eval();
116 typename Eigen::Matrix<Scalar, NV, Eigen::Dynamic> operator*(
const Eigen::MatrixBase<D> & F)
118 return (ref.S.transpose() * F).eval();
127 MatrixReturnType matrix_impl()
131 ConstMatrixReturnType matrix_impl()
const
138 return (
int)S.cols();
141 template<
typename S2,
int O2>
142 friend typename JointMotionSubspaceTpl<_Dim, _Scalar, _Options>::DenseBase
143 operator*(
const InertiaTpl<S2, O2> & Y,
const JointMotionSubspaceTpl & S)
145 typedef typename JointMotionSubspaceTpl::DenseBase ReturnType;
146 ReturnType res(6, S.nv());
151 template<
typename S2,
int O2>
152 friend Eigen::Matrix<_Scalar, 6, _Dim>
153 operator*(
const Eigen::Matrix<S2, 6, 6, O2> & Ymatrix,
const JointMotionSubspaceTpl & S)
155 typedef Eigen::Matrix<_Scalar, 6, _Dim> ReturnType;
156 return ReturnType(Ymatrix * S.matrix());
159 DenseBase se3Action(
const SE3Tpl<Scalar, Options> & m)
const
161 DenseBase res(6, nv());
166 DenseBase se3ActionInverse(
const SE3Tpl<Scalar, Options> & m)
const
168 DenseBase res(6, nv());
173 template<
typename MotionDerived>
174 DenseBase motionAction(
const MotionDense<MotionDerived> & v)
const
176 DenseBase res(6, nv());
181 void disp_impl(std::ostream & os)
const
183 os <<
"S =\n" << S << std::endl;
186 bool isEqual(
const JointMotionSubspaceTpl & other)
const
197 template<
int Dim,
typename Scalar,
int Options>
205 return constraint.matrix().transpose() * constraint.matrix();
ToVectorConstReturnType toVector() const
Return the force as an Eigen vector.
static void inertiaAction(const InertiaTpl< Scalar, Options > &I, const Eigen::MatrixBase< Mat > &iF, Eigen::MatrixBase< MatRet > const &jF)
Action of an Inertia matrix on a set of motions, represented by a 6xN matrix whose columns represent ...
static void se3ActionInverse(const SE3Tpl< Scalar, Options > &m, const Eigen::MatrixBase< Mat > &iV, Eigen::MatrixBase< MatRet > const &jV)
Inverse SE3 action on a set of motions, represented by a 6xN matrix whose column represent a spatial ...
static void se3Action(const SE3Tpl< Scalar, Options > &m, const Eigen::MatrixBase< Mat > &iV, Eigen::MatrixBase< MatRet > const &jV)
SE3 action on a set of motions, represented by a 6xN matrix whose column represent a spatial motion.
static void motionAction(const MotionDense< MotionDerived > &v, const Eigen::MatrixBase< Mat > &iF, Eigen::MatrixBase< MatRet > const &jF)
Action of a motion on a set of motions, represented by a 6xN matrix whose columns represent a spatial...
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.