Skip to content

Added a height profile to mission editor - #1716

Merged
tridge merged 3 commits into
ArduPilot:masterfrom
tridge:pr-mission-height-profile
Jul 29, 2026
Merged

Added a height profile to mission editor#1716
tridge merged 3 commits into
ArduPilot:masterfrom
tridge:pr-mission-height-profile

Conversation

@tridge

@tridge tridge commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

button off the mission editor
image

image

tridge added 3 commits July 29, 2026 09:49
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
tridge force-pushed the pr-mission-height-profile branch from 052b72c to 767ed9c Compare July 29, 2026 00:52
@tridge
tridge merged commit 67c9322 into ArduPilot:master Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant