From 62d9b14a65f2276534ae17306e531f67fcc0cdd8 Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Thu, 27 Jun 2024 16:30:31 -0300 Subject: [PATCH] Sub: add arming check for backup origin Co-authored-by: Clyde McQueen --- ArduSub/AP_Arming_Sub.cpp | 5 ++++- ArduSub/Parameters.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ArduSub/AP_Arming_Sub.cpp b/ArduSub/AP_Arming_Sub.cpp index bcf5c0c8b8..6c1c0504c4 100644 --- a/ArduSub/AP_Arming_Sub.cpp +++ b/ArduSub/AP_Arming_Sub.cpp @@ -152,8 +152,11 @@ bool AP_Arming_Sub::arm(AP_Arming::Method method, bool do_arming_checks) // if we do not have an ekf origin then we can't use the WMM tables if (!sub.ensure_ekf_origin()) { gcs().send_text(MAV_SEVERITY_WARNING, "Compass performance degraded"); + if (check_enabled(ARMING_CHECK_PARAMETERS)) { + check_failed(ARMING_CHECK_PARAMETERS, true, "No world position, check ORIGIN_* parameters"); + return false; + } } - // return success return true; } diff --git a/ArduSub/Parameters.cpp b/ArduSub/Parameters.cpp index 158d58e390..b2e319088a 100644 --- a/ArduSub/Parameters.cpp +++ b/ArduSub/Parameters.cpp @@ -709,14 +709,14 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = { // @Param: ORIGIN_LAT // @DisplayName: Backup latitude for EKF origin // @Description: Backup EKF origin latitude used when not using a positioning system. - // @Units: degrees + // @Units: deg // @User: Standard AP_GROUPINFO("ORIGIN_LAT", 19, ParametersG2, backup_origin_lat, 0), // @Param: ORIGIN_LON // @DisplayName: Backup longitude for EKF origin // @Description: Backup EKF origin longitude used when not using a positioning system. - // @Units: degrees + // @Units: deg // @User: Standard AP_GROUPINFO("ORIGIN_LON", 20, ParametersG2, backup_origin_lon, 0),