XTrack Failsafe

Hello,

we are planning a mission which is a few kilometres long and has many curves. The problem is that we have to stay in a specific corridor all the time. We planned to use a geofence, but since plane is limited to only 18 polygon points this is not an option.

Another idea would be to use the xtrack value. We could monitor it and trigger a failsafe if we exceed a certain distance of our planned path. Probably the most straightforward solution would be to use a lua script, but as far as I know there isn’t a binding for the xtrack value, nor the option to trigger a failsafe/parachute deployment.

Do you think lua is the way to go here or is there even a better solution?