From 3715169e220a5cb40b1c2df7424feb0ad1afea05 Mon Sep 17 00:00:00 2001 From: Jari Nippula Date: Fri, 9 Aug 2024 13:00:32 +0300 Subject: [PATCH] arming state fix for HITL --- src/modules/mavlink/streams/HEARTBEAT.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/mavlink/streams/HEARTBEAT.hpp b/src/modules/mavlink/streams/HEARTBEAT.hpp index 26d966a85ac5..822c2da727ac 100644 --- a/src/modules/mavlink/streams/HEARTBEAT.hpp +++ b/src/modules/mavlink/streams/HEARTBEAT.hpp @@ -122,7 +122,9 @@ class MavlinkStreamHeartbeat : public MavlinkStream } // system_status overrides - if (actuator_armed.force_failsafe || actuator_armed.lockdown || actuator_armed.manual_lockdown + if (actuator_armed.force_failsafe || (actuator_armed.lockdown + && vehicle_status.hil_state == vehicle_status_s::HIL_STATE_OFF) + || actuator_armed.manual_lockdown || vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_TERMINATION) { system_status = MAV_STATE_FLIGHT_TERMINATION;