mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 02:53:34 +08:00
RTL: fix Mission RTL vs normal RTL (#21464)
* Navigator: on_mission_landing() only can return true if currently in mission mode Signed-off-by: Silvan Fuhrer <silvan@auterion.com> * RTL: reset RTL state when not in RTL nav_state Signed-off-by: Silvan Fuhrer <silvan@auterion.com> * Navigator: fix mission vs. normal RTL - remove extra state _should_engange_mission_for_landing from rtl and have this logic outside of RTL where Navigator decides on running mission RTL or normal RTL - fix logic in Navigator to decide mission RTL vs normal RTL Signed-off-by: Silvan Fuhrer <silvan@auterion.com> * Mission: land_start(): fix decision if already on mission landing Simply checking landing() is not enough, as that is not reset until set_current_mission_index(get_land_start_index()) later in the function. Instead ask Naviator about it (on_mission_landing()). Signed-off-by: Silvan Fuhrer <silvan@auterion.com> * Navigator: only update _shouldEngangeMissionForLanding once, to not set it to false after VTOL backtansition Signed-off-by: Silvan Fuhrer <silvan@auterion.com> --------- Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -468,7 +468,9 @@ Mission::land_start()
|
||||
{
|
||||
// if not currently landing, jump to do_land_start
|
||||
if (_land_start_available) {
|
||||
if (landing()) {
|
||||
// check if we're currently already in mission mode and on landing part, then simply return true.
|
||||
// note: it's not enough to check landing(), as that is not reset until set_current_mission_index(get_land_start_index())
|
||||
if (_navigator->on_mission_landing()) {
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user