se3-base.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2015-2021 CNRS INRIA
3 // Copyright (c) 2016 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4 //
5 
6 #ifndef __pinocchio_spatial_se3_base_hpp__
7 #define __pinocchio_spatial_se3_base_hpp__
8 
9 namespace pinocchio
10 {
29  template<class Derived>
30  struct SE3Base : NumericalBase<Derived>
31  {
33 
34  Derived & derived()
35  {
36  return *static_cast<Derived *>(this);
37  }
38  const Derived & derived() const
39  {
40  return *static_cast<const Derived *>(this);
41  }
42 
43  Derived & const_cast_derived() const
44  {
45  return *const_cast<Derived *>(&derived());
46  }
47 
48  ConstAngularRef rotation() const
49  {
50  return derived().rotation_impl();
51  }
52  ConstLinearRef translation() const
53  {
54  return derived().translation_impl();
55  }
56  AngularRef rotation()
57  {
58  return derived().rotation_impl();
59  }
60  LinearRef translation()
61  {
62  return derived().translation_impl();
63  }
64  void rotation(const AngularType & R)
65  {
66  derived().rotation_impl(R);
67  }
68  void translation(const LinearType & t)
69  {
70  derived().translation_impl(t);
71  }
72 
73  HomogeneousMatrixType toHomogeneousMatrix() const
74  {
75  return derived().toHomogeneousMatrix_impl();
76  }
77  operator HomogeneousMatrixType() const
78  {
79  return toHomogeneousMatrix();
80  }
81 
92  ActionMatrixType toActionMatrix() const
93  {
94  return derived().toActionMatrix_impl();
95  }
96  operator ActionMatrixType() const
97  {
98  return toActionMatrix();
99  }
100 
101  template<typename Matrix6Like>
102  void toActionMatrix(const Eigen::MatrixBase<Matrix6Like> & action_matrix) const
103  {
104  derived().toActionMatrix_impl(action_matrix);
105  }
106 
111  ActionMatrixType toActionMatrixInverse() const
112  {
113  return derived().toActionMatrixInverse_impl();
114  }
115 
116  template<typename Matrix6Like>
117  void toActionMatrixInverse(const Eigen::MatrixBase<Matrix6Like> & action_matrix_inverse) const
118  {
119  derived().toActionMatrixInverse_impl(action_matrix_inverse.const_cast_derived());
120  }
121 
122  ActionMatrixType toDualActionMatrix() const
123  {
124  return derived().toDualActionMatrix_impl();
125  }
126 
127  void disp(std::ostream & os) const
128  {
129  static_cast<const Derived *>(this)->disp_impl(os);
130  }
131 
132  template<typename Matrix6Like>
133  void toDualActionMatrix(const Eigen::MatrixBase<Matrix6Like> & dual_action_matrix) const
134  {
135  derived().toDualActionMatrix_impl(dual_action_matrix);
136  }
137 
138  typename SE3GroupAction<Derived>::ReturnType operator*(const Derived & m2) const
139  {
140  return derived().__mult__(m2);
141  }
142 
144  template<typename D>
145  typename SE3GroupAction<D>::ReturnType act(const D & d) const
146  {
147  return derived().act_impl(d);
148  }
149 
151  template<typename D>
152  typename SE3GroupAction<D>::ReturnType actInv(const D & d) const
153  {
154  return derived().actInv_impl(d);
155  }
156 
157  bool operator==(const Derived & other) const
158  {
159  return derived().isEqual(other);
160  }
161 
162  bool operator!=(const Derived & other) const
163  {
164  return !(*this == other);
165  }
166 
167  bool isApprox(
168  const Derived & other,
169  const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
170  {
171  return derived().isApprox_impl(other, prec);
172  }
173 
174  friend std::ostream & operator<<(std::ostream & os, const SE3Base<Derived> & X)
175  {
176  X.disp(os);
177  return os;
178  }
179 
185  const typename traits<Derived>::Scalar & prec =
186  Eigen::NumTraits<typename traits<Derived>::Scalar>::dummy_precision()) const
187  {
188  return derived().isIdentity(prec);
189  }
190 
195  bool isNormalized(const Scalar & prec = Eigen::NumTraits<Scalar>::dummy_precision()) const
196  {
197  return derived().isNormalized(prec);
198  }
199 
203  void normalize()
204  {
205  derived().normalize();
206  }
207 
212  PlainType normalized() const
213  {
214  derived().normalized();
215  }
216 
217  }; // struct SE3Base
218 
219 } // namespace pinocchio
220 
221 #endif // ifndef __pinocchio_spatial_se3_base_hpp__
pinocchio::SE3Base::toHomogeneousMatrix
HomogeneousMatrixType toHomogeneousMatrix() const
Definition: se3-base.hpp:73
pinocchio::NumericalBase
Definition: fwd.hpp:89
pinocchio::SE3Base::operator!=
bool operator!=(const Derived &other) const
Definition: se3-base.hpp:162
pinocchio::SE3Base::actInv
SE3GroupAction< D >::ReturnType actInv(const D &d) const
by = aXb.actInv(ay)
Definition: se3-base.hpp:152
pinocchio::SE3Base::isIdentity
bool isIdentity(const typename traits< Derived >::Scalar &prec=Eigen::NumTraits< typename traits< Derived >::Scalar >::dummy_precision()) const
Definition: se3-base.hpp:184
pinocchio::SE3Base::toActionMatrix
void toActionMatrix(const Eigen::MatrixBase< Matrix6Like > &action_matrix) const
Definition: se3-base.hpp:102
pinocchio::SE3Base::isApprox
bool isApprox(const Derived &other, const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Definition: se3-base.hpp:167
pinocchio::SE3Base::toDualActionMatrix
ActionMatrixType toDualActionMatrix() const
Definition: se3-base.hpp:122
pinocchio::SE3GroupAction::ReturnType
D ReturnType
Definition: spatial/se3.hpp:41
pinocchio::NumericalBase::Scalar
traits< Derived >::Scalar Scalar
Definition: fwd.hpp:91
pinocchio::SE3Base::operator<<
friend std::ostream & operator<<(std::ostream &os, const SE3Base< Derived > &X)
Definition: se3-base.hpp:174
pinocchio::SE3Base::PINOCCHIO_SE3_TYPEDEF_TPL
PINOCCHIO_SE3_TYPEDEF_TPL(Derived)
R
R
pinocchio::SE3Base::const_cast_derived
Derived & const_cast_derived() const
Definition: se3-base.hpp:43
pinocchio::SE3Base::translation
ConstLinearRef translation() const
Definition: se3-base.hpp:52
pinocchio::SE3Base::toActionMatrix
ActionMatrixType toActionMatrix() const
The action matrix of .
Definition: se3-base.hpp:92
pinocchio::SE3Base::disp
void disp(std::ostream &os) const
Definition: se3-base.hpp:127
pinocchio::SE3Base::toActionMatrixInverse
void toActionMatrixInverse(const Eigen::MatrixBase< Matrix6Like > &action_matrix_inverse) const
Definition: se3-base.hpp:117
pinocchio::SE3Base::operator==
bool operator==(const Derived &other) const
Definition: se3-base.hpp:157
pinocchio::SE3Base::operator*
SE3GroupAction< Derived >::ReturnType operator*(const Derived &m2) const
Definition: se3-base.hpp:138
pinocchio::SE3Base::derived
const Derived & derived() const
Definition: se3-base.hpp:38
pinocchio::SE3Base::act
SE3GroupAction< D >::ReturnType act(const D &d) const
ay = aXb.act(by)
Definition: se3-base.hpp:145
pinocchio::SE3Base::derived
Derived & derived()
Definition: se3-base.hpp:34
pinocchio::SE3Base
Base class for rigid transformation.
Definition: se3-base.hpp:30
pinocchio::SE3Base::toActionMatrixInverse
ActionMatrixType toActionMatrixInverse() const
The action matrix of .
Definition: se3-base.hpp:111
pinocchio::SE3Base::normalized
PlainType normalized() const
Definition: se3-base.hpp:212
pinocchio::SE3Base::rotation
ConstAngularRef rotation() const
Definition: se3-base.hpp:48
pinocchio::traits
Common traits structure to fully define base classes for CRTP.
Definition: fwd.hpp:71
t
Transform3f t
pinocchio::SE3Base::toDualActionMatrix
void toDualActionMatrix(const Eigen::MatrixBase< Matrix6Like > &dual_action_matrix) const
Definition: se3-base.hpp:133
pinocchio::SE3Base::isNormalized
bool isNormalized(const Scalar &prec=Eigen::NumTraits< Scalar >::dummy_precision()) const
Definition: se3-base.hpp:195
pinocchio::SE3Base::normalize
void normalize()
Normalize *this in such a way the rotation part of *this lies on SO(3).
Definition: se3-base.hpp:203
d
FCL_REAL d
X
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Thu Dec 19 2024 03:41:32