liegroups.cpp
Go to the documentation of this file.
1 // Copyright (c) 2017-2020, CNRS INRIA
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 
5 #include <iostream>
6 #include <iomanip>
7 
12 
14 
15 #include <boost/test/unit_test.hpp>
16 #include <boost/utility/binary.hpp>
17 #include <boost/algorithm/string.hpp>
18 #include <boost/mpl/vector.hpp>
19 
20 #define EIGEN_VECTOR_IS_APPROX(Va, Vb, precision) \
21  BOOST_CHECK_MESSAGE( \
22  (Va).isApprox(Vb, precision), "check " #Va ".isApprox(" #Vb ") failed " \
23  "[\n" \
24  << (Va).transpose() << "\n!=\n" \
25  << (Vb).transpose() << "\n]")
26 #define EIGEN_MATRIX_IS_APPROX(Va, Vb, precision) \
27  BOOST_CHECK_MESSAGE( \
28  (Va).isApprox(Vb, precision), "check " #Va ".isApprox(" #Vb ") failed " \
29  "[\n" \
30  << (Va) << "\n!=\n" \
31  << (Vb) << "\n]")
32 
33 using namespace pinocchio;
34 
35 #define VERBOSE false
36 #define IFVERBOSE if (VERBOSE)
37 
38 namespace pinocchio
39 {
40  template<typename Derived>
41  std::ostream & operator<<(std::ostream & os, const LieGroupBase<Derived> & lg)
42  {
43  return os << lg.name();
44  }
45  template<typename LieGroupCollection>
46  std::ostream & operator<<(std::ostream & os, const LieGroupGenericTpl<LieGroupCollection> & lg)
47  {
48  return os << lg.name();
49  }
50 } // namespace pinocchio
51 
52 template<typename T>
53 void test_lie_group_methods(T & jmodel, typename T::JointDataDerived &)
54 {
55  typedef typename LieGroup<T>::type LieGroupType;
56  typedef double Scalar;
57 
58  const Scalar prec = Eigen::NumTraits<Scalar>::dummy_precision();
59  BOOST_TEST_MESSAGE("Testing Joint over " << jmodel.shortname());
60  typedef typename T::ConfigVector_t ConfigVector_t;
61  typedef typename T::TangentVector_t TangentVector_t;
62 
63  ConfigVector_t q1(ConfigVector_t::Random(jmodel.nq()));
64  TangentVector_t q1_dot(TangentVector_t::Random(jmodel.nv()));
65  ConfigVector_t q2(ConfigVector_t::Random(jmodel.nq()));
66 
67  static ConfigVector_t Ones(ConfigVector_t::Ones(jmodel.nq()));
68  const Scalar u = 0.3;
69  // pinocchio::Inertia::Matrix6 Ia(pinocchio::Inertia::Random().matrix());
70  // bool update_I = false;
71 
72  q1 = LieGroupType().randomConfiguration(-Ones, Ones);
73  BOOST_CHECK(LieGroupType().isNormalized(q1));
74 
75  typename T::JointDataDerived jdata = jmodel.createData();
76 
77  // Check integrate
78  jmodel.calc(jdata, q1, q1_dot);
79  SE3 M1 = jdata.M;
80  Motion v1(jdata.v);
81 
82  q2 = LieGroupType().integrate(q1, q1_dot);
83  BOOST_CHECK(LieGroupType().isNormalized(q2));
84  jmodel.calc(jdata, q2);
85  SE3 M2 = jdata.M;
86 
87  double tol_test = 1e2;
88  if (jmodel.shortname() == "JointModelPlanar")
89  tol_test = 5e4;
90 
91  const SE3 M2_exp = M1 * exp6(v1);
92 
93  if (jmodel.shortname() != "JointModelSphericalZYX")
94  {
95  BOOST_CHECK_MESSAGE(
96  M2.isApprox(M2_exp), std::string("Error when integrating1 " + jmodel.shortname()));
97  }
98 
99  // Check integrate when the same vector is passed as input and output
100  ConfigVector_t qTest(ConfigVector_t::Random(jmodel.nq()));
101  TangentVector_t qTest_dot(TangentVector_t::Random(jmodel.nv()));
102  ConfigVector_t qResult(ConfigVector_t::Random(jmodel.nq()));
103  qTest = LieGroupType().randomConfiguration(-Ones, Ones);
104  qResult = LieGroupType().integrate(qTest, qTest_dot);
105  LieGroupType().integrate(qTest, qTest_dot, qTest);
106  BOOST_CHECK_MESSAGE(
107  LieGroupType().isNormalized(qTest),
108  std::string(
109  "Normalization error when integrating with same input and output " + jmodel.shortname()));
110  SE3 MTest, MResult;
111  {
112  typename T::JointDataDerived jdata = jmodel.createData();
113  jmodel.calc(jdata, qTest);
114  MTest = jdata.M;
115  }
116  {
117  typename T::JointDataDerived jdata = jmodel.createData();
118  jmodel.calc(jdata, qResult);
119  MResult = jdata.M;
120  }
121  BOOST_CHECK_MESSAGE(
122  MTest.isApprox(MResult),
123  std::string(
124  "Inconsistent value when integrating with same input and output " + jmodel.shortname()));
125 
126  BOOST_CHECK_MESSAGE(
127  qTest.isApprox(qResult, prec),
128  std::string(
129  "Inconsistent value when integrating with same input and output " + jmodel.shortname()));
130 
131  // Check the reversability of integrate
132  ConfigVector_t q3 = LieGroupType().integrate(q2, -q1_dot);
133  jmodel.calc(jdata, q3);
134  SE3 M3 = jdata.M;
135 
136  BOOST_CHECK_MESSAGE(
137  M3.isApprox(M1), std::string("Error when integrating back " + jmodel.shortname()));
138 
139  // Check interpolate
140  ConfigVector_t q_interpolate = LieGroupType().interpolate(q1, q2, 0.);
141  BOOST_CHECK_MESSAGE(
142  q_interpolate.isApprox(q1), std::string("Error when interpolating " + jmodel.shortname()));
143 
144  q_interpolate = LieGroupType().interpolate(q1, q2, 1.);
145  if (jmodel.shortname() == "JointModelPlanar") // TODO(jcarpent) fix precision loss for
146  // JointModelPlanar log operations
147  BOOST_CHECK_MESSAGE(
148  q_interpolate.isApprox(q2, 1e-8),
149  std::string("Error when interpolating " + jmodel.shortname()));
150  else
151  BOOST_CHECK_MESSAGE(
152  q_interpolate.isApprox(q2, 1e0 * prec),
153  std::string("Error when interpolating " + jmodel.shortname()));
154 
155  if (jmodel.shortname() != "JointModelSphericalZYX")
156  {
157  q_interpolate = LieGroupType().interpolate(q1, q2, u);
158  jmodel.calc(jdata, q_interpolate);
159  SE3 M_interpolate = jdata.M;
160 
161  SE3 M_interpolate_expected = M1 * exp6(u * v1);
162  BOOST_CHECK_MESSAGE(
163  M_interpolate_expected.isApprox(M_interpolate, 1e4 * prec),
164  std::string("Error when interpolating " + jmodel.shortname()));
165  }
166 
167  // Check that difference between two equal configuration is exactly 0
168  TangentVector_t zero = LieGroupType().difference(q1, q1);
169  BOOST_CHECK_MESSAGE(
170  zero.isZero(), std::string("Error: difference between two equal configurations is not 0."));
171  zero = LieGroupType().difference(q2, q2);
172  BOOST_CHECK_MESSAGE(
173  zero.isZero(), std::string("Error: difference between two equal configurations is not 0."));
174 
175  // Check difference
176  // TODO(jcarpent): check the increase of tolerance.
177 
178  TangentVector_t vdiff = LieGroupType().difference(q1, q2);
179  BOOST_CHECK_MESSAGE(
180  vdiff.isApprox(q1_dot, tol_test * prec),
181  std::string("Error when differentiating " + jmodel.shortname()));
182 
183  // Check distance
184  Scalar dist = LieGroupType().distance(q1, q2);
185  BOOST_CHECK_MESSAGE(dist > 0., "distance - wrong results");
186  BOOST_CHECK_SMALL(math::fabs(dist - q1_dot.norm()), tol_test * prec);
187 
188  std::string error_prefix("LieGroup");
189  error_prefix += " on joint " + jmodel.shortname();
190 
191  BOOST_CHECK_MESSAGE(jmodel.nq() == LieGroupType::NQ, std::string(error_prefix + " - nq "));
192  BOOST_CHECK_MESSAGE(jmodel.nv() == LieGroupType::NV, std::string(error_prefix + " - nv "));
193 
194  BOOST_CHECK_MESSAGE(
195  jmodel.nq() == LieGroupType().randomConfiguration(-1 * Ones, Ones).size(),
196  std::string(error_prefix + " - RandomConfiguration dimensions "));
197 
198  ConfigVector_t q_normalize(ConfigVector_t::Random());
199  Eigen::VectorXd q_normalize_ref(q_normalize);
200  if (jmodel.shortname() == "JointModelSpherical")
201  {
202  BOOST_CHECK_MESSAGE(
203  !LieGroupType().isNormalized(q_normalize_ref),
204  std::string(error_prefix + " - !isNormalized "));
205  q_normalize_ref /= q_normalize_ref.norm();
206  }
207  else if (jmodel.shortname() == "JointModelFreeFlyer")
208  {
209  BOOST_CHECK_MESSAGE(
210  !LieGroupType().isNormalized(q_normalize_ref),
211  std::string(error_prefix + " - !isNormalized "));
212  q_normalize_ref.template tail<4>() /= q_normalize_ref.template tail<4>().norm();
213  }
214  else if (boost::algorithm::istarts_with(jmodel.shortname(), "JointModelRUB"))
215  {
216  BOOST_CHECK_MESSAGE(
217  !LieGroupType().isNormalized(q_normalize_ref),
218  std::string(error_prefix + " - !isNormalized "));
219  q_normalize_ref /= q_normalize_ref.norm();
220  }
221  else if (jmodel.shortname() == "JointModelPlanar")
222  {
223  BOOST_CHECK_MESSAGE(
224  !LieGroupType().isNormalized(q_normalize_ref),
225  std::string(error_prefix + " - !isNormalized "));
226  q_normalize_ref.template tail<2>() /= q_normalize_ref.template tail<2>().norm();
227  }
228  BOOST_CHECK_MESSAGE(
229  LieGroupType().isNormalized(q_normalize_ref), std::string(error_prefix + " - isNormalized "));
230  LieGroupType().normalize(q_normalize);
231  BOOST_CHECK_MESSAGE(
232  q_normalize.isApprox(q_normalize_ref), std::string(error_prefix + " - normalize "));
233 }
234 
235 struct TestJoint
236 {
237 
238  template<typename JointModel, typename JointData>
239  static void run_tests(JointModel & jmodel, JointData & jdata)
240  {
241  for (int i = 0; i <= 50; ++i)
242  {
243  test_lie_group_methods(jmodel, jdata);
244  }
245  }
246 
247  template<typename T>
248  void operator()(const T) const
249  {
250  T jmodel;
251  jmodel.setIndexes(0, 0, 0);
252  typename T::JointDataDerived jdata = jmodel.createData();
253 
254  run_tests(jmodel, jdata);
255  }
256 
258  {
259  pinocchio::JointModelRevoluteUnaligned jmodel(1.5, 1., 0.);
260  jmodel.setIndexes(0, 0, 0);
261  pinocchio::JointModelRevoluteUnaligned::JointDataDerived jdata = jmodel.createData();
262 
263  run_tests(jmodel, jdata);
264  }
265 
267  {
268  pinocchio::JointModelPrismaticUnaligned jmodel(1.5, 1., 0.);
269  jmodel.setIndexes(0, 0, 0);
270  pinocchio::JointModelPrismaticUnaligned::JointDataDerived jdata = jmodel.createData();
271 
272  run_tests(jmodel, jdata);
273  }
274 };
275 
277 {
278  template<typename T>
279  void operator()(const T) const
280  {
281  typedef typename T::ConfigVector_t ConfigVector_t;
282  typedef typename T::TangentVector_t TangentVector_t;
283  typedef typename T::JacobianMatrix_t JacobianMatrix_t;
284  typedef typename T::Scalar Scalar;
285 
286  T lg;
287  BOOST_TEST_MESSAGE(lg.name());
288  ConfigVector_t q[2], q_dv[2];
289  q[0] = lg.random();
290  q[1] = lg.random();
293  TangentVector_t va, vb, dv;
294  JacobianMatrix_t J[2];
295  dv.setZero();
296 
297  lg.difference(q[0], q[1], va);
298  lg.template dDifference<ARG0>(q[0], q[1], J[0]);
299  lg.template dDifference<ARG1>(q[0], q[1], J[1]);
300 
301  const Scalar eps = 1e-6;
302  for (int k = 0; k < 2; ++k)
303  {
304  BOOST_TEST_MESSAGE("Checking J" << k << '\n' << J[k]);
305  q_dv[0] = q[0];
306  q_dv[1] = q[1];
307  // Check J[k]
308  for (int i = 0; i < dv.size(); ++i)
309  {
310  dv[i] = eps;
311  lg.integrate(q[k], dv, q_dv[k]);
312  lg.difference(q_dv[0], q_dv[1], vb);
313 
314  // vb - va ~ J[k] * dv
315  TangentVector_t J_dv = J[k].col(i);
316  TangentVector_t vb_va = (vb - va) / eps;
317  EIGEN_VECTOR_IS_APPROX(vb_va, J_dv, 1e-2);
318  dv[i] = 0;
319  }
321  }
322 
323  specificTests(lg);
324  }
325 
326  template<typename T>
327  void specificTests(const T) const
328  {
329  }
330 
331  template<typename Scalar, int Options>
333  {
334 
335  const Scalar prec = Eigen::NumTraits<Scalar>::dummy_precision();
336  typedef SE3Tpl<Scalar> SE3;
338  typedef typename LG_t::ConfigVector_t ConfigVector_t;
339  typedef typename LG_t::JacobianMatrix_t JacobianMatrix_t;
340  typedef typename LG_t::ConstQuaternionMap_t ConstQuaternionMap_t;
341 
342  LG_t lg;
343 
344  ConfigVector_t q[2];
345  q[0] = lg.random();
346  q[1] = lg.random();
347 
348  ConstQuaternionMap_t quat0(q[0].template tail<4>().data()),
349  quat1(q[1].template tail<4>().data());
350  JacobianMatrix_t J[2];
351 
352  lg.template dDifference<ARG0>(q[0], q[1], J[0]);
353  lg.template dDifference<ARG1>(q[0], q[1], J[1]);
354 
355  SE3 om0(typename SE3::Quaternion(q[0].template tail<4>()).matrix(), q[0].template head<3>()),
356  om1(typename SE3::Quaternion(q[1].template tail<4>()).matrix(), q[1].template head<3>()),
357  _1m2(om1.actInv(om0));
358  EIGEN_MATRIX_IS_APPROX(J[1] * _1m2.toActionMatrix(), -J[0], 1e-8);
359 
360  // Test against SE3::Interpolate
361  const Scalar u = 0.3;
362  ConfigVector_t q_interp = lg.interpolate(q[0], q[1], u);
363  ConstQuaternionMap_t quat_interp(q_interp.template tail<4>().data());
364 
365  SE3 M0(quat0, q[0].template head<3>());
366  SE3 M1(quat1, q[1].template head<3>());
367 
368  SE3 M_u = SE3::Interpolate(M0, M1, u);
369  SE3 M_interp(quat_interp, q_interp.template head<3>());
370  BOOST_CHECK(M_u.isApprox(M_interp, prec));
371  }
372 
373  template<typename Scalar, int Options>
377  {
378  typedef SE3Tpl<Scalar> SE3;
382  LG_t;
383  typedef typename LG_t::ConfigVector_t ConfigVector_t;
384  typedef typename LG_t::JacobianMatrix_t JacobianMatrix_t;
385 
386  LG_t lg;
387 
388  ConfigVector_t q[2];
389  q[0] = lg.random();
390  q[1] = lg.random();
391  JacobianMatrix_t J[2];
392 
393  lg.template dDifference<ARG0>(q[0], q[1], J[0]);
394  lg.template dDifference<ARG1>(q[0], q[1], J[1]);
395 
396  typename SE3::Matrix3 oR0(typename SE3::Quaternion(q[0].template tail<4>()).matrix()),
397  oR1(typename SE3::Quaternion(q[1].template tail<4>()).matrix());
398  JacobianMatrix_t X(JacobianMatrix_t::Identity());
399  X.template bottomRightCorner<3, 3>() = oR1.transpose() * oR0;
400  EIGEN_MATRIX_IS_APPROX(J[1] * X, -J[0], 1e-8);
401  }
402 };
403 
404 template<bool around_identity>
406 {
407  template<typename T>
408  void operator()(const T) const
409  {
410  typedef typename T::ConfigVector_t ConfigVector_t;
411  typedef typename T::TangentVector_t TangentVector_t;
412  typedef typename T::JacobianMatrix_t JacobianMatrix_t;
413  typedef typename T::Scalar Scalar;
414 
415  T lg;
416  ConfigVector_t q = lg.random();
417  TangentVector_t v, dq, dv;
418  if (around_identity)
419  v.setZero();
420  else
421  v.setRandom();
422 
423  dq.setZero();
424  dv.setZero();
425 
426  ConfigVector_t q_v = lg.integrate(q, v);
427 
430  JacobianMatrix_t Jq, Jv;
431  lg.dIntegrate_dq(q, v, Jq);
432  lg.dIntegrate_dv(q, v, Jv);
434 
435  const Scalar eps = 1e-6;
436  for (int i = 0; i < v.size(); ++i)
437  {
438  dq[i] = dv[i] = eps;
439  ConfigVector_t q_dq = lg.integrate(q, dq);
440 
441  ConfigVector_t q_dq_v = lg.integrate(q_dq, v);
442  TangentVector_t Jq_dq = Jq.col(i);
443  // q_dv_v - q_v ~ Jq dv
444  TangentVector_t dI_dq = lg.difference(q_v, q_dq_v) / eps;
445  EIGEN_VECTOR_IS_APPROX(dI_dq, Jq_dq, 1e-2);
446 
447  ConfigVector_t q_v_dv = lg.integrate(q, (v + dv).eval());
448  TangentVector_t Jv_dv = Jv.col(i);
449  // q_v_dv - q_v ~ Jv dv
450  TangentVector_t dI_dv = lg.difference(q_v, q_v_dv) / eps;
451  EIGEN_VECTOR_IS_APPROX(dI_dv, Jv_dv, 1e-2);
452 
453  dq[i] = dv[i] = 0;
454  }
455  }
456 };
457 
459 {
460  template<typename T>
461  void operator()(const T) const
462  {
463  typedef typename T::ConfigVector_t ConfigVector_t;
464  typedef typename T::TangentVector_t TangentVector_t;
465  typedef typename T::JacobianMatrix_t JacobianMatrix_t;
466 
469  T lg;
470  BOOST_TEST_MESSAGE(lg.name());
471  ConfigVector_t qa, qb(lg.nq());
472  qa = lg.random();
473  TangentVector_t v(lg.nv());
474  v.setRandom();
475  lg.integrate(qa, v, qb);
476 
477  JacobianMatrix_t Jd_qb, Ji_v;
478 
479  lg.template dDifference<ARG1>(qa, qb, Jd_qb);
480  lg.template dIntegrate<ARG1>(qa, v, Ji_v);
482 
483  BOOST_CHECK_MESSAGE(
484  (Jd_qb * Ji_v).isIdentity(), "Jd_qb\n"
485  << Jd_qb << '\n'
486  << "* Ji_v\n"
487  << Ji_v << '\n'
488  << "!= Identity\n"
489  << Jd_qb * Ji_v << '\n');
490  }
491 };
492 
494 {
495  template<typename T>
496  void operator()(const T) const
497  {
498  typedef typename T::ConfigVector_t ConfigVector_t;
499  typedef typename T::TangentVector_t TangentVector_t;
500  typedef typename T::JacobianMatrix_t JacobianMatrix_t;
501 
504  T lg;
505  BOOST_TEST_MESSAGE(lg.name());
506  ConfigVector_t qa, qb(lg.nq());
507  qa = lg.random();
508  TangentVector_t v(lg.nv()), tvec_at_qb(lg.nv()), tvec_at_qa(lg.nv()), tvec_at_qa_r(lg.nv());
509  v.setRandom();
510  lg.integrate(qa, v, qb);
511 
512  // transport random tangent vector from q1 to q0
513  tvec_at_qb.setRandom();
514  lg.dIntegrateTransport(qa, v, tvec_at_qb, tvec_at_qa, ARG0);
515 
516  // test reverse direction
517  TangentVector_t v_r = -v; // reverse path
518  ConfigVector_t qa_r = lg.integrate(qb, v_r);
519  lg.dIntegrateTransport(qa_r, v_r, tvec_at_qa, tvec_at_qa_r, ARG0);
520 
521  BOOST_CHECK_SMALL((qa - qa_r).norm(), 1e-6); // recover init point on manifold
522  BOOST_CHECK_SMALL((tvec_at_qb - tvec_at_qa_r).norm(), 1e-6);
523 
524  // same test for matrix
525  JacobianMatrix_t J_at_qa(lg.nv(), lg.nv());
526  J_at_qa.setRandom();
527  JacobianMatrix_t J_at_qb(lg.nv(), lg.nv());
528  lg.dIntegrateTransport(qa, v, J_at_qa, J_at_qb, ARG0);
529  JacobianMatrix_t J_at_qa_r(lg.nv(), lg.nv());
530  lg.dIntegrateTransport(qa_r, v_r, J_at_qb, J_at_qa_r, ARG0);
531 
532  BOOST_CHECK_SMALL((J_at_qa - J_at_qa_r).norm(), 1e-6);
533  }
534 };
535 
537 {
538  template<typename T>
539  void operator()(const T) const
540  {
541  typedef typename T::ConfigVector_t ConfigVector_t;
542  typedef typename T::TangentVector_t TangentVector_t;
543  typedef typename T::Scalar Scalar;
544 
545  T lg;
546  ConfigVector_t q = lg.random();
547  TangentVector_t dv(TangentVector_t::Zero(lg.nv()));
548 
549  BOOST_TEST_MESSAGE(lg.name());
550  typedef Eigen::Matrix<Scalar, T::NQ, T::NV> JacobianCoeffs;
551  JacobianCoeffs Jintegrate(JacobianCoeffs::Zero(lg.nq(), lg.nv()));
552  lg.integrateCoeffWiseJacobian(q, Jintegrate);
553  JacobianCoeffs Jintegrate_fd(JacobianCoeffs::Zero(lg.nq(), lg.nv()));
554 
555  const Scalar eps = 1e-8;
556  for (int i = 0; i < lg.nv(); ++i)
557  {
558  dv[i] = eps;
559  ConfigVector_t q_next(ConfigVector_t::Zero(lg.nq()));
560  lg.integrate(q, dv, q_next);
561  Jintegrate_fd.col(i) = (q_next - q) / eps;
562 
563  dv[i] = 0;
564  }
565 
566  EIGEN_MATRIX_IS_APPROX(Jintegrate, Jintegrate_fd, sqrt(eps));
567  }
568 };
569 
570 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
571 
573 {
574  typedef boost::variant<
579  Variant;
580  for (int i = 0; i < 20; ++i)
581  boost::mpl::for_each<Variant::types>(TestJoint());
582 
583  // FIXME JointModelComposite does not work.
584  // boost::mpl::for_each<JointModelVariant::types>(TestJoint());
585 }
586 
588 {
589  typedef double Scalar;
590  enum
591  {
592  Options = 0
593  };
594 
595  typedef boost::mpl::vector<
607  Types;
608  for (int i = 0; i < 20; ++i)
609  boost::mpl::for_each<Types>(LieGroup_Jdifference());
610 }
611 
613 {
614  typedef double Scalar;
615  enum
616  {
617  Options = 0
618  };
619 
620  typedef boost::mpl::vector<
632  Types;
633  for (int i = 0; i < 20; ++i)
634  boost::mpl::for_each<Types>(LieGroup_dIntegrateTransport());
635 }
636 
638 {
639  typedef double Scalar;
640  enum
641  {
642  Options = 0
643  };
644 
645  typedef boost::mpl::vector<
657  Types;
658  for (int i = 0; i < 20; ++i)
659  boost::mpl::for_each<Types>(LieGroup_Jintegrate<false>());
660 
661  // Around identity
662  boost::mpl::for_each<Types>(LieGroup_Jintegrate<true>());
663 }
664 
665 BOOST_AUTO_TEST_CASE(Jintegrate_Jdifference)
666 {
667  typedef double Scalar;
668  enum
669  {
670  Options = 0
671  };
672 
673  typedef boost::mpl::vector<
685  Types;
686  for (int i = 0; i < 20; ++i)
687  boost::mpl::for_each<Types>(LieGroup_JintegrateJdifference());
688 }
689 
690 BOOST_AUTO_TEST_CASE(JintegrateCoeffWise)
691 {
692  typedef double Scalar;
693  enum
694  {
695  Options = 0
696  };
697 
698  typedef boost::mpl::vector<
710  Types;
711  for (int i = 0; i < 20; ++i)
712  boost::mpl::for_each<Types>(LieGroup_JintegrateCoeffWise());
713 
714  {
716  typedef LieGroup::ConfigVector_t ConfigVector_t;
717  LieGroup lg;
718 
719  ConfigVector_t q = lg.random();
720  // TangentVector_t dv(TangentVector_t::Zero(lg.nv()));
721 
722  typedef Eigen::Matrix<Scalar, LieGroup::NQ, LieGroup::NV> JacobianCoeffs;
723  JacobianCoeffs Jintegrate(JacobianCoeffs::Zero(lg.nq(), lg.nv()));
724  lg.integrateCoeffWiseJacobian(q, Jintegrate);
725  }
726 }
727 
728 BOOST_AUTO_TEST_CASE(test_vector_space)
729 {
731  VSO_t::ConfigVector_t q,
732  lo(VSO_t::ConfigVector_t::Constant(-std::numeric_limits<double>::infinity())),
733  // lo(VSO_t::ConfigVector_t::Constant( 0)),
734  // up(VSO_t::ConfigVector_t::Constant( std::numeric_limits<double>::infinity()));
735  up(VSO_t::ConfigVector_t::Constant(0));
736 
737  bool error = false;
738  try
739  {
740  VSO_t().randomConfiguration(lo, up, q);
741  }
742  catch (const std::runtime_error &)
743  {
744  error = true;
745  }
746  BOOST_CHECK_MESSAGE(error, "Random configuration between infinite bounds should return an error");
747 }
748 
750 {
751  // R^1: neutral = [0]
753  Eigen::VectorXd neutral;
754  neutral.resize(1);
755  neutral.setZero();
756  BOOST_CHECK(vs1.nq() == 1);
757  BOOST_CHECK(vs1.nv() == 1);
758  BOOST_CHECK(vs1.name() == "R^1");
759  BOOST_CHECK(vs1.neutral() == neutral);
760  // R^2: neutral = [0, 0]
762  neutral.resize(2);
763  neutral.setZero();
764  BOOST_CHECK(vs2.nq() == 2);
765  BOOST_CHECK(vs2.nv() == 2);
766  BOOST_CHECK(vs2.name() == "R^2");
767  BOOST_CHECK(vs2.neutral() == neutral);
768  // R^3: neutral = [0, 0, 0]
770  neutral.resize(3);
771  neutral.setZero();
772  BOOST_CHECK(vs3.nq() == 3);
773  BOOST_CHECK(vs3.nv() == 3);
774  BOOST_CHECK(vs3.name() == "R^3");
775  BOOST_CHECK(vs3.neutral() == neutral);
776  // SO(2): neutral = [1, 0]
778  neutral.resize(2);
779  neutral[0] = 1;
780  neutral[1] = 0;
781  BOOST_CHECK(so2.nq() == 2);
782  BOOST_CHECK(so2.nv() == 1);
783  BOOST_CHECK(so2.name() == "SO(2)");
784  BOOST_CHECK(so2.neutral() == neutral);
785  // SO(3): neutral = [0, 0, 0, 1]
787  neutral.resize(4);
788  neutral.setZero();
789  neutral[3] = 1;
790  BOOST_CHECK(so3.nq() == 4);
791  BOOST_CHECK(so3.nv() == 3);
792  BOOST_CHECK(so3.name() == "SO(3)");
793  BOOST_CHECK(so3.neutral() == neutral);
794  // SE(2): neutral = [0, 0, 1, 0]
796  neutral.resize(4);
797  neutral.setZero();
798  neutral[2] = 1;
799  BOOST_CHECK(se2.nq() == 4);
800  BOOST_CHECK(se2.nv() == 3);
801  BOOST_CHECK(se2.name() == "SE(2)");
802  BOOST_CHECK(se2.neutral() == neutral);
803  // SE(3): neutral = [0, 0, 0, 0, 0, 0, 1]
805  neutral.resize(7);
806  neutral.setZero();
807  neutral[6] = 1;
808  BOOST_CHECK(se3.nq() == 7);
809  BOOST_CHECK(se3.nv() == 6);
810  BOOST_CHECK(se3.name() == "SE(3)");
811  BOOST_CHECK(se3.neutral() == neutral);
812  // R^2 x SO(2): neutral = [0, 0, 1, 0]
815  r2xso2;
816  neutral.resize(4);
817  neutral.setZero();
818  neutral[2] = 1;
819  BOOST_CHECK(r2xso2.nq() == 4);
820  BOOST_CHECK(r2xso2.nv() == 3);
821  BOOST_CHECK(r2xso2.name() == "R^2*SO(2)");
822  BOOST_CHECK(r2xso2.neutral() == neutral);
823  // R^3 x SO(3): neutral = [0, 0, 0, 0, 0, 0, 1]
826  r3xso3;
827  neutral.resize(7);
828  neutral.setZero();
829  neutral[6] = 1;
830  BOOST_CHECK(r3xso3.nq() == 7);
831  BOOST_CHECK(r3xso3.nv() == 6);
832  BOOST_CHECK(r3xso3.name() == "R^3*SO(3)");
833  BOOST_CHECK(r3xso3.neutral() == neutral);
834 }
835 
836 BOOST_AUTO_TEST_CASE(test_dim_computation)
837 {
839  BOOST_CHECK(dim == 2);
841  BOOST_CHECK(dim == Eigen::Dynamic);
843  BOOST_CHECK(dim == Eigen::Dynamic);
844 }
845 
846 BOOST_AUTO_TEST_CASE(small_distance_test)
847 {
849  Eigen::VectorXd q1(so3.nq());
850  Eigen::VectorXd q2(so3.nq());
851  q1 << 0, 0, -0.1953711450011105244, 0.9807293794421349169;
852  q2 << 0, 0, -0.19537114500111049664, 0.98072937944213492244;
853 
854  BOOST_CHECK_MESSAGE(so3.distance(q1, q2) > 0., "SO3 small distance - wrong results");
855 }
856 
857 template<typename LieGroupCollection>
859 {
860 
862  typedef typename LieGroupGeneric::ConfigVector_t ConfigVector_t;
863  typedef typename LieGroupGeneric::TangentVector_t TangentVector_t;
864 
865  template<typename Derived>
866  void operator()(const LieGroupBase<Derived> & lg) const
867  {
869  test(lg, lg_generic);
870  }
871 
872  template<typename Derived>
873  static void
875  {
876  BOOST_CHECK(lg.nq() == nq(lg_generic));
877  BOOST_CHECK(lg.nv() == nv(lg_generic));
878 
879  BOOST_CHECK(lg.name() == name(lg_generic));
880 
881  BOOST_CHECK(lg.neutral() == neutral(lg_generic));
882 
883  typedef typename LieGroupGeneric::ConfigVector_t ConfigVectorGeneric;
884  typedef typename LieGroupGeneric::TangentVector_t TangentVectorGeneric;
885 
886  ConfigVector_t q0 = lg.random();
887  TangentVector_t v = TangentVector_t::Random(lg.nv());
888  ConfigVector_t qout_ref(lg.nq());
889  lg.integrate(q0, v, qout_ref);
890 
891  ConfigVectorGeneric qout(lg.nq());
892  integrate(lg_generic, ConfigVectorGeneric(q0), TangentVectorGeneric(v), qout);
893  BOOST_CHECK(qout.isApprox(qout_ref));
894 
895  ConfigVector_t q1(nq(lg_generic));
896  random(lg_generic, q1);
897  difference(lg_generic, q0, q1, v);
898  BOOST_CHECK_EQUAL(lg.distance(q0, q1), distance(lg_generic, q0, q1));
899 
900  ConfigVector_t q2(nq(lg_generic));
901  random(lg_generic, q2);
902  normalize(lg_generic, q2);
903  BOOST_CHECK(isNormalized(lg_generic, q2));
904  }
905 };
906 
907 BOOST_AUTO_TEST_CASE(test_liegroup_variant)
908 {
909  boost::mpl::for_each<LieGroupCollectionDefault::LieGroupVariant::types>(
911 }
912 
913 template<typename Lg1, typename Lg2>
914 void test_liegroup_variant_equal(Lg1 lg1, Lg2 lg2)
915 {
916  typedef LieGroupGenericTpl<LieGroupCollectionDefault> LieGroupGeneric;
917  BOOST_CHECK_EQUAL(LieGroupGeneric(lg1), LieGroupGeneric(lg2));
918 }
919 
920 template<typename Lg1, typename Lg2>
921 void test_liegroup_variant_not_equal(Lg1 lg1, Lg2 lg2)
922 {
923  typedef LieGroupGenericTpl<LieGroupCollectionDefault> LieGroupGeneric;
924  BOOST_CHECK_PREDICATE(
925  std::not_equal_to<LieGroupGeneric>(), (LieGroupGeneric(lg1))(LieGroupGeneric(lg2)));
926 }
927 
928 BOOST_AUTO_TEST_CASE(test_liegroup_variant_comparison)
929 {
934 }
935 
936 BOOST_AUTO_TEST_SUITE_END()
simulation-contact-dynamics.T
int T
Definition: simulation-contact-dynamics.py:89
LieGroup_JintegrateJdifference
Definition: liegroups.cpp:458
pinocchio::JointModelRevoluteUnalignedTpl::setIndexes
void setIndexes(JointIndex id, int q, int v)
Definition: joint-model-base.hpp:186
pinocchio::CartesianProductOperation
Definition: cartesian-product.hpp:40
cassie-simulation.qout
def qout
Definition: cassie-simulation.py:251
pinocchio::LieGroupGenericTpl
Definition: multibody/liegroup/fwd.hpp:13
pinocchio::SpecialEuclideanOperationTpl
Definition: special-euclidean.hpp:25
pinocchio::VectorSpaceOperationTpl::name
std::string name() const
Definition: vector-space.hpp:75
TestLieGroupVariantVisitor::LieGroupGeneric
LieGroupGenericTpl< LieGroupCollection > LieGroupGeneric
Definition: liegroups.cpp:861
pinocchio::distance
Scalar distance(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1)
Distance between two configuration vectors, namely .
Definition: joint-configuration.hpp:846
EIGEN_MATRIX_IS_APPROX
#define EIGEN_MATRIX_IS_APPROX(Va, Vb, precision)
Definition: liegroups.cpp:26
pinocchio::JointModelFreeFlyer
JointModelFreeFlyerTpl< context::Scalar > JointModelFreeFlyer
Definition: multibody/joint/fwd.hpp:110
LieGroup_Jintegrate
Definition: liegroups.cpp:405
test
def test(type SolverType)
pinocchio::JointModelTranslation
JointModelTranslationTpl< context::Scalar > JointModelTranslation
Definition: multibody/joint/fwd.hpp:126
pinocchio::u
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > const Scalar & u
Definition: joint-configuration.hpp:1139
LieGroup_dIntegrateTransport::operator()
void operator()(const T) const
Definition: liegroups.cpp:496
autodiff-rnea.dv
dv
Definition: autodiff-rnea.py:27
LieGroup_Jdifference::specificTests
void specificTests(const T) const
Definition: liegroups.cpp:327
pinocchio::Options
Options
Definition: joint-configuration.hpp:1082
floating-base-velocity-viewer.q_next
def q_next
Definition: floating-base-velocity-viewer.py:82
pinocchio::nv
int nv(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNvVisitor to get the dimension of the joint tangent space.
pinocchio::SE3Tpl< context::Scalar, context::Options >
pinocchio::nq
int nq(const JointModelTpl< Scalar, Options, JointCollectionTpl > &jmodel)
Visit a JointModelTpl through JointNqVisitor to get the dimension of the joint configuration space.
inverse-kinematics.i
int i
Definition: inverse-kinematics.py:17
pinocchio::name
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
Visit a LieGroupVariant to get the name of it.
TestLieGroupVariantVisitor::test
static void test(const LieGroupBase< Derived > &lg, const LieGroupGenericTpl< LieGroupCollection > &lg_generic)
Definition: liegroups.cpp:874
pinocchio::JointModelRX
JointModelRevoluteTpl< context::Scalar, context::Options, 0 > JointModelRX
Definition: joint-revolute.hpp:873
setup.data
data
Definition: cmake/cython/setup.in.py:48
q2
q2
test_liegroup_variant_equal
void test_liegroup_variant_equal(Lg1 lg1, Lg2 lg2)
Definition: liegroups.cpp:914
pinocchio::JointModelSpherical
JointModelSphericalTpl< context::Scalar > JointModelSpherical
Definition: multibody/joint/fwd.hpp:73
PINOCCHIO_COMPILER_DIAGNOSTIC_POP
#define PINOCCHIO_COMPILER_DIAGNOSTIC_POP
Definition: include/pinocchio/macros.hpp:130
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
inverse-kinematics-3d.J
J
Definition: inverse-kinematics-3d.py:28
pinocchio::JointDataTpl< context::Scalar >
pinocchio::difference
void difference(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &q0, const Eigen::MatrixBase< ConfigVectorIn2 > &q1, const Eigen::MatrixBase< ReturnType > &dvout)
Compute the tangent vector that must be integrated during one unit time to go from q0 to q1.
Definition: joint-configuration.hpp:193
TestLieGroupVariantVisitor
Definition: liegroups.cpp:858
pinocchio::dIntegrateTransport
void dIntegrateTransport(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< JacobianMatrixType1 > &Jin, const Eigen::MatrixBase< JacobianMatrixType2 > &Jout, const ArgumentPosition arg)
Transport a matrix from the terminal to the initial tangent space of the integrate operation,...
Definition: joint-configuration.hpp:576
test_liegroup_variant_not_equal
void test_liegroup_variant_not_equal(Lg1 lg1, Lg2 lg2)
Definition: liegroups.cpp:921
pinocchio::SE3Tpl::Interpolate
static SE3Tpl Interpolate(const SE3Tpl &A, const SE3Tpl &B, const OtherScalar &alpha)
Linear interpolation on the SE3 manifold.
pinocchio::ARG0
@ ARG0
Definition: fwd.hpp:123
pinocchio::randomConfiguration
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
Definition: joint-configuration.hpp:315
PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED
#define PINOCCHIO_COMPILER_DIAGNOSTIC_IGNORED_MAYBE_UNINITIALIZED
Definition: include/pinocchio/macros.hpp:134
TestJoint::operator()
void operator()(const pinocchio::JointModelPrismaticUnaligned &) const
Definition: liegroups.cpp:266
pinocchio::JointModelRevoluteUnalignedTpl::createData
JointDataDerived createData() const
Definition: joint-revolute-unaligned.hpp:642
pinocchio::JointModelPlanar
JointModelPlanarTpl< context::Scalar > JointModelPlanar
Definition: multibody/joint/fwd.hpp:118
LieGroup_Jintegrate::operator()
void operator()(const T) const
Definition: liegroups.cpp:408
pinocchio::SE3Tpl< context::Scalar, context::Options >::Matrix3
traits< SE3Tpl >::Matrix3 Matrix3
Definition: spatial/se3-tpl.hpp:56
pinocchio::JointModelRY
JointModelRevoluteTpl< context::Scalar, context::Options, 1 > JointModelRY
Definition: joint-revolute.hpp:877
pinocchio::LieGroupBase::name
std::string name() const
Get name of instance.
pinocchio::isNormalized
bool isNormalized(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision())
Check whether a configuration vector is normalized within the given precision provided by prec.
Definition: joint-configuration.hpp:933
cartesian-product-variant.hpp
TestLieGroupVariantVisitor::TangentVector_t
LieGroupGeneric::TangentVector_t TangentVector_t
Definition: liegroups.cpp:863
pinocchio::LieGroupGenericTpl::name
std::string name() const
Definition: liegroup-generic.hpp:92
LieGroup_Jdifference::specificTests
void specificTests(const CartesianProductOperation< VectorSpaceOperationTpl< 3, Scalar, Options >, SpecialOrthogonalOperationTpl< 3, Scalar, Options >>) const
Definition: liegroups.cpp:374
pinocchio::random
void random(const LieGroupGenericTpl< LieGroupCollection > &lg, const Eigen::MatrixBase< Config_t > &qout)
pinocchio::VectorSpaceOperationTpl::nq
Index nq() const
Definition: vector-space.hpp:61
EIGEN_VECTOR_IS_APPROX
#define EIGEN_VECTOR_IS_APPROX(Va, Vb, precision)
Definition: liegroups.cpp:20
pinocchio::integrate
void integrate(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType > &v, const Eigen::MatrixBase< ReturnType > &qout)
Integrate a configuration vector for the specified model for a tangent vector during one unit time.
Definition: joint-configuration.hpp:70
pinocchio::VectorSpaceOperationTpl::nv
Index nv() const
Definition: vector-space.hpp:65
pinocchio::LieGroupBase::derived
Derived & derived()
Definition: liegroup-base.hpp:707
collision-with-point-clouds.X
X
Definition: collision-with-point-clouds.py:36
joint-generic.hpp
pinocchio::Dynamic
const int Dynamic
Definition: fwd.hpp:140
TestJoint
Definition: joint-generic.cpp:282
pinocchio::LieGroupBase::nv
Index nv() const
Get dimension of Lie Group tangent space.
pinocchio::exp6
SE3Tpl< typename MotionDerived::Scalar, PINOCCHIO_EIGEN_PLAIN_TYPE(typename MotionDerived::Vector3)::Options > exp6(const MotionDense< MotionDerived > &nu)
Exp: se3 -> SE3.
Definition: spatial/explog.hpp:347
pinocchio::JointModelTpl< context::Scalar >
liegroup-generic.hpp
pinocchio::SpecialOrthogonalOperationTpl
Definition: special-orthogonal.hpp:18
LieGroup_dIntegrateTransport
Definition: liegroups.cpp:493
size
FCL_REAL size() const
pinocchio::JointModelRZ
JointModelRevoluteTpl< context::Scalar, context::Options, 2 > JointModelRZ
Definition: joint-revolute.hpp:881
pinocchio::JointModelPY
JointModelPrismaticTpl< context::Scalar, context::Options, 1 > JointModelPY
Definition: joint-prismatic.hpp:781
TestJoint::operator()
void operator()(const T) const
Definition: liegroups.cpp:248
pinocchio::LieGroupBase::neutral
ConfigVector_t neutral() const
Get neutral element as a vector.
pinocchio::LieGroupBase::random
void random(const Eigen::MatrixBase< Config_t > &qout) const
Generate a random joint configuration, normalizing quaternions when necessary.
pinocchio::q0
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > & q0
Definition: joint-configuration.hpp:1137
pinocchio::eval_set_dim
Definition: cartesian-product.hpp:13
dist
FCL_REAL & dist(short i)
PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
#define PINOCCHIO_COMPILER_DIAGNOSTIC_PUSH
macros for pragma push/pop/ignore deprecated warnings
Definition: include/pinocchio/macros.hpp:129
pinocchio::JointModelPrismaticUnalignedTpl::createData
JointDataDerived createData() const
Definition: joint-prismatic-unaligned.hpp:617
TestLieGroupVariantVisitor::operator()
void operator()(const LieGroupBase< Derived > &lg) const
Definition: liegroups.cpp:866
pinocchio::operator<<
std::ostream & operator<<(std::ostream &os, const FrameTpl< Scalar, Options > &f)
Definition: multibody/frame.hpp:253
pinocchio::JointModelPZ
JointModelPrismaticTpl< context::Scalar, context::Options, 2 > JointModelPZ
Definition: joint-prismatic.hpp:785
LieGroup_Jdifference::operator()
void operator()(const T) const
Definition: liegroups.cpp:279
pinocchio::LieGroupBase
Definition: liegroup-base.hpp:44
pinocchio::q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
Definition: joint-configuration.hpp:1083
pinocchio::JointModelRUBX
JointModelRevoluteUnboundedTpl< context::Scalar, context::Options, 0 > JointModelRUBX
Definition: joint-revolute-unbounded.hpp:264
LieGroup_JintegrateJdifference::operator()
void operator()(const T) const
Definition: liegroups.cpp:461
pinocchio::v
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
Definition: joint-configuration.hpp:1084
pinocchio::LieGroup
Definition: liegroup.hpp:31
LieGroup_JintegrateCoeffWise
Definition: liegroups.cpp:536
pinocchio::SE3Tpl< context::Scalar, context::Options >::Quaternion
Eigen::Quaternion< Scalar, Options > Quaternion
Definition: spatial/se3-tpl.hpp:54
LieGroup_JintegrateCoeffWise::operator()
void operator()(const T) const
Definition: liegroups.cpp:539
pinocchio::JointModelRevoluteUnalignedTpl
Definition: multibody/joint/fwd.hpp:38
pinocchio::JointModelPrismaticUnalignedTpl
Definition: multibody/joint/fwd.hpp:94
test_lie_group_methods
void test_lie_group_methods(T &jmodel, typename T::JointDataDerived &)
Definition: liegroups.cpp:53
pinocchio::LieGroupBase::integrate
void integrate(const Eigen::MatrixBase< ConfigIn_t > &q, const Eigen::MatrixBase< Tangent_t > &v, const Eigen::MatrixBase< ConfigOut_t > &qout) const
Integrate a joint's configuration with a tangent vector during one unit time duration.
TestLieGroupVariantVisitor::ConfigVector_t
LieGroupGeneric::ConfigVector_t ConfigVector_t
Definition: liegroups.cpp:862
liegroup.hpp
LieGroup_Jdifference::specificTests
void specificTests(const SpecialEuclideanOperationTpl< 3, Scalar, Options >) const
Definition: liegroups.cpp:332
pinocchio::JointModelPrismaticUnalignedTpl::setIndexes
void setIndexes(JointIndex id, int q, int v)
Definition: joint-model-base.hpp:186
pinocchio::q1
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorIn1 > const Eigen::MatrixBase< ConfigVectorIn2 > & q1
Definition: joint-configuration.hpp:1138
dcrba.eps
int eps
Definition: dcrba.py:458
dcrba.dq
dq
Definition: dcrba.py:459
TestJoint::run_tests
static void run_tests(JointModel &jmodel, JointData &jdata)
Definition: liegroups.cpp:239
pinocchio::JointModelPX
JointModelPrismaticTpl< context::Scalar, context::Options, 0 > JointModelPX
Definition: joint-prismatic.hpp:777
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(test_all)
Definition: liegroups.cpp:572
pinocchio::JointModelSphericalZYX
JointModelSphericalZYXTpl< context::Scalar > JointModelSphericalZYX
Definition: multibody/joint/fwd.hpp:81
pinocchio::neutral
void neutral(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ReturnType > &qout)
Return the neutral configuration element related to the model configuration space.
Definition: joint-configuration.hpp:363
LieGroup_Jdifference
Definition: liegroups.cpp:276
pinocchio::VectorSpaceOperationTpl
Definition: vector-space.hpp:16
pinocchio::JointModelRevoluteUnaligned
JointModelRevoluteUnalignedTpl< context::Scalar > JointModelRevoluteUnaligned
Definition: multibody/joint/fwd.hpp:38
liegroup-collection.hpp
pinocchio::LieGroupBase::nq
Index nq() const
dim
int dim
pinocchio::JointModelPrismaticUnaligned
JointModelPrismaticUnalignedTpl< context::Scalar > JointModelPrismaticUnaligned
Definition: multibody/joint/fwd.hpp:94
pinocchio::SE3
SE3Tpl< context::Scalar, context::Options > SE3
Definition: spatial/fwd.hpp:64
pinocchio::MotionTpl
Definition: context/casadi.hpp:27
dcrba.NV
NV
Definition: dcrba.py:536
dpendulum.NQ
int NQ
Definition: dpendulum.py:9
pinocchio.utils.zero
def zero(n)
Definition: bindings/python/pinocchio/utils.py:37
TestJoint::operator()
void operator()(const pinocchio::JointModelRevoluteUnaligned &) const
Definition: liegroups.cpp:257
pinocchio::JointModelRevoluteUnboundedTpl
Definition: multibody/joint/fwd.hpp:55
X
pinocchio::LieGroupBase::distance
Scalar distance(const Eigen::MatrixBase< ConfigL_t > &q0, const Eigen::MatrixBase< ConfigR_t > &q1) const
Distance between two configurations of the joint.
pinocchio::normalize
void normalize(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorType > &qout)
Normalize a configuration vector.
Definition: joint-configuration.hpp:887
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27
pinocchio::VectorSpaceOperationTpl::neutral
ConfigVector_t neutral() const
Definition: vector-space.hpp:70
pinocchio::JointModelRUBY
JointModelRevoluteUnboundedTpl< context::Scalar, context::Options, 1 > JointModelRUBY
Definition: joint-revolute-unbounded.hpp:268


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:11