From 72f10e5282ca6ee2ae6e59f2cb2cb5f952e4af96 Mon Sep 17 00:00:00 2001 From: davidsastresas Date: Sun, 7 May 2023 15:49:01 +0200 Subject: [PATCH] TransectStyleComplexItem.cc: Fix bug generating empty surveys when no terrain data: Selecting terrain data on surverys was generating an empty survey if the polygon was on an area where QGC doesn't have terrain height info about. This is because QGC was waiting on terrain info to build the path on such surveys, which is not needed at all, because terrain frame just specifies an altitude above terrain, and relies on the vehicle for being able to calculate that height, by terrain database or by altitude sensors, having terrain height information is not needed at all to generate this kind of surveys --- src/MissionManager/TransectStyleComplexItem.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/MissionManager/TransectStyleComplexItem.cc b/src/MissionManager/TransectStyleComplexItem.cc index af72bd5..b4d4bfd 100644 --- a/src/MissionManager/TransectStyleComplexItem.cc +++ b/src/MissionManager/TransectStyleComplexItem.cc @@ -422,12 +422,14 @@ void TransectStyleComplexItem::_rebuildTransects(void) return; case QGroundControlQmlGlobal::AltitudeModeRelative: case QGroundControlQmlGlobal::AltitudeModeAbsolute: - // Not following terrain so we can build the flight path now + case QGroundControlQmlGlobal::AltitudeModeTerrainFrame: + // Terrain height not needed to calculate path, as TerrainFrame specifies a fixed altitude over terrain, doesn't need to know the actual terrain height + // so vehicle is responsible for having or not this altitude calculation, so we can build the flight path right away. _buildFlightPathCoordInfoFromTransects(); break; case QGroundControlQmlGlobal::AltitudeModeCalcAboveTerrain: - case QGroundControlQmlGlobal::AltitudeModeTerrainFrame: - // Query the terrain data. Once available flight path will be calculated + // Query the terrain data. Once available flight path will be calculated, as on this mode QGC actually calculates the individual altitude for each waypoint + // having into account terrain data. _queryTransectsPathHeightInfo(); break; }