AP_Arming: add gps consistency and blend health check

This commit is contained in:
Randy Mackay 2017-03-09 09:47:57 +09:00
parent 729ce34ce3
commit 9f21649dc0

View File

@ -369,6 +369,26 @@ bool AP_Arming::gps_checks(bool report)
return false; return false;
} }
} }
// check GPSs are within 50m of each other and that blending is healthy
if ((checks_to_perform & ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_GPS_CONFIG)) {
float distance_m;
if (!gps.all_consistent(distance_m)) {
if (report) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL,
"PreArm: GPSs inconsistent by %4.1fm",
(double)distance_m);
}
return false;
}
if (!gps.blend_healthy()) {
if (report) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: GPS blending unhealthy");
}
return false;
}
}
return true; return true;
} }