roslaunch: rosparam does not override parameters in local namespace

asked 2017-05-27 05:38:48 -0600

rossie ros gravatar image

The wikipage on rosparam states that

Similarly, load commands can override parameters previously declared.

But I found that having a rosparam in a node tag does not behave this way. Am I misinterpreting the wiki page or may this be a bug?

A minimal example: This works as expected:

<launch>
    <node name="my_node" pkg="roscpp_tutorials" type="talker" />
    <param name="my_param" value="my value" />
    <rosparam>my_param: "my_overridden_value"</rosparam>
</launch>

rosparam dump gives "[...] my_param: my_overridden_value [...]".

But:

<launch>
    <node name="my_node" pkg="roscpp_tutorials" type="talker">
      <param name="my_param" value="my value" />
      <rosparam>my_param: "my_overridden_value"</rosparam>
    </node>
</launch>

yields "[...] my_node: {my_param: my value} [...]"., whereas on might expect "my_node: {my_param: my_overridden value}".

edit retag flag offensive close merge delete

Comments

From the doc, I also understand that the rule should be "Last value wins", which shows to be the case at the root level of the launchfile, but not within a node description. In addition to that, manually loading this param after launching the process works as expected with rosparam load

serial gravatar imageserial ( 2017-05-30 04:11:14 -0600 )edit

@serial: If this is not the case within a node description, wouldn't this be a bug then?

Timple86 gravatar imageTimple86 ( 2019-11-14 01:08:15 -0600 )edit