AP_Arming: only compare AHRS vs GPS if GPS is enabled

This commit is contained in:
Randy Mackay 2022-12-13 17:47:04 +09:00
parent 74a903109d
commit f670af63a6

View File

@ -598,6 +598,7 @@ bool AP_Arming::gps_checks(bool report)
}
// check AHRS and GPS are within 10m of each other
if (gps.num_sensors() > 0) {
const Location gps_loc = gps.location();
Location ahrs_loc;
if (AP::ahrs().get_location(ahrs_loc)) {
@ -608,6 +609,7 @@ bool AP_Arming::gps_checks(bool report)
}
}
}
}
if ((checks_to_perform & ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_GPS_CONFIG)) {
uint8_t first_unconfigured;