Browse Source

commander arming_state_transition: respect fRunPreArmChecks properly

if fRunPreArmChecks was set to false, there were still cases where the
preflight checks could be called. This fixes that.

arming_state_transition() with fRunPreArmChecks=false is only called
when entering & leaving preflight calibration mode.
All other places use fRunPreArmChecks=true, which means there is no change
for these.
sbg
Beat Küng 7 years ago
parent
commit
8c3cf0167c
  1. 5
      src/modules/commander/state_machine_helper.cpp

5
src/modules/commander/state_machine_helper.cpp

@ -137,8 +137,9 @@ transition_result_t arming_state_transition(vehicle_status_s *status, const batt @@ -137,8 +137,9 @@ transition_result_t arming_state_transition(vehicle_status_s *status, const batt
/* re-run the pre-flight check as long as sensors are failing */
if (!status_flags->condition_system_sensors_initialized
&& ((new_arming_state == vehicle_status_s::ARMING_STATE_ARMED) || (new_arming_state == vehicle_status_s::ARMING_STATE_STANDBY))
&& !hil_enabled) {
&& fRunPreArmChecks
&& ((new_arming_state == vehicle_status_s::ARMING_STATE_ARMED) || (new_arming_state == vehicle_status_s::ARMING_STATE_STANDBY))
&& !hil_enabled) {
if ((last_preflight_check == 0) || (hrt_elapsed_time(&last_preflight_check) > 1000 * 1000)) {

Loading…
Cancel
Save