What is the cause of ROS2 XML launch substitution error "Unknown substitution: arg"?

asked 2023-01-29 11:07:56 -0500

oubrejames gravatar image

I am trying to pass a yaml file as a launch argument to use as parameters for a node and I am getting the following error:

[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught exception when trying to load file of format [xml]: Error trying to process rule "substitution": Unknown substitution: arg

Below is how I implemented passing the yaml as an argument.

<arg name="config_file" default="$(find-pkg-share nusim)/config/basic_world.yaml"/> <node pkg="nusim" exec="nusim"> </node>

Everything I have seen on the ROS documentation uses this format for substituting arguments so I am unsure why it is an unknown substitution.

The only difference that I am seeing between mine and the ROS docs is that they do something like:

<param name="foo" value="$(arg my_foo)" />

From this I tried to give it a name but it still says unknown substitution.

Does anyone have any idea what could be the cause of this error?

edit retag flag offensive close merge delete