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

Revision history [back]

click to hide/show revision 1
initial version

A topic is the way nodes communicate with each other. Think of it like a newsletter--the terminology for topics is exactly the same.

Say you have a node that generates images, and it wants to send them to other nodes. The node advertises that it is going to publish sensor_msgs/Image messages on a topic. The topic has a URI, which is a path like /image or /vision/image (it can be whatever you want it to be). The ROS master keeps track of what nodes have advertised what topics.

Now say you have another node that processes images, and it wants to get them from the other node. This node subscribes to sensor_msgs/Image messages on the same topic.

The ROS master sees the publisher and the subscriber, and it tells the nodes how to connect directly. Now, whenever the first node publishes an image, it gets sent (over a TCP socket) to the subscribing node. A topic can have any number of publishers and any number of subscribers; every subscriber gets every message from every publisher.

Any questions?