MRPT  2.0.4
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 }
mrpt::hwdrivers::CIMUIntersense::doProcess
void doProcess() override
This method will be invoked at a minimum rate of "process_rate" (Hz)
Definition: CIMUIntersense.cpp:72
mrpt::hwdrivers::CIMUIntersense::m_sensitivity
uint32_t m_sensitivity
Definition: CIMUIntersense.h:87
CSerialPort.h
mrpt::hwdrivers::CIMUIntersense::m_sensorPose
mrpt::poses::CPose3D m_sensorPose
Definition: CIMUIntersense.h:83
mrpt::hwdrivers::CIMUIntersense
A class for interfacing Intersense Inertial Measuring Units (IMUs).
Definition: CIMUIntersense.h:73
mrpt::hwdrivers::CIMUIntersense::loadConfig_sensorSpecific
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override
See the class documentation at the top for expected parameters.
Definition: CIMUIntersense.cpp:308
mrpt::hwdrivers
Contains classes for various device interfaces.
Definition: C2DRangeFinderAbstract.h:20
DEFINE_GENERIC_SENSOR
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
Definition: CGenericSensor.h:302
mrpt::hwdrivers::CIMUIntersense::m_nSensors
int m_nSensors
Definition: CIMUIntersense.h:84
mrpt::hwdrivers::CIMUIntersense::~CIMUIntersense
~CIMUIntersense() override
Destructor.
Definition: CIMUIntersense.cpp:60
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:45
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:87
CGenericSensor.h
mrpt::hwdrivers::CIMUIntersense::m_useBuffer
bool m_useBuffer
Definition: CIMUIntersense.h:90
mrpt::system::TTimeStamp
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
mrpt::hwdrivers::CGenericSensor
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
Definition: CGenericSensor.h:71
mrpt::hwdrivers::CIMUIntersense::m_enhancement
uint32_t m_enhancement
Definition: CIMUIntersense.h:88
CPose3D.h
mrpt::hwdrivers::CIMUIntersense::m_timeStartUI
uint32_t m_timeStartUI
Timestamp management.
Definition: CIMUIntersense.h:80
mrpt::hwdrivers::CIMUIntersense::m_prediction
uint32_t m_prediction
Definition: CIMUIntersense.h:89
mrpt::hwdrivers::CIMUIntersense::initialize
void initialize() override
Turns on the iSense device and configure it for getting orientation data.
Definition: CIMUIntersense.cpp:216
mrpt::hwdrivers::CIMUIntersense::m_toutCounter
unsigned int m_toutCounter
Timeout counter (for internal use only)
Definition: CIMUIntersense.h:93
mrpt::hwdrivers::CIMUIntersense::m_timeStartTT
mrpt::system::TTimeStamp m_timeStartTT
Definition: CIMUIntersense.h:81
mrpt::hwdrivers::CIMUIntersense::m_handles_ptr
void * m_handles_ptr
Opaque pointer to specifid iSense IMU structure.
Definition: CIMUIntersense.h:77
mrpt::hwdrivers::CIMUIntersense::CIMUIntersense
CIMUIntersense()
Constructor.
Definition: CIMUIntersense.cpp:43



Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020