AP_Arming: Restrict GPS/AHRS difference to a 2D solution

This commit is contained in:
Michael du Breuil 2018-05-10 21:03:06 -07:00 committed by Randy Mackay
parent 794ebe32e3
commit 81e453dee3

View File

@ -384,7 +384,7 @@ bool AP_Arming::gps_checks(bool report)
Location gps_loc = gps.location();
Location ahrs_loc;
if (ahrs.get_position(ahrs_loc)) {
float distance = location_3d_diff_NED(gps_loc, ahrs_loc).length();
const float distance = location_diff(gps_loc, ahrs_loc).length();
if (distance > AP_ARMING_AHRS_GPS_ERROR_MAX) {
if (report) {
gcs().send_text(MAV_SEVERITY_CRITICAL, "PreArm: GPS and AHRS differ by %4.1fm", (double)distance);