rtl: for fixed wing (also vtol) make the descend state of RTL use type

NAV_CMD_LOITER_TO_ALT

- this allows vtol to track the loiter circle during the transition instead
of trying to fly to the landing position

Signed-off-by: RomanBapst <bapstroman@gmail.com>
This commit is contained in:
RomanBapst
2020-04-21 15:56:52 +03:00
committed by Lorenz Meier
parent bb2826ad27
commit 197a21a22e
+7 -1
View File
@@ -342,7 +342,13 @@ void RTL::set_rtl_item()
}
case RTL_STATE_DESCEND: {
_mission_item.nav_cmd = NAV_CMD_WAYPOINT;
if (_navigator->get_vstatus()->vehicle_type == vehicle_status_s::VEHICLE_TYPE_FIXED_WING) {
_mission_item.nav_cmd = NAV_CMD_LOITER_TO_ALT;
} else {
_mission_item.nav_cmd = NAV_CMD_WAYPOINT;
}
_mission_item.lat = _destination.lat;
_mission_item.lon = _destination.lon;
_mission_item.altitude = loiter_altitude;