-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(universe_utils): add SAT implementation for 2D convex polygon collision check #8239
Conversation
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
Signed-off-by: Maxime CLEMENT <maxime.clement@tier4.jp>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new algorithm is faster than GJK for triangles and rectangles.
polygons_nb = 500, vertices = 3, 91938 / 250000 pairs with intersects
Intersect:
Boost::geometry = 34.37 ms
GJK = 8.68 ms
SAT = 7.63 ms
No Intersect:
Boost::geometry = 53.99 ms
GJK = 13.70 ms
SAT = 8.53 ms
Total:
Boost::geometry = 88.35 ms
GJK = 22.37 ms
SAT = 16.16 ms
polygons_nb = 500, vertices = 4, 140274 / 250000 pairs with intersects
Intersect:
Boost::geometry = 58.65 ms
GJK = 14.13 ms
SAT = 14.62 ms
No Intersect:
Boost::geometry = 42.49 ms
GJK = 10.35 ms
SAT = 6.41 ms
Total:
Boost::geometry = 101.14 ms
GJK = 24.48 ms
SAT = 21.04 ms
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8239 +/- ##
==========================================
+ Coverage 24.10% 29.30% +5.20%
==========================================
Files 1399 1665 +266
Lines 102455 128913 +26458
Branches 38912 56602 +17690
==========================================
+ Hits 24694 37782 +13088
- Misses 75223 81446 +6223
- Partials 2538 9685 +7147
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Description
Added new intersect function within universe_utils to determine if two convex polygons intersect using the Separating Axis Theorem (SAT).
⚠️ the polygons must be convex.
Related links
Parent Issue:
How was this PR tested?
Unit tests.
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.