15 typedef _Scalar Scalar;
25 typedef Eigen::Matrix<Scalar, Dim, 1, Options, _MaxDim, 1> JointForce;
26 typedef Eigen::Matrix<Scalar, 6, Dim, Options, 6, _MaxDim> DenseBase;
27 typedef Eigen::Matrix<Scalar, Dim, Dim, Options, _MaxDim, _MaxDim> ReducedSquaredMatrix;
29 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(DenseBase) ConstMatrixReturnType;
32 typedef ReducedSquaredMatrix StDiagonalMatrixSOperationReturnType;
65 struct JointMotionSubspaceTpl
68 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
73 PINOCCHIO_CONSTRAINT_TYPEDEF_TPL(JointMotionSubspaceTpl)
80 constexpr static int MaxNV = NV < 0 ? _MaxDim : NV;
85 explicit JointMotionSubspaceTpl(
const Eigen::MatrixBase<D> & _S)
91 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(
DenseBase, D);
94 JointMotionSubspaceTpl()
98 _Dim != Eigen::Dynamic, YOU_CALLED_A_DYNAMIC_SIZE_METHOD_ON_A_FIXED_SIZE_MATRIX_OR_VECTOR)
102 explicit JointMotionSubspaceTpl(
const int dim)
106 _Dim == Eigen::Dynamic, YOU_CALLED_A_FIXED_SIZE_METHOD_ON_A_DYNAMIC_SIZE_MATRIX_OR_VECTOR);
107 assert(_MaxDim < 0 || dim <= _MaxDim);
111 template<
int D,
int MD>
112 explicit JointMotionSubspaceTpl(
const JointMotionSubspaceTpl<D, _Scalar, _Options, MD> subspace)
113 : S(subspace.matrix())
116 _Dim == Eigen::Dynamic, YOU_CALLED_A_FIXED_SIZE_METHOD_ON_A_DYNAMIC_SIZE_MATRIX_OR_VECTOR);
117 assert(_MaxDim < 0 || subspace.matrix().cols() <= _MaxDim);
120 static JointMotionSubspaceTpl Zero(
const int dim)
122 return JointMotionSubspaceTpl(dim);
125 template<
typename VectorLike>
126 JointMotion __mult__(
const Eigen::MatrixBase<VectorLike> & vj)
const 133 const JointMotionSubspaceTpl & ref;
134 Transpose(
const JointMotionSubspaceTpl & ref)
139 template<
typename ForceDerived>
140 typename ConstraintForceOp<JointMotionSubspaceTpl, ForceDerived>::ReturnType
143 return (ref.S.transpose() * f.
toVector()).eval();
146 template<
typename ForceSet>
147 typename ConstraintForceSetOp<JointMotionSubspaceTpl, ForceSet>::ReturnType
148 operator*(
const Eigen::MatrixBase<ForceSet> & F)
150 return ref.S.transpose() * F.derived();
163 ConstMatrixReturnType matrix_impl()
const 170 return (
int)S.cols();
173 template<
typename S2,
int O2>
174 friend typename JointMotionSubspaceTpl<_Dim, _Scalar, _Options, _MaxDim>::DenseBase
175 operator*(
const InertiaTpl<S2, O2> & Y,
const JointMotionSubspaceTpl & S)
177 typedef typename JointMotionSubspaceTpl::DenseBase ReturnType;
178 ReturnType res(6, S.nv());
183 template<
typename S2,
int O2>
184 friend Eigen::Matrix<_Scalar, 6, _Dim, _Options, 6, _MaxDim>
185 operator*(
const Eigen::Matrix<S2, 6, 6, O2> & Ymatrix,
const JointMotionSubspaceTpl & S)
187 typedef Eigen::Matrix<_Scalar, 6, _Dim, _Options, 6, _MaxDim> ReturnType;
188 return ReturnType(Ymatrix * S.matrix());
191 DenseBase se3Action(
const SE3Tpl<Scalar, Options> & m)
const 193 DenseBase res(6, nv());
198 DenseBase se3ActionInverse(
const SE3Tpl<Scalar, Options> & m)
const 200 DenseBase res(6, nv());
205 template<
typename MotionDerived>
206 DenseBase motionAction(
const MotionDense<MotionDerived> & v)
const 208 DenseBase res(6, nv());
213 void disp_impl(std::ostream & os)
const 215 os <<
"S =\n" << S << std::endl;
218 bool isEqual(
const JointMotionSubspaceTpl & other)
const 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 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 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...
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 ...