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



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020