MRPT  2.0.2
CIMUXSens_MT4.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/core/pimpl.h>
14 #include <mrpt/poses/CPose3D.h>
15 
16 namespace mrpt::hwdrivers
17 {
18 /** A class for interfacing XSens 4th generation Inertial Measuring Units
19  * (IMUs): MTi 10-series, MTi 100-series.
20  * Usage considerations:
21  * - In Windows, you only need to install XSens drivers.
22  * - In Linux, this class requires the system libraries: libusb-1.0 &
23  * libudev (dev packages). Accessing USB devices may require
24  * running the program as super user ("sudo"). To avoid that, Or, install
25  * <code> MRPT/scripts/52-xsens.rules </code> in <code>/etc/udev/rules.d/</code>
26  * to allow access to all users.
27  *
28  * \code
29  * PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
30  * -------------------------------------------------------
31  * [supplied_section_name]
32  * pose_x=0 // Sensor 3D position relative to the robot (meters)
33  * pose_y=0
34  * pose_z=0
35  * pose_yaw=0 // Angles in degrees
36  * pose_pitch=0
37  * pose_roll=0
38  * sensorLabel = <label> // Label of the sensor
39  * #sampleFreq = 100 // The requested rate of sensor packets (default:
40  * 100Hz)
41  * # If a portname is not provided, the first found device will be opened:
42  * #portname_LIN = USB002:005
43  * #portname_WIN = \\?\usb#vid_2639&pid_0003#...
44  * #baudRate = 115200 // Baudrate for communicating, only if
45  * // the port is a COM port
46  * #deviceId = xxxxx // Device ID to open, or first one if empty.
47  * #logFile = xxxx // If provided, will enable XSens SDK's own log
48  * \endcode
49  *
50  * \note Set the environment variable "MRPT_HWDRIVERS_VERBOSE" to "1" to
51  * enable diagnostic information while using this class.
52  *
53  * \ingroup mrpt_hwdrivers_grp
54  */
56 {
58  public:
59  CIMUXSens_MT4();
60  ~CIMUXSens_MT4() override;
61 
62  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
63  * \exception This method must throw an exception with a descriptive
64  * message if some critical error is found.
65  */
66  void doProcess() override;
67 
68  /** Turns on the xSens device and configure it for getting orientation data
69  */
70  void initialize() override;
71 
72  void close();
73 
74  protected:
75  /** The interface to the file: */
76  struct Impl;
78 
79  /** Baudrate, only for COM ports. */
80  int m_port_bauds{0};
81  /** The USB or COM port name (if blank -> autodetect) */
82  std::string m_portname;
83 
84  /** Device ID to open, or first one if empty string. */
85  std::string m_deviceId;
86 
87  std::string m_xsensLogFile;
88 
89  int m_sampleFreq{100};
90 
92 
93  /** See the class documentation at the top for expected parameters */
95  const mrpt::config::CConfigFileBase& configSource,
96  const std::string& iniSection) override;
97 
98  friend class MyXSensCallback;
99 
100 }; // end of class
101 
102 } // namespace mrpt::hwdrivers
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
void initialize() override
Turns on the xSens device and configure it for getting orientation data.
mrpt::poses::CPose3D m_sensorPose
Definition: CIMUXSens_MT4.h:91
void doProcess() override
This method will be invoked at a minimum rate of "process_rate" (Hz)
spimpl::impl_ptr< T > pimpl
Definition: pimpl.h:15
std::string m_deviceId
Device ID to open, or first one if empty string.
Definition: CIMUXSens_MT4.h:85
Contains classes for various device interfaces.
std::string m_portname
The USB or COM port name (if blank -> autodetect)
Definition: CIMUXSens_MT4.h:82
int m_port_bauds
Baudrate, only for COM ports.
Definition: CIMUXSens_MT4.h:80
This class allows loading and storing values and vectors of different types from a configuration text...
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override
See the class documentation at the top for expected parameters.
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:85
mrpt::pimpl< Impl > m_impl
Definition: CIMUXSens_MT4.h:76
A class for interfacing XSens 4th generation Inertial Measuring Units (IMUs): MTi 10-series...
Definition: CIMUXSens_MT4.h:55



Page generated by Doxygen 1.8.14 for MRPT 2.0.2 Git: 9b4fd2465 Mon May 4 16:59:08 2020 +0200 at lun may 4 17:26:07 CEST 2020