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.
This commit is contained in:
Julian Oes
2021-06-16 09:23:49 +02:00
committed by Matthias Grob
parent 60de330f18
commit cfdb53a4d8
+2 -1
View File
@@ -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);