Let's learn how two nodes communicate with each other using ROS topics. The following diagram shows how this happens:
As you can see, there are two nodes named talker and listener. The talker node publishes a string message called Hello World into a topic called /talker, while the listener node is subscribed to this topic. Let's see what happens at each stage, marked (1), (2), and (3) in the preceding diagram:
- Before running any nodes in ROS, we should start the ROS Master. After it has been started, it will wait for nodes. When the talker node (publisher) starts running, ...