From 5ad5e3e03f6d0416ff0ecc4a78020f441c834a03 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Thu, 7 May 2020 18:43:11 -0700 Subject: [PATCH] Fix VTOL hover determination --- src/MissionManager/MissionController.cc | 4 +++- src/MissionManager/MissionController.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/MissionManager/MissionController.cc b/src/MissionManager/MissionController.cc index bb664d1a85..143ed49f98 100644 --- a/src/MissionManager/MissionController.cc +++ b/src/MissionManager/MissionController.cc @@ -1205,6 +1205,7 @@ void MissionController::_recalcFlightPathSegments(void) FlightPathSegmentHashTable oldSegmentTable = _flightPathSegmentHashTable; + _missionContainsVTOLTakeoff = false; _flightPathSegmentHashTable.clear(); _waypointPath.clear(); @@ -1244,6 +1245,7 @@ void MissionController::_recalcFlightPathSegments(void) switch (command) { case MAV_CMD_NAV_TAKEOFF: case MAV_CMD_NAV_VTOL_TAKEOFF: + _missionContainsVTOLTakeoff = command == MAV_CMD_NAV_VTOL_TAKEOFF; if (!linkEndToHome) { // If we still haven't found the first coordinate item and we hit a takeoff command this means the mission starts from the ground. // Link the first item back to home to show that. @@ -1459,7 +1461,7 @@ void MissionController::_recalcMissionFlightStatus() _resetMissionFlightStatus(); - bool vtolInHover = true; + bool vtolInHover = _missionContainsVTOLTakeoff; bool linkStartToHome = false; bool foundRTL = false; bool vehicleYawSpecificallySet = false; diff --git a/src/MissionManager/MissionController.h b/src/MissionManager/MissionController.h index be8f9561bb..5c08729756 100644 --- a/src/MissionManager/MissionController.h +++ b/src/MissionManager/MissionController.h @@ -369,6 +369,7 @@ private: bool _isROIBeginCurrentItem = false; double _minAMSLAltitude = 0; double _maxAMSLAltitude = 0; + bool _missionContainsVTOLTakeoff = false; static const char* _settingsGroup; -- GitLab