ROS 2 Learning Path  ยท  Illustrated Textbook

Chapter 14: Multi-Robot โ€” A Fleet of ARCHOs

When one ARCHO isn't enough anymore
Prerequisite: Chapter 5 (TF2), Chapter 11 (Nav2)
Running project: the ARCHO fleet
Concepts: Namespace, TF Prefix, Fleet Manager
Reading time: 90โ€“110 minutes
What's in this chapter 14.1The problem: when three ARCHOs talk at once 14.2First solution: Namespace 14.3Second solution: TF Prefix 14.4Fleet Manager: the brain above all the ARCHOs 14.5Shared map or independent map 14.6The congestion problem: when two robots meet head-on 14.7Summary, glossary, and exercises

14.1The problem: when three ARCHOs talk at once

Suppose the warehouse has grown large enough that one ARCHO is no longer enough, and three of them work at the same time: robot_1, robot_2, and robot_3.

โš ๏ธ If all three publish the same topic

If all three ARCHOs simultaneously publish and subscribe on /scan, /odom, and /cmd_vel, the whole system no longer knows which message belongs to which robot. Each robot's Nav2 tries to send a motion command meant for all three robots at once โ€” the result is pure chaos.

14.2First solution: Namespace

The simple, common solution is to prefix every topic of each robot with its own name โ€” exactly the same Namespace concept we saw in Chapter 2, just this time at the scale of an entire fleet:

/robot_1/scan
/robot_1/odom
/robot_1/cmd_vel

/robot_2/scan
/robot_2/odom
/robot_2/cmd_vel

Now each ARCHO listens only to its own topics and publishes only on its own topics. Nav2, SLAM Toolbox, and ros2_control each run inside that same namespace and have no idea other ARCHOs even exist.

14.3Second solution: TF Prefix

Namespace alone isn't enough. Recall from Chapter 5 that the TF Tree is a global structure โ€” if all three ARCHOs each have a frame called base_link, TF has no way of knowing which base_link belongs to which robot. The solution: each robot names its own frames with its own prefix.

robot_1/base_link
robot_1/laser_link
robot_1/odom

robot_2/base_link
robot_2/laser_link
robot_2/odom
flowchart TB M["map"] --> O1["robot_1/odom"] --> B1["robot_1/base_link"] --> L1["robot_1/laser_link"] M --> O2["robot_2/odom"] --> B2["robot_2/base_link"] --> L2["robot_2/laser_link"] style M fill:#eef0ff,stroke:#3d4bf5
๐Ÿง  Why map is shared but odom is separate

The map frame is usually a single one shared by the whole fleet โ€” because all the robots move through the same warehouse. But each robot has its own odometry, its own drift, and its own accumulated error; so each one needs its own independent odom frame, exactly as in Chapters 5 and 9 for a single robot.

14.4Fleet Manager: the brain above all the ARCHOs

Namespace and TF Prefix only guarantee that the robots don't get mixed up with each other. But a bigger question is still open: when a new mission comes in (say, "empty shelf 40"), which ARCHO should do it?

flowchart TB FM["Fleet Manager"] --> R1["Robot 1
Nav2"] FM --> R2["Robot 2
Nav2"] FM --> R3["Robot 3
Nav2"] style FM fill:#3d4bf5,color:#fff
๐Ÿ“– What decisions a Fleet Manager makes
  • Which robot should take this mission?
  • Which robot is closest to the destination?
  • Which robot has more battery left?
  • Is the destination aisle currently reserved by another robot?
  • Do two robots' paths conflict with each other?
๐Ÿ“– This chapter's golden sentence

Multi-robot isn't just running several parallel copies of Nav2; it requires a fleet management layer (Fleet Manager) to assign missions and resolve conflicts among robots.

14.5Shared map or independent map

ModeScenarioExample
Shared mapOne building, several robots, all moving on the same mapSeveral ARCHOs on one floor of a warehouse
Independent mapRobots work on completely separate floors or environmentsOne ARCHO on the ground floor, another on the floor above

14.6The congestion problem: when two robots meet head-on

Even if each ARCHO avoids fixed obstacles on its own, two robots can still end up facing each other in exactly the same narrow aisle โ€” something a single robot's local costmap cannot predict, because each robot only sees its own surroundings.

Robot A โ†’      โ† Robot B

Common solutions at the fleet level (not at the level of a single robot):

SolutionIdea
Aisle reservationBefore entering a narrow aisle, a robot reserves it for itself
Right of wayOne robot (e.g. with a more urgent mission or lower battery) gets priority to pass
Traffic graphThe warehouse map is converted into a traffic graph with allowed directions of travel
Zone lockAn entire zone is locked for a short time so only one robot can be in it
Mission schedulingNearby missions are scheduled so robots don't arrive at the same point simultaneously
Waiting pointA robot waits at a safe point until the path is clear
Narrow aisle โ€” needs fleet-level reservation A B Possible collision without aisle reservation
Two ARCHOs moving toward each other in a narrow aisle without fleet-level coordination.

14.7Chapter 14 summary

The ARCHO fleet can now operate without communication conflicts (thanks to Namespace and TF Prefix), and missions are intelligently distributed among the robots (thanks to the Fleet Manager) โ€” without two ARCHOs colliding in a narrow aisle.

โœ… Learning checkpoint
  • I can explain why, without a Namespace, multiple robots can't work simultaneously.
  • I know why TF Prefix is needed separately from Namespace.
  • I can explain why the map is usually shared but odom is independent.
  • I can name at least three fleet-level solutions for preventing congestion.
๐ŸŒ Connection to the main project

ARCHO Project now operates in the warehouse as a three-robot fleet with independent Namespaces and TF Prefixes, plus a simple Fleet Manager for mission assignment and aisle reservation.

What the next chapter adds

In Chapter 15 we'll learn how to package this whole system with Docker and automatically test and deliver it with CI/CD โ€” the path that turns a ROS 2 project from "it works on my laptop" into a deployable product.

Chapter 14 glossary

Namespace
A prefix that separates one robot's topics and services from other robots on the same network.
TF Prefix
A prefix that distinguishes one robot's TF frames from other robots' frames within a shared TF Tree.
Fleet Manager
An upper-level layer that assigns missions across multiple robots and resolves conflicts between them.
Traffic Graph
A graph-like representation of the environment map for managing direction and right-of-way among multiple robots.
Zone Lock
A temporary lock on a region of the map allowing only one robot to be present in it.

Chapter 14 common mistakes โ€” summary