feat(gps): use HDOP for !gps fix readiness, satellite count as fallback

Satellite count alone is a poor proxy for fix quality -- few satellites
in good geometry can beat many in poor geometry. LocationProvider now
exposes getHDOP() (default -1 = unsupported); MicroNMEA implements it.
isLocFixReady() prefers HDOP <= 2.0 when available, falling back to the
old >=8 satellite threshold for providers that don't report it (e.g.
RAK12500/u-blox).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-07-24 22:49:17 +02:00
parent 2c656f5af7
commit 7b6ae8e2cb
6 changed files with 29 additions and 9 deletions

View File

@@ -14,6 +14,12 @@ public:
virtual long getLongitude() = 0;
virtual long getAltitude() = 0;
virtual long satellitesCount() = 0;
// Horizontal Dilution of Precision, in tenths (11 == HDOP 1.1) -- lower is
// better, and a much more direct read on fix quality than satellite count
// alone (few satellites in good geometry can beat many in poor geometry).
// -1 means this provider doesn't expose it; callers fall back to
// satellitesCount() in that case.
virtual long getHDOP() { return -1; }
virtual bool isValid() = 0;
virtual long getTimestamp() = 0;
virtual void sendSentence(const char * sentence);

View File

@@ -120,6 +120,7 @@ public :
return alt;
}
long satellitesCount() override { return nmea.getNumSatellites(); }
long getHDOP() override { return nmea.getHDOP(); }
bool isValid() override { return nmea.isValid(); }
long getTimestamp() override {