Robotics From Zero
Module: Making Parts Talk

Why Communication Matters

Sensor data is useless unless it reaches the right place at the right time. Here's why communication is the backbone of every robot.

6 min read

Why Communication Matters

In Module 1, we built a ball-following robot with four nodes: camera, detector, controller, and motor driver. We drew arrows between them showing data flow. But we hand-waved the actual mechanism — how does an Image message get from the Camera Node to the Ball Detector?

Raspberry Pi, Arduino Uno, and Raspberry Pi Zero side by side — common robot computing boards
Real computing boards used in robots: Raspberry Pi (left), Arduino Uno (top right), and Pi Zero (bottom right). These are the physical hardware where your robot's nodes run and communicate.

This question might sound boring. It isn't. Communication is arguably the most critical piece of robot software. Get it wrong and your robot is blind, slow, or dead.

The Real Cost of Bad Communication

Monolithic failure cascade — one component crash kills the entire system
In a monolithic program, one bug triggers a cascade that kills the entire robot — camera, planner, motors, everything.
Distributed resilience — camera node fails but other nodes keep running safely
With independent nodes, the camera crash is isolated. The rest of the system keeps running and falls back to LiDAR-only navigation.

Consider these failure modes:

Too slow: Your LiDAR detects a wall 2 meters ahead, but the scan takes 200ms to reach the controller. At 1 m/s, the robot has traveled 20cm in that time. If the processing adds another 100ms, you've lost 30cm of stopping distance. For a fast-moving robot, that's the difference between stopping and crashing.

Too unreliable: Your path planner sends motor commands, but one in every hundred messages gets dropped. Most of the time, the robot drives smoothly. But occasionally, it misses a "slow down" command right before a turn — and drives off course.

Too unstructured: Your camera publishes raw bytes. The detector expects a width, height, and pixel format. But there's no agreement on the format — did the camera send RGB or BGR? Is it 640×480 or 1280×720? The detector crashes on unexpected data.

Tip

A well-designed communication system solves all three problems: it's fast enough for real-time control, reliable enough to not lose critical messages, and structured enough to prevent format mismatches.

Communication need — without a channel between sensor and motor, the robot crashes
Left: no communication channel means the camera's warning never reaches the motors. Right: a proper message system delivers the stop command in under 1ms.

What We Need

A good robot communication system must be:

  1. Fast — Sub-millisecond latency for control loops, sub-second for perception
  2. Typed — Messages have a defined structure that both sender and receiver agree on
  3. Decoupled — Senders don't need to know about receivers (and vice versa)
  4. Scalable — Works with 4 nodes on one computer or 40 nodes on a network
  5. Observable — You can inspect what data is flowing and where

The Approaches

There are several ways nodes can communicate:

ApproachHow it worksUsed for
Publish-SubscribeBroadcast messages to named channelsMost robot data (sensors, commands)
Request-ResponseAsk a question, get an answerConfiguration, one-time queries
Shared MemoryMultiple processes read/write the same memory regionHigh-bandwidth, same-machine data
Network SocketsTCP/UDP over the networkMulti-machine robots

Most robot frameworks use publish-subscribe as the primary pattern, with the others available for special cases. We'll focus on pub/sub in the next lesson.

What's Next?

In the next lesson, we'll dive into the publish-subscribe pattern — the most common way robot nodes communicate. You'll understand exactly how topics work, why they're so powerful, and when to use (or avoid) them.

Got questions? Join the community

Discuss this lesson, get help, and connect with other learners on r/softwarerobotics.

Join r/softwarerobotics

Frequently Asked Questions

Why do robot components need to communicate?

A robot has many independent parts — sensors, controllers, planners — that must share data to work together. Without communication, the path planner cannot see obstacles, and the motor controller cannot receive velocity commands. Communication is the glue that makes a robot function as a system.

What is publish/subscribe in robotics?

Publish/subscribe (pub/sub) is a communication pattern where components publish data to named channels called topics, and other components subscribe to receive that data. Neither side needs to know about the other, making the system modular and flexible.

What is a topic in robot software?

A topic is a named channel for streaming data between robot software components. For example, a camera publishes images to /camera/image, and any component that needs images subscribes to that topic. Topics carry typed messages and support one-to-many communication.

Further Reading

Related Lessons

Discussion

Sign in to join the discussion.