Introduction to ROS
A Concrete Pipeline: Camera to Action · 1/2

Tracing data through a real system

Consider a simple robot that needs to stop when it sees a person. The camera node captures frames at, say, 30 times a second and publishes each one to /camera/image. A perception node subscribes to that topic, runs a detection model on every frame, and if it finds a person, publishes a message to a /person_detected topic. A decision node subscribes to /person_detected and, on receiving that message, publishes a stop command to /cmd_vel, the topic the motor controller node is subscribed to.

Notice that at no point does the camera node know a motor exists, and the motor controller node has no idea a camera exists either. Each node only knows about the topics directly next to it in the chain. This is what makes ROS systems debuggable and testable: you can record real topic data to a file and replay it later, or you can inject fake /person_detected messages to test the decision node in isolation without a real camera or motor present.