Browse Source

AP_Arming: use get_distance instead of location_diff

master
Pierre Kancir 6 years ago committed by Tom Pittenger
parent
commit
6397cb0c0e
  1. 2
      libraries/AP_Arming/AP_Arming.cpp

2
libraries/AP_Arming/AP_Arming.cpp

@ -434,7 +434,7 @@ bool AP_Arming::gps_checks(bool report) @@ -434,7 +434,7 @@ bool AP_Arming::gps_checks(bool report)
const Location gps_loc = gps.location();
Location ahrs_loc;
if (AP::ahrs().get_position(ahrs_loc)) {
const float distance = location_diff(gps_loc, ahrs_loc).length();
const float distance = gps_loc.get_distance(ahrs_loc);
if (distance > AP_ARMING_AHRS_GPS_ERROR_MAX) {
check_failed(ARMING_CHECK_GPS, report, "GPS and AHRS differ by %4.1fm", (double)distance);
return false;

Loading…
Cancel
Save