Ask Your Question
1

Why does rqt_bag often fail to plot data?

asked 2016-05-19 00:19:19 -0500

M@t gravatar image

updated 2016-05-21 18:04:48 -0500

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/qmwyrmg13zj... If no-one else experiences the same behavior then my problem is likely to do with my setup.

edit retag flag offensive close merge delete

Comments

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.

ahendrix gravatar imageahendrix ( 2016-05-19 00:45:25 -0500 )edit

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.

M@t gravatar imageM@t ( 2016-05-19 16:43:05 -0500 )edit

I've tried this with a few bag files that I had around and can't reproduce the error you describe.

ahendrix gravatar imageahendrix ( 2016-05-19 17:25:41 -0500 )edit

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.

M@t gravatar imageM@t ( 2016-05-19 17:36:42 -0500 )edit

If you don't want to attach bag files to this question, you can email them to me: namniart@gmail.com (or upload them somewhere and email a link)

ahendrix gravatar imageahendrix ( 2016-05-19 21:16:24 -0500 )edit

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.

M@t gravatar imageM@t ( 2016-05-21 18:06:24 -0500 )edit

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

ahendrix gravatar imageahendrix ( 2016-05-22 20:43:38 -0500 )edit

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)

M@t gravatar imageM@t ( 2016-05-22 21:55:52 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-06-15 00:31:54 -0500

ahendrix gravatar image

updated 2016-06-15 23:21:21 -0500

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.

edit flag offensive delete link more

Comments

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.

M@t gravatar imageM@t ( 2016-06-15 19:20:50 -0500 )edit

Thanks for confirming! I've submitted my patch as a pull request to rqt_common_plugins: https://github.com/ros-visualization/...

ahendrix gravatar imageahendrix ( 2016-06-15 23:23:39 -0500 )edit

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

M@t gravatar imageM@t ( 2016-06-16 23:53:01 -0500 )edit

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.

M@t gravatar imageM@t ( 2016-06-16 23:59:43 -0500 )edit

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.

M@t gravatar imageM@t ( 2016-06-21 21:34:09 -0500 )edit

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

ahendrix gravatar imageahendrix ( 2016-06-21 22:51:53 -0500 )edit

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?

ahendrix gravatar imageahendrix ( 2016-07-20 13:57:13 -0500 )edit

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.

M@t gravatar imageM@t ( 2016-07-20 16:20:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2016-05-19 00:19:19 -0500

Seen: 932 times

Last updated: Jun 15 '16