gazebosim / gz-physics

Abstract physics interface designed to support simulation and rapid development of robot applications.
https://gazebosim.org
Apache License 2.0
62 stars 38 forks source link

bullet-featherstone: Fix convex hull shape's AABB #637

Closed iche033 closed 1 month ago

iche033 commented 1 month ago

🦟 Bug fix

Summary

After setting a btConvexHullShape's collision margin, the AABBs need to be explicitly recalculated.

This has performance implications. When AABBs overlap, More computation is done in terms of building islands, solving constraints, etc. Non overlapping objects at rest can also be deactivated. So this fix helps improve performance when many objects are located close to each other.

For reference, the same calls are done in the bullet examples, e.g. here

The difference in broadphase AABBs is visualized below:

bullet_convex_aabb

Left: No recalculation (before the changes) Right: AABB recalculated

The AABB size difference is roughly [0.1 0.1 0.1]

Note that there is still some obvious padding in the updated broadphase AABB

Checklist

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.