Ask Your Question
2

ros2 component_container yaml parsing

asked 2020-03-10 16:38:09 -0600

julesvegas gravatar image

updated 2020-03-10 16:45:07 -0600

gvdhoorn gravatar image

Does the ros2 component_container use a different yaml file parser than a node that is launched with launch_ros.actions.Node?

I have a yaml file that contains a few parameters that works fine when the node is launched using a component_container. But, when I launch the node using its own main() executable and launch_ros.actions.Node, I get the following error:

[node-1]   'Couldn't parse params file: '--params-file /home/tom/ros2-packages/install/moog/share/moog/config/vehicle/base.yaml'. Error: Cannot have a value before ros__parameters at line 1, at /tmp/binarydeb/ros-eloquent-rcl-yaml-param-parser-0.8.4/src/parser.c:1491, at /tmp/binarydeb/ros-eloquent-rcl-0.8.4/src/rcl/arguments.c:471'

My yaml file does not contain a 'ros__parameters' line in it, which seems to be the format stated here: https://github.com/ros2/rcl/tree/mast...

But again, the yaml file is parsed just fine when using the component_container to launch.

If I add the ros__parameters line to the yaml file, then the parameters are not read properly when launching using component_container.

Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-11 12:40:44 -0600

julesvegas gravatar image

updated 2020-03-11 13:19:41 -0600

This problem looks to be the same as: https://github.com/ros2/rclcpp/issues...

Resolution is to load and parse the yaml file within the launch file, and then pass the parameters to the ComposableNode action: https://github.com/osrf/ros2_serial_e...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-03-10 16:38:09 -0600

Seen: 727 times

Last updated: Mar 11 '20