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

How do you expand the displayed data in rqt_bag?

asked 2016-05-01 17:35:37 -0600

M@t gravatar image

I'm playing back data from a rosbag file and I want to view the entire NMEA "GGA" sentence in real-time. However, when I try to enlarge the play-back window I get this:

image description

The end of the sentence is cut off and replaced with "..." even though there is plenty of room in the window to print the whole message. Does anyone know how to force rqt_bag to display the whole sentence? It seems like a bug with rqt_graph.

Before anyone suggests it, I can't view the sentence by publishing the it because of an unrelated problem.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2016-05-03 22:04:02 -0600

M@t gravatar image

updated 2016-05-04 17:07:10 -0600

Problem: When playing back a bag file in rqt_bag some data values (such as NMEA sentences) are cut off after a certain length, even if the window is expanded so that there is plenty of room for the full value to be displayed eg:

image description

Cause: rqt_bag automatically truncates displayed data after 50 characters, regardless of window space.

Solution: A work-around is to edit the raw_view.py file in rqt_bag's source files to change the truncation limit. But before you make any changes, clone rqt_bag into your workspace so you have a safe version to work on. The file path should be similar to:

~/rqt_bag/plugins/raw_view.py

Then, open raw_view.py in any python editor and look for the following code segment:

# Truncate long representations
if len(obj_repr) >= 50:
    obj_repr = obj_repr[:50] + '...'

Change both "50" entries to be any larger number you want (e.g. 100) and then save the file. Open rqt_bag, load your rosbag and the problem should be fixed:

image description

edit flag offensive delete link more

Comments

Actually, I think it's /opt, not ~/opt. And you should never modify files in /opt. Instead, clone rqt_bag into your catkin workspace and make the modifications there.

Martin Günther gravatar image Martin Günther  ( 2016-05-04 03:38:16 -0600 )edit

Sorry, you're quite right, thanks for the corrections!

M@t gravatar image M@t  ( 2016-05-04 17:06:46 -0600 )edit
0

answered 2016-05-03 03:09:40 -0600

I don't think that's possible in rqt_bag at the moment. You could open a feature request here if you want (or better yet do a pull request). I agree it would be nicer if strings were at least copy-able, so you could just copy-paste it into an editor window to see the full string.

Before anyone suggests it, I can't view the sentence by publishing the it because of an unrelated problem.

Damn, I was about to suggest that! :)

I think that's actually what you should do. There's two ways of doing it:

Either

roscore
rosparam set use_sim_time true
rosbag play --clock my.bag
rostopic echo /navsat/auxgps/nmea_sentence__Raw | grep sentence

... or simply:

rostopic echo /navsat/auxgps/nmea_sentence__Raw -b my.bag | grep sentence
edit flag offensive delete link more

Comments

It should be easy to modify the current behavior (which truncates after 50 characters: https://github.com/ros-visualization/... ). Please consider contributing a pull request for this.

Dirk Thomas gravatar image Dirk Thomas  ( 2016-05-03 12:59:40 -0600 )edit

Thanks for the help Martin and Dirk! Short-term, increasing 50 to 100 in raw_view.py works (its hacky but it hasn't created any problems yet). Long-term I'll look into a pull request.

M@t gravatar image M@t  ( 2016-05-03 21:37:06 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-05-01 17:35:37 -0600

Seen: 1,062 times

Last updated: May 04 '16