Return-point-inside-fence check when FENCE_RET_RALLY=1

Hi all,

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[0], 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[0] is constantly updated with the nearest rally point? And if not, then which point does boundary[0] correspond to at the moment that you try to activate the geofence (with FENCE_RET_RALLY enabled)?

@joris,
Attachment of tlogs and/or data flash logs will help to troubleshoot your issue.

Regards,
TCIII GM

@TCIII : thanks – didn’t think the logs would be much use, but here is the tlog anyway. The actual flight is in the last minute or so (tlog ends with crash)