Last weekend I failed to enable a geofence after takeoff (error “geo-fence setup error”), and, being a beginner RC pilot, I stalled and crashed into a different kind of fence. The geofence error was very likely my bad, but I’d like to identify the cause.
The plane was within the geofence box at the point of the error, and the geofence polygon meets the requirements (including matching first and last points), but one of the three rally points was outside the fence. So this is my number 1 suspect, but I’d like to be sure.
In the source code I see that the “return point”,
geofence_state->boundary, is checked to ensure that it is inside the fence polygon.
Being new to the codebase, it is not clear to me yet whether
boundary is constantly updated with the nearest rally point? And if not, then which point does boundary correspond to at the moment that you try to activate the geofence (with FENCE_RET_RALLY enabled)?