Skip to content
Snippets Groups Projects
Commit 2167457e authored by Lorenz Meier's avatar Lorenz Meier
Browse files

VTOL status: Do not force a commander status change

Before the VTOL status would automatically force a commander state update all the time. This saves effort and makes sure the system only updates when it should.
parent 90b4afeb
No related branches found
No related tags found
No related merge requests found
......@@ -2018,15 +2018,33 @@ Commander::run()
/* Make sure that this is only adjusted if vehicle really is of type vtol */
if (is_vtol(&status)) {
status.is_rotary_wing = vtol_status.vtol_in_rw_mode;
status.in_transition_mode = vtol_status.vtol_in_trans_mode;
status.in_transition_to_fw = vtol_status.in_transition_to_fw;
status_flags.vtol_transition_failure = vtol_status.vtol_transition_failsafe;
armed.soft_stop = !status.is_rotary_wing;
}
// Check if there has been any change while updating the flags
if (status.is_rotary_wing != vtol_status.vtol_in_rw_mode) {
status.is_rotary_wing = vtol_status.vtol_in_rw_mode;
status_changed = true;
}
status_changed = true;
if (status.in_transition_mode != vtol_status.vtol_in_trans_mode) {
status.in_transition_mode = vtol_status.vtol_in_trans_mode;
status_changed = true;
}
if (status.in_transition_to_fw != vtol_status.in_transition_to_fw) {
status.in_transition_to_fw = vtol_status.in_transition_to_fw;
status_changed = true;
}
if (status_flags.vtol_transition_failure != vtol_status.vtol_transition_failsafe) {
status_flags.vtol_transition_failure = vtol_status.vtol_transition_failsafe;
status_changed = true;
}
if (armed.soft_stop != !status.is_rotary_wing) {
armed.soft_stop = !status.is_rotary_wing;
status_changed = true;
}
}
}
// Check if quality checking of position accuracy and consistency is to be performed
......
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