commander Preflight::preflightCheck: transition condition_system_sensors_initialized only to true

- this matches the logic in arming_state_transition()
- if Commander::preflight_check was run in armed state and the checks
  failed, disarming was not possible anymore
  (because disarming checks for condition_system_sensors_initialized).
  That is currently not the case, but the existing logic is way too fragile.

Alternative solution: check if armed in Preflight::preflightCheck, and
only transition to false if disarmed (but also respect the re-arming
grace period).
This commit is contained in:
Beat Küng
2018-06-09 11:42:34 +02:00
parent 9eae8e7c5b
commit 469b5f98e2
+3 -1
View File
@@ -4057,7 +4057,9 @@ bool Commander::preflight_check(bool report)
bool success = Preflight::preflightCheck(&mavlink_log_pub, status, status_flags, checkGNSS, report, false,
hrt_elapsed_time(&commander_boot_timestamp));
status_flags.condition_system_sensors_initialized = success;
if (success) {
status_flags.condition_system_sensors_initialized = true;
}
return success;
}