0
$\begingroup$

Rosanswers logo

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.


Originally posted by searchrescue on ROS Answers with karma: 50 on 2012-09-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Lorenz with karma: 22731 on 2012-09-13

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.