tomas789 / kitti2bag

Convert KITTI dataset to ROS bag file the easy way!
MIT License
702 stars 256 forks source link

export velodyne data raise error if there are empty lines in 'timestamps.txt' #4

Closed victl closed 7 years ago

victl commented 7 years ago

on the 113th line of kitti2bag

    velo_datetimes = map(lambda x: datetime.strptime(x[:-4], '%Y-%m-%d %H:%M:%S.%f'), f.readlines())

so if there are empty lines in the timestamps.txt file, this code will fail with:

    ValueError: time data '' does not match format '%Y-%m-%d %H:%M:%S.%f'

And there are indeed empty lines in some kitti datasets, e.g. 2011_09_26_drive_0009_sync

tomas789 commented 7 years ago

Thank you for bug report. I'll look into it.

tomas789 commented 7 years ago

I have consulted people from KITTI and they said it is not a bug and data loss happened from time to time. So I made a new version 1.4 which fixes this bug. One have to be careful because data might not be aligned anymore. They are fully aligned only for datasets without missing data. By aligned I mean that nth item from velodyne laser scanner might not correspond to nth OXTS measurement. @victl: Thank you for your bug report.