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

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Patrick Bouffard
Date:  
To: ros-users
Subject: [ros-users] Easily pulling in time-histories from bagfiles
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