swift-nav / libswiftnav

A portable C library implementing GNSS related functions and algorithms.
GNU Lesser General Public License v3.0
17 stars 20 forks source link

[SCB-102] Assert on invalid tow. #2

Closed akleeman closed 3 years ago

akleeman commented 3 years ago

In SCB-102 we encountered an issue in which the times encoded in BDS ephemeris messages were not normalized which caused very large outliers do to erroneous computations inside calc_sat_state which assume that all times are normalized. This is actually the second time we've tracked down this same bug and both times required a large amount of man hours.

In order to prevent future issues like this I've added an assertion which will cause a hard failure if an ephemeris has an invalid time. One alternative would be to normalize all unnormalized times.