Main MRPT website > C++ reference for MRPT 1.9.9
SE_traits.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef MRPT_SE3_TRAITS_H
10 #define MRPT_SE3_TRAITS_H
11 
12 #include <mrpt/poses/CPose3D.h>
13 #include <mrpt/poses/CPose2D.h>
16 
17 namespace mrpt
18 {
19 namespace poses
20 {
21 /** \addtogroup poses_grp
22  * @{ */
23 
24 /** A helper class for SE(2) and SE(3) geometry-related transformations,
25  * on-manifold optimization Jacobians, etc.
26  * \sa SE_traits<2>, SE_traits<3>, CPose3D, CPose2D
27  */
28 template <size_t DOF>
29 struct SE_traits;
30 
31 /** Specialization of SE for 3D poses \sa SE_traits */
32 template <>
33 struct SE_traits<3>
34 {
35  enum
36  {
37  VECTOR_SIZE = 6
38  };
42  typedef CPose3D pose_t;
45 
46  /** Exponential map in SE(3), with XYZ different from the first three values
47  * of "x" \sa pseudo_exp */
48  static inline void exp(const array_t& x, CPose3D& P)
49  {
50  CPose3D::exp(x, P, false);
51  }
52 
53  /** Pseudo-Exponential map in SE(3), with XYZ copied from the first three
54  * values of "x" \sa exp */
55  static inline void pseudo_exp(const array_t& x, CPose3D& P)
56  {
57  CPose3D::exp(x, P, true);
58  }
59 
60  /** Logarithm map in SE(3) */
61  static inline void ln(const CPose3D& P, array_t& x) { P.ln(x); }
62  /** A pseudo-Logarithm map in SE(3), where the output = [X,Y,Z, Ln(ROT)],
63  * that is, the normal
64  * SO(3) logarithm is used for the rotation components, but the
65  * translation is left unmodified. */
66  static void pseudo_ln(const CPose3D& P, array_t& x);
67 
68  /** Return one or both of the following 6x6 Jacobians, useful in graph-slam
69  * problems:
70  * \f[ \frac{\partial pseudoLn(P_1 D P_2^{-1}) }{\partial \epsilon_1}
71  * \f]
72  * \f[ \frac{\partial pseudoLn(P_1 D P_2^{-1}) }{\partial \epsilon_2}
73  * \f]
74  * With \f$ \epsilon_1 \f$ and \f$ \epsilon_2 \f$ being increments in the
75  * linearized manifold for P1 and P2.
76  */
77  static void jacobian_dP1DP2inv_depsilon(
78  const CPose3D& P1DP2inv, matrix_VxV_t* df_de1, matrix_VxV_t* df_de2);
79 
80 }; // end SE_traits
81 
82 /** Specialization of SE for 2D poses \sa SE_traits */
83 template <>
84 struct SE_traits<2>
85 {
86  enum
87  {
88  VECTOR_SIZE = 3
89  };
93  typedef CPose2D pose_t;
96 
97  /** Exponential map in SE(2) */
98  static inline void exp(const array_t& x, CPose2D& P)
99  {
100  P.x(x[0]);
101  P.y(x[1]);
102  P.phi(x[2]);
103  }
104 
105  /** Pseudo-Exponential map in SE(2), in this case identical to exp() */
106  static inline void pseudo_exp(const array_t& x, CPose2D& P) { exp(x, P); }
107  /** Logarithm map in SE(2) */
108  static inline void ln(const CPose2D& P, array_t& x)
109  {
110  x[0] = P.x();
111  x[1] = P.y();
112  x[2] = P.phi();
113  } //-V537
114 
115  /** A pseudo-Logarithm map in SE(2), where the output = [X,Y, Ln(ROT)], that
116  * is, the normal
117  * SO(2) logarithm is used for the rotation components, but the
118  * translation is left unmodified.
119  */
120  static inline void pseudo_ln(const CPose2D& P, array_t& x) { ln(P, x); }
121  /** Return one or both of the following 3x3 Jacobians, useful in graph-slam
122  * problems:
123  * \f[ \frac{\partial pseudoLn(P_1 D P_2^{-1}) }{\partial \epsilon_1}
124  * \f]
125  * \f[ \frac{\partial pseudoLn(P_1 D P_2^{-1}) }{\partial \epsilon_2}
126  * \f]
127  * With \f$ \epsilon_1 \f$ and \f$ \epsilon_2 \f$ being increments in the
128  * linearized manifold for P1 and P2.
129  */
130  static void jacobian_dP1DP2inv_depsilon(
131  const CPose2D& P1DP2inv, matrix_VxV_t* df_de1, matrix_VxV_t* df_de2);
132 
133 }; // end SE_traits
134 
135 /** @} */ // end of grouping
136 
137 } // End of namespace
138 } // End of namespace
139 
140 #endif
static void exp(const array_t &x, CPose3D &P)
Exponential map in SE(3), with XYZ different from the first three values of "x".
Definition: SE_traits.h:48
double x() const
Common members of all points & poses classes.
Definition: CPoseOrPoint.h:135
mrpt::math::CArrayDouble< VECTOR_SIZE > array_t
Definition: SE_traits.h:90
static void ln(const CPose2D &P, array_t &x)
Logarithm map in SE(2)
Definition: SE_traits.h:108
static void ln(const CPose3D &P, array_t &x)
Logarithm map in SE(3)
Definition: SE_traits.h:61
A numeric matrix of compile-time fixed size.
static void exp(const array_t &x, CPose2D &P)
Exponential map in SE(2)
Definition: SE_traits.h:98
mrpt::math::TPoint2D point_t
Definition: SE_traits.h:95
mrpt::math::CMatrixFixedNumeric< double, VECTOR_SIZE, VECTOR_SIZE > matrix_VxV_t
Definition: SE_traits.h:92
mrpt::math::CArrayDouble< VECTOR_SIZE > array_t
Definition: SE_traits.h:39
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle...
Definition: CPose2D.h:40
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
const double & phi() const
Get the phi angle of the 2D pose (in radians)
Definition: CPose2D.h:91
A helper class for SE(2) and SE(3) geometry-related transformations, on-manifold optimization Jacobia...
Definition: SE_traits.h:29
Lightweight 3D pose (three spatial coordinates, plus three angular coordinates).
Lightweight 2D pose.
static void pseudo_exp(const array_t &x, CPose3D &P)
Pseudo-Exponential map in SE(3), with XYZ copied from the first three values of "x".
Definition: SE_traits.h:55
A partial specialization of CArrayNumeric for double numbers.
Definition: CArrayNumeric.h:87
mrpt::math::TPose3D lightweight_pose_t
Definition: SE_traits.h:43
static void pseudo_ln(const CPose2D &P, array_t &x)
A pseudo-Logarithm map in SE(2), where the output = [X,Y, Ln(ROT)], that is, the normal SO(2) logarit...
Definition: SE_traits.h:120
static void pseudo_exp(const array_t &x, CPose2D &P)
Pseudo-Exponential map in SE(2), in this case identical to exp()
Definition: SE_traits.h:106
mrpt::math::CMatrixFixedNumeric< double, VECTOR_SIZE, VECTOR_SIZE > matrix_VxV_t
Definition: SE_traits.h:41
GLenum GLint x
Definition: glext.h:3538
Lightweight 3D point.
Lightweight 2D point.
void ln(mrpt::math::CArrayDouble< 6 > &out_ln) const
Take the logarithm of the 3x4 matrix defined by this pose, generating the corresponding vector in the...
Definition: CPose3D.cpp:872
static CPose3D exp(const mrpt::math::CArrayNumeric< double, 6 > &vect, bool pseudo_exponential=false)
Exponentiate a Vector in the SE(3) Lie Algebra to generate a new CPose3D (static method).
Definition: CPose3D.cpp:832
mrpt::math::TPoint3D point_t
Definition: SE_traits.h:44
mrpt::math::TPose2D lightweight_pose_t
Definition: SE_traits.h:94



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019