mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 14:40:35 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user