Rosanswers logo

Rosbag and rqt_bag are fantastic diagnostic tools. But I've found that the plotting function in rqt_bag is unbelievably buggy. Roughly 60% of the time, the data simply doesn't show up when I try to plot it, for example:

image description

Notice that the "altitude" variable is ticked, yet nothing is being displayed on the plot. The plotting function can mess up in other ways too, e.g.

  • The data may plot correctly but the red line indicating the position in the rosbag file will freeze or disappear altogther
  • The whole plot may freeze, even the raw numbers in the window to the right of the plot
  • The plot itself may experience a graphical glitch where two plots overlap slightly (I haven't been able to re-create this one sorry)

These problems are very inconsistent - sometimes restarting rqt_bag makes the plot display properly and sometimes it doesn't. Like I said, any given time I start rqt_bag there is only a 40% chance of everything displaying properly, regardless of which rosbag file I am trying to play. Often when rqt_bag bugs out, a few error messages get printed to terminal, here are some of them:

Has anyone else experienced this or know how to fix it? I'm not sure if this is a bug, corruption in the rosbag file or something I've unknowingly done to mess up the plugin.

Here is a link to one of the bags I'm using: https://www.dropbox.com/s/qmwyrmg13zjwgx1/debugingbag.zip?dl=0 If no-one else experiences the same behavior then my problem is likely to do with my setup.

Originally posted by M@t on ROS Answers with karma: 2327 on 2016-05-19

Post score: 1

Original comments

Comment by ahendrix on 2016-05-19:
I haven't had most of these issues but I also wrote most of the rqt_bag plot plugin, so I'm more prone to look past its faults. If you can provide a bag file that replicates these issues I can try to reproduce them.

Comment by M@t on 2016-05-19:
Unfortunately these errors occur regardless of the file I'm trying to play, which makes me think that it's something to do with my setup. I've edited my question to add some of the error messages I've seen. Hopefully they'll mean more to you than they do to me. I'll keep investigating the problem.

Comment by ahendrix on 2016-05-19:
I've tried this with a few bag files that I had around and can't reproduce the error you describe.

Comment by M@t on 2016-05-19:
What's the best way for me to send you a bag file? if it works fine for you then we can at least rule out the bag files being the cause of the problem. Also see if the error messages I'm adding mean anything to you. And thanks for the help ahendrix, I really appreciate it.

Comment by ahendrix on 2016-05-19:
If you don't want to attach bag files to this question, you can email them to me: [email protected] (or upload them somewhere and email a link)

Comment by M@t on 2016-05-21:
Attaching a file doesn't seem to be working for me so I've added a link to one of the bag files I'm using in the question.

Comment by ahendrix on 2016-05-22:
I'm able to reproduce a few of the issues you describe if I play back a bag file and toggle the plot on or off at the same time. I suspect some kind of threading bug in rqt_bag

Comment by M@t on 2016-05-22:
Do you see these problems with the bag file I linked to in the question or your own? It may be related to the volume of data I'm dealing with. I've noticed that rqt_bag becomes much less responsive when I'm playing large bag files (100+ MB, 30+ min)


1 Answer 1


Rosanswers logo

The plotting plugin in rqt_bag did not lock the bag file when it was reading it; this lead to rare cases where multiple threads would try to read from the bag at the same time, with both threads moving the file point around and probably corrupting one another.

This bug seems significantly rarer on machines with very high disk bandwidth, so I see the error far less frequently than you report because my laptop has a fast processor and solid state drive.

I have a proposed fix in the bag_plot_lock branch of my fork of rqt_common_plugins; please give this a try and let me know if it fixes the issue for you.

Originally posted by ahendrix with karma: 47576 on 2016-06-15

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by M@t on 2016-06-15:
That might explain why I had so many problems on the VM and on my laptop (which is getting old). Your changes initially seem to have fixed the issue. Plotting is way more responsive and I haven't had any problems (yet). I'll test it with some more bag files and report back if I encounter any errors.

Comment by ahendrix on 2016-06-15:
Thanks for confirming! I've submitted my patch as a pull request to rqt_common_plugins: https://github.com/ros-visualization/rqt_common_plugins/pull/382

Comment by M@t on 2016-06-16:
Well the fix worked for a while. I've now encountered an issue where any time I try to plot something or view the raw data - with any bag file, rqt_bag just ignores the command and does nothing. Here's one of my files: testData.bag

Comment by M@t on 2016-06-16:
I've also noticed that for some reason the window size options (exit, minimize, fullscreen) in the top left corner no longer appear when starting rqt_bag. Unfortunately, nothing is printed to terminal this time so I can't even give you any error messages to look at.

Comment by M@t on 2016-06-21:
Yeah, its really weird, I can't even view raw data, let alone plot it. And the problem is consistent even after re-starting rqt and the laptop. Reverting your changes doesn't fix the issue which is even weirder. It's like something is locked somewhere and not resetting. That or my rosbag is corrupt.

Comment by ahendrix on 2016-06-21:
I've been away from my dev machine so I haven't had time to look at this new bag file. You can check if other tools will play it such as rosbag info, rosbag play and rostopic echo -b testData.bag /topic

Comment by ahendrix on 2016-07-20:
I had a look at your bag file and was able to view and plot the cmd_vel topic. I suspect the issue is on your system; did you recently change your ROS version or something about your workspace?

Comment by M@t on 2016-07-20:
The only thing I've changed is the length of the displayed data, as per this question. The other tools like rosbag info, rosbag play work fine. It only seems to be rqt_bag that locks up.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.