Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use ROS parameters to change the configuration values of your nodes at run time; have a look at the rospy parameters tutorial for how to retrieve parameters. The roslaunch XML reference explains the tags that are available in roslaunch.

If you use a private parameter to configure your node, your launch file would look something like:

<launch>
  <node pkg="my_controller_package" type="controller.py" name="controller1">
    <param name="name" value="bot_1"/>
  </node>
  <node pkg="my_controller_package" type="controller.py" name="controller2">
    <param name="name" value="bot_2"/>
  </node>
</launch>

Assuming that your node is called controller.py in a package named my_controller_package; this sets the private parameter name for each node, which you can retrieve in rospy with rospy.get_param("~name")