From c851187eb8ba1398b58672ebd2532d671afcf9b7 Mon Sep 17 00:00:00 2001 From: Silvan Fuhrer Date: Thu, 19 Dec 2024 16:43:36 +0100 Subject: [PATCH] Failsafe: enable low position failsafe also in Position flight mode Signed-off-by: Silvan Fuhrer --- src/modules/commander/commander_params.c | 2 +- src/modules/commander/failsafe/failsafe.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index 48b0cce522..eca5ab3f6a 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -935,7 +935,7 @@ PARAM_DEFINE_FLOAT(COM_POS_LOW_EPH, -1.0f); * * Action the system takes when the estimated position has an accuracy below the specified threshold. * See COM_POS_LOW_EPH to set the failsafe threshold. - * The failsafe action is only executed if the vehicle is in auto mission or auto loiter mode, + * The failsafe action is only executed if the vehicle is in Mission, Loiter or Manual Position mode * otherwise it is only a warning. * * @group Commander diff --git a/src/modules/commander/failsafe/failsafe.cpp b/src/modules/commander/failsafe/failsafe.cpp index 3ba1131d97..209f4d0753 100644 --- a/src/modules/commander/failsafe/failsafe.cpp +++ b/src/modules/commander/failsafe/failsafe.cpp @@ -514,7 +514,8 @@ void Failsafe::checkStateAndMode(const hrt_abstime &time_us, const State &state, // trigger Low Position Accuracy Failsafe (only in auto mission and auto loiter) if (state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_MISSION || - state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER) { + state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_AUTO_LOITER || + state.user_intended_mode == vehicle_status_s::NAVIGATION_STATE_POSCTL) { CHECK_FAILSAFE(status_flags, local_position_accuracy_low, fromPosLowActParam(_param_com_pos_low_act.get())); }