ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rosbag record is not recording topic at the same frequency that the topic is being published?

asked 2019-07-25 17:03:36 -0500

MagicMan gravatar image

I have a very simple package with one only one node. This node reads data from an MC DAQ and publishes data to the topic /MC_AI. The node is working as intended, and using rostopic hz /MC_AI I can see that the publishing rate is around 1100Hz, which is what I need.

This node is meant to run in parallel with a second node that publishes image data to another topic at around 100Hz. I have verified that I can run both nodes simultaneously while still maintaining the 1100 & 100 Hz rates I require.

However, when I use rosbag record to save my data to a .bag file, I noticed that the /MC_AI topic is only being logged at around 200Hz. I should mention that recording just the /MC_AI topic allows the 1100Hz rate to be achieved. It seems that the addition of logging my image data is causing a slow down in record rate for /MC_AI.

I launch rosbag record in a launch file if that makes any difference.

Any ideas on what is causing this behavior? I have verified that the topic is still being published at 1100Hz when recording so I don't think rosbag record is slowing anything down. Have you heard of anything that will cause data to be recorded at a slower rate than it is published? Could this be a limitation of my disk write speed?

If anyone has any suggestions I would greatly appreciate it.

edit retag flag offensive close merge delete


Just a thought: Did you see any warnings about rosbag dropping messages? This can occur when you try to record large amounts of data. So basically, images are often a source of hassle here. As your image data is coming in at 100Hz, it might be quite a lot. So in the end the bottleneck might be writing to the harddrive.... But then, you should get some warnings.

mgruhler gravatar image mgruhler  ( 2019-07-26 01:10:04 -0500 )edit

I haven't seen any warnings, and the 200Hz rate I am seeing is too consistent for dropped messages. Considering my images are roughly 100,000 uint8's (500x250) publishing at 100Hz I'm, not so sure adding 1 float at 1000Hz should have much affect on writing to the disk. Also, I have been able to record two of these images at 100Hz in the past with little problems.

MagicMan gravatar image MagicMan  ( 2019-07-26 07:30:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-29 12:24:13 -0500

MagicMan gravatar image

updated 2019-07-29 12:24:38 -0500

Solved it myself. I had the use_sim_time parameter set to true; it should be false.

edit flag offensive delete link more


great that you solved it. But I must admit that I'm confused that this parameter does have this kind of influence... However, this might be better suited as a bug report upstream, if this can be reproduced easily.

mgruhler gravatar image mgruhler  ( 2019-07-30 01:32:13 -0500 )edit

Question Tools



Asked: 2019-07-25 17:03:36 -0500

Seen: 1,023 times

Last updated: Jul 29 '19