refactor(navigator): define the pre-geofence by its margin alone

GF_PRE_MAX_HDIST and GF_PRE_MAX_VDIST gave the pre-geofence its own
limits from Home, next to GF_PRE_MARGIN for the geofence plan. That is
two ways to set one boundary, and a limit could be set outside its
geofence twin.

Drop the two parameters. The pre-geofence is now the geofence moved
inwards by GF_PRE_MARGIN: the margin applies to GF_MAX_HOR_DIST as it
does to the polygons and circles of the plan. It is horizontal only,
the maximum altitude has no pre-geofence.

isCloserThanMaxDistToHome() and isBelowMaxAltitude() are main's again,
the first with the margin as an argument.

Assisted-by: Claude:claude-fable-5-2
Signed-off-by: jonas <jonspero@me.com>
This commit is contained in:
jonas committed 2026-11-19 17:31:13 +01:00
1 parent 9c467b774e
commit 4b71fa9d3c
15 files changed
+143 -238

No files matched your search

-1
View File
@@ -10,7 +10,6 @@ bool geofence_max_dist_triggered # true the check for max distance from Home is
bool geofence_max_alt_triggered # true the check for max altitude above Home is triggered
bool geofence_custom_fence_triggered # true the check for custom inclusion/exclusion geofence(s) is triggered
bool pre_geofence_max_dist_triggered # true if the pre-geofence check for max distance from Home is triggered
bool pre_geofence_max_alt_triggered # true if the pre-geofence check for max altitude above Home is triggered
bool pre_geofence_custom_fence_triggered # true if the pre-geofence check for custom inclusion/exclusion geofence(s) is triggered
uint8 geofence_action # action to take when the geofence is breached