From 46e3ca6a384a30cc615a07323fe7774db691ebb0 Mon Sep 17 00:00:00 2001 From: artem30801 Date: Tue, 17 Sep 2024 18:23:13 +0300 Subject: [PATCH] Use SYS_HAS_MAG in sensor info --- drone/modules/mavros_wrapper.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drone/modules/mavros_wrapper.py b/drone/modules/mavros_wrapper.py index 01f4f96..fb5d7eb 100644 --- a/drone/modules/mavros_wrapper.py +++ b/drone/modules/mavros_wrapper.py @@ -82,15 +82,18 @@ def get_calibration_status(): gyro_status = get_param('CAL_GYRO0_ID') mag_status = get_param('CAL_MAG0_ID') acc_status = get_param('CAL_ACC0_ID') + sys_has_mag = get_param('SYS_HAS_MAG') + has_mag = sys_has_mag.success and sys_has_mag.value.integer == 1 + status_text = "" if gyro_status.value.integer == 0 and gyro_status.success: status_text += "gyro: uncalibrated; " - if mag_status.value.integer == 0 and mag_status.success: + if has_mag and mag_status.value.integer == 0 and mag_status.success: status_text += "mag: uncalibrated; " if acc_status.value.integer == 0 and acc_status.success: status_text += "acc: uncalibrated; " if status_text == "": - if not gyro_status.success or not mag_status.success or not acc_status.success: + if not gyro_status.success or not acc_status.success or not (has_mag and mag_status.success): status_text = "NO_INFO" else: status_text = "OK"