Browse Source

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.
master
Julian Oes 4 years ago committed by Matthias Grob
parent
commit
cfdb53a4d8
  1. 3
      src/modules/manual_control/ManualControl.cpp

3
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) { if (switches.gear_switch == manual_control_switches_s::SWITCH_POS_ON) {
publish_landing_gear(landing_gear_s::GEAR_UP); publish_landing_gear(landing_gear_s::GEAR_UP);

Loading…
Cancel
Save