The computation graph level

The ROS computation graph is a peer-to-peer based network that processes all the information together. The ROS graph concept constitutes nodes, topics, messages, master, parameter server, services, and bags:

The ROS computational graph concept diagram

The preceding diagram shows the various concepts in the ROS computational graph. Here is a short description of each concept:

  • Nodes: ROS nodes are simply processes that use ROS APIs to communicate with each other. A robot may have many nodes to perform its computations. For example, an autonomous mobile robot may have a node each for hardware interfacing, reading laser scan, and localization and mapping. We can create ROS nodes using ROS client libraries such as roscpp and rospy, which we will be discussing in the upcoming sections.
  • Master: The ROS master works as an intermediate node that aids connections between different ROS nodes. The master has all of the details about all the nodes running in the ROS environment. It will exchange details of one node with another to establish a connection between them. After exchanging this information, communication will start between the two ROS nodes.
  • Parameter server: The parameter server is a pretty useful thing in ROS. A node can store a variable in the parameter server and set its privacy, too. If the parameter has a global scope, it can be accessed by all other nodes. The ROS parameter runs along with the ROS master.
  • Messages: ROS nodes can communicate with each other in many ways. In all the methods, nodes send and receive data in the form of ROS messages. The ROS message is a data structure that's used by ROS nodes to exchange data.
  • Topics: One of the methods to communicate and exchange ROS messages between two ROS nodes is called ROS topics. Topics are named buses in which data is exchanged using ROS messages. Each topic will have a specific name, and one node will publish data to a topic and another node can read from the topic by subscribing to it.
  • Services: Services are another kind of communication method, similar to topics. Topics use publish or subscribe interaction, but in services, a request or reply method is used. One node will act as the service provider, which has a service routine running, and a client node requests a service from the server. The server will execute the service routine and send the result to the client. The client node should wait until the server responds with the results.
  • Bags: Bags are a useful utility in ROS for the recording and playback of ROS topics. While working on robots, there may be some situations where we need to work without actual hardware. Using rosbag, we can record sensor data and copy the bag file to other computers to inspect data by playing it back.

This sums up the computational graph concept.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.190.93