How to use substitution args in a yaml file?
I have a yaml file that is used by many launch files. I centralized most of the parameters in the yaml file, but those with substitution arguments do not get properly evaluated. Instead, they get passed in literally (verbatim) to the node. For example:
# params.yaml
showRobotModel: true
folderNameForSnapshots: $(find ocu)/snapshots
robot_description: cat $(find ocu)/media/robot_model/NIFTi.urdf
How could I avoid copy-pasting the more complex parameters in each launch file? Can they be interpreted somehow in the yaml file?
I'm asking the same question 5 years later, but it appears there is no solution.
YAML is just a markup language and doesn't have a concept of paths or includes. As @dornhenge said, the better way to do this is by creating a launch file which does the substitution and sets the desired parameters.
I do not agree. My case is that I have other package's large YAML in which I need to change only one parameter depending on the scenario. Having an arg substitution there would be fantastic. There is an open request here: https://github.com/ros/ros_comm/issue...