Added a height profile to mission editor - #1716
Merged
Merged
Conversation
GetElevation() returns None while srtm.py fetches a tile in the background, and the two terrain frame branches of set_grad_dist() added that None to a float. Loading any mission containing terrain frame items threw a TypeError out of the grid update until the tiles happened to be cached. Skip the row instead; the gradient is recalculated on the next edit once the terrain has arrived.
getURIWithRedirect() returned the response body whatever the status, so a 404 page was written into the tile cache under the tile's name. From then on getTile() found the file, failed to open it as a zip and returned no terrain, permanently, with no retry even after the server was fixed. terrain.ardupilot.org currently 404s the whole SRTM3 set, which is enough to fill a cache with these. Return None on a non-200 status so nothing is cached. Existing bad entries can be cleared with: find ~/.tilecache/SRTM3 -name '*.hgt.zip' -size -1000c -delete
Adds a Height Profile button to the mission editor, for checking terrain clearance when planning long BVLOS missions. The top pane shows mission height against terrain height along the track with the waypoints labelled, and the bottom pane shows height above ground. Terrain can be switched between SRTM1 and SRTM3, with the track sampled at the spacing of the selected database, heights shown as AMSL, AGL or AboveHome, and units in metres or feet. Moving the cursor reads the values out at the top right of each pane. A profile width takes the worst case over a corridor either side of the track rather than the centreline alone, so the profile shows the clearance available if the mission is not flown exactly on track. Terrain height is then the highest in the corridor and height above ground the lowest. The corridor is stepped at the same resolution as the track so that widening it cannot step over a narrow ridge, with a budget on the total lookups that coarsens both directions together when needed, and says so when it has. A leg into a terrain frame waypoint follows the terrain, as ArduPilot interpolates height above ground rather than AMSL for those legs, so a pair of AGL waypoints either side of a hill stays clear of it. Mission items keep their frame until the profile resolves them, so the terrain selector applies to terrain frame waypoints as well as to the terrain. The window is a child frame in the mission editor's existing GUI process, so it reads the grid directly and follows edits. Redraws are debounced, since a mission load produces a burst of item events and each redraw samples terrain. Terrain missing because a tile is still downloading is left as a gap rather than drawn at the wrong height, and retried until it arrives.
tridge
force-pushed
the
pr-mission-height-profile
branch
from
July 29, 2026 00:52
052b72c to
767ed9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
button off the mission editor
