MRPT  2.0.1
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 
13 #include <mrpt/poses/CPose3D.h>
14 
15 namespace mrpt::hwdrivers
16 {
17 /** A class for interfacing XSens 4th generation Inertial Measuring Units
18  * (IMUs): MTi 10-series, MTi 100-series.
19  * Usage considerations:
20  * - In Windows, you only need to install XSens drivers.
21  * - In Linux, this class requires the system libraries: libusb-1.0 &
22  * libudev (dev packages). Accessing USB devices may require
23  * running the program as super user ("sudo"). To avoid that, Or, install
24  * <code> MRPT/scripts/52-xsens.rules </code> in <code>/etc/udev/rules.d/</code>
25  * to allow access to all users.
26  *
27  * For the older 3rd generation devices, see the class
28  * mrpt::hwdrivers::CIMUXSens
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  * ;sampleFreq = 100 // The requested rate of sensor packets (default:
42  * 100Hz)
43  * ; If a portname is not provided, the first found device will be opened:
44  * ;portname_LIN = USB002:005
45  * ;portname_WIN = \\?\usb#vid_2639&pid_0003#...
46  * ;baudRate = 115200 ; Baudrate for communicating, only
47  * if the port is a COM port
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  protected:
59  /** Baudrate, only for COM ports. */
60  int m_port_bauds{0};
61  /** The USB or COM port name (if blank -> autodetect) */
62  std::string m_portname;
63  int m_sampleFreq{100};
64 
65  uint64_t m_timeStartUI{};
67 
69 
70  void* /*DeviceClass */ m_dev_ptr{nullptr};
71  void* /*XsDeviceId */ m_devid_ptr{nullptr};
72 
73  /** See the class documentation at the top for expected parameters */
75  const mrpt::config::CConfigFileBase& configSource,
76  const std::string& iniSection) override;
77 
78  public:
79  /** Constructor
80  */
81  CIMUXSens_MT4();
82 
83  /** Destructor
84  */
85  ~CIMUXSens_MT4() override;
86 
87  /** This method will be invoked at a minimum rate of "process_rate" (Hz)
88  * \exception This method must throw an exception with a descriptive
89  * message if some critical error is found.
90  */
91  void doProcess() override;
92 
93  /** Turns on the xSens device and configure it for getting orientation data
94  */
95  void initialize() override;
96 
97 }; // end of class
98 
99 } // 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::system::TTimeStamp m_timeStartTT
Definition: CIMUXSens_MT4.h:66
mrpt::poses::CPose3D m_sensorPose
Definition: CIMUXSens_MT4.h:68
void doProcess() override
This method will be invoked at a minimum rate of "process_rate" (Hz)
Contains classes for various device interfaces.
std::string m_portname
The USB or COM port name (if blank -> autodetect)
Definition: CIMUXSens_MT4.h:62
int m_port_bauds
Baudrate, only for COM ports.
Definition: CIMUXSens_MT4.h:60
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 loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override
See the class documentation at the top for expected parameters.
~CIMUXSens_MT4() override
Destructor.
#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
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.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020