srinivas.siteApplied RoboticsUnit 11

Unit 11 · Phase 3 · Frames & Software

Messages and logs

Mission: Preserve one synthetic rover distance stream so a later replay can explain a missing reading. This browser activity is a teaching simulation, not ROS 2 or evidence that the ROS 2 experiment ran.

The interactive version of this unit needs JavaScript. Below are its steps as text.

Steps

1. Send one reading

Press “Send reading” and inspect the model and numerical readout.

Why it matters: A component can send a distance reading to another component.

2. Remove the receiver

Press “Remove receiver” and inspect the model and numerical readout.

Why it matters: A message sent without a listening receiver is not collected.

3. Name the route

Press “Connect route” and inspect the model and numerical readout.

Why it matters: A node is a program component, and a topic names a route between publishers and subscribers. A topic is not a central broker, a queue, or a disk.

4. Add the payload

Press “Add timestamp” and inspect the model and numerical readout.

Why it matters: A timestamp says when the source made the reading according to its clock. The unit makes the distance interpretable.

5. Repeat the stream

Press “Publish stream” and inspect the model and numerical readout.

Why it matters: At 5 Hz, the interval is 1000 ms / 5 = 200 ms. The readings are synthetic.

6. Follow the receiver

Press “Process queue” and inspect the model and numerical readout.

Why it matters: This receiver has a small queue while it waits to process readings. Arrival is 20 ms after emission in this toy; processing may happen later.

7. Overload the receiver

Press “Increase rate” and inspect the model and numerical readout.

Why it matters: At 20 Hz, arrivals are 50 ms apart while processing takes 200 ms. The bounded queue drops its oldest waiting reading when full.

8. Save a clean run

Press “Record ten” and inspect the model and numerical readout.

Why it matters: Recording is explicit and saves processed payloads only. A reading lost before recording cannot be recovered by replay.

9. Inspect the record

Press “Inspect rows” and inspect the model and numerical readout.

Why it matters: The stored source timestamp is distinct from arrival and storage time. Retain the setup so the run can be interpreted.

10. Replay the record

Press “Replay rows” and inspect the model and numerical readout.

Why it matters: Replay keeps the stored payloads and source timestamps. Delivery times change and lost originals do not reappear.

11. Compare clocks

Press “Offset source clock” and inspect the model and numerical readout.

Why it matters: Receive time minus source time is only meaningful when clocks share a basis. The actual toy transport remains 20 ms.

12. Audit the evidence

Press “Audit record” and inspect the model and numerical readout.

Why it matters: Ten recorded and replayed readings, metre units and strictly increasing source stamps satisfy this simulated audit. A real ROS 2 run requires its own evidence.

Go deeper

Rates, clocks and this toy

interval (ms) = 1000 / rate (Hz)
apparent age = receiver arrival time − source timestamp

The source clock starts at 1000 ms plus its offset. The toy orders arrivals before service at equal times, services FIFO, drops the oldest waiting item when full, and drains the queue after the final arrival. This one receiver queue is not a faithful DDS QoS or ROS scheduler model. A record and replay cannot guarantee byte-identical DDS traffic or the same physical motion.

Prerequisites: Unit 3 timing and Unit 9 frames. Video question: Why should a robot record messages? A saved stream can help investigate a failure without repeating the physical run.