ros launch get param in launch file to append to param from config file

asked 2020-09-15 03:01:58 -0500

noob_ros gravatar image

Using a common configuration file (not to be modified) - package_config.yaml:

param0: param0_value
param1: param1_value
...

Is it possible to append and override certain params only through the launch file? For example:

<launch>
    <arg name="ns" value="namespace0"/>
    <node name="node_name" pkg="package" type="package_node" clear_params="true">
      <rosparam command="load" file="$(find package)/cfg/package_config.yaml"/>
      <param name="param0" value="$(arg ns)$(param param0)"/>
    </node>
</launch>

I know that param overriding from the launch file is allowed (calling <param name="param0" value="override_value"/> after loading params from yaml file <rosparam command="load" file="$(find package)/cfg/package_config.yaml"/>). But (for some reason that is beyond me) there is no way to access params (e.g. $(param param0)) in the param server from a launch file. Is there any way to append to existing params from a launch file?

edit retag flag offensive close merge delete