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

Add support to get link AABB from its collisions #2787

Open
wants to merge 5 commits into
base: gz-sim9
Choose a base branch
from

Conversation

gabrielfpacheco
Copy link
Contributor

@gabrielfpacheco gabrielfpacheco commented Feb 19, 2025

🎉 New feature

Summary

This PR adds AABB support to the Link API. It computes the overall link aligned bounding box (in local and world coordinates) by merging all collision bounding boxes obtained from their geometry shapes. Plus, it adds utility functions to transform AABB coordinates and calculate mesh AABB using utilities from gz::common::Mesh.

Test it

  • Checkout the appropriate gz-sim and sdformat branches
  • Build these packages
$ colcon build --packages-select sdformat15 gz-sim9 --merge-install
  • Run the following gz-sim9 tests:
$ ./build/gz-sim9/bin/UNIT_Util_TEST && ./build/gz-sim9/bin/INTEGRATION_link

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Gabriel Pacheco <gabriel.fpacheco@gmail.com>
Signed-off-by: Gabriel Pacheco <gabriel.fpacheco@gmail.com>
Signed-off-by: Gabriel Pacheco <gabriel.fpacheco@gmail.com>
Signed-off-by: Gabriel Pacheco <gabriel.fpacheco@gmail.com>
* Following gazebosim#2353 (comment)
* This allows to use the ECM as cache if bounding box doesn't have to be
recomputed and is more suitable so that other systems can determine the
AABB if necessary (e.g. physics system if checks are enabled)

Signed-off-by: Gabriel Pacheco <gabriel.fpacheco@gmail.com>
@gabrielfpacheco
Copy link
Contributor Author

gabrielfpacheco commented Mar 10, 2025

@iche033, @scpeters, @ahcorde. Please, let me know if extra changes are required. If not, I will create a follow-up PR to add link AABB computation to the physics system update callback.

@iche033
Copy link
Contributor

iche033 commented Mar 10, 2025

@iche033, @scpeters, @ahcorde. Please, let me know if extra changes are required. If not, I will create a follow-up PR to add link AABB computation to the physics system update callback.

took a quick look at the logic for enabling and computing AxisAlignedBox in the Link class. I think overall the approach looks fine. I see that the AxisAlignedBox component is first initialized with results computed from SDF, then later the component will be updated with the value from the physics system. I'm curious to see how similar or different the two values are. If they are very different, it could be confusing to the users. We should have a test to verify that the values are similar within some reasonable tolerance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏛️ ionic Gazebo Ionic
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

Boundingbox on Link API
3 participants