Safe Landing Points: Added new RTL_TYPE: closest between home, mission landing and safe points

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>

Co-authored by Martina Rivizzigno <martina@rivizzigno.it>
This commit is contained in:
Silvan Fuhrer
2019-10-28 09:54:59 +01:00
committed by Beat Küng
parent efafd91095
commit 0ce9329803
7 changed files with 224 additions and 87 deletions
+10 -2
View File
@@ -490,9 +490,16 @@ Navigator::run()
const bool rtl_activated = _previous_nav_state != vehicle_status_s::NAVIGATION_STATE_AUTO_RTL;
switch (rtl_type()) {
case RTL::RTL_LAND:
case RTL::RTL_LAND: // use mission landing
case RTL::RTL_CLOSEST:
if (rtl_activated) {
mavlink_and_console_log_info(get_mavlink_log_pub(), "RTL LAND activated");
if (rtl_type() == RTL::RTL_LAND) {
mavlink_and_console_log_info(get_mavlink_log_pub(), "RTL LAND activated");
} else {
mavlink_and_console_log_info(get_mavlink_log_pub(), "RTL Closest landing point activated");
}
}
// if RTL is set to use a mission landing and mission has a planned landing, then use MISSION to fly there directly
@@ -570,6 +577,7 @@ Navigator::run()
navigation_mode_new = &_rtl;
break;
}
break;