38 typedef _Scalar Scalar;
43 typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
44 typedef Eigen::Matrix<Scalar, 6, 1, Options> Vector6;
45 typedef Eigen::Matrix<Scalar, 4, 4, Options> Matrix4;
46 typedef Eigen::Matrix<Scalar, 6, 6, Options> Matrix6;
47 typedef typename PINOCCHIO_EIGEN_REF_CONST_TYPE(Vector6) ToVectorConstReturnType;
48 typedef typename PINOCCHIO_EIGEN_REF_TYPE(Vector6) ToVectorReturnType;
49 typedef Vector3 AngularType;
50 typedef Vector3 LinearType;
51 typedef const Vector3 ConstAngularType;
52 typedef const Vector3 ConstLinearType;
53 typedef Matrix6 ActionMatrixType;
54 typedef Matrix4 HomogeneousMatrixType;
56 typedef MotionPlain PlainReturnType;
65 struct MotionPrismaticUnalignedTpl :
MotionBase<MotionPrismaticUnalignedTpl<_Scalar, _Options>>
67 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
68 MOTION_TYPEDEF_TPL(MotionPrismaticUnalignedTpl);
70 MotionPrismaticUnalignedTpl()
74 template<
typename Vector3Like,
typename S2>
75 MotionPrismaticUnalignedTpl(
const Eigen::MatrixBase<Vector3Like> & axis,
const S2 & v)
79 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like, 3);
87 template<
typename OtherScalar>
88 MotionPrismaticUnalignedTpl __mult__(
const OtherScalar & alpha)
const 90 return MotionPrismaticUnalignedTpl(m_axis, alpha * m_v);
93 template<
typename Derived>
96 other.linear() += m_axis * m_v;
99 template<
typename Derived>
102 other.linear().noalias() = m_axis * m_v;
103 other.angular().setZero();
106 template<
typename S2,
int O2,
typename D2>
109 v.linear().noalias() = m_v * (m.rotation() * m_axis);
110 v.angular().setZero();
113 template<
typename S2,
int O2>
117 se3Action_impl(m, res);
121 template<
typename S2,
int O2,
typename D2>
125 v.linear().noalias() = m_v * (m.rotation().transpose() * m_axis);
128 v.angular().setZero();
131 template<
typename S2,
int O2>
135 se3ActionInverse_impl(m, res);
139 template<
typename M1,
typename M2>
143 mout.linear().noalias() = v.angular().cross(m_axis);
144 mout.linear() *= m_v;
147 mout.angular().setZero();
150 template<
typename M1>
154 motionAction(v, res);
158 bool isEqual_impl(
const MotionPrismaticUnalignedTpl & other)
const 160 return internal::comparison_eq(m_axis, other.m_axis)
161 && internal::comparison_eq(m_v, other.m_v);
164 const Scalar & linearRate()
const 197 operator^(
const MotionDense<MotionDerived> & m1,
const MotionPrismaticUnalignedTpl<S2, O2> & m2)
208 typedef _Scalar Scalar;
220 typedef Eigen::Matrix<Scalar, 1, 1, Options> JointForce;
221 typedef Eigen::Matrix<Scalar, 6, 1, Options> DenseBase;
222 typedef Eigen::Matrix<Scalar, 1, 1, Options> ReducedSquaredMatrix;
223 typedef Eigen::Matrix<Scalar, 3, 1, Options> Vector3;
225 typedef DenseBase MatrixReturnType;
226 typedef const DenseBase ConstMatrixReturnType;
228 typedef typename ReducedSquaredMatrix::IdentityReturnType StDiagonalMatrixSOperationReturnType;
270 struct JointMotionSubspacePrismaticUnalignedTpl
273 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
274 PINOCCHIO_CONSTRAINT_TYPEDEF_TPL(JointMotionSubspacePrismaticUnalignedTpl)
283 JointMotionSubspacePrismaticUnalignedTpl()
287 template<
typename Vector3Like>
288 JointMotionSubspacePrismaticUnalignedTpl(
const Eigen::MatrixBase<Vector3Like> & axis)
291 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector3Like, 3);
294 template<
typename Vector1Like>
295 JointMotion __mult__(
const Eigen::MatrixBase<Vector1Like> & v)
const 297 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Vector1Like, 1);
301 template<
typename S1,
int O1>
302 typename SE3GroupAction<JointMotionSubspacePrismaticUnalignedTpl>::ReturnType
305 typename SE3GroupAction<JointMotionSubspacePrismaticUnalignedTpl>::ReturnType res;
307 v.linear().noalias() = m.rotation() * m_axis;
308 v.angular().setZero();
312 template<
typename S1,
int O1>
313 typename SE3GroupAction<JointMotionSubspacePrismaticUnalignedTpl>::ReturnType
316 typename SE3GroupAction<JointMotionSubspacePrismaticUnalignedTpl>::ReturnType res;
318 v.linear().noalias() = m.rotation().transpose() * m_axis;
319 v.angular().setZero();
328 struct TransposeConst
331 const JointMotionSubspacePrismaticUnalignedTpl & ref;
332 TransposeConst(
const JointMotionSubspacePrismaticUnalignedTpl & ref)
337 template<
typename ForceDerived>
338 typename ConstraintForceOp<JointMotionSubspacePrismaticUnalignedTpl, ForceDerived>::ReturnType
344 res[0] = ref.axis().dot(f.
linear());
349 template<
typename ForceSet>
350 typename ConstraintForceSetOp<JointMotionSubspacePrismaticUnalignedTpl, ForceSet>::ReturnType
351 operator*(
const Eigen::MatrixBase<ForceSet> & F)
354 ForceSet::RowsAtCompileTime == 6, THIS_METHOD_IS_ONLY_FOR_MATRICES_OF_A_SPECIFIC_SIZE)
356 return ref.axis().transpose() * F.template middleRows<3>(LINEAR);
374 S.template segment<3>(LINEAR) = m_axis;
375 S.template segment<3>(ANGULAR).setZero();
379 template<
typename MotionDerived>
380 DenseBase motionAction(
const MotionDense<MotionDerived> & v)
const 383 res.template segment<3>(LINEAR).noalias() = v.angular().cross(m_axis);
384 res.template segment<3>(ANGULAR).setZero();
389 const Vector3 & axis()
const 398 bool isEqual(
const JointMotionSubspacePrismaticUnalignedTpl & other)
const 400 return internal::comparison_eq(m_axis, other.m_axis);
484 typedef _Scalar Scalar;
497 typedef Eigen::Matrix<Scalar, 6, NV, Options> U_t;
498 typedef Eigen::Matrix<Scalar, NV, NV, Options> D_t;
499 typedef Eigen::Matrix<Scalar, 6, NV, Options> UD_t;
501 typedef Eigen::Matrix<Scalar, NQ, 1, Options> ConfigVector_t;
502 typedef Eigen::Matrix<Scalar, NV, 1, Options> TangentVector_t;
504 typedef boost::mpl::true_ is_mimicable_t;
506 PINOCCHIO_JOINT_DATA_BASE_ACCESSOR_DEFAULT_RETURN_TYPE
517 struct JointDataPrismaticUnalignedTpl
518 :
public JointDataBase<JointDataPrismaticUnalignedTpl<_Scalar, _Options>>
520 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
522 PINOCCHIO_JOINT_DATA_TYPEDEF_TEMPLATE(JointDerived);
523 PINOCCHIO_JOINT_DATA_BASE_DEFAULT_ACCESSOR
525 ConfigVector_t joint_q;
526 TangentVector_t joint_v;
539 JointDataPrismaticUnalignedTpl()
540 : joint_q(ConfigVector_t::Zero())
541 , joint_v(TangentVector_t::Zero())
542 , M(Transformation_t::Vector3::Zero())
543 , S(Constraint_t::Vector3::Zero())
544 , v(Constraint_t::Vector3::Zero(), (
Scalar)0)
547 , UDinv(UD_t::Zero())
552 template<
typename Vector3Like>
553 JointDataPrismaticUnalignedTpl(
const Eigen::MatrixBase<Vector3Like> & axis)
554 : joint_q(ConfigVector_t::Zero())
555 , joint_v(TangentVector_t::Zero())
556 , M(Transformation_t::Vector3::Zero())
561 , UDinv(UD_t::Zero())
566 static std::string classname()
568 return std::string(
"JointDataPrismaticUnaligned");
570 std::string shortname()
const 586 struct JointModelPrismaticUnalignedTpl
587 :
public JointModelBase<JointModelPrismaticUnalignedTpl<_Scalar, _Options>>
589 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
591 PINOCCHIO_JOINT_TYPEDEF_TEMPLATE(JointDerived);
597 using Base::idx_vExtended;
598 using Base::setIndexes;
600 typedef Eigen::Matrix<Scalar, 3, 1, _Options> Vector3;
602 JointModelPrismaticUnalignedTpl()
603 :
axis(Vector3::UnitX())
610 assert(
isUnitary(
axis) &&
"Translation axis is not unitary");
613 template<
typename Vector3Like>
614 JointModelPrismaticUnalignedTpl(
const Eigen::MatrixBase<Vector3Like> &
axis)
617 EIGEN_STATIC_ASSERT_VECTOR_ONLY(Vector3Like);
618 assert(
isUnitary(
axis) &&
"Translation axis is not unitary");
621 JointDataDerived createData()
const 623 return JointDataDerived(
axis);
626 const std::vector<bool> hasConfigurationLimit()
const 631 const std::vector<bool> hasConfigurationLimitInTangent()
const 637 bool isEqual(
const JointModelPrismaticUnalignedTpl & other)
const 639 return Base::isEqual(other) && internal::comparison_eq(
axis, other.
axis);
642 template<
typename ConfigVector>
643 void calc(JointDataDerived & data,
const typename Eigen::MatrixBase<ConfigVector> & qs)
const 645 data.joint_q[0] = qs[idx_q()];
646 data.M.translation().noalias() =
axis * data.joint_q[0];
649 template<
typename TangentVector>
651 calc(JointDataDerived & data,
const Blank,
const typename Eigen::MatrixBase<TangentVector> & vs)
654 data.joint_v[0] = vs[idx_v()];
655 data.v.linearRate() = data.joint_v[0];
658 template<
typename ConfigVector,
typename TangentVector>
660 JointDataDerived & data,
661 const typename Eigen::MatrixBase<ConfigVector> & qs,
662 const typename Eigen::MatrixBase<TangentVector> & vs)
const 664 calc(data, qs.derived());
666 data.joint_v[0] = vs[idx_v()];
667 data.v.linearRate() = data.joint_v[0];
670 template<
typename VectorLike,
typename Matrix6Like>
672 JointDataDerived & data,
673 const Eigen::MatrixBase<VectorLike> & armature,
674 const Eigen::MatrixBase<Matrix6Like> & I,
675 const bool update_I)
const 677 data.U.noalias() = I.template block<6, 3>(0, Inertia::LINEAR) *
axis;
679 Scalar(1) / (
axis.dot(data.U.template segment<3>(Inertia::LINEAR)) + armature[0]);
680 data.UDinv.noalias() = data.U * data.Dinv;
683 PINOCCHIO_EIGEN_CONST_CAST(Matrix6Like, I).noalias() -= data.UDinv * data.U.transpose();
686 static std::string classname()
688 return std::string(
"JointModelPrismaticUnaligned");
690 std::string shortname()
const 696 template<
typename NewScalar>
697 JointModelPrismaticUnalignedTpl<NewScalar, Options>
cast()
const 699 typedef JointModelPrismaticUnalignedTpl<NewScalar, Options>
ReturnType;
701 res.setIndexes(
id(), idx_q(), idx_v(), idx_vExtended());
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
bool isUnitary(const Eigen::MatrixBase< MatrixLike > &mat, const typename MatrixLike::RealScalar &prec=Eigen::NumTraits< typename MatrixLike::Scalar >::dummy_precision())
Check whether the input matrix is Unitary within the given precision.