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

Revision history [back]

If the nodes can publish on the same topic and just equal node names are your problem, you can use anonymous node names. In a launch file, you can use $(anon foo) as node name. Otherwise, you can pass the AnonymousName option.

If you need separate topics, you will have to use groups in launch files. Either use different launch files and just include your actual launch file inside a group with a namespace set or you might be able to use an environment variable.

If the nodes can publish on the same topic and just equal node names are your problem, you can use anonymous node names. In a launch file, you can use $(anon foo) as node name. Otherwise, you can pass the AnonymousName option.

If you need separate topics, you will have to use groups in launch files. Either use different launch files and just include your actual launch file inside a group with a namespace set or you might be able to use an environment variable.variable. For instance, the following might work:

<launch>
  <group ns="$(env ROBOT_NAME)">
    ...
  </group>
</launch>

By setting the environment variable ROBOT_NAME to different names, the nodes should then publish on different namespaces.