commander: Do not lock down the system once HIL has kickeed in

This commit is contained in:
Lorenz Meier
2015-04-26 18:27:48 +02:00
parent b07964660e
commit a57030c836
@@ -140,6 +140,11 @@ arming_state_transition(struct vehicle_status_s *status, ///< current vehicle s
prearm_ret = OK; prearm_ret = OK;
status->condition_system_sensors_initialized = true; 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 { } else {
armed->lockdown = false; armed->lockdown = false;
} }
@@ -211,8 +216,10 @@ arming_state_transition(struct vehicle_status_s *status, ///< current vehicle s
valid_transition = true; valid_transition = true;
} }
// Sensors need to be initialized for STANDBY state // Sensors need to be initialized for STANDBY state, except for HIL
if (new_arming_state == vehicle_status_s::ARMING_STATE_STANDBY && !status->condition_system_sensors_initialized) { 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"); mavlink_and_console_log_critical(mavlink_fd, "Not ready to fly: Sensors need inspection");
feedback_provided = true; feedback_provided = true;
valid_transition = false; valid_transition = false;