Browse Source

RemoteIDManager: Fix GPS bad not being detected:

we were using the geopositioninfo.isValid() in order to discard
GPS and send lat/long/alt 0, but this function returns true
even if latest GPS refresh was long time ago, so now instead
we are using _gcsGPSGood, which takes into account the 5 seconds
timeout as well
QGC4.4
davidsastresas 2 years ago committed by David Sastre
parent
commit
4e7f2f88e1
  1. 6
      src/Vehicle/RemoteIDManager.cc

6
src/Vehicle/RemoteIDManager.cc

@ -337,15 +337,15 @@ void RemoteIDManager::_sendSystem() @@ -337,15 +337,15 @@ void RemoteIDManager::_sendSystem()
_id_or_mac_unknown,
_settings->locationType()->rawValue().toUInt(),
_settings->classificationType()->rawValue().toUInt(),
geoPositionInfo.isValid() ? ( gcsPosition.latitude() * 1.0e7 ) : 0, // If position not valid, send a 0
geoPositionInfo.isValid() ? ( gcsPosition.longitude() * 1.0e7 ) : 0, // If position not valid, send a 0
_gcsGPSGood ? ( gcsPosition.latitude() * 1.0e7 ) : 0, // If position not valid, send a 0
_gcsGPSGood ? ( gcsPosition.longitude() * 1.0e7 ) : 0, // If position not valid, send a 0
AREA_COUNT,
AREA_RADIUS,
-1000.0f,
-1000.0f,
_settings->categoryEU()->rawValue().toUInt(),
_settings->classEU()->rawValue().toUInt(),
geoPositionInfo.isValid() ? gcsPosition.altitude() : 0, // If position not valid, send a 0
_gcsGPSGood ? gcsPosition.altitude() : 0, // If position not valid, send a 0
_timestamp2019()), // Time stamp needs to be since 00:00:00 1/1/2019
_vehicle->sendMessageOnLinkThreadSafe(sharedLink.get(), msg);
}

Loading…
Cancel
Save