Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: interpolate invalid GPS timestamps #696

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Conversation

ptpt
Copy link
Member

@ptpt ptpt commented Jan 15, 2025

This pull request introduces several improvements to the mapillary_tools/geotag/gpmf_parser.py file, focusing on enhancing GPS timestamp handling and code organization. The most important changes include reordering imports, adding error handling for GPS timestamp conversion, implementing a function to backfill GPS timestamps, and modifying the extraction of points from samples to use the new backfill function.

Enhancements to GPS timestamp handling:

  • Added error handling in the gps5_from_stream function to ensure robustness when converting GPS timestamps.
  • Implemented a new function _backfill_gps_timestamps to fill in missing GPS timestamps based on available data points.
  • Modified the _extract_points_from_samples function to use the _backfill_gps_timestamps function, ensuring that GPS timestamps are backfilled both forward and backward from the first available timestamp.

Code organization improvements:

  • Reordered imports to follow standard conventions, moving the datetime import to the correct position.

@ptpt ptpt merged commit ced3aa6 into main Jan 15, 2025
16 checks passed
@ptpt ptpt deleted the fix-invalid-gopro-gps-timestamps branch January 15, 2025 01:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants