Show the drone's locked home point on the fly-mode map

Adds MSP_WP (118) support to query the flightcontroller's stored home
point (WP#0 is a special case for this in iNAV's getWaypoint(), per
navigation.c) - the FC reports (0,0,0) rather than an error before one
is set, so parseMspHomePoint() treats that pair as "unset". Rendered
with a small pentagon house icon (design/homepoint-pentagon.svg,
ported to a CustomPainter like the other map icons).

Deliberately not polled continuously: a new home_point_provider.dart
refreshes it only at the three moments the FC's home point can
actually change - connect/reconnect, GPS fix acquired, and arming
(iNAV's default reset_home_type=FIRST_ARM only freezes it at the first
arm; before that it continuously follows the aircraft while disarmed).

Mock's implementation offsets the point 25m from the anchor so it
doesn't sit exactly under the drone marker during UI testing.
This commit is contained in:
Constantin Leue
2026-08-09 21:10:00 +02:00
parent c9f16b13f8
commit 5fd5d0117a
12 changed files with 594 additions and 0 deletions
+7
View File
@@ -16,6 +16,7 @@ class MissionMap extends StatelessWidget {
this.routeSegments = const [],
this.rubberBandLine,
this.droneMarker,
this.homePointMarker,
this.onMapReady,
});
@@ -33,6 +34,11 @@ class MissionMap extends StatelessWidget {
/// keine Telemetrie eingetroffen ist.
final Marker? droneMarker;
/// Homepoint-Marker im Fly-Modus (Doku: "den auf der Drohne gelockten
/// Homepoint abfragen"), null solange noch keiner abgefragt wurde/der FC
/// noch keinen gesetzt hat - siehe home_point_provider.dart.
final Marker? homePointMarker;
/// Geraden + Kreisbogen-Segmente des Flugpfads (Doku 3.7/4.6); rot
/// markierte Segmente ueberschreiten Steig-/Sinkrate oder Kurvenradius.
final List<RouteSegment> routeSegments;
@@ -95,6 +101,7 @@ class MissionMap extends StatelessWidget {
CircleLayer(circles: waypointMarkers),
MarkerLayer(markers: [
...windMarkers,
?homePointMarker,
?droneMarker,
]),
const _CompactAttribution(),