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 <silvan@auterion.com>
This commit is contained in:
Silvan
2025-02-28 11:41:47 +01:00
committed by Marco Hauswirth
parent ba31054992
commit 14941bc270
+1 -1
View File
@@ -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);
}