ARGOS LAB Start with an idea

14 / ROS 2 · NODES, TOPICS AND EXPLICIT ROUNDS

Same averaging rule.
Six separate programs.

In workshop 1, one browser computed every agent. Here, six ROS 2 nodes in six Python processes actually exchanged messages and computed their own updates. Replay their recorded trace, inspect one node’s inbox, and compare every committed state with the original consensus rule.

Predict: one agent omits a publication. Does reliable delivery invent the missing value, do peers average a partial inbox, or does the round stop?

Algorithm, architecture and middleware are different things.

Read the protocol ↗
Algorithm and variant
Distributed average consensus

The same linear update as workshop 1, with a constant edge gain α = 1/12. A node uses its own scalar and its configured neighbors’ scalars.

Decision architecture
Decentralized numerical decisions

Each agent computes locally. A separate supervisor coordinates round barriers and records evidence; this timing authority is centralized.

Software and communication
ROS 2 / publish–subscribe topics

One node per process is this experiment’s choice, not a ROS requirement. Topics carry messages with run, round and sender identity. The complete graph and chain change neighbors, not the algorithm.

Timing and fidelity
Synchronous rounds · recorded execution

Agents wait for every expected neighbor before computing. This browser replays a saved process trace. It runs no live ROS nodes and measures no network latency.

Local inputs versus evaluator: each decision receives one node’s own value and actual neighbor envelopes for that round. The global mean, spread and browser reference comparison are observer measurements, never an extra input to the agents.

REAL PROCESS TRACE · BROWSER REPLAY

Follow a value across a process boundary.

Loading trace…
RECORDED ROS 2 EXECUTIONValidating the bundled trace…

Play, Reset and the timeline only change replay position. To run new ROS processes, use the reproducible runner described below.

Process network / abstract software view
Committed state1 / Publish2 / Receive3 / Commit

Drag to orbit · scroll to zoom. Blocks represent operating-system processes, not robots. Channels show neighbor subscriptions; height of the small value columns represents the scalar.

● Agent process / local value◆ Actual recorded envelope▰ Round supervisor / timing only

No new processes run in this browser.

COMMITTED ROUND0Recorded updates
DISAGREEMENT / EVALUATOR—max(x) − min(x) · agreement threshold 0.01
MEAN / EVALUATOR—Across all six agents, not an agent input
REFERENCE COMPARISON—All recorded states against the browser rule

ONE AGENT’S AVAILABLE INFORMATION

Inspect the inbox before the update.

Recorded deliveries for the selected node and exchange.
FromEnvelope roundScalar valueState
Local calculation

Recorded receipt envelopes / trace representation

The trace uses agent for the receiver and from for the sender. IDs 0–5 correspond to A1–A6. The wire JSON uses sender; run ID, round and value are preserved.

OBSERVER VIEW / NOT SHARED AGENT KNOWLEDGE

Six states, one explicit barrier.

Committed node values. Selecting a row changes inspection only.
AgentProcess PIDValueNeighbors
Round barrier

Disagreement over committed rounds

The horizontal axis counts committed logical rounds, not seconds. Presentation phases group logged events; they are not the wall-clock order of every process callback.

Inspect recording provenance and process identities

Process IDs identify the recorded execution. They do not imply those programs are currently running. Import validation checks the trace contract and numerical comparison; it does not authenticate who created a file.

PREDICT · COMPARE · EXPLAIN / BUNDLED REFERENCE CASES

Delivery guarantees cannot supply an absent publication.

01 / COMPLETE GRAPH

Reproduce the first workshop.

After one round, predict [3, 4, 5, 7, 8, 9]. Inspect one process’s own value and five incoming envelopes. The central barrier does not perform its averaging.

02 / CHAIN

Same rule, fewer neighbors.

Information travels through intermediate agents over many rounds. Compare agreement round and messages per exchange. Playback duration is not a middleware benchmark.

03 / OMITTED PUBLICATION

A round cannot commit.

A3 (wire sender ID 2) deliberately skips its publication in round 2. Its peers cannot complete their expected inboxes. The supervisor records a timeout; it does not silently accept partial updates.

ROS 2 / ROBOT OPERATING SYSTEM 2

Middleware moves messages.
The protocol gives them meaning.

A node is a ROS participant. A process is an operating-system program instance. A topic is a named publish–subscribe channel. The RMW layer connects ROS to a middleware implementation.

The six agents run on one host for this experiment. There are no drones, sensor inputs, radio links, clock-synchronization measurements or flight dynamics.

xᵢ(k + 1) = xᵢ(k) + α Σⱼ∈Nᵢ [xⱼ(k) − xᵢ(k)]
α = 1/12 · every input belongs to the same run and round
xᵢ(k) / local state
The scalar retained by agent i at committed round k. The supervisor authorizes progress but does not supply an average.
Nᵢ / configured neighbors
Five peers in the complete graph; one or two in the chain. These subscriptions determine the required inbox.
Envelope / run, round, sender, value
Identity lets a receiver reject unrelated runs, wrong-round data and duplicate contributions. A topic name alone is not a synchronization protocol.
Barrier / all expected inputs
Each node computes a candidate from a complete inbox. Only a completed global round becomes the next committed state in this replay.

Reliable does not mean instantaneous or sufficient

The runtime uses reliable, volatile, keep-last QoS with depth 256 and std_msgs/msg/String carrying JSON. This lesson does not compare QoS policies or measure end-to-end latency. A message that the application never publishes cannot be delivered by the transport.

Timeout is evidence of missing progress

The failure case deliberately omits a publication. In a general system, silence alone would not identify a crashed process. Restart handling, asynchronous consensus and transport comparisons belong to later experiments.

Run a fresh process experiment

With Docker available, run npm run record:ros2 from the repository, then import local/ros2-consensus.json above. This launches actual ROS 2 processes; it is separate from browser playback. The repository guide docs/lessons/14-ros2-rounds.md explains the runtime, protocol and limitations.

Primary documentation: ROS 2 nodes, topics, and Quality of Service. The known averaging rule is introduced in workshop 1; ROS 2 is the execution and communication stack, not a new consensus algorithm.