rosbag record is not recording topic at the same frequency that the topic is being published?
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.
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.
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.