Lesson reading
live
50 min
Start with the lesson question, connect the representations, and test the model with evidence.
Inspect the opening phenomenon
Predict what changes, then name the evidence.
Apply in the lab
Name the evidence before reading the answer.
Read only what helps
Then use the lab and recall check.
More when needed
Transcript and resources stay available below.
Course progress
Robot Observability and Replay
Decision challenge
Use the opening example to make a prediction, identify evidence, and explain which model supports it.
Name one signal that should survive an intermittent late-braking failure.
Before
Name one signal that should survive an intermittent late-braking failure.
During
Track the five evidence-loop stages.
After
Explain what replay cannot prove about physical motion.
Lesson reading
live
50 min
Video script
draft
Transcript fallback
available
courses/ai-robotics/modules/04-programming-robot-systems-with-ros2/lessons/03-robot-observability-and-replay/video-transcript.md
Build a Robot Evidence Packet
draft
30 min
Mastery check
live
7 questions / 10 min
# Video transcript A robot brakes late once, then the bug disappears. What evidence survives? Observe live topics, logs, action states, parameters, and physical outcomes. Record the smallest sufficient set as timestamped messages, and tie every signal to a hypothesis. Inspect the bag before trusting it: check topics, message counts, duration, timestamps, and the failure window. Replay under controlled conditions, then compare expected and observed software outputs. If replay matches the original command stream, what is still not proven? The physical robot's motion. Replay is evidence—not physical reality.
Reading lab
Connect the lesson's words, diagrams, graphs, evidence, and equations.
A delivery robot brakes late once, but behaves normally when the engineer watches it. Restarting the robot removes the immediate symptom—and also destroys much of the evidence.
Retrieval pause: What would you need to record before trying the same route again?
Observability means arranging signals so a human can reconstruct what the system believed, received, decided, and commanded. Replay turns selected timestamped messages into a repeatable software experiment. Neither is a substitute for physical evidence.

| Stage | Question | Useful evidence |
|---|---|---|
| Observe | What changed before the symptom? | topic values and rates, logs, action states, parameters |
| Record | Which signals must survive the run? | selected timestamped topics and metadata |
| Inspect | Is the recording complete enough? | ros2 bag info, topic list, counts, duration, timing plots |
| Replay | Can software consumers see the same message sequence? | controlled playback, selected topics, rate, logs |
| Compare | Which hypothesis fits both runs? | expected versus observed timing, values, states, outputs |
The order matters. Recording everything without a question can create a huge bag while missing the operator decision, parameter change, or hardware state that explains the failure.
Suppose /scan remains healthy, but /cmd_vel stays positive 300 milliseconds after a near obstacle appears.
/scan, /cmd_vel, /tf, /tf_static, relevant state topics, and /clock when simulation time is used./cmd_vel, the evidence points into the recorded-input/software path. If it does not, investigate unrecorded state, nondeterminism, timing, middleware, or hardware.That result narrows the investigation; it does not prove a motor physically stopped on time.
ROS 2's rosbag2 records timestamped communications and can play them back. Prefer an explicit topic set tied to the hypothesis:
ros2 bag record -o late_braking /scan /cmd_vel /tf /tf_static
ros2 bag info late_braking
ros2 bag play late_braking
Use ros2 bag <verb> --help for the installed distribution's current options. Recording all topics with -a is useful for exploration, but it can increase storage and expose unrelated data. A bag is only as complete as the signals, time basis, and failure window it contains.
No single layer proves the entire causal chain.
Playback republishes recorded communications. It may differ from the original run because wall-clock load, scheduler order, random seeds, external services, unrecorded parameters, device drivers, network conditions, and physical dynamics can differ.
Three safe claims:
One unsafe claim: “The replay proves the physical robot behaved identically.”
Volume is not structure. Evidence needs timestamps, stable identifiers, severity, context, and a question it can answer.
A successful replay may only show that one recorded case no longer fails. Test the causal hypothesis, edge cases, and live system separately.
It may also mean the topic was not selected, discovered, compatible, or recorded successfully. First verify the recorder's subscriptions and bag metadata.
For a robot that turns unexpectedly, name:
External sources are linked for learning; their text, diagrams, screenshots, and code are not republished.
Design a minimal evidence plan for an intermittent robot failure, then inspect a simulated bag summary and defend what replay can prove.
turtlesim and rosbag2/scan 180 messages; /cmd_vel 72 messages; /tf 510 messages; no safety-state topic.Optional CLI extension:
ros2 bag record -o evidence_packet /turtle1/pose /turtle1/cmd_vel
ros2 bag info evidence_packet
ros2 bag play evidence_packet
Use the installed distribution's ros2 bag --help; do not drive physical hardware for this lab.
The submission includes a hypothesis-linked signal table, identifies the missing safety-state evidence, documents replay conditions, distinguishes recorded messages from physical motion, and proposes different next experiments for reproduced versus unreproduced symptoms.
/cmd_vel when investigating late braking?Design a snapshot-mode trigger that preserves the seconds before and after an intermittent fault. Specify the trigger, buffer evidence, privacy boundary, retention rule, and how you would verify that the snapshot is usable.
Complete the entire activity with the simulated summary and a screen-reader-friendly table. No robot, paid software, video, or ROS installation is required.