Browse Source

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.
sbg
Lorenz Meier 7 years ago
parent
commit
2167457e2e
  1. 22
      src/modules/commander/commander.cpp

22
src/modules/commander/commander.cpp

@ -2018,16 +2018,34 @@ Commander::run() @@ -2018,16 +2018,34 @@ Commander::run()
/* Make sure that this is only adjusted if vehicle really is of type vtol */
if (is_vtol(&status)) {
// 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;
}
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_flags.vtol_transition_failure = vtol_status.vtol_transition_failsafe;
status_changed = true;
}
armed.soft_stop = !status.is_rotary_wing;
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
bool run_quality_checks = !status_flags.circuit_breaker_engaged_posfailure_check;

Loading…
Cancel
Save