Difference between revisions of "Getting Started with ROS on Embedded Systems/User Guide/C++/Topics"

From RidgeRun Developer Connection
Jump to: navigation, search
m
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Getting Started with ROS on Embedded Systems/Head|previous=User Guide/C++/Initialization|next=User Guide/C++/Messages|keywords=ROS}}
+
{{Getting Started with ROS on Embedded Systems/Head|previous=User Guide/C++/Initialization|next=User Guide/C++/Messages|metakeywords=ROS}}
  
 
== Introduction ==
 
== Introduction ==
 
This wiki is based on the following ROS page: http://wiki.ros.org/Topics
 
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 of 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 amount 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 way by many subscribers.   
+
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.
 
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.
Line 10: Line 10:
 
== Types ==
 
== Types ==
  
Each topic will have a ROS message type assigned to publish. It is not complete 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 the consistency between the same code bases. We will cover more on the messages section of the guide.  
+
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 ==
 
== Tools ==
Line 20: Line 20:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
{{Getting Started with ROS on Embedded Systems/Foot||}}
+
{{Getting Started with ROS on Embedded Systems/Foot|User Guide/C++/Initialization|User Guide/C++/Messages}}

Latest revision as of 13:14, 8 March 2023




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