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:
Silvan Fuhrer
2023-04-14 09:49:47 +02:00
committed by GitHub
parent 752e3b450d
commit bc560ddddb
5 changed files with 37 additions and 22 deletions
+3 -1
View File
@@ -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 {