Main MRPT website > C++ reference
MRPT logo
obs/CObservationIMU.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 #ifndef CObservationIMU_H
10 #define CObservationIMU_H
11 
13 #include <mrpt/math/CMatrixD.h>
14 #include <mrpt/obs/CObservation.h>
15 #include <mrpt/poses/CPose3D.h>
16 #include <mrpt/poses/CPose2D.h>
17 
18 namespace mrpt
19 {
20 namespace obs
21 {
22 
23  DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE( CObservationIMU , CObservation,OBS_IMPEXP )
24 
25  /** Symbolic names for the indices of IMU data (refer to mrpt::obs::CObservationIMU)
26  * \ingroup mrpt_obs_grp
27  */
29  {
30  /// x-axis acceleration (m/sec<sup>2</sup>)
31  IMU_X_ACC = 0 ,
32  /// y-axis acceleration (m/sec<sup>2</sup>)
34  /// z-axis acceleration (m/sec<sup>2</sup>)
36  /// yaw angular velocity (rad/sec)
38  /// pitch angular velocity (rad/sec)
40  /// roll angular velocity (rad/sec)
42  /// x-axis velocity (m/sec)
44  /// y-axis velocity (m/sec)
46  /// z-axis velocity (m/sec)
48  /// yaw absolute value (rad)
50  /// pitch absolute value (rad)
52  /// roll absolute value (rad)
54  /// x absolute value (meters)
56  /// y absolute value (meters)
58  /// z absolute value (meters)
60  /// x magnetic field value (gauss)
62  /// y magnetic field value (gauss)
64  /// z magnetic field value (gauss)
66  /// air pressure (Pascals)
68  /// altitude from an altimeter (meters)
70  /// temperature (degrees Celsius)
72  /// Orientation Quaternion X
74  /// Orientation Quaternion Y
76  /// Orientation Quaternion Z
78  /// Orientation Quaternion W
80 
81  // Always leave this last value to reflect the number of enum values:
83  };
84 
85  /** This class stores measurements from an Inertial Measurement Unit (IMU) (attitude estimation, raw gyroscope and accelerometer values), altimeters or magnetometers.
86  *
87  * The order of the 21 raw values in each entry of mrpt::obs::CObservationIMU::rawMeasurements is (you can use the TIMUDataIndex "enum" symbolic names):
88  <table>
89  <tr> <td> 0 </td> <td>IMU_X_ACC</td> <td> x-axis acceleration (m/sec<sup>2</sup>)</td> </tr>
90  <tr> <td> 1 </td> <td>IMU_Y_ACC</td> <td> y-axis acceleration (m/sec<sup>2</sup>)</td> </tr>
91  <tr> <td> 2 </td> <td>IMU_Z_ACC</td> <td> z-axis acceleration (m/sec<sup>2</sup>)</td> </tr>
92  <tr> <td> 3 </td> <td>IMU_YAW_VEL</td> <td> yaw angular velocity (rad/sec)</td> </tr>
93  <tr> <td> 4 </td> <td>IMU_PITCH_VEL</td> <td> pitch angular velocity (rad/sec)</td> </tr>
94  <tr> <td> 5 </td> <td>IMU_ROLL_VEL</td> <td> roll angular velocity (rad/sec)</td> </tr>
95  <tr> <td> 6 </td> <td>IMU_X_VEL</td> <td> x-axis velocity (m/sec)</td> </tr>
96  <tr> <td> 7 </td> <td>IMU_Y_VEL</td> <td> y-axis velocity (m/sec)</td> </tr>
97  <tr> <td> 8 </td> <td>IMU_Z_VEL</td> <td> z-axis velocity (m/sec)</td> </tr>
98  <tr> <td> 9 </td> <td>IMU_YAW</td> <td> yaw absolute value (rad)</td> </tr>
99  <tr> <td> 10 </td> <td>IMU_PITCH</td> <td> pitch absolute value (rad)</td> </tr>
100  <tr> <td> 11 </td> <td>IMU_ROLL</td> <td> roll absolute value (rad)</td> </tr>
101  <tr> <td> 12 </td> <td>IMU_X</td> <td> x absolute value (meters)</td> </tr>
102  <tr> <td> 13 </td> <td>IMU_Y</td> <td> y absolute value (meters)</td> </tr>
103  <tr> <td> 14 </td> <td>IMU_Z</td> <td> z absolute value (meters)</td> </tr>
104  <tr> <td> 15 </td> <td>IMU_MAG_X</td> <td> x magnetic field value (gauss)</td> </tr>
105  <tr> <td> 16 </td> <td>IMU_MAG_Y</td> <td> y magnetic field value (gauss)</td> </tr>
106  <tr> <td> 17 </td> <td>IMU_MAG_Z</td> <td> z magnetic field value (gauss)</td> </tr>
107  <tr> <td> 18 </td> <td>IMU_PRESSURE</td> <td> air pressure (Pascals)</td> </tr>
108  <tr> <td> 19 </td> <td>IMU_ALTITUDE</td> <td>altitude from an altimeter (meters)</td> </tr>
109  <tr> <td> 20 </td> <td>IMU_TEMPERATURE</td> <td> temperature (degrees Celsius)</td> </tr>
110  <tr> <td> 21 </td> <td>IMU_ORI_QUAT_X</td> <td> Orientation Quaternion X value </td> </tr>
111  <tr> <td> 22 </td> <td>IMU_ORI_QUAT_Y</td> <td> Orientation Quaternion Y value </td> </tr>
112  <tr> <td> 23 </td> <td>IMU_ORI_QUAT_Z</td> <td> Orientation Quaternion Z value </td> </tr>
113  <tr> <td> 24 </td> <td>IMU_ORI_QUAT_W</td> <td> Orientation Quaternion W value </td> </tr>
114  </table>
115  *
116  * Values from 0 to 5 are direct measurements measured by accelerometers & gyroscopes.
117  * Values at indices from 6 to 14, if present, are estimates (dead reckoning) from the IMU unit.
118  * Values at indices 15 to 20, if present, are from additional sensors.
119  * Values at indices 20 to 24, if present, are a quaternion representation of the orientation.
120  *
121  * \sa CObservation
122  * \ingroup mrpt_obs_grp
123  */
125  {
126  // This must be added to any CSerializable derived class:
128 
129  public:
130  /** Constructor.
131  */
133  sensorPose(),
134  dataIsPresent(25,false),
135  rawMeasurements(25,0)
136  { }
137 
138  /** Destructor
139  */
141  { }
142 
143  /** The pose of the sensor on the robot. */
145 
146  /** Each entry in this vector is true if the corresponding data index contains valid data (the IMU unit supplies that kind of data).
147  * See the top of this page for the meaning of the indices.
148  */
150 
151  /** The accelerometer and/or gyroscope measurements taken by the IMU at the given timestamp.
152  * \sa dataIsPresent, CObservation::timestamp
153  */
154  std::vector<double> rawMeasurements;
155 
156 
157  // See base class docs
158  void getSensorPose( mrpt::poses::CPose3D &out_sensorPose ) const { out_sensorPose = sensorPose; }
159  // See base class docs
160  void setSensorPose( const mrpt::poses::CPose3D &newSensorPose ) { sensorPose = newSensorPose; }
161  // See base class docs
162  virtual void getDescriptionAsText(std::ostream &o) const;
163 
164 
165  }; // End of class def.
166  DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE( CObservationIMU , CObservation,OBS_IMPEXP )
167 
168 
169  } // End of namespace
170 } // End of namespace
171 
172 #endif
std::vector< double > rawMeasurements
The accelerometer and/or gyroscope measurements taken by the IMU at the given timestamp.
pitch absolute value (rad)
void getSensorPose(mrpt::poses::CPose3D &out_sensorPose) const
A general method to retrieve the sensor pose on the robot.
temperature (degrees Celsius)
std::vector< bool > vector_bool
A type for passing a vector of bools.
Definition: types_simple.h:26
x magnetic field value (gauss)
y-axis acceleration (m/sec2)
Orientation Quaternion X.
This class stores measurements from an Inertial Measurement Unit (IMU) (attitude estimation, raw gyroscope and accelerometer values), altimeters or magnetometers.
z-axis acceleration (m/sec2)
x-axis velocity (m/sec)
void setSensorPose(const mrpt::poses::CPose3D &newSensorPose)
A general method to change the sensor pose on the robot.
virtual ~CObservationIMU()
Destructor.
pitch angular velocity (rad/sec)
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
Orientation Quaternion Y.
Orientation Quaternion Z.
z magnetic field value (gauss)
Orientation Quaternion W.
y absolute value (meters)
y magnetic field value (gauss)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
mrpt::poses::CPose3D sensorPose
The pose of the sensor on the robot.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:69
Declares a class that represents any robot's observation.
air pressure (Pascals)
z absolute value (meters)
TIMUDataIndex
Symbolic names for the indices of IMU data (refer to mrpt::obs::CObservationIMU)
yaw absolute value (rad)
y-axis velocity (m/sec)
roll absolute value (rad)
yaw angular velocity (rad/sec)
x absolute value (meters)
roll angular velocity (rad/sec)
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
x-axis acceleration (m/sec2)
z-axis velocity (m/sec)
vector_bool dataIsPresent
Each entry in this vector is true if the corresponding data index contains valid data (the IMU unit s...
altitude from an altimeter (meters)



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