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-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
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::config::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
mrpt::hwdrivers::CIMUXSens::m_sensorPose
mrpt::poses::CPose3D m_sensorPose
Definition: CIMUXSens.h:69
mrpt::hwdrivers::CIMUXSens::doProcess
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
Definition: CIMUXSens.cpp:95
mrpt::hwdrivers::CIMUXSens::m_cmt3_ptr
void * m_cmt3_ptr
Definition: CIMUXSens.h:75
mrpt::hwdrivers::CIMUXSens::~CIMUXSens
virtual ~CIMUXSens()
Destructor.
Definition: CIMUXSens.cpp:80
mrpt::hwdrivers::CIMUXSens::CIMUXSens
CIMUXSens()
Constructor.
Definition: CIMUXSens.cpp:55
mrpt::hwdrivers::CIMUXSens
A class for interfacing XSens 3rd generation Inertial Measuring Units (IMUs), the "XSens MTi" model.
Definition: CIMUXSens.h:56
mrpt::hwdrivers::CIMUXSens::m_com_port
std::string m_com_port
Definition: CIMUXSens.h:65
CSerialPort.h
mrpt::hwdrivers::CIMUXSens::m_timeStartUI
uint64_t m_timeStartUI
Definition: CIMUXSens.h:66
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
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:314
mrpt::system::TTimeStamp
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
Definition: datetime.h:31
mrpt::hwdrivers::CIMUXSens::m_timeStartTT
mrpt::system::TTimeStamp m_timeStartTT
Definition: CIMUXSens.h:67
mrpt::hwdrivers::CIMUXSens::loadConfig_sensorSpecific
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:391
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
CGenericSensor.h
uint64_t
unsigned __int64 uint64_t
Definition: rptypes.h:50
mrpt::hwdrivers::CGenericSensor
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
Definition: CGenericSensor.h:70
CPose3D.h
mrpt::hwdrivers::CIMUXSens::initialize
void initialize()
Turns on the xSens device and configure it for getting orientation data.
Definition: CIMUXSens.cpp:305
mrpt::hwdrivers::CIMUXSens::searchPortAndConnect
bool searchPortAndConnect()
Search the port where the sensor is located and connect to it.
Definition: CIMUXSens.cpp:222
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::hwdrivers::CIMUXSens::m_COMbauds
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
mrpt::hwdrivers::CIMUXSens::m_toutCounter
unsigned int m_toutCounter
Timeout counter (for internal use only)
Definition: CIMUXSens.h:78
mrpt::hwdrivers::CIMUXSens::m_deviceId_ptr
void * m_deviceId_ptr
Definition: CIMUXSens.h:76



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST