From 866b6993f200f18bc620729dc6a86f8d69330ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 6 Apr 2018 11:00:11 +0200 Subject: [PATCH] commander: immediately publish kill switch state change --- src/modules/commander/commander.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index bd2cc8f702c7..adf1e998a7eb 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -2483,13 +2483,15 @@ Commander::run() /* set lockdown flag */ if (!armed.manual_lockdown) { mavlink_log_emergency(&mavlink_log_pub, "MANUAL KILL SWITCH ENGAGED"); + status_changed = true; + armed.manual_lockdown = true; } - armed.manual_lockdown = true; } else if (sp_man.kill_switch == manual_control_setpoint_s::SWITCH_POS_OFF) { if (armed.manual_lockdown) { mavlink_log_emergency(&mavlink_log_pub, "MANUAL KILL SWITCH OFF"); + status_changed = true; + armed.manual_lockdown = false; } - armed.manual_lockdown = false; } /* no else case: do not change lockdown flag in unconfigured case */ } else {