mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-18 21:20:35 +08:00
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user