bluespace-ai / bluespace_ai_xsens_ros_mti_driver

xsens ros2 driver
BSD 3-Clause "New" or "Revised" License
47 stars 63 forks source link

No MTI device found for MTi-3 on Ubuntu 20.04 and ros2 foxy #3

Closed aserbremen closed 2 years ago

aserbremen commented 2 years ago

I tried installing the bluespace_ai_xsens_ros_mti_driver on a Ubuntu 20.04 machine with ros2 foxy. I followed the installlation guidelines and I am also in the correct group (dialout).

When running

ros2 launch bluespace_ai_xsens_mti_driver xsens_mti_node.launch.py

I get the error:

[xsens_mti_node-1] [ERROR] [1636372933.308295039] [xsens_mti_node]: No MTi device found.

The xsens mtmanager can find the MTi-3 device when clicking 'Scan Single Port' ttyUSB0. But the mtmanager cannot find the device when clicking 'Scan All Ports', I don't know if this information might be helpful.

aserbremen commented 2 years ago

I also tried setting the correct port (/dev/ttyUSB0) or the device_id (from the xsens mtmanager) in the /param/xsens_mti_node.yaml of your package which didn't resolve the issue.

aserbremen commented 2 years ago

I contacted the Xsens support which helped with my problem. After installing the bluespace xsens driver I had to configure the following yaml file: <ros2_ws>/install/bluespace_ai_xsens_mti_driver/share/bluespace_ai_xsens_mti_driver/param/xsens_mti_node.yaml

By setting scan_for_devices to false and setting the correct port (/dev/ttyUSB0) as well as baudrate (115200) the ros package found the xsens IMU.

jollysg commented 2 years ago

@aserbremen Changing the configurations in the xsens_mti_node.yaml currently requires a rebuild of the package. During a colcon build, this yaml file is copied into the install directory in the ros2_ws. Just and FYI, If you have edited the yaml file in the install directory, it will take the configurations from it, however any future rebuilding of the package (directly or indirectly) will end up replacing the edited file in the install folder with the one from the /param/xsens_mti_node.yaml version. So recommended way currently is to edit the /param/... version and compile the package.

aserbremen commented 2 years ago

@jollysg thanks for you reply, I will stick to your suggested method. I think it might make sense, setting certain variables, such as scan_for_devices, port, and baudrate, as command line arguments to the launch file. This is not possible at the moment if I understand correctly.

jollysg commented 2 years ago

@aserbremen Existing launch file is meant simply to give an example of configurations and help with jump starting the use of the package. The use cases for the sensor can expand enormously with different projects, some may even have multiple IMUs requiring multiple driver nodes. Hence, recommended approach would be to create their own launch file with their custom launch configurations.

Here are the two options you can use:

  1. Modify the launch file to your preference, or create your custom. This will require compilation of package after you modify.
  2. Run the executable directly instead of using the launch file, using ROS2.0 conventions for setting parameters. Here is an example to run the node using your custom param file. This method should work without recompilation of the package. ros2 run bluespace_ai_xsens_mti_driver xsens_mti_node --ros-args --params-file <param-file-path/file.yaml>

keep in mind, you can also specify the individual parameters using the parameter argument (-p) with the executable.

For eg, ros2 run bluespace_ai_xsens_mti_driver xsens_mti_node --ros-args -p scan_for_devices:=False -p port:=/dev/xxxx -p baudrate:=115200

aserbremen commented 2 years ago

@jollysg Thanks, I'm new to ros2 and this helped me understand the command line arguments