double geofence vertices limit to 128 #18870
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up of conversation on slack with @dagar on the maximum number of geofence vertices: https://px4.slack.com/archives/C0V533X4N/p1638198388018100
Describe problem solved by this pull request
We have found 64 vertices to be a too restrictive limit for some long-distance missions we fly.
Describe your solution
Increase the limit to 128.
Test data / coverage
On a Pixhawk 4 equipped with a Here2 GPS. I used perf counters to check the elapsed time when checking if inside the polygon. Tested with 8, 63 and 127 vertices.
The average time increases by about 20ms (+50%) for checking 127 vertices compared to 63. I think 60ms is still acceptable given that it's checked once every 200ms, but I'm not an expert on this.
Additional context
The open question is if the processor can handle to check up to 128 vertices. I only have Pixhawk 4 at my hand so I can't check for older processors.