mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 17:50:35 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user