From cfdb53a4d88efe65c9ee788a7474e8d55001d5c3 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 16 Jun 2021 09:23:49 +0200 Subject: [PATCH] manual_control: don't switch gear on first init This will ignore the first transition from NONE to something. This matches the behaviour that existed before. --- src/modules/manual_control/ManualControl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/manual_control/ManualControl.cpp b/src/modules/manual_control/ManualControl.cpp index 0212304a96..9a3361367a 100644 --- a/src/modules/manual_control/ManualControl.cpp +++ b/src/modules/manual_control/ManualControl.cpp @@ -230,7 +230,8 @@ void ManualControl::Run() } } - if (switches.gear_switch != _previous_switches.gear_switch) { + if (switches.gear_switch != _previous_switches.gear_switch + && _previous_switches.gear_switch != manual_control_switches_s::SWITCH_POS_NONE) { if (switches.gear_switch == manual_control_switches_s::SWITCH_POS_ON) { publish_landing_gear(landing_gear_s::GEAR_UP);