ARGOS LAB Start with an idea

15 / ROS 2 · QUALITY OF SERVICE · MESSAGE AGE

Delivered does not mean up to date.

A source publishes a synthetic drone position. Three real ROS 2 reader processes listen to the same stream with different history depths and acceptance rules. Pause their executors for one second, then inspect the position each reader still remembers.

Predict: which helps a reader recover a recent position: keeping 20 messages, keeping only the latest one, or rejecting messages older than 150 ms?

Name the policy. Separate it from the application rule.

Understand the terms ↗
Middleware policies
ROS 2 Quality of Service / QoS

All endpoints use RELIABLE delivery and VOLATILE durability. Reader history is KEEP_LAST, with depth 20 or 1. Reliability is held constant.

Application rule
Timestamp age gate / 150 ms

One depth-20 reader rejects old callback samples. This is application validation, separate from DDS history, deadline and lifespan policies.

Architecture and timing
One publisher → three independent readers

Separate processes on one host. The source publishes every 50 ms. Readers take at most one telemetry callback per 50 ms; a scheduled executor pause changes availability.

Execution and fidelity
Actual ROS 2 trace · synthetic XYZ motion

The browser replays measured timestamps and callbacks. A prescribed 3D trajectory provides visual context; it is no flight-physics or radio simulation.

Available information: a reader receives stamped position samples only when its callback executes. The moving solid drone and the full reference curve are evaluator context. They never update a reader’s retained position.

ONE STREAM · THREE READERS · RECORDED EXECUTION

How old is the position you are using?

Loading trace…
RECORDED ROS 2 EXECUTIONValidating recorded callback timestamps…

Play changes the recorded-time cursor. It does not launch ROS processes, emulate DDS delivery, or measure network speed.

Synthetic trajectory / evaluator + retained sample
Publisher: waitingReader: waiting
● Solid drone / evaluator reference◇ Ghost / selected reader’s retained sample→ Spatial difference / evaluator only

Drag to orbit · scroll to zoom. The drone follows synthetic XYZ positions, with no flight dynamics. A ghost moves only when the selected reader accepts a recorded callback.

Source stamps and callback times share this host’s monotonic clock.

COMPARE THE SAME STREAM

Select the reader shown by the ghost.

Age of information keeps growing between accepted samples.

ACTUAL CALLBACK / WHAT ARRIVED

Inspect the last callback.

Recorded callback envelope

Recently observed callbacks

Click a sequence to inspect its recorded callback time. No future callbacks are listed.
SequenceTime / sAge / msDecision

RETAINED STATE / WHAT IS STILL BEING USED

A rejected message cannot refresh old state.

Two different ages

Callback age = callback time − sample generation time.
Age of Information (AoI) = cursor time − generation time of the last accepted sample.

Age of retained information / ms

The chart reveals elapsed time only. A drop means a newer sample was accepted. The 150 ms line is the common display freshness threshold; only the gated reader enforces it at callback time.

Observed so far, across three independent readers.

Counts up to the cursor. “Not observed” means published sequences with no callback yet for that reader. It includes pending or overwritten samples and is not a packet-loss measurement.
ReaderHistoryCallbacksAcceptedRejectedSequences not observed

Actual DDS queue occupancy was not recorded. The interface shows publications and executed callbacks, without inventing queued packets.

Recording provenance, process identities and runtime

Process IDs belong to the recorded run, not live programs in this page. Imported metadata is untrusted provenance. Structural consistency does not authenticate that ROS produced a file.

PREDICT · INSPECT · EXPLAIN

More history can mean older information.

01 / CONTINUOUS READERS

Establish the baseline.

Load the nominal case. While publishing continues, compare callback age and retained-state age. Do the three readers receive the same sequence numbers?

02 / PAUSED EXECUTORS

Watch the first callback after resume.

Compare depth 20 with depth 1. Both use reliable delivery. One callback per publication period leaves little spare capacity to catch up with a retained history.

03 / STALE STATE

Rejection is not recovery.

Select the gated depth-20 reader after resume. It can reject old messages correctly while its last accepted position becomes increasingly outdated. At the end, the stopped publisher makes every retained state age.

ROS 2 / QUALITY OF SERVICE

Choose what to retain.
Then decide what to use.

Reliability concerns middleware delivery behavior. History and depth bound retained samples. An executor runs the callback that lets the application see a message. These are distinct from validating a timestamp.

This experiment pauses reader execution on one host. It introduces no radio failure, packet-loss rate, multi-machine clock offset, drone dynamics or controller.

callback age = tcallback − tgenerated
gate accepts if callback age ≤ 150 ms
retained-state age = tcursor − tlast accepted generation
RELIABLE / unchanged
All four telemetry endpoints use reliable delivery and volatile durability. This experiment does not compare reliable with best-effort delivery.
KEEP_LAST / depth 20 or 1
Retain a bounded recent history. A depth-one reader can overwrite intermediate samples before the application takes them. Missing callback sequences are not proof of lost network packets.
Application age gate / depth 20
Read the timestamp inside each callback and reject samples older than 150 ms. Rejection does not flush the middleware history or make the retained position current.
Shared-host monotonic clock
Generation-to-callback age includes executor waiting, queueing and software overhead. It is not isolated wire latency and does not establish performance across machines.

A real trace, a synthetic reference

The source samples x = 3 cos(t), y = 2 sin(t), z = 1.5 + 0.4 sin(2t), in meters with t in seconds. The reference continues through the observation window after publications stop. Those unsent positions remain evaluator-only information.

Freshness is not a controller

The display labels retained data fresh at age ≤ 150 ms. Only the gated reader checks that threshold when accepting a callback. Stopping, requesting data or changing a flight command requires a separate application policy.

Record another actual ROS 2 run

With Docker available, run npm run record:qos, then import local/ros2-qos.json above. The runner launches actual publisher and reader processes. Browser playback simply observes their saved results. The repository guide docs/lessons/15-ros2-freshness.md defines the experiment and its limits.

Primary documentation: the Age of Information survey, ROS 2 Jazzy Quality of Service settings and executors. This is a middleware and application-policy experiment, not a new named coordination algorithm.