[ros-users] Easily pulling in time-histories from bagfiles

Tim Field tfield at willowgarage.com
Fri May 14 22:37:54 UTC 2010

Hi Pat,

There aren't any tools, but it's pretty easy to do with rosrecord:

[(t, msg.var1) for topic, msg, t in
rosrecord.logplayer('/path/to/some/bagfile.bag') if topic ==

Hope that helps,

On Fri, May 14, 2010 at 3:15 PM, Patrick Bouffard <
bouffard at eecs.berkeley.edu> wrote:

> Are there tools in existence that allow one to easily grab any given
> variable out of a bagfile, in Python (ideally) or Matlab (if push
> comes to shove)? I'd like to be able to do something like the
> following pseudo-python-code:
> from awesome_plotting_package import plot
> from super_bagfile_package import BagFile
> mybag = BagFile('/path/to/some/bagfile.bag')
> (t_important_var1, important_var1) = mybag.get('/important_topic/var1')
> plot(t_important_var1, important_var1)
> ... and this would give me a plot of my important variable vs. time.
> This would assume important_var1 is of a numeric type like float64,
> and I as the user would probably need to do special processing to
> parse other types like arrays, but that would be pretty
> straightforward.
> Does something similar to the above exist? If not, I'll try to put
> something together and share it.
> Cheers,
> Pat
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100514/8adb2f88/attachment-0003.html>

More information about the ros-users mailing list