7 #include "pinocchio/spatial/force.hpp" 8 #include "pinocchio/spatial/motion.hpp" 9 #include "pinocchio/spatial/se3.hpp" 10 #include "pinocchio/spatial/inertia.hpp" 11 #include "pinocchio/spatial/act-on-set.hpp" 12 #include "pinocchio/spatial/explog.hpp" 13 #include "pinocchio/spatial/skew.hpp" 14 #include "pinocchio/spatial/cartesian-axis.hpp" 15 #include "pinocchio/spatial/spatial-axis.hpp" 17 #include <boost/test/unit_test.hpp> 18 #include <boost/utility/binary.hpp> 20 BOOST_AUTO_TEST_SUITE ( BOOST_TEST_MODULE )
25 typedef SE3::HomogeneousMatrixType HomogeneousMatrixType;
26 typedef SE3::ActionMatrixType ActionMatrixType;
28 typedef Eigen::Matrix<double,4,1> Vector4;
34 Quaternion
quat(Vector4::Random().normalized());
36 SE3 m_from_quat(quat,Vector3::Random());
42 HomogeneousMatrixType aMb = amb;
43 HomogeneousMatrixType bMc = bmc;
46 HomogeneousMatrixType aMc = amc;
47 BOOST_CHECK(aMc.isApprox(aMb*bMc));
49 HomogeneousMatrixType bMa = amb.
inverse();
50 BOOST_CHECK(bMa.isApprox(aMb.inverse()));
53 Vector3
p = Vector3::Random();
54 Vector4 p4; p4.head(3) =
p; p4[3] = 1;
56 Vector3
Mp = (aMb*p4).head(3);
57 BOOST_CHECK(amb.
act(p).isApprox(Mp));
59 Vector3 Mip = (aMb.inverse()*p4).head(3);
60 BOOST_CHECK(amb.
actInv(p).isApprox(Mip));
63 ActionMatrixType aXb = amb;
64 ActionMatrixType bXc = bmc;
65 ActionMatrixType aXc = amc;
66 BOOST_CHECK(aXc.isApprox(aXb*bXc));
68 ActionMatrixType bXa = amb.
inverse();
69 BOOST_CHECK(bXa.isApprox(aXb.inverse()));
72 BOOST_CHECK(X_identity.isIdentity());
75 BOOST_CHECK(X_identity_inverse.isIdentity());
84 BOOST_CHECK(identity.
isApprox(identity));
88 SE3f::Matrix3 rot_float(amb.
rotation().cast<
float>());
89 SE3f amb_float = amb.
cast<
float>();
90 BOOST_CHECK(amb_float.isApprox(amb.
cast<
float>()));
96 BOOST_CHECK(Minv.
actInv(Minv).isIdentity());
97 BOOST_CHECK(M.actInv(identity).isApprox(Minv));
101 const double prec = Eigen::NumTraits<double>::dummy_precision();
103 M.
rotation() += prec * SE3::Matrix3::Random();
107 BOOST_CHECK(M_normalized.isNormalized());
118 typedef SE3::ActionMatrixType ActionMatrixType;
119 typedef Motion::Vector6 Vector6;
131 Vector6 bv2_vec = bv2;
134 std::stringstream ss;
135 ss << bv << std::endl;
136 BOOST_CHECK(!ss.str().empty());
139 Vector6 bvPbv2_vec = bv+bv2;
140 BOOST_CHECK(bvPbv2_vec.isApprox(bv_vec+bv2_vec));
142 Motion bplus =
static_cast<Base &
>(
bv) + static_cast<Base &>(bv2);
143 BOOST_CHECK((bv+bv2).
isApprox(bplus));
145 Motion v_not_zero(Vector6::Ones());
146 BOOST_CHECK(!v_not_zero.
isZero());
148 Motion v_zero(Vector6::Zero());
149 BOOST_CHECK(v_zero.isZero());
152 BOOST_CHECK(bv == bv);
153 BOOST_CHECK(!(bv != bv));
156 Vector6 Mbv_vec = -
bv;
157 BOOST_CHECK( Mbv_vec.isApprox(-bv_vec));
161 BOOST_CHECK( bv3.toVector().isApprox(bv_vec+bv2_vec));
165 BOOST_CHECK( bv3.toVector().isApprox(bv2_vec));
173 BOOST_CHECK(bvtwice.isApprox(twicebv));
176 Motion bvdividedbytwo(bvtwice/2.);
177 BOOST_CHECK(bvdividedbytwo.isApprox(bv));
181 BOOST_CHECK( bv4.toVector().isApprox(bv2_vec));
184 ActionMatrixType aXb = amb;
185 BOOST_CHECK(amb.
act(bv).toVector().isApprox(aXb*bv_vec));
188 ActionMatrixType bXc = bmc;
189 BOOST_CHECK(bmc.actInv(bv).toVector().isApprox(bXc.inverse()*bv_vec));
194 BOOST_CHECK(amb.
act(bv).toVector().isApprox(amc.
act(cv).toVector()));
198 BOOST_CHECK_SMALL(vxv.
toVector().tail(3).norm(), 1e-3);
202 Motion::ActionMatrixType actv2 = bv2.toActionMatrix();
204 BOOST_CHECK(v2xv.toVector().isApprox(actv2*bv.
toVector()));
208 Force v2xf = bv2.cross(f);
209 Motion::ActionMatrixType dualactv2 = bv2.toDualActionMatrix();
211 BOOST_CHECK(v2xf.toVector().isApprox(dualactv2*f.toVector()));
212 BOOST_CHECK(dualactv2.isApprox(-actv2.transpose()));
216 BOOST_CHECK(vxf.
linear().isApprox(bv.
angular().cross(f.linear())));
217 BOOST_CHECK_SMALL(vxf.
angular().norm(), 1e-3);
224 Force avxf = av.cross(af);
226 BOOST_CHECK(avxf.
toVector().isApprox(amb.
act(bvxf).toVector()));
235 BOOST_CHECK(avxw.
toVector().isApprox(amb.
act(bvxw).toVector()));
239 const double eps = 1e-6;
240 BOOST_CHECK(bv == bv);
243 bv_approx.linear()[0] +=
eps;
244 BOOST_CHECK(bv_approx.isApprox(bv,eps));
249 BOOST_CHECK(a.
ref().isApprox(a));
252 BOOST_CHECK(b.isApprox(a.
ref()));
259 Motionf a_float = a.
cast<
float>();
260 BOOST_CHECK(a_float.isApprox(a.
cast<
float>()));
267 typedef Motion::Vector6 Vector6;
276 MotionV6::MotionPlain v2(
v*2.);
285 BOOST_CHECK(v2.isApprox(v));
292 BOOST_CHECK(v2.isApprox(v));
295 BOOST_CHECK(v2.isApprox(v));
301 v2_ref = v_ref.
cross(v3);
303 BOOST_CHECK(v2.isApprox(v2_ref));
311 Vector6 v6(Vector6::Random());
313 BOOST_CHECK(a.ref().isApprox(a));
316 BOOST_CHECK(b.isApprox(a.ref()));
342 typedef SE3::ActionMatrixType ActionMatrixType;
343 typedef Force::Vector6 Vector6;
353 Vector6 bf2_vec = bf2;
356 std::stringstream ss;
357 ss << bf << std::endl;
358 BOOST_CHECK(!ss.str().empty());
361 Vector6 bfPbf2_vec = bf+bf2;
362 BOOST_CHECK(bfPbf2_vec.isApprox(bf_vec+bf2_vec));
365 Vector6 Mbf_vec = -bf;
366 BOOST_CHECK(Mbf_vec.isApprox(-bf_vec));
369 Force bf3 = bf; bf3 += bf2;
370 BOOST_CHECK(bf3.toVector().isApprox(bf_vec+bf2_vec));
374 BOOST_CHECK(bf3.toVector().isApprox(bf2_vec));
378 BOOST_CHECK(bf4.toVector().isApprox(bf2_vec));
381 ActionMatrixType aXb = amb;
382 BOOST_CHECK(amb.
act(bf).toVector().isApprox(aXb.inverse().transpose()*bf_vec));
385 ActionMatrixType bXc = bmc;
386 BOOST_CHECK(bmc.actInv(bf).toVector().isApprox(bXc.transpose()*bf_vec));
391 BOOST_CHECK(amb.
act(bf).toVector().isApprox(amc.
act(cf).toVector()));
397 Force f_not_zero(Vector6::Ones());
398 BOOST_CHECK(!f_not_zero.
isZero());
400 Force f_zero(Vector6::Zero());
401 BOOST_CHECK(f_zero.isZero());
405 BOOST_CHECK(bf == bf);
408 BOOST_CHECK(bf == bf);
409 BOOST_CHECK(bf != bf2);
413 const double eps = 1e-6;
416 BOOST_CHECK(!bf_approx.
isApprox(bf,eps));
421 BOOST_CHECK(a.
ref().isApprox(a));
424 BOOST_CHECK(b.isApprox(a.
ref()));
431 Forcef a_float = a.
cast<
float>();
432 BOOST_CHECK(a_float.isApprox(a.
cast<
float>()));
436 const double alpha = 1.5;
438 Force alpha_f = alpha *
b;
439 Force f_alpha = b * alpha;
441 BOOST_CHECK(alpha_f == f_alpha);
447 typedef Force::Vector6 Vector6;
456 ForceV6::ForcePlain f2(f*2.);
457 Force f2_ref(f_ref*2.);
465 BOOST_CHECK(f2.isApprox(f));
472 BOOST_CHECK(f2.isApprox(f));
475 BOOST_CHECK(f2.isApprox(f));
481 f2_ref = v.cross(f_ref);
483 BOOST_CHECK(f2.isApprox(f2_ref));
491 Vector6 v6(Vector6::Random());
493 BOOST_CHECK(a.ref().isApprox(a));
496 BOOST_CHECK(b.isApprox(a.ref()));
503 typedef Inertia::Matrix6 Matrix6;
507 BOOST_CHECK_EQUAL(matI(0,0), aI.
mass());
508 BOOST_CHECK_EQUAL(matI(1,1), aI.
mass());
509 BOOST_CHECK_EQUAL(matI(2,2), aI.
mass());
511 BOOST_CHECK_SMALL((matI-matI.transpose()).norm(),matI.norm());
512 BOOST_CHECK_SMALL((matI.topRightCorner<3,3>()*aI.
lever()).norm(),
516 BOOST_CHECK(I1.matrix().isApprox(Matrix6::Identity()));
521 BOOST_CHECK(f.
toVector().isApprox(v.toVector()));
529 BOOST_CHECK((bXa.transpose().inverse() * aI.
matrix() * bXa.inverse())
533 BOOST_CHECK((bXa.transpose() * bI.
matrix() * bXa)
539 Force vxf = v.cross(f);
546 BOOST_CHECK((I1.matrix()+I2.
matrix()).
isApprox((I1+I2).matrix()));
554 double kinetic_ref = v.toVector().transpose() * aI.
matrix() * v.toVector();
555 double kinetic = aI.
vtiv(v);
556 BOOST_CHECK_SMALL(kinetic_ref - kinetic, 1e-12);
560 BOOST_CHECK(I1.matrix().isApprox(I1_bis.matrix()));
563 const double sphere_mass = 5.;
564 const double sphere_radius = 2.;
566 const double L_sphere = 2./5. * sphere_mass * sphere_radius * sphere_radius;
567 BOOST_CHECK_SMALL(I1.mass() - sphere_mass, 1e-12);
568 BOOST_CHECK(I1.lever().isZero());
569 BOOST_CHECK(I1.inertia().matrix().isApprox(
Symmetric3(L_sphere, 0., L_sphere , 0., 0., L_sphere).matrix()));
573 BOOST_CHECK_SMALL(I1.mass() - 2, 1e-12);
574 BOOST_CHECK_SMALL(I1.lever().norm(), 1e-12);
575 BOOST_CHECK(I1.inertia().matrix().isApprox(
Symmetric3(
576 16.4, 0., 13.6, 0., 0., 10.).matrix()));
580 BOOST_CHECK_SMALL(I1.mass() - 2, 1e-12);
581 BOOST_CHECK_SMALL(I1.lever().norm(), 1e-12);
582 BOOST_CHECK(I1.inertia().matrix().isApprox(
Symmetric3(
583 14., 0., 14., 0., 0., 16.).matrix()));
587 BOOST_CHECK_SMALL(I1.mass() - 2, 1e-12);
588 BOOST_CHECK_SMALL(I1.lever().norm(), 1e-12);
589 BOOST_CHECK(I1.inertia().matrix().isApprox(
Symmetric3(
590 78., 0., 60., 0., 0., 30.).matrix()));
594 BOOST_CHECK(aI_copy == aI);
598 BOOST_CHECK(!I_not_zero.
isZero());
601 BOOST_CHECK(I_zero.isZero());
604 const double eps = 1e-6;
605 BOOST_CHECK(aI == aI);
608 aI_approx.mass() += eps/2.;
609 BOOST_CHECK(aI_approx.isApprox(aI,eps));
612 Inertia::Matrix6 aIvariation = aI.
variation(v);
614 Motion::ActionMatrixType vAction = v.toActionMatrix();
615 Motion::ActionMatrixType vDualAction = v.toDualActionMatrix();
617 Inertia::Matrix6 aImatrix = aI.
matrix();
618 Inertia::Matrix6 aIvariation_ref = vDualAction * aImatrix - aImatrix * vAction;
620 BOOST_CHECK(aIvariation.isApprox(aIvariation_ref));
625 typedef Inertia::Matrix6 Matrix6;
632 BOOST_CHECK(M.isApprox(M_ref));
633 BOOST_CHECK(I.
vxi(v).isApprox(M_ref));
638 typedef Inertia::Matrix6 Matrix6;
645 BOOST_CHECK(M.isApprox(M_ref));
646 BOOST_CHECK(I.
ivx(v).isApprox(M_ref));
651 typedef Inertia::Matrix6 Matrix6;
661 BOOST_CHECK(M3.isApprox(Ivariation));
670 BOOST_CHECK_CLOSE(v[0], I.
mass(), 1e-12);
672 BOOST_CHECK(v.segment<3>(1).isApprox(I.
mass()*I.
lever()));
675 Eigen::Matrix3d I_ov;
676 I_ov << v[4], v[5], v[7],
680 BOOST_CHECK(I_o.isApprox(I_ov));
683 BOOST_CHECK(I2.isApprox(I));
688 std::cout << aI << std::endl;
697 BOOST_CHECK(Y.
cast<
double>() == Y);
698 BOOST_CHECK(Y.
cast<
long double>().cast<
double>() == Y);
705 typedef Eigen::Matrix<double,6,N> Matrix6N;
710 Matrix6N iF = Matrix6N::Random(),jF,jFinv,jF_ref,jFinv_ref;
714 for(
int k=0;k<
N;++k )
715 BOOST_CHECK(jMi.
act(
Force(iF.col(k))).toVector().isApprox(jF.col(k)));
718 BOOST_CHECK(jF_ref.isApprox(jF));
721 BOOST_CHECK(jFinv.isApprox(jF));
723 Matrix6N iF2 = Matrix6N::Random();
726 forceSet::se3Action<ADDTO>(jMi,iF2,jF);
727 BOOST_CHECK(jF.isApprox(jF_ref));
729 Matrix6N iF3 = Matrix6N::Random();
730 jF_ref -= jMi.toDualActionMatrix() * iF3;
732 forceSet::se3Action<RMTO>(jMi,iF3,jF);
733 BOOST_CHECK(jF.isApprox(jF_ref));
737 jFinv_ref = jMi.inverse().toDualActionMatrix() * iF;
738 BOOST_CHECK(jFinv_ref.isApprox(jFinv));
740 jFinv_ref += jMi.inverse().toDualActionMatrix() * iF2;
741 forceSet::se3ActionInverse<ADDTO>(jMi,iF2,jFinv);
742 BOOST_CHECK(jFinv.isApprox(jFinv_ref));
744 jFinv_ref -= jMi.inverse().toDualActionMatrix() * iF3;
745 forceSet::se3ActionInverse<RMTO>(jMi,iF3,jFinv);
746 BOOST_CHECK(jFinv.isApprox(jFinv_ref));
750 for(
int k=0;k<
N;++k )
751 BOOST_CHECK(v.
cross(
Force(iF.col(k))).toVector().isApprox(jF.col(k)));
754 BOOST_CHECK(jF.isApprox(jF_ref));
757 forceSet::motionAction<ADDTO>(
v,iF2,jF);
758 BOOST_CHECK(jF.isApprox(jF_ref));
760 jF_ref -= v.toDualActionMatrix() * iF3;
761 forceSet::motionAction<RMTO>(
v,iF3,jF);
762 BOOST_CHECK(jF.isApprox(jF_ref));
765 Matrix6N iV = Matrix6N::Random(),jV,jV_ref,jVinv,jVinv_ref;
769 for(
int k=0;k<
N;++k )
770 BOOST_CHECK(jMi.act(
Motion(iV.col(k))).toVector().isApprox(jV.col(k)));
772 jV_ref = jMi.toActionMatrix()*iV;
773 BOOST_CHECK(jV.isApprox(jV_ref));
776 BOOST_CHECK(jVinv.isApprox(jV));
778 Matrix6N iV2 = Matrix6N::Random();
779 jV_ref += jMi.toActionMatrix()*iV2;
780 motionSet::se3Action<ADDTO>(jMi,iV2,jV);
781 BOOST_CHECK(jV.isApprox(jV_ref));
783 Matrix6N iV3 = Matrix6N::Random();
784 jV_ref -= jMi.toActionMatrix()*iV3;
785 motionSet::se3Action<RMTO>(jMi,iV3,jV);
786 BOOST_CHECK(jV.isApprox(jV_ref));
790 jVinv_ref = jMi.inverse().toActionMatrix() * iV;
791 BOOST_CHECK(jVinv.isApprox(jVinv_ref));
793 jVinv_ref += jMi.inverse().toActionMatrix()*iV2;
794 motionSet::se3ActionInverse<ADDTO>(jMi,iV2,jVinv);
795 BOOST_CHECK(jVinv.isApprox(jVinv_ref));
797 jVinv_ref -= jMi.inverse().toActionMatrix()*iV3;
798 motionSet::se3ActionInverse<RMTO>(jMi,iV3,jVinv);
799 BOOST_CHECK(jVinv.isApprox(jVinv_ref));
803 for(
int k=0;k<
N;++k )
804 BOOST_CHECK(v.cross(
Motion(iV.col(k))).toVector().isApprox(jV.col(k)));
806 jV_ref = v.toActionMatrix()*iV;
807 BOOST_CHECK(jV.isApprox(jV_ref));
809 jV_ref += v.toActionMatrix()*iV2;
810 motionSet::motionAction<ADDTO>(
v,iV2,jV);
811 BOOST_CHECK(jV.isApprox(jV_ref));
813 jV_ref -= v.toActionMatrix()*iV3;
814 motionSet::motionAction<RMTO>(
v,iV3,jV);
815 BOOST_CHECK(jV.isApprox(jV_ref));
820 for(
int k=0;k<
N;++k )
821 BOOST_CHECK((I*(
Motion(iV.col(k)))).toVector().isApprox(jV.col(k)));
823 jV_ref = I.matrix()*iV;
824 BOOST_CHECK(jV.isApprox(jV_ref));
826 jV_ref += I.matrix()*iV2;
827 motionSet::inertiaAction<ADDTO>(I,iV2,jV);
828 BOOST_CHECK(jV.isApprox(jV_ref));
830 jV_ref -= I.matrix()*iV3;
831 motionSet::inertiaAction<RMTO>(I,iV3,jV);
832 BOOST_CHECK(jV.isApprox(jV_ref));
837 for(
int k=0;k<
N;++k )
838 BOOST_CHECK(
Motion(iV.col(k)).
cross(f).toVector().isApprox(jF.col(k)));
840 for(
int k=0;k<
N;++k )
842 BOOST_CHECK(jF.isApprox(jF_ref));
844 for(
int k=0;k<
N;++k )
846 motionSet::act<ADDTO>(iV2,f,jF);
847 BOOST_CHECK(jF.isApprox(jF_ref));
849 for(
int k=0;k<
N;++k )
851 motionSet::act<RMTO>(iV3,f,jF);
852 BOOST_CHECK(jF.isApprox(jF_ref));
859 typedef Motion::Vector6 Vector6;
861 Vector3 v3(Vector3::Random());
862 Vector6 v6(Vector6::Random());
865 BOOST_CHECK(res1.isApprox(v3));
868 BOOST_CHECK(res2.isApprox(v6.head<3>()));
870 Vector3 res3 =
skew(v3)*v3;
871 BOOST_CHECK(res3.isZero());
873 Vector3 rhs(Vector3::Random());
874 Vector3 res41 =
skew(v3)*rhs;
875 Vector3 res42 = v3.cross(rhs);
877 BOOST_CHECK(res41.isApprox(res42));
887 Vector3
v(Vector3::Random());
888 Matrix3
M(Matrix3::Random());
893 BOOST_CHECK(M.isApprox(Mref));
897 BOOST_CHECK(M.isApprox(Mcopy));
901 BOOST_CHECK(M.isApprox(skew(v)));
910 Vector3
u(Vector3::Random());
911 Vector3
v(Vector3::Random());
917 BOOST_CHECK(res.isApprox(ref));
929 const Scalar alpha = static_cast <Scalar> (
rand()) / static_cast <Scalar> (RAND_MAX);
930 const Vector3 r1 = Axis() * alpha;
931 const Vector3
r2 = alpha * Axis();
933 BOOST_CHECK(r1.isApprox(r2));
935 for(
int k = 0; k < Axis::dim; ++k)
939 BOOST_CHECK(r1[k] == alpha);
940 BOOST_CHECK(r2[k] == alpha);
944 BOOST_CHECK(r1[k] ==
Scalar(0));
945 BOOST_CHECK(r2[k] ==
Scalar(0));
953 using namespace Eigen;
955 Vector3d
v(Vector3d::Random());
956 const double alpha = 3;
957 Vector3d v2(alpha*v);
980 const Scalar alpha = static_cast <Scalar> (
rand()) / static_cast <Scalar> (RAND_MAX);
981 const Motion r1 = Axis() * alpha;
982 const Motion
r2 = alpha * Axis();
986 for(
int k = 0; k < Axis::dim; ++k)
990 BOOST_CHECK(r1.
toVector()[k] == alpha);
991 BOOST_CHECK(r2.
toVector()[k] == alpha);
1012 BOOST_CHECK(v.
cross(AxisVX()).isApprox(v.
cross(vaxis)));
1017 BOOST_CHECK(v.
cross(AxisVY()).isApprox(v.
cross(vaxis)));
1022 BOOST_CHECK(v.
cross(AxisVZ()).isApprox(v.
cross(vaxis)));
1027 BOOST_CHECK(v.
cross(AxisWX()).isApprox(v.
cross(vaxis)));
1032 BOOST_CHECK(v.
cross(AxisWY()).isApprox(v.
cross(vaxis)));
1037 BOOST_CHECK(v.
cross(AxisWZ()).isApprox(v.
cross(vaxis)));
1049 typedef Motion::ActionMatrixType ActionMatrixType;
1050 typedef ActionMatrixType::ColXpr ColType;
1053 ActionMatrixType Sxf,Sxf_ref;
1054 ActionMatrixType S(ActionMatrixType::Identity());
1063 for(
int k = 0; k < 6; ++k)
1065 MotionRefOnColType Scol(S.col(k));
1066 ForceRefOnColType(Sxf_ref.col(k)) = Scol.cross(f);
1069 BOOST_CHECK(Sxf.isApprox(Sxf_ref));
1072 BOOST_AUTO_TEST_SUITE_END ()
Force vxiv(const Motion &v) const
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
Eigen::Matrix< Scalar, 3, 1 > Vector3
const Symmetric3 & inertia() const
Vector10 toDynamicParameters() const
bool isNormalized(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
PlainType normalized() const
void unSkew(const Eigen::MatrixBase< Matrix3 > &M, const Eigen::MatrixBase< Vector3 > &v)
Inverse of skew operator. From a given skew-symmetric matrix M of dimension 3x3, it extracts the supp...
bool isApprox(const ForceDense< M2 > &f, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
ForceTpl< double, 0 > Force
ToVectorConstReturnType toVector() const
Return the force as an Eigen vector.
SE3GroupAction< D >::ReturnType actInv(const D &d) const
by = aXb.actInv(ay)
static InertiaTpl Random()
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Eigen::Matrix< _Scalar, 10, 1, _Options > Vector10
const Vector3 & lever() const
static InertiaTpl FromSphere(const Scalar mass, const Scalar radius)
Computes the Inertia of a sphere defined by its mass and its radius.
static void alphaCross(const Scalar &s, const Eigen::MatrixBase< V3_in > &vin, const Eigen::MatrixBase< V3_out > &vout)
bool isIdentity(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
static InertiaTpl FromEllipsoid(const Scalar mass, const Scalar x, const Scalar y, const Scalar z)
Computes the Inertia of an ellipsoid defined by its mass and main semi-axis dimensions (x...
ActionMatrixType toDualActionMatrix() const
ConstAngularType angular() const
Return the angular part of the force vector.
static void se3ActionInverse(const SE3Tpl< Scalar, Options > &m, const Eigen::MatrixBase< Mat > &iF, Eigen::MatrixBase< MatRet > const &jF)
Inverse SE3 action on a set of forces, represented by a 6xN matrix whose each column represent a spat...
MotionTpl< NewScalar, Options > cast() const
static void act(const Eigen::MatrixBase< Mat > &iV, const ForceDense< ForceDerived > &f, Eigen::MatrixBase< MatRet > const &jF)
Action of a motion set on a force object. The input motion set is represented by a 6xN matrix whose e...
ConstAngularType angular() const
MotionAlgebraAction< OtherSpatialType, Derived >::ReturnType cross(const OtherSpatialType &d) const
ActionMatrixType toActionMatrix() const
The action matrix of .
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...
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > const Scalar & u
Eigen::Quaternion< Scalar, Options > Quaternion
static void se3Action(const SE3Tpl< Scalar, Options > &m, const Eigen::MatrixBase< Mat > &iF, Eigen::MatrixBase< MatRet > const &jF)
SE3 action on a set of forces, represented by a 6xN matrix whose each column represent a spatial forc...
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
bool isApprox(const Shape &s1, const Shape &s2, const FCL_REAL tol)
void cross(const Eigen::MatrixBase< Vector3 > &v, const Eigen::MatrixBase< Matrix3xIn > &Min, const Eigen::MatrixBase< Matrix3xOut > &Mout)
Applies the cross product onto the columns of M.
static void cross(const MotionDense< Derived1 > &min, const MotionDense< Derived2 > &mout)
pinocchio::CartesianAxis< axis > Axis
SE3Tpl< NewScalar, Options > cast() const
SE3Tpl inverse() const
aXb = bXa.inverse()
MotionTpl< double, 0 > Motion
bool isZero(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
static InertiaTpl Identity()
ForceTpl< NewScalar, Options > cast() const
Matrix6 variation(const Motion &v) const
static InertiaTpl FromDynamicParameters(const Eigen::MatrixBase< Vector10Like > ¶ms)
static void cross(const Eigen::MatrixBase< V3_in > &vin, const Eigen::MatrixBase< V3_out > &vout)
InertiaTpl< NewScalar, Options > cast() const
pinocchio::SpatialAxis< axis > Axis
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 ...
traits< SE3Tpl >::Vector3 Vector3
traits< SE3Tpl >::Vector4 Vector4
ForceRef< Vector6 > ref()
ConstLinearType linear() const
Return the linear part of the force vector.
void addSkew(const Eigen::MatrixBase< Vector3Like > &v, const Eigen::MatrixBase< Matrix3Like > &M)
Add skew matrix represented by a 3d vector to a given matrix, i.e. add the antisymmetric matrix repre...
ConstAngularRef rotation() const
BOOST_AUTO_TEST_CASE(test_SE3)
void skewSquare(const Eigen::MatrixBase< V1 > &u, const Eigen::MatrixBase< V2 > &v, const Eigen::MatrixBase< Matrix3 > &C)
Computes the square cross product linear operator C(u,v) such that for any vector w...
Main pinocchio namespace.
ToVectorConstReturnType toVector() const
MotionRef< Vector6 > ref()
static InertiaTpl FromBox(const Scalar mass, const Scalar x, const Scalar y, const Scalar z)
Computes the Inertia of a box defined by its mass and main dimensions (x,y,z).
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Eigen::TensorRef< Tensor > ref(Eigen::TensorRef< Tensor > tensor)
static void ivx(const Motion &v, const InertiaTpl< _Scalar, _Options > &I, const Eigen::MatrixBase< M6 > &Iout)
Time variation operator. It computes the time derivative of an inertia I corresponding to the formula...
Symmetric3Tpl< double, 0 > Symmetric3
bool isApprox(const MotionDense< M2 > &m2, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
SE3GroupAction< D >::ReturnType act(const D &d) const
ay = aXb.act(by)
ActionMatrixType toActionMatrixInverse() const
The action matrix of .
static InertiaTpl FromCylinder(const Scalar mass, const Scalar radius, const Scalar length)
Computes the Inertia of a cylinder defined by its mass, radius and length along the Z axis...
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...
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 ...
MotionZeroTpl< double, 0 > MotionZero
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 forces, represented by a 6xN matrix whose each column represent a spat...
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
traits< SE3Tpl >::Matrix3 Matrix3
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 MotionTpl Random()
Scalar vtiv(const Motion &v) const
ActionMatrixType toActionMatrix() const
static void vxi(const Motion &v, const InertiaTpl< _Scalar, _Options > &I, const Eigen::MatrixBase< M6 > &Iout)
Time variation operator. It computes the time derivative of an inertia I corresponding to the formula...
pinocchio::MotionTpl< Scalar > Motion
ActionMatrixType toDualActionMatrix() const