ROS2 xsens autoware driver

asked 2021-01-19 12:22:07 -0600

Abdullah Mohiuddin gravatar image

## Description

We are trying to use the Xsens driver, however there are no instructions on how to use the Xsens driver. When we are trying to launch the xsens node, we also select the parameter yaml file to be used while launching the node. However when we are doing that we are getting the error.

expected [string] got [not set]

How to Reproduce

We use a launch file as follows:

``` from ament_index_python.packages import get_package_share_directory from launch import LaunchDescription from launch.actions import DeclareLaunchArgument from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from launch.substitutions import LaunchConfiguration from launch_ros.actions import Node import yaml

def generate_launch_description(): param_file = os.path.join( get_package_share_directory('xsens_nodes'), 'param', 'xsens_test.param.yaml' )
with open(param_file, 'r') as f: params = yaml.safe_load(f)

return LaunchDescription([


Current Behavior

Currently xsens driver is not working. When node is run, we get following error.

expected [string] got [not set]

We also tried to use the xsens driver in both dasing and foxy versions of ROS2. The behavior is same. The gps node exhibits the same behavior.

Expected behavior

we were expecting to receive the imu data on an /imu ros2 topic.

edit retag flag offensive close merge delete


The error you are seeing is because the node is expecting a parameter that is not being provided. Try running the node with ros2 run providing the full path to the params file on the command line instead of using the launch file. This will tell you whether the problem with the missing parameter is due to the parameter actually missing in the params file or if it is a problem with the launch file loading the params file.

Josh Whitley gravatar image Josh Whitley  ( 2021-01-21 23:55:56 -0600 )edit

Hello Josh, Thank you for the answer, We have tried this solution,

ros2 run xsens_node xsens_imu_node_exe __params:=xsens_test.param.yaml

and also:

ros2 run xsens_node xsens_imu_node_exe __params:=/home/behnam/adehome2/AutowareAuto/install/xsens_node/share/xsens_node/param/xsens_test.param.yaml

and here is the error:

Failed to parse parameters from file 'xsens_test.param.yaml': Error opening YAML file, at /tmp/binarydeb/ros-dashing-rcl-yaml-param-parser-0.7.9/src/parser.c:1387

Have you tried to run Autoware.Auto xsens package on your machine? If yes, have you seen this error?

Behnam gravatar image Behnam  ( 2021-01-26 13:24:40 -0600 )edit