From 54a53e553e08726dffb176379d8e8a413fd816ad Mon Sep 17 00:00:00 2001 From: Balduin Date: Thu, 12 Feb 2026 15:36:31 +0100 Subject: [PATCH] Failsafe: descend on joint global position invalid and RC loss --- src/modules/commander/failsafe/failsafe.cpp | 7 +++++++ src/modules/commander/failsafe/failsafe.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/modules/commander/failsafe/failsafe.cpp b/src/modules/commander/failsafe/failsafe.cpp index b0c19db29b..377fbc9fbc 100644 --- a/src/modules/commander/failsafe/failsafe.cpp +++ b/src/modules/commander/failsafe/failsafe.cpp @@ -547,6 +547,13 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state, if (state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION || state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER) { CHECK_FAILSAFE(status_flags, position_accuracy_low, fromPosLowActParam(_param_com_pos_low_act.get())); + + // Joint invalid global position and RC loss failsafe + _last_state_joint_pos_rcl_loss = checkFailsafe(_caller_id_joint_pos_rcl_loss, _last_state_joint_pos_rcl_loss, + status_flags.global_position_invalid && status_flags.manual_control_signal_lost, + Action::Descend); + // To do it immediately regardless of COM_FAIL_ACT_T, replace Action::Descend by: + // ActionOptions(Action::Descend).cannotBeDeferred() } if (state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_TAKEOFF || diff --git a/src/modules/commander/failsafe/failsafe.h b/src/modules/commander/failsafe/failsafe.h index d5b3f0a79e..ff28b4702a 100644 --- a/src/modules/commander/failsafe/failsafe.h +++ b/src/modules/commander/failsafe/failsafe.h @@ -186,6 +186,8 @@ private: bool _last_state_fd_esc_arming{false}; const int _caller_id_battery_unhealthy_spoolup{genCallerId()}; bool _last_state_battery_unhealthy_spoolup{false}; + const int _caller_id_joint_pos_rcl_loss{genCallerId()}; + bool _last_state_joint_pos_rcl_loss{false}; hrt_abstime _armed_time{0}; bool _was_armed{false};