ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

I don't know of a way to have macros or for loops in launch files.

One option is to have a separate yaml file for each controller that contains the parameter values for a single controller. In your launch file you would have to list out each <node> separately but you could have something like this that uses the rosparam tag:

<node pkg="pid" type="controller" name="pid1">
  <rosparam command="load" file="$(arg your_package)/config/pid1.yaml"/>
</node>

Repeat that block N times and have N yaml files. The pid1.yaml file would look like (follow the link above for more examples):

Kp: 1.0
Ki: 0.1
Kd: 0.2
upper_limit: 5.0
lower_limit: 0.2
windup_limit: 10.0