Improve pilotPosition when internal GPS is available (#5187)
* Update pilotposition when internal GPS does have a fix *** UNTESTED YET *** * Cosmetics, tested OK
This commit is contained in:
@@ -93,6 +93,12 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
|
|||||||
newVal = 0;
|
newVal = 0;
|
||||||
}
|
}
|
||||||
else if (unit == UNIT_GPS_LATITUDE) {
|
else if (unit == UNIT_GPS_LATITUDE) {
|
||||||
|
#if defined(INTERNAL_GPS)
|
||||||
|
if (gpsData.fix) {
|
||||||
|
pilotLatitude = gpsData.latitude;
|
||||||
|
distFromEarthAxis = getDistFromEarthAxis(pilotLatitude);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!pilotLatitude) {
|
if (!pilotLatitude) {
|
||||||
pilotLatitude = newVal;
|
pilotLatitude = newVal;
|
||||||
distFromEarthAxis = getDistFromEarthAxis(newVal);
|
distFromEarthAxis = getDistFromEarthAxis(newVal);
|
||||||
@@ -102,6 +108,11 @@ void TelemetryItem::setValue(const TelemetrySensor & sensor, int32_t val, uint32
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (unit == UNIT_GPS_LONGITUDE) {
|
else if (unit == UNIT_GPS_LONGITUDE) {
|
||||||
|
#if defined(INTERNAL_GPS)
|
||||||
|
if (gpsData.fix) {
|
||||||
|
pilotLongitude = gpsData.longitude;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (!pilotLongitude) {
|
if (!pilotLongitude) {
|
||||||
pilotLongitude = newVal;
|
pilotLongitude = newVal;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user