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:

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

Assuming that your node is called 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")