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



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