Ask Your Question

Possible to live the data from rosbag

asked 2017-07-20 04:42:04 -0500

Obedulla gravatar image

I want to live the data from rosbag and display on graph with respect to time. I googled it ,but not get any solution. I know reading data and writting data into rosbag . I want to display graph when rosbag play command was executed.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-07-20 10:52:56 -0500


I see 3 way to display rosbag data in streaming :

1) with rqt_bag

You can use the executable "rqt_bag" (or "rosrun rqt_bag rqt_bag") to open a rqt GUI where you can load a rosbag -> right click on a topic -> view -> plot -> check the data you want on the graph on the new rqt_plot GUI and click play.

You will see a graph of your data with a red bar (the timeline) to see the current data. It's not a live streaming (all data appear on the graph) but it's the easiest method.

2) with rqt_plot

You can play a bag file and open a rqt_plot at the same time with 3 terminal.

On terminal 1, launch a roscore (command "roscore")

On terminal 2, launch play your bag file (command "rosbag play bagname")

On terminal 3, launch rqt_plot (command "rqt_plot" or "rosrun rqt_plot rqt_plot")

On the rqt_plot GUI, type the topic you want to display and adjust the axes.

You can also use PlotJuggler

3) with roslaunch

You can use the previous method but instead of launching "rqt_plot", just launch rqt (with "rqt" or "rosrun rqt rqt")

Then go to plugin > visualization > Plot

Choose the topic you want.

Click on perspective > Export... and save the perspective file where you want (an easy path if possible).

Then you need a roslaunch file that look like this :

  <node name="<name_of_your_rosbag_node>" pkg="rosbag" type="rosbag" args="play <name_of_your_rosbag>"/>
  <node name="<name_of_your_gui_node>" pkg="rqt" type="rqt" args="--perspective-file <your_perspective_file>"/>

Then execute your launch file with "roslaunch name_of_your_launch_file".

Your data in live streaming with rqt_plot should open.

edit flag offensive delete link more

answered 2018-01-30 05:59:10 -0500

Davide Faconti gravatar image

Similarly to what @lmathieu said, but using PlotJuggler ( )

1) roscore 2) rosbag play your_rosbag_file 3) Start PlotJuggler and select Strraming -> Start ROS_Topic_Streamer 4) Drag and drop the fields you want to visualize

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2017-07-20 04:42:04 -0500

Seen: 2,027 times

Last updated: Jan 30 '18