forked from Archive/PX4-Autopilot
commander: fix RC mode switch not getting applied after boot
the condition to enter the rc mode switch evaluation was neglecting the first connection of an RC when "no RC switch changed". this means depending on the actual initialization values of _last_sp_man and the desired mode preselected on the RC while connecting it would not get evaluated.
This commit is contained in:
parent
f177a68da9
commit
3bf5d6af12
|
@ -2746,8 +2746,9 @@ Commander::set_main_state_rc(const vehicle_status_s &status_local, bool *changed
|
||||||
|| (_last_sp_man.man_switch != sp_man.man_switch);
|
|| (_last_sp_man.man_switch != sp_man.man_switch);
|
||||||
|
|
||||||
// only switch mode based on RC switch if necessary to also allow mode switching via MAVLink
|
// only switch mode based on RC switch if necessary to also allow mode switching via MAVLink
|
||||||
const bool should_evaluate_rc_mode_switch = position_got_valid || ((first_time_rc || rc_values_updated)
|
const bool should_evaluate_rc_mode_switch = first_time_rc
|
||||||
&& some_switch_changed);
|
|| position_got_valid
|
||||||
|
|| (rc_values_updated && some_switch_changed);
|
||||||
|
|
||||||
if (!should_evaluate_rc_mode_switch) {
|
if (!should_evaluate_rc_mode_switch) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue