Class CIMUXSens_MT4

Inheritance Relationships

Base Type

Class Documentation

class CIMUXSens_MT4 : public mrpt::hwdrivers::CGenericSensor

A class for interfacing XSens 4th generation Inertial Measuring Units (IMUs): MTi 10-series, MTi 100-series. Usage considerations:

  • In Windows, you only need to install XSens drivers.

  • In Linux, this class requires the system libraries: libusb-1.0 & libudev (dev packages). Accessing USB devices may require running the program as super user (“sudo”). To avoid that, Or, install MRPT/scripts/52-xsens.rules in /etc/udev/rules.d/ to allow access to all users.

 PARAMETERS IN THE ".INI"-LIKE CONFIGURATION STRINGS:
-------------------------------------------------------
  [supplied_section_name]
   pose_x=0     // Sensor 3D position relative to the robot (meters)
   pose_y=0
   pose_z=0
   pose_yaw=0   // Angles in degrees
   pose_pitch=0
   pose_roll=0
   sensorLabel = <label>   // Label of the sensor
   #sampleFreq  = 100  // The requested rate of sensor packets (default:
100Hz)
   # If a portname is not provided, the first found device will be opened:
   #portname_LIN    = USB002:005
   #portname_WIN    = \\?\usb#vid_2639&pid_0003#...
   #baudRate        = 115200   // Baudrate for communicating, only if
                            // the port is a COM port
   #deviceId     = xxxxx    // Device ID to open, or first one if empty.
   #logFile      = xxxx     // If provided, will enable XSens SDK's own log

Note

Set the environment variable “MRPT_HWDRIVERS_VERBOSE” to “1” to enable diagnostic information while using this class.

Public Functions

CIMUXSens_MT4()
~CIMUXSens_MT4() override
virtual void doProcess() override

This method will be invoked at a minimum rate of “process_rate” (Hz)

Throws:

This – method must throw an exception with a descriptive message if some critical error is found.

virtual void initialize() override

Turns on the xSens device and configure it for getting orientation data

void close()

Protected Functions

virtual void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override

See the class documentation at the top for expected parameters

Protected Attributes

mrpt::pimpl<Impl> m_impl
int m_port_bauds = {0}

Baudrate, only for COM ports.

std::string m_portname

The USB or COM port name (if blank -> autodetect)

std::string m_deviceId

Device ID to open, or first one if empty string.

std::string m_xsensLogFile
int m_sampleFreq = {100}
mrpt::poses::CPose3D m_sensorPose

Friends

friend class MyXSensCallback