MRPT  1.9.9
CIMUIntersense.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-2018, 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 #ifndef CIMUIntersense_H
11 #define CIMUIntersense_H
12 
14 #include <mrpt/comms/CSerialPort.h>
15 #include <mrpt/poses/CPose3D.h>
16 
17 namespace mrpt::hwdrivers
18 {
19 // clang-format off
20 /** A class for interfacing Intersense Inertial Measuring Units (IMUs).
21  * It connects to a InterSense inertiaCube 3 sensor and records inertial data.
22  * NOTE: This device provides:
23  * - Euler angles,
24  * - 2 angular velocties (body-frame and navigation-frame)
25  * - X,Y,Z velocity
26  * - 2 accelerations (body-frame and navigation-frame)
27  *
28  * In order to record all this information within the 'rawMeasurements'
29  *vector
30  *in mrpt::obs::CObservationIMU, some of it had to be stored in positions which
31  *weren't intended for the stored data (marked with *):
32  * - Euler angles --> rawMeasurements[IMU_YAW], rawMeasurements[IMU_PITCH],
33  *rawMeasurements[IMU_ROLL]
34  * - Body-frame angular velocity --> rawMeasurements[IMU_YAW_VEL],
35  *rawMeasurements[IMU_PITCH_VEL], rawMeasurements[IMU_ROLL_VEL]
36  * - * Nav-frame angular velocity --> rawMeasurements[IMU_MAG_X],
37  *rawMeasurements[IMU_MAG_Y], rawMeasurements[IMU_MAG_Z]
38  * - XYZ velocity --> rawMeasurements[IMU_X_VEL],
39  *rawMeasurements[IMU_Y_VEL],
40  *rawMeasurements[IMU_Z_VEL]
41  * - Body-frame acceleration --> rawMeasurements[IMU_X_ACC],
42  *rawMeasurements[IMU_Y_ACC], rawMeasurements[IMU_Z_ACC]
43  * - * Nav-frame acceleration --> rawMeasurements[IMU_X],
44  *rawMeasurements[IMU_Y], rawMeasurements[IMU_Z]
45  * Be careful with this when using the grabbed mrpt::obs::CObservationIMU
46  *data.
47  *
48  * See also the application "rawlog-grabber" for a ready-to-use application to
49  *gather data from this sensor.
50  *
51  * \code
52  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
53  * -------------------------------------------------------
54  * [supplied_section_name]
55  * driver = CIMUIntersense
56  * sensorLabel = <label> ; Label of the sensor
57  * pose_x = 0 ; [double] Sensor 3D position relative to the robot (meters)
58  * pose_y = 0
59  * pose_z = 0
60  * pose_yaw = 0 ; [double] Angles in degrees
61  * pose_pitch = 0
62  * pose_roll = 0
63  *
64  * sensitivity = 10 ; [int] Sensor sensitivity (see API documentation)
65  * enhancement = 2 ; [int] Enhancement mode (see API documentation)
66  * prediction = 0 ; [int] Prediction mode (see API documentation)
67  * useBuffer = 0 ; [bool] {0,1} (unused by now) Whether or not use a buffer for storing old data (see API documentation)
68  *
69  * \endcode
70  * \note Class introduced in MRPT 1.3.1
71  * \ingroup mrpt_hwdrivers_grp
72  */ // clang-format
74 {
76  protected:
77  /** Opaque pointer to specifid iSense IMU structure */
78  void* /* ISD_TRACKER_HANDLE* */ m_handles_ptr{nullptr};
79 
80  /** Timestamp management */
83 
85  int m_nSensors{0};
86 
87  /* Configurable parameters */
91  bool m_useBuffer{false};
92 
93  /** Timeout counter (for internal use only) */
94  unsigned int m_toutCounter{0};
95 
96  /** See the class documentation at the top for expected parameters */
98  const mrpt::config::CConfigFileBase& configSource,
99  const std::string& iniSection);
100 
101  public:
102  /** Constructor
103  */
104  CIMUIntersense();
105 
106  /** Destructor
107  */
108  virtual ~CIMUIntersense();
109 
110  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
111  * \exception This method must throw an exception with a descriptive
112  * message if some critical error is found.
113  */
114  void doProcess();
115 
116  /** Turns on the iSense device and configure it for getting orientation data
117  */
118  void initialize();
119 
120 }; // end of class
121 
122 }
123 #endif
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
unsigned int m_toutCounter
Timeout counter (for internal use only)
A class for interfacing Intersense Inertial Measuring Units (IMUs).
Contains classes for various device interfaces.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:40
This class allows loading and storing values and vectors of different types from a configuration text...
mrpt::poses::CPose3D m_sensorPose
void initialize()
Turns on the iSense device and configure it for getting orientation data.
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
GLsizei const GLchar ** string
Definition: glext.h:4101
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
virtual ~CIMUIntersense()
Destructor.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:86
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
void * m_handles_ptr
Opaque pointer to specifid iSense IMU structure.
mrpt::system::TTimeStamp m_timeStartTT
unsigned __int32 uint32_t
Definition: rptypes.h:47
uint32_t m_timeStartUI
Timestamp management.



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020