diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-26 18:27:48 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-26 18:27:48 +0200 |
commit | a57030c83685c64941977ecaaf865004cff51e9d (patch) | |
tree | b3181f11b7bf79632a9009b70bdfd5e8979a4e3a /src/modules | |
parent | b07964660e8b959cad410064b1f74f839b2c268f (diff) | |
download | px4-firmware-a57030c83685c64941977ecaaf865004cff51e9d.tar.gz px4-firmware-a57030c83685c64941977ecaaf865004cff51e9d.tar.bz2 px4-firmware-a57030c83685c64941977ecaaf865004cff51e9d.zip |
commander: Do not lock down the system once HIL has kickeed in
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/commander/state_machine_helper.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 844e8f2ab..73fdb0940 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -140,6 +140,11 @@ arming_state_transition(struct vehicle_status_s *status, ///< current vehicle s prearm_ret = OK; status->condition_system_sensors_initialized = true; + /* recover from a prearm fail */ + if (status->arming_state == vehicle_status_s::ARMING_STATE_STANDBY_ERROR) { + status->arming_state = vehicle_status_s::ARMING_STATE_STANDBY; + } + } else { armed->lockdown = false; } @@ -211,8 +216,10 @@ arming_state_transition(struct vehicle_status_s *status, ///< current vehicle s valid_transition = true; } - // Sensors need to be initialized for STANDBY state - if (new_arming_state == vehicle_status_s::ARMING_STATE_STANDBY && !status->condition_system_sensors_initialized) { + // Sensors need to be initialized for STANDBY state, except for HIL + if ((status->hil_state != vehicle_status_s::HIL_STATE_ON) && + (new_arming_state == vehicle_status_s::ARMING_STATE_STANDBY) && + (!status->condition_system_sensors_initialized)) { mavlink_and_console_log_critical(mavlink_fd, "Not ready to fly: Sensors need inspection"); feedback_provided = true; valid_transition = false; |