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

how to publish the same node on different laptops under one master node

asked 2012-09-13 06:52:11 -0600

searchrescue gravatar image

Hi all, Here is my setup. I have a multi-robot task where i setup an ad-hoc network and set the master uri to one of the 3 laptops. 2 laptops on the 2 robots and 1 laptop is in the middle. I have 2 icreate robots which will run the non-master nodes. For basic coordination, i defined a custom message with 2 fields where the master node running laptop listens the robot id and their states. the laptops on the robots will be running the same node to publish their id and state. However, as there is one master node , the same node cannot be run on the laptops. I can guess that i should do something like group namespacing. any help is appreciated.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2012-09-13 07:13:20 -0600

Lorenz gravatar image

updated 2012-09-13 07:15:49 -0600

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. 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.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-09-13 06:52:11 -0600

Seen: 298 times

Last updated: Sep 13 '12