Diving into ROS 2 nodes
In Chapter 2, we discussed what a ROS 2 node is. When we run a ROS 2 program/executable, it can start a single or multiple nodes. In ROS 2, a node is a fundamental component of a robotic system that performs a specific task, such as sensor data processing, actuation, or communication. While a node is often associated with a process, ROS 2 allows multiple nodes to exist within a single process, offering greater flexibility and efficiency.
According to the ROS 2 documentation, “A node is a participant in the ROS 2 graph, which uses a client library to communicate with other nodes. Nodes can communicate with other nodes within the same process, in a different process, or on a different machine. Nodes are typically the unit of computation in a ROS graph; each node should do one logical thing.”
Depending on the robotics application in ROS 2, multiple nodes can work and communicate together to accomplish a robotics application. Nodes in ROS...