From 9f414e82f64bbaba28ba4b7d764c488758cb84a2 Mon Sep 17 00:00:00 2001 From: Philipp Oettershagen Date: Wed, 6 Jun 2018 14:24:19 +0200 Subject: [PATCH] Subsystem_info status flags & checks: Add comment to indicate that the IMU+MAG consistency checks need to be performed AFTER the individual checks are complete --- src/modules/commander/PreflightCheck.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/modules/commander/PreflightCheck.cpp b/src/modules/commander/PreflightCheck.cpp index 57ce023dfd9..9ad055b1c92 100644 --- a/src/modules/commander/PreflightCheck.cpp +++ b/src/modules/commander/PreflightCheck.cpp @@ -747,7 +747,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, bool mag_fail_reported = false; - /* check all sensors, but fail only for mandatory ones */ + /* check all sensors individually, but fail only for mandatory ones */ for (unsigned i = 0; i < max_optional_mag_count; i++) { bool required = (i < max_mandatory_mag_count) && sys_has_mag == 1; int device_id = -1; @@ -771,7 +771,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, failed = true; } - /* fail if mag sensors are inconsistent */ + /* mag consistency checks (need to be performed after the individual checks) */ if (!magConsistencyCheck(mavlink_log_pub, status, (reportFailures && !failed))) { failed = true; } @@ -785,7 +785,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, bool accel_fail_reported = false; - /* check all sensors, but fail only for mandatory ones */ + /* check all sensors individually, but fail only for mandatory ones */ for (unsigned i = 0; i < max_optional_accel_count; i++) { bool required = (i < max_mandatory_accel_count); int device_id = -1; @@ -818,7 +818,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, bool gyro_fail_reported = false; - /* check all sensors, but fail only for mandatory ones */ + /* check all sensors individually, but fail only for mandatory ones */ for (unsigned i = 0; i < max_optional_gyro_count; i++) { bool required = (i < max_mandatory_gyro_count); int device_id = -1; @@ -880,6 +880,7 @@ bool preflightCheck(orb_advert_t *mavlink_log_pub, vehicle_status_s &status, } /* ---- IMU CONSISTENCY ---- */ + // To be performed after the individual sensor checks have completed if (checkSensors) { if (!imuConsistencyCheck(mavlink_log_pub, status, (reportFailures && !failed))) { failed = true;