From 370bee5c890b84e3f252b0350cc799d79efd4369 Mon Sep 17 00:00:00 2001 From: Arthur Golubtsov Date: Thu, 31 Oct 2019 16:39:12 +0000 Subject: [PATCH] mavros_mavlink: Modify get_calibration_status --- Drone/mavros_mavlink.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Drone/mavros_mavlink.py b/Drone/mavros_mavlink.py index 7f58180..e5dede5 100644 --- a/Drone/mavros_mavlink.py +++ b/Drone/mavros_mavlink.py @@ -78,17 +78,11 @@ def get_calibration_status(): mag_status = get_param('CAL_MAG0_ID') acc_status = get_param('CAL_ACC0_ID') status_text = "" - if gyro_status.success == False: - status_text += "gyro: wrong_param; " - elif gyro_status.value.integer == 0: + if gyro_status.value.integer == 0 and gyro_status.success: status_text += "gyro: uncalibrated; " - if mag_status.success == False: - status_text += "mag: wrong_param; " - elif mag_status.value.integer == 0: + if mag_status.value.integer == 0 and mag_status.success: status_text += "mag: uncalibrated; " - if acc_status.success == False: - status_text += "acc: wrong_param; " - elif acc_status.value.integer == 0: + if acc_status.value.integer == 0 and acc_status.success: status_text += "acc: uncalibrated; " if status_text == "": status_text = "OK"