Sub: integrate ahrs.pre_arm_check

This commit is contained in:
Randy Mackay 2020-08-11 14:04:42 +09:00 committed by Peter Barker
parent 161d235c8b
commit facc0ea8bb

View File

@ -65,12 +65,9 @@ bool AP_Arming_Sub::ins_checks(bool display_failure)
// additional sub-specific checks // additional sub-specific checks
if ((checks_to_perform & ARMING_CHECK_ALL) || if ((checks_to_perform & ARMING_CHECK_ALL) ||
(checks_to_perform & ARMING_CHECK_INS)) { (checks_to_perform & ARMING_CHECK_INS)) {
if (!AP::ahrs().prearm_healthy()) { char failure_msg[50] = {};
const char *reason = AP::ahrs().prearm_failure_reason(); if (!AP::ahrs().pre_arm_check(failure_msg, sizeof(failure_msg))) {
if (reason == nullptr) { check_failed(ARMING_CHECK_INS, display_failure, "AHRS: %s", failure_msg);
reason = "AHRS not healthy";
}
check_failed(ARMING_CHECK_INS, display_failure, "%s", reason);
return false; return false;
} }
} }