From 161d235c8b9550e090fc2df659246426b20c32aa Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 11 Aug 2020 14:04:30 +0900 Subject: [PATCH] Rover: integrate ahrs.pre_arm_check --- Rover/AP_Arming.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Rover/AP_Arming.cpp b/Rover/AP_Arming.cpp index 83cada638f..ecfe82cea0 100644 --- a/Rover/AP_Arming.cpp +++ b/Rover/AP_Arming.cpp @@ -42,12 +42,9 @@ bool AP_Arming_Rover::gps_checks(bool display_failure) const AP_AHRS &ahrs = AP::ahrs(); // always check if inertial nav has started and is ready - if (!ahrs.prearm_healthy()) { - const char *reason = ahrs.prearm_failure_reason(); - if (reason == nullptr) { - reason = "AHRS not healthy"; - } - check_failed(display_failure, "%s", reason); + char failure_msg[50] = {}; + if (!ahrs.pre_arm_check(failure_msg, sizeof(failure_msg))) { + check_failed(display_failure, "AHRS: %s", failure_msg); return false; } @@ -59,11 +56,8 @@ bool AP_Arming_Rover::gps_checks(bool display_failure) // ensure position esetimate is ok if (!rover.ekf_position_ok()) { - const char *reason = ahrs.prearm_failure_reason(); - if (reason == nullptr) { - reason = "Need Position Estimate"; - } - check_failed(display_failure, "%s", reason); + // vehicle level position estimate checks + check_failed(display_failure, "Need Position Estimate"); return false; }