Detect messages dropped by ros2 bag record
- Platform: Ubuntu 20.04
- ROS version: ROS2 foxy
I'm using ros2 bag record
to record data published by my own nodes. I know the expected message rate of my nodes and can therefore calculate the expected number of messages in the bag file given the "duration" and "message count" provided by ros2 bag info
.
My node publishes data on a single topic. When I run a single node and record the data published on its topic, I'm getting the expected number of messages in the bag file. If I instantiate two nodes and record the data from both topics, there are less messages in the bag file than expected.
I'm assuming this is some performance issue as the data rate of such a topic is rather high (~120 MB/s). Before starting to tune performance, I want to find a reliable way to detect if ros2 bag record
is unable to record any of the incoming data. For my application, dropping data is not allowed and therefore this needs to be at least detected to avoid ending up with a bag file with missing data.
Is there any way to detect messages being dropped by ros2 bag record
? Can this be somehow controlled by setting QoS appropriately? I have tried setting QoS of my publishing node to KeepAll
but this has not prevented drops.