Skip to main content

Introduction

This chapter introduces ROS 2 as the middleware framework used to connect the modular robot software you have designed conceptually in earlier chapters. You will start with why ROS 2 decouples a robot’s software into separate, modular processes that communicate over DDS rather than one fragile monolithic script, then learn how nodes perform dedicated tasks and communicate anonymously over named topics using structured message definitions (.msg). From there you will practice the command-line toolsβ€”ros2 node list, ros2 topic echo, and ros2 topic pubβ€”used to debug a running computational graph. The chapter closes with the ROS 2 workspace: the src/ β†’ colcon build β†’ source install/setup.bash workflow used to integrate your own custom packages into the environment. Understanding these foundations is a prerequisite for writing the publisher and subscriber code introduced in the next chapter.