From a570aa9facb8537bd428fea572e9fdd25e4daeb9 Mon Sep 17 00:00:00 2001 From: Nicolas de Palezieux Date: Wed, 19 Feb 2020 19:24:17 +0100 Subject: [PATCH] Commander: fix preflight check condition to fail if not in HIL mode --- src/modules/commander/Commander.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index f40a137dd4..75e6162dd6 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -697,7 +697,7 @@ Commander::handle_command(vehicle_status_s *status_local, const vehicle_command_ } else { // Refuse to arm if preflight checks have failed - if ((!status_local->hil_state) != vehicle_status_s::HIL_STATE_ON + if (status_local->hil_state != vehicle_status_s::HIL_STATE_ON && !status_flags.condition_system_sensors_initialized) { mavlink_log_critical(&mavlink_log_pub, "Arming denied! Preflight checks have failed"); cmd_result = vehicle_command_s::VEHICLE_CMD_RESULT_DENIED;