x12 gps improvement (#6570)

* Add hdop handling

* Add GPS to debug screen

* Only update PilotPos when a decent hdop is achieved
This commit is contained in:
3djc
2019-07-14 17:33:31 +02:00
committed by Andre Bernet
parent 328677abed
commit 9792bf52d4
6 changed files with 24 additions and 3 deletions
+2 -2
View File
@@ -141,7 +141,7 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
}
else if (unit == UNIT_GPS_LATITUDE) {
#if defined(INTERNAL_GPS)
if (gpsData.fix) {
if (gpsData.fix && gpsData.hdop < PILOTPOS_MIN_HDOP) {
pilotLatitude = gpsData.latitude;
distFromEarthAxis = getDistFromEarthAxis(pilotLatitude);
}
@@ -156,7 +156,7 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
}
else if (unit == UNIT_GPS_LONGITUDE) {
#if defined(INTERNAL_GPS)
if (gpsData.fix) {
if (gpsData.fix && gpsData.hdop < PILOTPOS_MIN_HDOP) {
pilotLongitude = gpsData.longitude;
}
#endif