From 71afdb568030ce34accd8176f946c2e866f25318 Mon Sep 17 00:00:00 2001 From: Balduin Date: Tue, 18 Feb 2025 10:03:54 +0100 Subject: [PATCH] preflight check: restore old nav_state only once previously it would always change _user_mode_intention to _prev_nav_state forever. now we change it only if we are in preflight check mode to not interfere with anything else later. --- src/modules/commander/Commander.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index 30ee768eb3..dc7f4883d8 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -1894,8 +1894,9 @@ void Commander::run() // } } else { - // leave the mode again somehow... - _user_mode_intention.change(_prev_nav_state); + if (_vehicle_status.nav_state == vehicle_status_s::NAVIGATION_STATE_CS_PREFLIGHT_CHECK) { + _user_mode_intention.change(_prev_nav_state); + } } modeManagementUpdate();