Main MRPT website > C++ reference
MRPT logo
srba_options_sensor_pose.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-2015, 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 
10 #pragma once
11 
12 #include <mrpt/poses/CPose2D.h>
13 #include <mrpt/poses/CPose3D.h>
15 
16 namespace mrpt { namespace srba {
17 namespace options
18 {
19  /** \defgroup mrpt_srba_options_pose_on_robot Types for RBA_OPTIONS::sensor_pose_on_robot_t
20  * \ingroup mrpt_srba_options */
21 
22  namespace internal {
23  /** Typedefs for determining whether the result of combining a KF pose (+) a sensor
24  * pose leads to a SE(2) or SE(3) pose */
25  template <class SENSOR_POSE_CLASS, size_t KF_POSE_DIMS> struct resulting_pose_t;
26  }
27 
28  /** Usage: A possible type for RBA_OPTIONS::sensor_pose_on_robot_t.
29  * Meaning: The robot pose and the sensor pose coincide, i.e. the sensor pose on the
30  * robot is the identitity transformation.
31  * \ingroup mrpt_srba_options_pose_on_robot */
33  {
34  /** In this case there are no needed parameters */
35  struct parameters_t
36  {
37  };
38 
39  /** Gets the pose of the sensor given the robot pose (robot->sensor) */
40  template <class POSE>
41  static inline void robot2sensor(const POSE & robot, POSE & sensor, const parameters_t &p) {
43  sensor = robot;
44  }
45 
46  /** Converts a pose relative to the robot coordinate frame (P) into a pose relative to
47  * the sensor (RES = P \ominus POSE_IN_ROBOT ) */
48  template <class KF_POSE>
49  static inline void pose_robot2sensor(const KF_POSE & pose_wrt_robot,
50  KF_POSE & pose_wrt_sensor, const parameters_t &p) {
52  pose_wrt_sensor = pose_wrt_robot;
53  }
54 
55  /** Converts a point relative to the robot coordinate frame (P) into a point relative
56  * to the sensor (RES = P \ominus POSE_IN_ROBOT ) */
57  template <class LM_TYPE, class POINT>
58  static inline void point_robot2sensor(const POINT & pt_wrt_robot,
59  POINT & pt_wrt_sensor, const parameters_t &p) {
61  pt_wrt_sensor=pt_wrt_robot;
62  }
63 
64  /** Take into account the possible displacement of the sensor wrt the keyframe when
65  * evaluating the Jacobian dh_dx */
66  template <class MATRIX>
67  static inline void jacob_dh_dx_rotate( MATRIX & dh_dx, const parameters_t &p) {
68  MRPT_UNUSED_PARAM(dh_dx);
70  /* nothing to do, since there's no displacement */
71  }
72  template <class LANDMARK_T>
74  const parameters_t &p) {
76  /* nothing to do, since there's no displacement */
77  }
78  };
79 
80  namespace internal {
81  /** Typedefs for determining whether the result of combining a KF pose (+) a sensor
82  * pose leads to a SE(2) or SE(3) pose */
87  }
88 
89  /** Usage: A possible type for RBA_OPTIONS::sensor_pose_on_robot_t.
90  * Meaning: The sensor is located at an arbitrary SE(3) pose wrt the robot reference frame.
91  * \ingroup mrpt_srba_options_pose_on_robot */
93  {
94  /** In this case there are no needed parameters */
95  struct parameters_t
96  {
98  };
99 
100  /** Gets the pose of the sensor given the robot pose (robot->sensor) */
101  template <class KF_POSE>
102  static inline void robot2sensor(const KF_POSE & robot, mrpt::poses::CPose3D & sensor,
103  const parameters_t &p) {
104  sensor.composeFrom(robot, p.relative_pose);
105  }
106 
107  /** Converts a pose relative to the robot coordinate frame (P) into a pose relative to
108  * the sensor (RES = P \ominus POSE_IN_ROBOT ) */
109  template <class KF_POSE>
110  static inline void pose_robot2sensor(const KF_POSE & pose_wrt_robot,
111  mrpt::poses::CPose3D & pose_wrt_sensor, const parameters_t &p) {
112  pose_wrt_sensor.inverseComposeFrom(pose_wrt_robot, p.relative_pose);
113  }
114 
115  /** Converts a point relative to the robot coordinate frame (P) into a point relative
116  * to the sensor (RES = P \ominus POSE_IN_ROBOT ) */
117  template <class LM_TYPE,class POINT>
118  static inline void point_robot2sensor(const POINT & pt_wrt_robot,
119  POINT & pt_wrt_sensor, const parameters_t &p) {
120  LM_TYPE::inverseComposePosePoint(pt_wrt_robot,pt_wrt_sensor,p.relative_pose);
121  }
122 
123  /** Take into account the possible displacement of the sensor wrt the keyframe when
124  * evaluating the Jacobian dh_dx */
125  template <class MATRIX>
126  static inline void jacob_dh_dx_rotate( MATRIX & dh_dx, const parameters_t &p) {
127  // dh(R2S+x)_dx = dh(x')_dx' * d(x')_dx
128  dh_dx = dh_dx * p.relative_pose.getRotationMatrix().transpose();
129  }
130 
131  template <class LANDMARK_T>
134  }
135  };
136  namespace internal {
137  /** Typedefs for determining whether the result of combining a KF pose (+) a sensor pose leads to a SE(2) or SE(3) pose */
140  }
141 
142 } } } // End of namespaces
void inverseComposeFrom(const CPose3D &A, const CPose3D &B)
Makes this method is slightly more efficient than "this= A - B;" since it avoids the temporary objec...
Typedefs for determining whether the result of combining a KF pose (+) a sensor pose leads to a SE(2)...
static void point_robot2sensor(const POINT &pt_wrt_robot, POINT &pt_wrt_sensor, const parameters_t &p)
Converts a point relative to the robot coordinate frame (P) into a point relative to the sensor (RES ...
static void sensor2robot_point(typename landmark_traits< LANDMARK_T >::array_landmark_t &pt, const parameters_t &p)
static void jacob_dh_dx_rotate(MATRIX &dh_dx, const parameters_t &p)
Take into account the possible displacement of the sensor wrt the keyframe when evaluating the Jacobi...
static void jacob_dh_dx_rotate(MATRIX &dh_dx, const parameters_t &p)
Take into account the possible displacement of the sensor wrt the keyframe when evaluating the Jacobi...
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
Get the 3x3 rotation matrix.
Definition: CPose3D.h:170
static void sensor2robot_point(typename landmark_traits< LANDMARK_T >::array_landmark_t &pt, const parameters_t &p)
static void pose_robot2sensor(const KF_POSE &pose_wrt_robot, KF_POSE &pose_wrt_sensor, const parameters_t &p)
Converts a pose relative to the robot coordinate frame (P) into a pose relative to the sensor (RES = ...
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
static void point_robot2sensor(const POINT &pt_wrt_robot, POINT &pt_wrt_sensor, const parameters_t &p)
Converts a point relative to the robot coordinate frame (P) into a point relative to the sensor (RES ...
static void pose_robot2sensor(const KF_POSE &pose_wrt_robot, mrpt::poses::CPose3D &pose_wrt_sensor, const parameters_t &p)
Converts a pose relative to the robot coordinate frame (P) into a pose relative to the sensor (RES = ...
static void robot2sensor(const POSE &robot, POSE &sensor, const parameters_t &p)
Gets the pose of the sensor given the robot pose (robot->sensor)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A class used to store a 2D pose.
Definition: CPose2D.h:36
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:69
void composeFrom(const CPose3D &A, const CPose3D &B)
Makes "this = A (+) B"; this method is slightly more efficient than "this= A + B;" since it avoids th...
The argument "LM_TRAITS" can be any of those defined in srba/models/landmarks.h (typically, either landmarks::Euclidean3D or landmarks::Euclidean2D).
Definition: srba_types.h:100
Usage: A possible type for RBA_OPTIONS::sensor_pose_on_robot_t.
static void robot2sensor(const KF_POSE &robot, mrpt::poses::CPose3D &sensor, const parameters_t &p)
Gets the pose of the sensor given the robot pose (robot->sensor)
Usage: A possible type for RBA_OPTIONS::sensor_pose_on_robot_t.



Page generated by Doxygen 1.8.9.1 for MRPT 1.3.0 SVN: at Sun Sep 13 03:55:12 UTC 2015