ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Nested eval in ROS2 XML launch file

asked 2020-11-25 12:36:01 -0500

nnmm gravatar image

updated 2020-11-25 14:53:23 -0500

gvdhoorn gravatar image

I am trying to find out if it's possible to load a parameter file in an XML launch file, where the path is computed from an arg. This requires nested (or chained) evals:

  • The arg has the name of a robot
  • Adding a suffix to that gives the name of the package that has the parameter file
  • Then we need to call find-pkg-share
  • And add another string to get the full file path

Is this possible? What would go into <param from="...">?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-12-16 05:25:21 -0500

nnmm gravatar image

I still don't know how to do nested evals, but this particular problem can be solved without eval, e.g.:

<arg name="robot_name" />
<let name="param_file" value="$(find-pkg-share $(var robot_name)_description)/config/robot_params.yaml "/>
<param from="$(var param_file)" />
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

1 follower


Asked: 2020-11-25 12:36:01 -0500

Seen: 225 times

Last updated: Dec 16 '20