Commit ea08020
Add ground-station only offline moving-map overlay + preflight tool t… (#104)
* Add ground-station only offline moving-map overlay + preflight tool to predownload it.
Native OSD moving-map renderer (GS builds only, _x86/__ROCKCHIP__) drawn into the OSD with Cairo, over the video: follow modes (plane/north/center/fit), rounded window frame, ini-configurable position/size, on-screen status messages, POI direction markers, home/target from state.ini + landmarks DB. All new rendering is guarded, so air-unit builds (goke/hisi/star6*) are unaffected.
Ground-station preflight tool (gs/): Python mapserver + WebKit viewer to browse/download tiles into per-basemap MBTiles, set targets, and build a standalone preflight binary (gs/pack). Keyed-provider (Thunderforest) support with the API key kept out of git.
native/rockchip now link sqlite3 (CI dep added). Docs under documentation/ and gs/README.md.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* GS offline map: terrain elevation + AGL, link horizon, named packs
Extends the ground-station moving map and its preflight tool. Ground-side
only: the new C sources go in GS_SRCS and are compiled into the native and
rockchip targets, so camera builds are unaffected.
Terrain elevation
- Preflight stores a terrain height grid alongside the tiles in
maps/elevation.db (AWS "terrarium" tiles decoded to int16 metres at z12,
~28 m/sample). On by default, capped at 1000 tiles.
- mapserver.py gains a stdlib-only PNG decoder, so no new dependency.
- osd/util/terrain_elevation.c mirrors the Python lookup in C; terrain_agl.c
calibrates GPS altitude against terrain at the armed transition and feeds
AGL to the map and to the new !AGL! OSD keyword.
- tests/terrain_{elevation,agl}_test.c, run by `make test-terrain` under
ASan/UBSan.
Link horizon
- New /viewshed endpoint and preflight panel: given an antenna height and a
flight altitude, draws where terrain stops blocking line of sight. Models
4/3-earth refraction and reproduces the textbook horizon over flat ground.
It is a terrain-only upper bound; the DEM is bare earth, so trees, masts
and buildings are not in it.
Map packs
- Each download is allocated a name and never overwrites an existing pack;
the panel lists downloaded packs and can delete them.
- The OSD map cycles packs at runtime with 'h', and falls back to the first
pack in the folder when the configured one is missing.
Downloads
- Tile fetches reuse a kept-alive connection per host instead of a fresh TLS
handshake per tile; the handshake was ~125 ms of a ~220 ms tile.
- Progress is reported per phase (tiles -> POIs -> elevation), so the bar no
longer sits at 100% while elevation is still downloading.
OSD map rendering
- JPEG tiles decode via vendored stb_image, so imagery basemaps render.
- Track vector: an arrow along the GPS ground course drawn over the plane
marker, showing the drift angle when the aircraft crabs. Configurable
length and opacity; hidden below a ground-speed threshold, which also
suppresses it when no GPS data is arriving.
- Up to 5 named waypoints instead of a single target.
- Pack filename banner and a key guide shown briefly when the map appears.
- Fix: in center (track-up) mode the plane icon was drawn at a fixed angle,
so it showed the ground track rather than the heading. Icon and vector now
both derive their screen angle from the rotation the tiles were rendered
with, making all four follow modes consistent.
Preflight UI
- Detail zoom selectable z12-z18, per-zoom basemap sources, an Advanced
section for pack naming, terrain height under the pointer, waypoint
editing and cached-coverage shading.
- map.sh/run-map.sh open the system browser by default; --GTK selects the
WebKitGTK window.
Docs
- New documentation/terrain-elevation.md and gs-map-internals.md; gs/README.md
rewritten around capabilities.
- msposd.ini is gitignored, so add a tracked msposd.ini.example documenting
every [poi] and [map] key, including the new ones. Per-FC sections that
msposd writes at runtime are excluded. Fixes the dangling ../msposd.ini
link in map_control_via_RC.md.
Co-Authored-By: Claude Opus 5
* GS map: commit vendored Leaflet 1.9.4 so packaged builds work from a clean checkout
leaflet.js/css and the marker images were gitignored and only fetched by
fetch-leaflet.sh, so build.bat/CI on a fresh clone produced a binary whose
viewer 404s on leaflet.* ("L is not defined"). Commit the files, guard the
PyInstaller spec against a missing copy, and whitelist the images/ set that
leaflet.css references.
Also on Windows: swallow ConnectionAbortedError (WinError 10053, the browser
cancelling a tile or SSE stream) like BrokenPipe/Reset by catching the common
ConnectionError base, and log the reason when a live tile fetch fails instead
of silently answering 204, so blank basemaps can be diagnosed from the console.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* GS map preflight: run on Windows from a fresh checkout
- map.sh: fall back to the default port when config.ini is absent
- mapserver.py: on Windows, verify TLS with certifi's root bundle (OpenTopoMap
failed with an expired cross-cert in the Windows store), bind without
SO_REUSEADDR so a relaunch reuses the running server instead of starting a
second one, and report reserved ports clearly
- run-map.bat: native Windows launcher; build.bat requires Python 3.12+ and
bundles certifi; CI installs certifi
- docs: Windows notes
Linux behaviour unchanged (all changes gated on win32).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Lower MSP attitude latency: early UART read, no attitude send gate, GS AHI draw not throttled
- Camera: poll MSP_ATTITUDE first in the tick and read the UART once more
15 ms later, so the reply is forwarded in the same tick (~49 ms -> ~19 ms).
- Camera: flush attitude to UDP without the 10 ms gate; a DRAW_SCREEN flush
in the same read no longer holds it a full tick. DisplayPort frames are
aggregated for 2 refresh intervals to keep the datagram rate unchanged.
- GS: attitude-driven AHI redraw bypasses the screen refresh throttle so no
sample is skipped. Air units keep the throttle.
- Stats: AttitMSGs(ms) is now a true per-second average.
* Changes in readme and map.sh to reflect the new offline map build process. Added a new offline map image to the pics directory.
* mspmaptool: version 1.0; skip firmware build on mspmaptool tags
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent f226049 commit ea08020
55 files changed
Lines changed: 20278 additions & 61 deletions
File tree
- .github/workflows
- .vscode
- documentation
- gs
- pack
- web
- icons
- images
- osd/util
- pics
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
24 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | | - | |
73 | | - | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
0 commit comments