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
1 changed files with 3 additions and 6 deletions

View File

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