Introduction
This chapter focuses on the publisher/subscriber communication model used heavily in modern robotic software. You will start by contrasting synchronous and asynchronous communication and seeing why ROS 2βs Pub/Sub pattern lets nodes broadcast and receive data without blocking on one another. From there you will write your own publisher node using
rclpy, then write the complementary subscriber side, learning how event-driven callback functions react to incoming messages instead of polling for them. You will practice this callback pattern directly with a LaserScan safety-stop exercise, then get introduced to TurtleSim, the standard 2D simulator used to test publisher and subscriber code without physical hardware, before applying everything youβve learned in a hands-on TurtleSim navigation assignment. Mastering this pattern is key to building responsive, modular, and reusable robot applications.
