Main MRPT website > C++ reference
MRPT logo
observations.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/utils/TCamera.h>
14 
15 namespace mrpt { namespace srba {
16 namespace observations {
17 
18  /** \defgroup mrpt_srba_observations Observation types
19  * \ingroup mrpt_srba_grp */
20 
21  /** \addtogroup mrpt_srba_observations
22  * @{ */
23 
24  /** Observation = one monocular camera feature (the coordinates of one pixel) */
26  {
27  static const size_t OBS_DIMS = 2; //!< Each observation is one pixel (px,py)
28 
29  /** The observation-specific data structure */
30  struct obs_data_t
31  {
33 
34  /** Converts this observation into a plain array of its parameters */
35  template <class ARRAY>
36  inline void getAsArray(ARRAY &obs) const {
37  obs[0] = px.x;
38  obs[1] = px.y;
39  }
40  };
41 
42  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
43  * hold sensor-specific parameters, etc. needed in the sensor model. */
45  {
47  };
48  };
49 
50  // -------------------------------------------------------------------------------------------------
51 
52  /** Observation = one stereo camera feature (the coordinates of two pixels) */
53  struct StereoCamera
54  {
55  static const size_t OBS_DIMS = 4; //!< Each observation is a pair of pixels (px_l,py_l,px_r,py_r)
56 
57  /** The observation-specific data structure */
58  struct obs_data_t
59  {
61 
62  /** Converts this observation into a plain array of its parameters */
63  template <class ARRAY>
64  inline void getAsArray(ARRAY &obs) const {
65  obs[0] = left_px.x; obs[1] = left_px.y;
66  obs[2] = right_px.x; obs[3] = right_px.y;
67  }
68  };
69 
70  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
71  * hold sensor-specific parameters, etc. needed in the sensor model. */
73  {
75  };
76  };
77 
78  // -------------------------------------------------------------------------------------------------
79 
80  /** Observation = XYZ coordinates of landmarks relative to the sensor */
81  struct Cartesian_3D
82  {
83  static const size_t OBS_DIMS = 3; //!< Each observation is a triplet of coordinates (x,y,z)
84 
85  /** The observation-specific data structure */
86  struct obs_data_t
87  {
89 
90  /** Converts this observation into a plain array of its parameters */
91  template <class ARRAY>
92  inline void getAsArray(ARRAY &obs) const {
93  obs[0] = pt.x; obs[1] = pt.y; obs[2] = pt.z;
94  }
95  };
96 
97  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
98  * hold sensor-specific parameters, etc. needed in the sensor model. */
100  {
101  // This type of observations has no further parameters.
102  };
103  };
104 
105  // -------------------------------------------------------------------------------------------------
106 
107  /** Observation = XY coordinates of landmarks relative to the sensor */
109  {
110  static const size_t OBS_DIMS = 2; //!< Each observation is a pair of coordinates (x,y)
111 
112  /** The observation-specific data structure */
113  struct obs_data_t
114  {
116 
117  /** Converts this observation into a plain array of its parameters */
118  template <class ARRAY>
119  inline void getAsArray(ARRAY &obs) const {
120  obs[0] = pt.x; obs[1] = pt.y;
121  }
122  };
123 
124  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
125  * hold sensor-specific parameters, etc. needed in the sensor model. */
127  {
128  // This type of observations has no further parameters.
129  };
130  };
131 
132  // -------------------------------------------------------------------------------------------------
133 
134  /** Observation = Range+Bearing (yaw & pitch) of landmarks relative to the sensor */
136  {
137  static const size_t OBS_DIMS = 3; //!< Each observation is a triplet of coordinates (range,yaw,pitch)
138 
139  /** The observation-specific data structure */
140  struct obs_data_t
141  {
142  double range; //!< Distance (in meters)
143  double yaw; //!< Angle around +Z (in radians)
144  double pitch; //!< Angle around +Y (in radians)
145 
146  /** Converts this observation into a plain array of its parameters */
147  template <class ARRAY>
148  inline void getAsArray(ARRAY &obs) const {
149  obs[0] = range; obs[1] = yaw; obs[2] = pitch;
150  }
151  };
152 
153  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
154  * hold sensor-specific parameters, etc. needed in the sensor model. */
156  {
157  // This type of observations has no further parameters.
158  };
159  };
160 
161  // -------------------------------------------------------------------------------------------------
162 
163  /** Observation = Range+Bearing (yaw) of landmarks relative to the sensor, for planar environments only. */
165  {
166  static const size_t OBS_DIMS = 2; //!< Each observation is a pair of coordinates (range,yaw)
167 
168  /** The observation-specific data structure */
169  struct obs_data_t
170  {
171  double range; //!< Distance (in meters)
172  double yaw; //!< Angle around +Z (in radians)
173 
174  /** Converts this observation into a plain array of its parameters */
175  template <class ARRAY>
176  inline void getAsArray(ARRAY &obs) const {
177  obs[0] = range; obs[1] = yaw;
178  }
179  };
180 
181  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
182  * hold sensor-specific parameters, etc. needed in the sensor model. */
184  {
185  // This type of observations has no further parameters.
186  };
187  };
188 
189  // -------------------------------------------------------------------------------------------------
190 
191  /** Observation = Relative SE(2) poses (x,y,yaw) */
193  {
194  static const size_t OBS_DIMS = 3; //!< Each observation is a triplet (x,y,yaw)
195 
196  /** The observation-specific data structure */
197  struct obs_data_t
198  {
199  double x,y; //!< Displacement (in meters)
200  double yaw; //!< Angle around +Z (in radians)
201 
202  /** Converts this observation into a plain array of its parameters */
203  template <class ARRAY>
204  inline void getAsArray(ARRAY &obs) const {
205  obs[0]=x; obs[1]=y; obs[2]=yaw;
206  }
207  };
208 
209  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
210  * hold sensor-specific parameters, etc. needed in the sensor model. */
212  {
213  // This type of observations has no further parameters.
214  };
215  };
216 
217  // -------------------------------------------------------------------------------------------------
218 
219  /** Observation = Relative SE(3) poses (x,y,z,yaw,pitch,roll) */
221  {
222  static const size_t OBS_DIMS = 6; //!< Each observation is a vector (x,y,z,yaw,pitch,roll)
223 
224  /** The observation-specific data structure */
225  struct obs_data_t
226  {
227  double x,y,z; //!< Displacement (in meters)
228  double yaw,pitch,roll; //!< Angles (in radians)
229 
230  /** Converts this observation into a plain array of its parameters */
231  template <class ARRAY>
232  inline void getAsArray(ARRAY &obs) const {
233  obs[0]=x; obs[1]=y; obs[2]=z;
234  obs[3]=yaw; obs[4]=pitch; obs[5]=roll;
235  }
236  };
237 
238  /** The type "TObservationParams" must be declared in each "observations::TYPE" to
239  * hold sensor-specific parameters, etc. needed in the sensor model. */
241  {
242  // This type of observations has no further parameters.
243  };
244  };
245 
246  // -------------------------------------------------------------------------------------------------
247 
248  /** @} */
249 
250 }
251 } } // end NS
double yaw
Angle around +Z (in radians)
Definition: observations.h:172
static const size_t OBS_DIMS
Each observation is a pair of coordinates (range,yaw)
Definition: observations.h:166
A pair (x,y) of pixel coordinates (subpixel resolution).
Definition: TPixelCoord.h:21
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:119
The observation-specific data structure.
Definition: observations.h:225
Observation = one monocular camera feature (the coordinates of one pixel)
Definition: observations.h:25
double y
X,Y coordinates.
double pitch
Angle around +Y (in radians)
Definition: observations.h:144
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:92
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:183
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:126
static const size_t OBS_DIMS
Each observation is a pair of coordinates (x,y)
Definition: observations.h:110
The observation-specific data structure.
Definition: observations.h:58
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:176
double z
X,Y,Z coordinates.
The observation-specific data structure.
Definition: observations.h:169
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:232
Structure to hold the parameters of a pinhole stereo camera model.
Definition: TStereoCamera.h:25
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:99
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:240
The observation-specific data structure.
Definition: observations.h:86
The observation-specific data structure.
Definition: observations.h:113
Observation = XY coordinates of landmarks relative to the sensor.
Definition: observations.h:108
Observation = XYZ coordinates of landmarks relative to the sensor.
Definition: observations.h:81
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:211
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:204
double yaw
Angle around +Z (in radians)
Definition: observations.h:143
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:64
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
The observation-specific data structure.
Definition: observations.h:140
Observation = Relative SE(3) poses (x,y,z,yaw,pitch,roll)
Definition: observations.h:220
Observation = Relative SE(2) poses (x,y,yaw)
Definition: observations.h:192
The observation-specific data structure.
Definition: observations.h:30
static const size_t OBS_DIMS
Each observation is a vector (x,y,z,yaw,pitch,roll)
Definition: observations.h:222
static const size_t OBS_DIMS
Each observation is one pixel (px,py)
Definition: observations.h:27
static const size_t OBS_DIMS
Each observation is a triplet of coordinates (range,yaw,pitch)
Definition: observations.h:137
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:148
Lightweight 3D point.
Observation = one stereo camera feature (the coordinates of two pixels)
Definition: observations.h:53
static const size_t OBS_DIMS
Each observation is a pair of pixels (px_l,py_l,px_r,py_r)
Definition: observations.h:55
static const size_t OBS_DIMS
Each observation is a triplet (x,y,yaw)
Definition: observations.h:194
Lightweight 2D point.
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:155
static const size_t OBS_DIMS
Each observation is a triplet of coordinates (x,y,z)
Definition: observations.h:83
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:44
The observation-specific data structure.
Definition: observations.h:197
Structure to hold the parameters of a pinhole camera model.
Definition: TCamera.h:31
Observation = Range+Bearing (yaw & pitch) of landmarks relative to the sensor.
Definition: observations.h:135
void getAsArray(ARRAY &obs) const
Converts this observation into a plain array of its parameters.
Definition: observations.h:36
Observation = Range+Bearing (yaw) of landmarks relative to the sensor, for planar environments only...
Definition: observations.h:164
The type "TObservationParams" must be declared in each "observations::TYPE" to hold sensor-specific p...
Definition: observations.h:72



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