ROS 2 is software that helps the parts of a robot work together. This page explains seven ideas, and each one has something to try: swap a camera, follow a message on its journey, drive a robot through a translator, send messages three different ways, change a codebase, and set up a workspace. Everything here is a simulation, so no robot and no ROS 2 installation are needed.
A robot program that talks straight to a camera is tied to that camera. ROS 2 puts a standard message in between, so the camera can be replaced without touching the program that uses the pictures. In plain words: a topic is a named mailbox. The camera driver puts pictures into the mailbox called /camera/image, and the program takes them out. Neither side needs to know what the other one is.
When one program sends a message to another, the message passes through six layers, like a parcel passing through stations. Each layer has one small job. First walk a single message through, step by step. Then send many messages over a network that loses some of them.
The operating system of a computer (Windows or Linux, for example) hides the computer’s parts from programs, and uses drivers to talk to each device. ROS 2 does the same job for a robot. First match the parts of the two worlds, then drive a robot through a driver.
Every printer has its own private language, so a printer driver translates for it. Motors, sensors and cameras are the same. A driver translates, so robot programs never have to learn the private language of each device.
The programs on a robot (the nodes) need ways to talk to each other. There are three. A topic is a stream of messages. A service is a question with one answer. An action is a long job that reports progress and can be cancelled. Each tab is a small simulator.
A computer does not keep every program in one giant file, and neither should a robot. ROS 2 splits robot software into packages that each do one job. First see what happens when something has to change. Then decide what a drone can reuse.
Robot software lives in two places. ROS 2 itself, as installed on the computer, is the ground floor (the underlay). The folder where a developer writes new code is the floor above it (the overlay). If both floors have a package with the same name, the upper floor wins. Try the steps in different combinations. Then look inside a package and start its nodes.