mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 06:03:34 +08:00
commander: HITL skip auto disarm if lockdown
- auto disarm when locked down was added in #14766 to prevent user confusion in regular usage, but also breaks HITL where lockdown is enabled for safety - fixes #15686
This commit is contained in:
@@ -1679,7 +1679,15 @@ Commander::run()
|
||||
}
|
||||
|
||||
// Auto disarm after 5 seconds if kill switch is engaged
|
||||
_auto_disarm_killed.set_state_and_update(armed.manual_lockdown || armed.lockdown, hrt_absolute_time());
|
||||
bool auto_disarm = armed.manual_lockdown;
|
||||
|
||||
// auto disarm if locked down to avoid user confusion
|
||||
// skipped in HITL where lockdown is enabled for safety
|
||||
if (status.hil_state != vehicle_status_s::HIL_STATE_ON) {
|
||||
auto_disarm |= armed.lockdown;
|
||||
}
|
||||
|
||||
_auto_disarm_killed.set_state_and_update(auto_disarm, hrt_absolute_time());
|
||||
|
||||
if (_auto_disarm_killed.get_state()) {
|
||||
if (armed.manual_lockdown) {
|
||||
|
||||
Reference in New Issue
Block a user