commaai / laika

Simple Python GNSS processing library
MIT License
647 stars 179 forks source link

Ephemeris: Fix roll-over time when reading ublox ephemeris messages #79

Closed gijskoning closed 2 years ago

gijskoning commented 2 years ago

The weektime of the ephemeris messages rolls over after 10 bits ~= 19.6 years. The method now expects an argument for the current gps time such that it can decide if the message is before or after 2019 when the second roll-over happened. This time can be retrieved from last gnss message or just the current time. (It only gets tricky at 6/4/2019 at 23:59, however if it is wrongly set the worst that happens is that an ephemeris message is lost, since it will not be used because of the large time difference)

Also refactor ephemeris classes by moving things to the abstract Ephemeris class.

(It's funny that the method was actually failing after April 2019)