37 typedef _Scalar Scalar;
42 typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
43 typedef Eigen::Matrix<Scalar, 6, 1, Options> Vector6;
44 typedef Eigen::Matrix<Scalar, 4, 4, Options> Matrix4;
45 typedef Eigen::Matrix<Scalar, 6, 6, Options> Matrix6;
46 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6) ToVectorConstReturnType;
47 typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
48 typedef Vector3 AngularType;
49 typedef Vector3 LinearType;
50 typedef const Vector3 ConstAngularType;
51 typedef const Vector3 ConstLinearType;
52 typedef Matrix6 ActionMatrixType;
53 typedef Matrix4 HomogeneousMatrixType;
55 typedef MotionPlain PlainReturnType;
64 struct MotionTranslationTpl :
MotionBase<MotionTranslationTpl<_Scalar, _Options>>
66 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
68 MOTION_TYPEDEF_TPL(MotionTranslationTpl);
70 MotionTranslationTpl()
74 template<
typename Vector3Like>
75 MotionTranslationTpl(
const Eigen::MatrixBase<Vector3Like> & v)
80 MotionTranslationTpl(
const MotionTranslationTpl & other)
89 const Vector3 & operator()()
const 99 bool isEqual_impl(
const MotionTranslationTpl & other)
const 101 return internal::comparison_eq(m_v, other.m_v);
104 MotionTranslationTpl & operator=(
const MotionTranslationTpl & other)
110 template<
typename Derived>
113 other.linear() += m_v;
116 template<
typename Derived>
119 other.linear() = m_v;
120 other.angular().setZero();
123 template<
typename S2,
int O2,
typename D2>
126 v.angular().setZero();
127 v.linear().noalias() = m.rotation() * m_v;
130 template<
typename S2,
int O2>
134 se3Action_impl(m, res);
138 template<
typename S2,
int O2,
typename D2>
142 v.linear().noalias() = m.rotation().transpose() * m_v;
145 v.angular().setZero();
148 template<
typename S2,
int O2>
152 se3ActionInverse_impl(m, res);
156 template<
typename M1,
typename M2>
160 mout.linear().noalias() = v.angular().cross(m_v);
163 mout.angular().setZero();
166 template<
typename M1>
170 motionAction(v, res);
207 typedef _Scalar Scalar;
209 typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
210 typedef Eigen::Matrix<Scalar, 3, 3, Options> Matrix3;
211 typedef typename Matrix3::IdentityReturnType AngularType;
212 typedef AngularType AngularRef;
213 typedef AngularType ConstAngularRef;
214 typedef Vector3 LinearType;
215 typedef LinearType & LinearRef;
216 typedef const LinearType & ConstLinearRef;
228 struct TransformTranslationTpl :
SE3Base<TransformTranslationTpl<_Scalar, _Options>>
230 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
231 PINOCCHIO_SE3_TYPEDEF_TPL(TransformTranslationTpl);
234 TransformTranslationTpl()
238 template<
typename Vector3Like>
239 TransformTranslationTpl(
const Eigen::MatrixBase<Vector3Like> & translation)
240 : m_translation(translation)
247 res.rotation().setIdentity();
248 res.translation() = translation();
258 template<
typename S2,
int O2>
259 typename SE3GroupAction<TransformTranslationTpl>::ReturnType
262 typedef typename SE3GroupAction<TransformTranslationTpl>::ReturnType
ReturnType;
264 res.translation() += translation();
269 ConstLinearRef translation()
const 271 return m_translation;
273 LinearRef translation()
275 return m_translation;
278 AngularType rotation()
const 280 return AngularType(3, 3);
283 bool isEqual(
const TransformTranslationTpl & other)
const 285 return internal::comparison_eq(m_translation, other.m_translation);
289 LinearType m_translation;
298 typedef _Scalar Scalar;
311 typedef Eigen::Matrix<Scalar, 3, 1, Options> JointForce;
312 typedef Eigen::Matrix<Scalar, 6, 3, Options> DenseBase;
313 typedef Eigen::Matrix<Scalar, 3, 3, Options> ReducedSquaredMatrix;
315 typedef DenseBase MatrixReturnType;
316 typedef const DenseBase ConstMatrixReturnType;
318 typedef typename ReducedSquaredMatrix::IdentityReturnType StDiagonalMatrixSOperationReturnType;
322 struct JointMotionSubspaceTranslationTpl
325 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
327 PINOCCHIO_CONSTRAINT_TYPEDEF_TPL(JointMotionSubspaceTranslationTpl)
334 JointMotionSubspaceTranslationTpl()
342 template<
typename Vector3Like>
343 JointMotion __mult__(
const Eigen::MatrixBase<Vector3Like> & v)
const 345 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like, 3);
356 const JointMotionSubspaceTranslationTpl & ref;
357 ConstraintTranspose(
const JointMotionSubspaceTranslationTpl & ref)
362 template<
typename Derived>
369 template<
typename MatrixDerived>
371 operator*(
const Eigen::MatrixBase<MatrixDerived> & F)
const 373 assert(F.rows() == 6);
374 return F.derived().template middleRows<3>(LINEAR);
387 S.template middleRows<3>(LINEAR).setIdentity();
388 S.template middleRows<3>(ANGULAR).setZero();
392 template<
typename S1,
int O1>
393 Eigen::Matrix<S1, 6, 3, O1> se3Action(
const SE3Tpl<S1, O1> & m)
const 395 Eigen::Matrix<S1, 6, 3, O1> M;
396 M.template middleRows<3>(LINEAR) = m.rotation();
397 M.template middleRows<3>(ANGULAR).setZero();
402 template<
typename S1,
int O1>
403 Eigen::Matrix<S1, 6, 3, O1> se3ActionInverse(
const SE3Tpl<S1, O1> & m)
const 405 Eigen::Matrix<S1, 6, 3, O1> M;
406 M.template middleRows<3>(LINEAR) = m.rotation().transpose();
407 M.template middleRows<3>(ANGULAR).setZero();
412 template<
typename MotionDerived>
413 DenseBase motionAction(
const MotionDense<MotionDerived> & m)
const 415 const typename MotionDerived::ConstAngularType w = m.angular();
418 skew(w, res.template middleRows<3>(LINEAR));
419 res.template middleRows<3>(ANGULAR).setZero();
424 bool isEqual(
const JointMotionSubspaceTranslationTpl &)
const 440 inline Eigen::Matrix<S2, 6, 3, O2>
444 Eigen::Matrix<S2, 6, 3, O2> M;
485 typedef _Scalar Scalar;
498 typedef Eigen::Matrix<Scalar, 6, NV, Options> U_t;
499 typedef Eigen::Matrix<Scalar, NV, NV, Options> D_t;
500 typedef Eigen::Matrix<Scalar, 6, NV, Options> UD_t;
502 typedef Eigen::Matrix<Scalar, NQ, 1, Options> ConfigVector_t;
503 typedef Eigen::Matrix<Scalar, NV, 1, Options> TangentVector_t;
505 typedef boost::mpl::false_ is_mimicable_t;
507 PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE
525 struct JointDataTranslationTpl :
public JointDataBase<JointDataTranslationTpl<_Scalar, _Options>>
527 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
530 PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
531 PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
533 ConfigVector_t joint_q;
534 TangentVector_t joint_v;
547 JointDataTranslationTpl()
548 : joint_q(ConfigVector_t::Zero())
549 , joint_v(TangentVector_t::Zero())
550 , M(Transformation_t::Vector3::Zero())
551 , v(Motion_t::Vector3::Zero())
554 , UDinv(UD_t::Zero())
559 static std::string classname()
561 return std::string(
"JointDataTranslation");
563 std::string shortname()
const 572 :
public JointModelBase<JointModelTranslationTpl<_Scalar, _Options>>
574 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
577 PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
583 using Base::idx_vExtended;
584 using Base::setIndexes;
586 JointDataDerived createData()
const 588 return JointDataDerived();
591 const std::vector<bool> hasConfigurationLimit()
const 593 return {
true,
true,
true};
596 const std::vector<bool> hasConfigurationLimitInTangent()
const 598 return {
true,
true,
true};
601 template<
typename ConfigVector>
602 void calc(JointDataDerived & data,
const typename Eigen::MatrixBase<ConfigVector> & qs)
const 604 data.joint_q = this->jointConfigSelector(qs);
605 data.M.translation() = data.joint_q;
608 template<
typename TangentVector>
610 calc(JointDataDerived & data,
const Blank,
const typename Eigen::MatrixBase<TangentVector> & vs)
613 data.joint_v = this->jointVelocitySelector(vs);
614 data.v.linear() = data.joint_v;
617 template<
typename ConfigVector,
typename TangentVector>
619 JointDataDerived & data,
620 const typename Eigen::MatrixBase<ConfigVector> & qs,
621 const typename Eigen::MatrixBase<TangentVector> & vs)
const 623 calc(data, qs.derived());
625 data.joint_v = this->jointVelocitySelector(vs);
626 data.v.linear() = data.joint_v;
629 template<
typename VectorLike,
typename Matrix6Like>
631 JointDataDerived & data,
632 const Eigen::MatrixBase<VectorLike> & armature,
633 const Eigen::MatrixBase<Matrix6Like> & I,
634 const bool update_I)
const 636 data.U = I.template middleCols<3>(Inertia::LINEAR);
638 data.StU = data.U.template middleRows<3>(Inertia::LINEAR);
639 data.StU.diagonal() += armature;
641 internal::PerformStYSInversion<Scalar>::run(data.StU, data.Dinv);
643 data.UDinv.noalias() = data.U * data.Dinv;
646 PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like, I).noalias() -= data.UDinv * data.U.transpose();
649 static std::string classname()
651 return std::string(
"JointModelTranslation");
653 std::string shortname()
const 659 template<
typename NewScalar>
664 res.setIndexes(
id(), idx_q(), idx_v(), idx_vExtended());
void alphaSkew(const Scalar alpha, const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3 > &M)
Computes the skew representation of a given 3d vector multiplied by a given scalar....
void skew(const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3 > &M)
Computes the skew representation of a given 3d vector, i.e. the antisymmetric matrix representation o...