What is an MCAP file? How to open, read and convert it
What an MCAP file is, how ROS 2 records it, and how to inspect, read in Python, convert from .db3, compress and recover MCAP files on real robots.
By Eitan Chudnovsky →Why a ROS 2 node can look alive while its topic goes quiet, how to catch it by hand and in code, and how to alert on silence across a robot fleet.

Late on a night shift at a customer site, a picking arm has been standing still for forty minutes. Everything you can check says it's fine. The container is running. systemd says the service is active. ros2 node list shows every node you expect, including the wrist camera driver. Nobody gets paged, because nothing failed.
But the last message on /wrist_cam/image_raw arrived forty minutes ago. The driver is still registered in the graph. It just stopped sending images. The policy downstream is waiting for a frame that will never come, and the operator on site thinks the robot is waiting for parts.
This is the ROS 2 failure I'd worry about most, because nothing in a normal stack reports it. A crash is loud: the process exits, systemd restarts it, a log line says why. A node that stays and says nothing produces no log line at all.
It matters more than it used to. A robot running a learned policy is a living mind: a model decides many times a second from what the cameras and joints report, the model and the site keep changing, and the robot runs far from the person who could notice. When an input goes quiet, the policy has nothing new to decide from. Whatever it does next, waiting or repeating, it does without telling anyone why.
The short answer: A node being up tells you nothing about its data. Measure the time since the last message on every topic that normally flows at a steady rate, and alert when it has been silent for several times that topic's own usual gap. On one robot, ros2 topic hz and ros2 topic info -v tell you which kind of silence you have; in code, a QoS deadline on the subscription reports it. Treat silence as its own alert, separate from crashes and low rates.
ros2 node list shows what DDS discovery knows (through the ros2 daemon's cached view; add --no-daemon to ask the network directly). A node stays in that list as long as its process keeps taking part in discovery, and that work happens in middleware threads, not in your callbacks. So a node can be fully present in the graph while the code that's supposed to publish hasn't run for an hour.
These are the ways I've seen a topic go quiet while everything else looked green.
A ROS 2 executor runs your timers and subscription callbacks. The executors documentation says callbacks in a mutually exclusive callback group must not run in parallel, and a plain spin(node) runs everything on a single thread. So if one callback blocks, the timer that publishes your topic never fires again.
What blocks it in real life:
The node is alive and uses almost no CPU. Low CPU plus no output usually means it's waiting, not working.
A USB camera disconnects for half a second because a cable moved during a fast motion, and comes back with a new device number. The driver keeps trying the old one. Same with a serial motor bus after a brownout, or an I2C sensor that stopped answering. Often the driver is looping on read errors it logged once, an hour ago. Sometimes it's blocked in the kernel. Either way, nothing in ROS knows.
Managed (lifecycle) nodes have four primary states: unconfigured, inactive, active and finalized. A lifecycle publisher only sends messages while its node is active. The lifecycle demo shows what happens otherwise: the node logs that the publisher is inactive and messages are not published. The node is in ros2 node list, and its publisher still counts. It's simply not active, maybe because a supervisor deactivated it after an error and never brought it back.
Many nodes only publish when they receive input. A detector publishes when an image arrives. A policy publishes actions when it gets an observation. If the camera stops, the detector stops, and the action topic stops. Three topics went silent, but only one of them is the cause. Find the first silent topic in the chain, not the loudest symptom.
Someone attached a debugger on site and forgot about it, or the process got a stop signal. This one looks different: a stopped process stops its DDS threads too, so after its discovery lease runs out the node disappears from the graph while the process is still there. "Node gone, process alive" is its own signal, and it's not a crash.
Then there's the case where the publisher is fine and you just don't hear it: incompatible QoS, shared memory not shared between containers, a domain ID mismatch. We covered those traps in how to monitor ROS 2 across a fleet of robots. Establish early whether the publisher stopped or you stopped hearing it.
This is the trap I see most often. Teams add an alert like "camera rate below 20 Hz for 1 minute" and assume silence is covered, because zero is below 20.
It often isn't. A rate is computed from messages. When messages stop, many pipelines stop producing rate samples at all, instead of producing zeros. A threshold rule over no data has nothing to evaluate, so it stays quiet. The alert that was supposed to catch the worst case catches only the mild one.
So measure silence directly:
When you're on a single robot and a topic looks dead, this is the order I check in. The ROS commands are from the Jazzy CLI (ros2topic source).
ros2 topic hz /wrist_cam/image_raw -w 50 # is anything arriving at all?
ros2 topic info -v /wrist_cam/image_raw # publisher count and QoS of each side
ros2 node list --no-daemon # is the publishing node still in the graph?
ros2 lifecycle get /wrist_cam_driver # managed node: active or inactive?
ps -L -o tid,stat,wchan:32,comm -p <pid> # every thread: S, D (kernel wait), T or t (stopped)
sudo py-spy dump --pid <pid> # Python node: where is each thread waiting?
sudo gdb -p <pid> -batch -ex "thread apply all bt" # C++ node: the same, from gdb
How to read the answers:
dump prints each Python thread's stack, and gdb does the same for C++; the blocking call is usually right there. Attaching needs root, and inside Docker py-spy may fail because the container blocks the system call it uses, so run it from the host./rosout for an incompatible QoS warning.ROS 2 has built-in ways for a node to report silence.
QoS deadline. The QoS documentation defines the deadline as the expected maximum time between messages on a topic. A subscription that sets one gets a "requested deadline missed" event when nothing arrives in time; a publisher that offers one gets "offered deadline missed" when it fails to publish in time. Here's a subscriber on the camera, in the style of the official deadline demo:
from copy import copy
from rclpy.duration import Duration
from rclpy.event_handler import SubscriptionEventCallbacks
from rclpy.qos import qos_profile_sensor_data
from sensor_msgs.msg import Image
def on_deadline(event):
node.get_logger().error(f"wrist_cam silent: {event.total_count} deadlines missed")
qos = copy(qos_profile_sensor_data) # best effort, like most camera drivers
qos.deadline = Duration(seconds=0.2)
cbs = SubscriptionEventCallbacks(deadline=on_deadline)
node.create_subscription(Image, "/wrist_cam/image_raw", on_image, qos, event_callbacks=cbs)
One catch: a deadline is part of the QoS contract. The publisher must offer a deadline equal to or shorter than the one the subscription requests, or the two don't connect at all. A driver with the default (no deadline) won't match this subscriber. So this works for nodes you own on both sides; for a third-party driver, set its publisher's deadline through its parameters if it allows that, or watch the topic from outside.
Liveliness. With automatic liveliness, the documentation says all of a node's publishers count as alive when any one of them has published. One healthy topic hides a quiet one on the same node. For "is this topic flowing", the deadline is the better tool.
diagnostic_updater. If your drivers publish /diagnostics, the diagnostic_updater package has FrequencyStatus and DiagnosedPublisher, which check a publisher's rate against a minimum and maximum with a tolerance. When no events were recorded in the window, the status is ERROR with "No events recorded."
The limit of all three: they run inside the robot's own processes. If the node that should report the miss is the one that's stuck, it reports nothing. In-process checks are good for fast local reactions, like a controller stopping motion when its command topic goes stale. You still need a watcher outside the process that judges every topic the same way.
On one robot, a person runs the commands above. On fifty robots, nobody notices the silence in the first place. Before the second site goes live, I'd have:
/rosout, metrics and a camera frame, and save them when a topic goes quiet. That's what a flight recorder for robots is for.If one robot's driver goes quiet every afternoon and its peers never do, look at that robot before the code; more on that in finding the robot that's different.
Our agent watches ROS 1 and ROS 2 from outside your processes, with nothing added to your workspace, and it never publishes. It learns each topic's rhythm, reports a topic that stopped (silent for several times its usual gap) and when it flows again, leaves topics sent only on change alone, and reports a node that left the ROS network while its process is still there, with that process's state. On-device diagnosis names the likely cause, such as a lost publisher, a process stopped or blocked on I/O, or a change in the hour before, and the minutes around it are saved as a flight recording. More on the observability page.
If you've chased a silent node on a robot far away, I'd like to hear what it turned out to be.
In code, set a QoS deadline on the subscription and register a deadline callback; it fires when no message arrives within the deadline. The publisher has to offer a deadline equal or shorter, or they won't connect. For topics you don't control, watch the age of the last message from outside the node and alert at a multiple of the topic's usual gap.
Because the list reflects DDS discovery, which runs in middleware threads, not in your callbacks. A node with a blocked callback, a driver looping on errors, or an inactive lifecycle state stays in the graph while publishing nothing. Check the topic's rate and the process's threads, not just the node list.
A deadline is the expected maximum time between messages on one topic, and missing it raises an event on each side that set one. Liveliness tells you whether a publisher is still alive; with automatic liveliness, any publisher of a node publishing keeps all of that node's publishers alive. To detect a single quiet topic, use the deadline.
No. A lifecycle publisher only sends messages while its node is active; while inactive, messages are not published, even though the node and its publisher still appear in the graph. If a managed node's topic is silent, run ros2 lifecycle get on it first.
Base it on each topic's own rhythm rather than one global timeout. A multiple of the usual gap between messages, with a floor of around ten seconds, ignores normal jitter on fast topics and still catches a 1 Hz topic that stopped. Topics that publish only on change should not get a silence alert at all.

What an MCAP file is, how ROS 2 records it, and how to inspect, read in Python, convert from .db3, compress and recover MCAP files on real robots.
By Eitan Chudnovsky →
Fixed thresholds miss most problems on AI robots. How learned baselines, peer comparison and config differences find the one robot that's off, and why.
By Eitan Chudnovsky →Connect your first machine in minutes, develop it in the lab and run your whole fleet in production from one place.
Free for up to 3 machines · Then pay as you go