Main MRPT website > C++ reference for MRPT 1.9.9
CIMUXSens.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-2017, 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 CIMUXSens_H
11 #define CIMUXSens_H
12 
14 #include <mrpt/comms/CSerialPort.h>
15 
16 #include <mrpt/poses/CPose3D.h>
17 
18 namespace mrpt
19 {
20 namespace hwdrivers
21 {
22 /** A class for interfacing XSens 3rd generation Inertial Measuring Units
23  *(IMUs), the "XSens MTi" model.
24  * It uses a serial port or USB-to-serial adapter to communicate to the
25  *device, so no special drivers are needed.
26  * For the more recent 4th generation devices, see the class
27  *mrpt::hwdrivers::CIMUXSens_MT4
28  *
29  * See also the application "rawlog-grabber" for a ready-to-use application to
30  *gather data from the scanner.
31  *
32  * \code
33  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
34  * -------------------------------------------------------
35  * [supplied_section_name]
36  * pose_x=0 ; Sensor 3D position relative to the robot (meters)
37  * pose_y=0
38  * pose_z=0
39  * pose_yaw=0 ; Angles in degrees
40  * pose_pitch=0
41  * pose_roll=0
42  * sensorLabel = <label> ; Label of the sensor
43  * COM_port_LIN = /dev/ttyUSB0 ; COM PORT in LINUX (optional. If not
44  *provided, the system will search the connected port)
45  * COM_port_WIN = COM1 ; COM PORT in Windows (optional. If not
46  *provided, the system will search the connected port)
47  * baudRate ; Baudrate for communicating with the
48  *COM port (mandatory for Linux)
49  * (for Windows, if COM_port_WIN is not
50  *provided,
51  *this
52  *value is ignored)
53  * \endcode
54  * \ingroup mrpt_hwdrivers_grp
55  */
57 {
59  protected:
60  /** This serial port will be attempted to be opened automatically when this
61  * class is first used to request data from the device.
62  * \sa comms::CSerialPort
63  */
68 
70 
71  /** Search the port where the sensor is located and connect to it
72  */
73  bool searchPortAndConnect();
74 
75  void* /*xsens::Cmt3 */ m_cmt3_ptr;
76  void* /*CmtDeviceId */ m_deviceId_ptr;
77  /** Timeout counter (for internal use only) */
78  unsigned int m_toutCounter;
79 
80  /** See the class documentation at the top for expected parameters */
82  const mrpt::utils::CConfigFileBase& configSource,
83  const std::string& iniSection);
84 
85  public:
86  /** Constructor
87  */
88  CIMUXSens();
89 
90  /** Destructor
91  */
92  virtual ~CIMUXSens();
93 
94  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
95  * \exception This method must throw an exception with a descriptive
96  * message if some critical error is found.
97  */
98  void doProcess();
99 
100  /** Turns on the xSens device and configure it for getting orientation data
101  */
102  void initialize();
103 
104 }; // end of class
105 
106 } // end of namespace
107 } // end of namespace
108 
109 #endif
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
Definition: datetime.h:32
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
Definition: CIMUXSens.cpp:95
CIMUXSens()
Constructor.
Definition: CIMUXSens.cpp:55
bool searchPortAndConnect()
Search the port where the sensor is located and connect to it.
Definition: CIMUXSens.cpp:222
A class for interfacing XSens 3rd generation Inertial Measuring Units (IMUs), the "XSens MTi" model...
Definition: CIMUXSens.h:56
virtual ~CIMUXSens()
Destructor.
Definition: CIMUXSens.cpp:80
mrpt::system::TTimeStamp m_timeStartTT
Definition: CIMUXSens.h:67
This class allows loading and storing values and vectors of different types from a configuration text...
void initialize()
Turns on the xSens device and configure it for getting orientation data.
Definition: CIMUXSens.cpp:305
GLsizei const GLchar ** string
Definition: glext.h:4101
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
Definition: CIMUXSens.cpp:391
mrpt::poses::CPose3D m_sensorPose
Definition: CIMUXSens.h:69
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
int m_COMbauds
This serial port will be attempted to be opened automatically when this class is first used to reques...
Definition: CIMUXSens.h:64
unsigned __int64 uint64_t
Definition: rptypes.h:50
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned int m_toutCounter
Timeout counter (for internal use only)
Definition: CIMUXSens.h:78
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019