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

How does ROS handle messages between 3 or more nodes across 2 machines?

asked 2012-07-04 22:12:01 -0500

TimZ gravatar image


I am working on a robot that creates a node on one computer to capture and transmit (through ros messages) an image (Node 1). The image is sent to two other nodes. One node is on a separate computer (connected via wi-fi) which also runs the rosmaster (Node 2). The third node is on the same computer as the image capture node (Node 3).

My question is: How is the image message transmitted to each node. Does the image get sent to the computer with the rosmaster and redistributed to the listening nodes (Node 1->Master->Node 3 and Node 2)? Or is the messaging system more dynamic in that messages go directly to listening nodes(Node 1-> Node 2 and Node 1->Node 3)? The reason this matters is because of the delay involved in wireless transmission to the rosmaster and then back to the transmitting computer to be consumed by node 3. Also the processing overhead of sending and receiving extra messages is undesirable.

Thank you,


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-07-04 22:25:45 -0500

ipso gravatar image

updated 2012-07-04 22:28:03 -0500

In short: the master can be thought of as a coordinator; it does not route all traffic between nodes through itself, but helps nodes (at startup, and during execution) to find each other. Nodes then communicate directly, via either TCP or UDP (this can even be configured per subscriber).

From the wiki/Master and wiki/Topics wiki pages.

The role of the Master is to enable individual ROS nodes to locate one another. Once these nodes have located each other they communicate with each other peer-to-peer.

In your case, images will go directly from the publisher to the subscriber, after the master has provided them with enough information to be able to find each other.

edit flag offensive delete link more

answered 2012-07-04 22:27:06 -0500

Lorenz gravatar image

Messages are always transmitted directly to the subscribers. When subscribing to a topic, a socket is opened between each of the publishers of a topic and the subscriber. The core is only used as sort of a name service to find out which nodes are publishing topics, who is providing a service and it stores ROS parameters. For more information, have a look here and in here.

edit flag offensive delete link more

Question Tools


Asked: 2012-07-04 22:12:01 -0500

Seen: 1,437 times

Last updated: Jul 04 '12