Browse Source

AP_NavEKF2: apply min GPS accuracy at measurement point

this fixes an issue a RTK GPS gives 1cm horizontal and vertical
accuracy and that causes the variances to get too small
c415-sdk
Andrew Tridgell 5 years ago
parent
commit
83e5639225
  1. 3
      libraries/AP_NavEKF2/AP_NavEKF2_Measurements.cpp

3
libraries/AP_NavEKF2/AP_NavEKF2_Measurements.cpp

@ -517,6 +517,7 @@ void NavEKF2_core::readGpsData() @@ -517,6 +517,7 @@ void NavEKF2_core::readGpsData()
} else {
gpsSpdAccuracy = MAX(gpsSpdAccuracy,gpsSpdAccRaw);
gpsSpdAccuracy = MIN(gpsSpdAccuracy,50.0f);
gpsSpdAccuracy = MAX(gpsSpdAccuracy,frontend->_gpsHorizVelNoise);
}
gpsPosAccuracy *= (1.0f - alpha);
float gpsPosAccRaw;
@ -525,6 +526,7 @@ void NavEKF2_core::readGpsData() @@ -525,6 +526,7 @@ void NavEKF2_core::readGpsData()
} else {
gpsPosAccuracy = MAX(gpsPosAccuracy,gpsPosAccRaw);
gpsPosAccuracy = MIN(gpsPosAccuracy,100.0f);
gpsPosAccuracy = MAX(gpsPosAccuracy, frontend->_gpsHorizPosNoise);
}
gpsHgtAccuracy *= (1.0f - alpha);
float gpsHgtAccRaw;
@ -533,6 +535,7 @@ void NavEKF2_core::readGpsData() @@ -533,6 +535,7 @@ void NavEKF2_core::readGpsData()
} else {
gpsHgtAccuracy = MAX(gpsHgtAccuracy,gpsHgtAccRaw);
gpsHgtAccuracy = MIN(gpsHgtAccuracy,100.0f);
gpsHgtAccuracy = MAX(gpsHgtAccuracy, 1.5f * frontend->_gpsHorizPosNoise);
}
// check if we have enough GPS satellites and increase the gps noise scaler if we don't

Loading…
Cancel
Save