commander: prevent ekf checking being bypassed if GPS checking is disabled

This commit is contained in:
Paul Riseborough
2017-11-25 08:10:12 +11:00
committed by Lorenz Meier
parent ddfe077f7c
commit c09eecbab1

View File

@@ -789,9 +789,9 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, bool checkSensors, bool check
// only check EKF2 data if EKF2 is selected as the estimator and GNSS checking is enabled
int32_t estimator_type;
param_get(param_find("SYS_MC_EST_GROUP"), &estimator_type);
if (estimator_type == 2 && checkGNSS) {
if (estimator_type == 2) {
// don't fail if not using GPS for the first 20s after gaining 3D lock because quality checks take time to pass
bool enforce_gps_required = (_time_last_no_gps_lock > 20 * 1000000);
bool enforce_gps_required = (_time_last_no_gps_lock > 20 * 1000000) && checkGNSS;
if (!ekf2Check(mavlink_log_pub, true, reportFailures, enforce_gps_required)) {
failed = true;