0

Rosanswers logo

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="...">?


Originally posted by nnmm on ROS Answers with karma: 351 on 2020-11-25

Post score: 1

1 Answers1

0

Rosanswers logo

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)" />

Originally posted by nnmm with karma: 351 on 2020-12-16

This answer was ACCEPTED on the original site

Post score: 1