Repository navigation
Skip malformed NMEA sentences with a warning - #895
Merged
Merged
Conversation
One malformed RMC or GGA sentence failed the whole file, as not a valid NMEA file, and since NMEA files are read from any talker, so did one from a talker that v0.14.7 did not read. A log of 222 sentences with one more, a $GLGGA sentence whose checksum does not match, failed all 113 images geotagged from it, where v0.14.7 geotagged 106 of them, the 7 others being duplicates of the previous image. A video geotagged from such a log failed too. v0.14.7 crashed on a malformed $GPGGA sentence. A sentence that does not parse, whose checksum does not match, or with a field a fix is read from that does not parse, is now skipped, and one warning per file says how many were skipped and quotes the first, with its line number and what is wrong with it. pynmea2 leaves a field it cannot parse a string: a malformed time failed the file, and a malformed altitude crashed process with a traceback, for images and videos alike. Void sentences and sentences without a fix are skipped as before, without a warning. A file of which no fix can be read and that has malformed sentences still fails as not a valid NMEA file. On that log the 106 images get the same positions, times, directions and altitudes as with v0.14.7 and as from the log without the bad sentence, and the 7 others are duplicates as before.
caglarpir
force-pushed
the
nmea-skip-bad-sentences
branch
from
October 23, 2026 13:04
e9395a9 to
71217a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #894; review the last commit.
One malformed RMC or GGA sentence failed the whole file, as not a valid
NMEA file, and since NMEA files are read from any talker, so did one
from a talker that v0.14.7 did not read. A log of 222 sentences with one
more, a $GLGGA sentence whose checksum does not match, failed all 113
images geotagged from it, where v0.14.7 geotagged 106 of them, the 7
others being duplicates of the previous image. A video geotagged from
such a log failed too. v0.14.7 crashed on a malformed $GPGGA sentence.
A sentence that does not parse, whose checksum does not match, or with a
field a fix is read from that does not parse, is now skipped, and one
warning per file says how many were skipped and quotes the first, with
its line number and what is wrong with it. pynmea2 leaves a field it
cannot parse a string: a malformed time failed the file, and a malformed
altitude crashed process with a traceback, for images and videos alike.
Void sentences and sentences without a fix are skipped as before,
without a warning. A file of which no fix can be read and that has
malformed sentences still fails as not a valid NMEA file.
On that log the 106 images get the same positions, times, directions and
altitudes as with v0.14.7 and as from the log without the bad sentence,
and the 7 others are duplicates as before.
Unit and integration tests, doctests,
mypy --python-version 3.9,ruff check,ruff format --checkandusort diffare clean.