Skip to content
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

Merged
merged 11 commits into from
Aug 28, 2024

Conversation

mraditya01
Copy link
Contributor

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:

  • Link

How was this PR tested?

Unit tests.

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added the component:common Common packages from the autoware-common repository. (auto-assigned) label Jul 29, 2024
Copy link

github-actions bot commented Jul 29, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@maxime-clem maxime-clem changed the title feat(universe_utils): add SAT implementation for 2D convex polygon collision check feat(universe_utils): add SAT implementation for 2D convex polygon collision check Aug 1, 2024
@maxime-clem maxime-clem added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Aug 1, 2024
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>
Copy link
Contributor

@maxime-clem maxime-clem left a 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

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.30%. Comparing base (c9bb1e1) to head (7c85d27).
Report is 42 commits behind head on main.

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     
Flag Coverage Δ *Carryforward flag
differential 26.08% <100.00%> (?)
total 29.26% <ø> (+5.16%) ⬆️ Carriedforward from d82ba99

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maxime-clem maxime-clem merged commit e5ac1a5 into autowarefoundation:main Aug 28, 2024
30 of 31 checks passed
a-maumau pushed a commit to a-maumau/autoware.universe that referenced this pull request Sep 2, 2024
ktro2828 pushed a commit to ktro2828/autoware.universe that referenced this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:common Common packages from the autoware-common repository. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants