From 14941bc270a8f010b2e43e10e0ed8b242f28a8c1 Mon Sep 17 00:00:00 2001 From: Silvan Date: Fri, 28 Feb 2025 11:41:47 +0100 Subject: [PATCH] Commander: handle mode change rejection the same for RC and MAVLink Previously, when requesting a mode switch to Position without a valid position estimate through an RC button, the mode change to Position mode was not rejected if COM_POSCTL_NAVL was set to 1 and instead the system switched to Altitude mode. If the mode request instead came in through MAVLink it was rejected. This commit aligns the two ways of changing a flight mode. Signed-off-by: Silvan --- 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 f0537c7c6e..4c8dce5618 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -1696,7 +1696,7 @@ void Commander::executeActionRequest(const action_request_s &action_request) case action_request_s::ACTION_SWITCH_MODE: - if (!_user_mode_intention.change(action_request.mode, ModeChangeSource::User, true)) { + if (!_user_mode_intention.change(action_request.mode, ModeChangeSource::User, false)) { printRejectMode(action_request.mode); }