Getting Started with ROS on Embedded Systems - User Guide - C++ - Topics

From RidgeRun Developer Connection
Jump to: navigation, search




Previous: User Guide/C++/Initialization Index Next: User Guide/C++/Messages




Introduction

This wiki is based on the following ROS page: http://wiki.ros.org/Topics

Topics are buses that have a name in which nodes can exchange information. This information is normally messages (we will cover them shortly). Different nodes will use multiple different topics to communicate, there is no limit on this. This method of exchanging information decouples the production of the information from its consumption, therefore a node can produce for example images and another node can receive them and process them, this way receiving is made by using ROS subscribers to a topic, and the method of sending information is made by using ROS publishers to a topic. There is no limit on the number of subscribers and publishers in a topic so that the information can have multiple sources of information and it can be processed in multiple different ways by many subscribers.

Topics are intended for unidirectional, streaming communication. Nodes that need to perform remote procedure calls, i.e. receive a response to a request, should use services instead. There is also the Parameter Server for maintaining small amounts of state.

Types

Each topic will have a ROS message type assigned to publish. It is not completely necessary to have all publishers using the same type of message on the same topic, but the subscribers will not establish any connection if the message type does not match. This match is performed by computing the MD5 of the msg files used. This check ensures consistency between the same codebases. We will cover more on the messages section of the guide.

Tools

See current topics:

rostopic list
Previous: User Guide/C++/Initialization Index Next: User Guide/C++/Messages