Is there a way to enable roslaunch to load specific parameters in a yaml file

Hello everybody,

We usually choose to easily configure the parameters by loading the parameters in the yaml file via rosparam, like this:

  <param name="move_base/base_local_planner"    type="string" value="dwa_local_planner/DWAPlannerROS"/>
  <rosparam file="$(find turn_on_wheeltec_robot)/params_nav_common/dwa_local_planner_params.yaml"  command="load" ns="move_base"/>

We load the parameters in dwa_local_planner_params.yaml via rosparam in the launch file.

But I have a problem, this will make me load all the parameters in this file, but if I only need some of the parameters in this yaml file, how do I do it?

Like this, here is a test.yaml file and I only need the accel_lim_v and accel_lim_w parameters in it, how can I do it?

speed_lim_v: 1.5 
speed_lim_w: 3.14

accel_lim_v: 0.5
accel_lim_w: 0.3

frequency: 30.0
decel_factor: 1.0

robot_feedback: 0

All I can think of at the moment is to save the parameters I need in a separate yaml file that does not contain other data.

Thank you,

Hello @zlwnge ,

as you mentioned, one way is to create a new .yaml file. Here a a few other options how you can load parameters in ROS1 using a launch file:

  1. Pass the parameter directly using the param tag :
<param name="/move_base/DWAPlannerROS/accel_lim_v" value="0.5" /> 
<param name="/move_base/DWAPlannerROS/accel_lim_w" value="0.3" />
  1. You can also write a yaml structure inside <rosparam> tags:
     accel_lim_v: 0.5
     accel_lim_w: 0.3

Note that in the code above, you must write the parameters using a valid YAML structure. So you must use a correct indentation since it is meaningful in YAML .

Hope this helps,


This topic was automatically closed after 7 days. New replies are no longer allowed.