Skip to content
Snippets Groups Projects
Commit 3bf5d6af authored by Matthias Grob's avatar Matthias Grob Committed by Lorenz Meier
Browse files

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.
parent f177a68d
No related branches found
No related tags found
No related merge requests found
...@@ -2746,8 +2746,9 @@ Commander::set_main_state_rc(const vehicle_status_s &status_local, bool *changed ...@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment