Skip to content

A driver for using the Xsens MTw Awinda system within ROS2 using the XDA 2022.

License

Notifications You must be signed in to change notification settings

ksomml/xsens_mtw_driver_ros2

Repository files navigation

Xsens MTw Awinda driver for ROS2

                   !!!  WORK IN PROGRESS !!!
        Any helpful pull requests are really appreciated!

This project contains a ROS2 driver for the Xsens MTw Awinda system sensors.

Image Description

TODO

  • Implement params.yaml for configurable parameters
  • Remove debugging logs
  • Update README
  • Better Code (efficiency, follow coding conventions, etc.)

Hardware

  • Xsens MTw Awinda System

Software

  • The driver is developed upon the XDA 2022, with ROS2 on Ubuntu 22.04 LTS
    • XDA 2022 =/= public XDA 2022 (the public XDA 2022 only supports MTi devices)
  • ISO C++17 Standard corrections have been applied to the XDA 2022 files
  • Instead of using the Xsens Quaternion, this driver uses the state-of-the-art quaternion filter VQF

Prerequisites

Tested with Ubuntu 22.04 and ROS2 Humble.

Features

  • Data recording through button presses
  • Data recording through ros2 services
  • Orientation visualization in RViz for multiple IMUs at the same time
  • (coming soon) Adjustable .yaml config

Usage

The driver upsamples the IMU data and publishes all sensor data into the /xsens_imu_data topic.
Custom messages IMUData.msg, IMUDataArray.msg and Quaternion.msg are used.
The params.yaml is currently not used, due to the problem listed below.
The imu_mapping.yaml is only used for a specific IMU setup. It will just move the orientations in a more "visually correct" position. Using xsens_mtw_visualization without any config, will just publish the TFs of all IMUs next to each other for visibility.

Commands:

  • ros2 run xsens_mtw_driver_ros2 xsens_mtw_manager
  • ros2 run xsens_mtw_driver_ros2 xsens_mtw_visualization
  • ros2 launch xsens_mtw_driver_ros2 xsens_mtw_visualization.launch.py (uses config/imu_mapping.yaml) [experimental]

Custom Services:

  • /xsens_mtw_manager/status
  • /xsens_mtw_manager/get_ready
  • /xsens_mtw_manager/start_recording
  • /xsens_mtw_manager/stop_recording

These services are using the std_srvs/srv/trigger.hpp.

Recording

The time in timestamp is tracked from the start of the node and will be reset to 0 when starting to record by default. This can be changed in the params.yaml in the future.
Currently the recording will only save the quaternions.
Currently the recorded data is saved in the same directy where the node is started.

Supported sensor update rates for the Xsens MTw Awinda System

IMUs desiredUpdateRate (max)
1 - 5 120 Hz
6 - 9 100 Hz
10 80 Hz
11 - 20 60 Hz
21 - 32 40 Hz

Problems

  • Starting the xsens_mtw_manager node through launch files will prevent keyinput readings from conio.c, meaning the params.yaml would need to be loaded by a separate parameter server node.

Xsens MTw Awinda IMU Orientation

Image Description

Troubleshooting

Make sure you are in the correct group:

$ ls -l /dev/ttyUSB0

crw-rw---- 1 root dialout 188, 0 May 4 13:37 /dev/ttyUSB0

$ groups

"username" adm cdrom sudo dip plugdev lpadmin sambashare

Add yourself to the group:

$ sudo usermod -G dialout -a $USER
$ newgrp dialout

More troubleshooting on the xsens_mti_driver page

ROS2 Coding in VSCode ROS2:

Make sure to add /opt/ros/\<ros2version\>/include/** to the includePath in your c_cpp_properties.json from your .vscode folder.

Related links