Rosbag not recording every message [closed]

asked 2013-05-15 10:30:54 -0500

jrvanwhy gravatar image

updated 2013-05-22 08:34:09 -0500

We are trying to log data using rosbag, but are finding that it is falling behind. A realtime system is spitting out messages at 1kHz on various topics (using Orocos's ROS integration), which we are bagging on the same machine via rosbag record. We are recording around 400KB/s total.

We'll often see skips in the data (skipped messages). This is reflected both in the (custom) timestamps in the headers as well as the sequence numbers skipping. These skips can vary from a few messages to several hundred messages.

The machine on which this is occurring is not under particularly high system load, and rosbag is recording to the local hard drive. I've noted that rosbag does not output any messages about falling behind.

Is there any way we can fix/further debug this issue?

EDIT: This is running on a quad core Intel i7-based system with an SSD hard drive. I'm slightly mystified by the contradictory load results I'm getting from various sources (likely an artifact of the (periodic?) sampling used to calculate processor usage), so I'll list them all.

According to htop, rosbag is using approximately 120% of one core, with one thread using 42% of a core and another using 37%. The other threads are mostly idle.

Also according to htop, our node (which is publishing the messages) is using approximately 20% of the CPU.

htop reports that all CPU cores are nearly idle or completely idle, with less than 5% usage each, and often 0.0% usage (?!)

The load average floats between 0.7 and 2.0 (this also seems incorrect).

Xenomai (the realtime OS we use) reports that our code uses a total of 19% of the CPU, matching the 20% number reported by htop.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2016-07-27 18:11:01.513398

Comments

Usually this only happens under high system load when message queues are processed slower than they are filled. Can you provide a simple example which drops messages under low system load?

Dirk Thomas gravatar image Dirk Thomas  ( 2013-05-16 08:18:14 -0500 )edit

I've posted information on the system load above. I'm unable to provide a sample that drops messages while sending a minimal amount of data. However, the system load is far from 100% and is stable, so I do not think that is the issue.

jrvanwhy gravatar image jrvanwhy  ( 2013-05-22 08:41:45 -0500 )edit

Why has this question been closed without an answer? I still have this problem quite often and don't know how to fix it. If you don't have an answer that's fine, but don't close the perfectly valid question.

Hakaishin gravatar image Hakaishin  ( 2018-11-21 10:44:46 -0500 )edit