liegroup-generic.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 CNRS
3 //
4 
5 #ifndef __pinocchio_lie_group_generic_hpp__
6 #define __pinocchio_lie_group_generic_hpp__
7 
10 
11 namespace pinocchio
12 {
13  template<typename LieGroupCollection>
14  struct LieGroupGenericTpl;
15 
16  template<typename LieGroupCollection>
17  struct traits<LieGroupGenericTpl<LieGroupCollection>>
18  {
20  enum
21  {
25  };
26  };
27 
28  template<typename LieGroupCollection>
29  struct LieGroupGenericTpl
30  : LieGroupBase<LieGroupGenericTpl<LieGroupCollection>>
31  , LieGroupCollection::LieGroupVariant
32  {
33  typedef typename LieGroupCollection::LieGroupVariant Base;
34  typedef typename LieGroupCollection::LieGroupVariant LieGroupVariant;
35 
37  enum
38  {
40  };
41 
42  template<typename LieGroupDerived>
44  : Base(lg_base.derived())
45  {
46  }
47 
48  template<typename LieGroup>
49  LieGroupGenericTpl(const LieGroupVariant & lg_variant)
50  : Base(lg_variant)
51  {
52  }
53 
54  LieGroupGenericTpl(const LieGroupGenericTpl & lg_generic) = default;
55  LieGroupGenericTpl & operator=(const LieGroupGenericTpl & other) = default;
56 
57  const LieGroupVariant & toVariant() const
58  {
59  return static_cast<const LieGroupVariant &>(*this);
60  }
61 
63  {
64  return static_cast<LieGroupVariant &>(*this);
65  }
66 
67  bool isEqual_impl(const LieGroupGenericTpl & other) const
68  {
69  return boost::apply_visitor(
70  visitor::LieGroupEqual<Scalar, Options>(), toVariant(), other.toVariant());
71  }
72 
73  int nq() const
74  {
76  }
77  int nv() const
78  {
80  }
81 
82  bool operator==(const LieGroupGenericTpl & other) const
83  {
84  return isEqual_impl(other);
85  }
86 
87  bool operator!=(const LieGroupGenericTpl & other) const
88  {
89  return this->isDifferent_impl(other);
90  }
91 
92  std::string name() const
93  {
94  return LieGroupNameVisitor::run(*this);
95  }
96  };
97 
98 } // namespace pinocchio
99 
100 #endif // ifndef __pinocchio_lie_group_generic_hpp__
pinocchio::LieGroupGenericTpl
Definition: multibody/liegroup/fwd.hpp:13
pinocchio::LieGroupGenericTpl::operator!=
bool operator!=(const LieGroupGenericTpl &other) const
Definition: liegroup-generic.hpp:87
omniidl_be_python_with_docstring.run
def run(tree, args)
Definition: cmake/hpp/idl/omniidl_be_python_with_docstring.py:140
pinocchio::LieGroupGenericTpl::toVariant
const LieGroupVariant & toVariant() const
Definition: liegroup-generic.hpp:57
pinocchio::LieGroupGenericTpl::toVariant
LieGroupVariant & toVariant()
Definition: liegroup-generic.hpp:62
pinocchio::Options
Options
Definition: joint-configuration.hpp:1082
pinocchio::LieGroupGenericTpl::operator==
bool operator==(const LieGroupGenericTpl &other) const
Definition: liegroup-generic.hpp:82
pinocchio::LieGroupGenericTpl::operator=
LieGroupGenericTpl & operator=(const LieGroupGenericTpl &other)=default
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
pinocchio::traits< LieGroupGenericTpl< LieGroupCollection > >::Scalar
LieGroupCollection::Scalar Scalar
Definition: liegroup-generic.hpp:19
pinocchio::python::Options
@ Options
Definition: expose-contact-inverse-dynamics.cpp:22
pinocchio::LieGroupGenericTpl::nq
int nq() const
Definition: liegroup-generic.hpp:73
codegen-rnea.nq
nq
Definition: codegen-rnea.py:18
pinocchio::LieGroupGenericTpl::name
std::string name() const
Definition: liegroup-generic.hpp:92
pinocchio::LieGroupGenericTpl::LieGroupVariant
LieGroupCollection::LieGroupVariant LieGroupVariant
Definition: liegroup-generic.hpp:34
pinocchio::LieGroupGenericTpl::Options
@ Options
Definition: liegroup-generic.hpp:39
pinocchio::Dynamic
const int Dynamic
Definition: fwd.hpp:140
pinocchio::LieGroupGenericTpl::LieGroupGenericTpl
LieGroupGenericTpl(const LieGroupVariant &lg_variant)
Definition: liegroup-generic.hpp:49
pinocchio::LieGroupGenericTpl::isEqual_impl
bool isEqual_impl(const LieGroupGenericTpl &other) const
Definition: liegroup-generic.hpp:67
pinocchio::LieGroupGenericTpl::Scalar
LieGroupCollection::Scalar Scalar
Definition: liegroup-generic.hpp:36
pinocchio::LieGroupGenericTpl::nv
int nv() const
Definition: liegroup-generic.hpp:77
pinocchio::LieGroupBase
Definition: liegroup-base.hpp:44
pinocchio::LieGroupGenericTpl::Base
LieGroupCollection::LieGroupVariant Base
Definition: liegroup-generic.hpp:33
liegroup-variant-visitors.hpp
pinocchio::LieGroupGenericTpl::LieGroupGenericTpl
LieGroupGenericTpl(const LieGroupBase< LieGroupDerived > &lg_base)
Definition: liegroup-generic.hpp:43
codegen-rnea.nv
nv
Definition: codegen-rnea.py:19
pinocchio::traits
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:71
Base
dcrba.NV
NV
Definition: dcrba.py:536
dpendulum.NQ
int NQ
Definition: dpendulum.py:9
liegroup-base.hpp
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Mon Dec 16 2024 03:41:03