mission: be more intelligent about saying that we are on a mission landing

- previously the decision of being on a landing pattern was taken by just
looking at the current mission index. However, even if the current mission
index indicates a landing pattern the vehicle could be at an arbitrary location, far
from being established on the pattern.

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst
2021-01-04 11:58:16 +01:00
committed by Lorenz Meier
parent 29c3ce6d5d
commit a4a03e86da
6 changed files with 49 additions and 6 deletions
+7 -2
View File
@@ -563,9 +563,14 @@ Navigator::run()
}
// if RTL is set to use a mission landing and mission has a planned landing, then use MISSION to fly there directly
if (on_mission_landing() && !get_land_detected()->landed) {
if (!rtl_activated && _rtl.initialClimbDone() && get_mission_start_land_available()) {
_mission.set_execution_mode(mission_result_s::MISSION_EXECUTION_MODE_FAST_FORWARD);
if (!getMissionLandingInProgress()) {
start_mission_landing();
}
navigation_mode_new = &_mission;
} else {