Skip to content

Instantly share code, notes, and snippets.

@herzig
Created November 1, 2020 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herzig/6c784951bcf8e286ffcbf6b1e5b133c3 to your computer and use it in GitHub Desktop.
Save herzig/6c784951bcf8e286ffcbf6b1e5b133c3 to your computer and use it in GitHub Desktop.
rosbag_to_csv.py
import rosbag_pandas
import glob
for f in glob.glob('*.bag'):
print(f'convert bag file {f} to csv...')
df = rosbag_pandas.bag_to_dataframe(f, exclude=['/rosout', '/rosout_agg'])
df.to_csv(f'{f[:-4]}.zip')
print(' ok')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment