Supports convex decomposition on meshes. Bullet-featherstone implementation will parse the new mesh simplification attribute introduced in https://github.com/gazebosim/sdformat/pull/1380, decompses the mesh into convex meshes, and builds btConvexHullShape collision shapes.
Compared to btGImpactMeshes (which is currently used for all meshes), the convex hulls seems to be more stable, do not have gaps between meshes (collision margins can be set to 1mm instead of 1cm), and some manual testing shows potentially faster performance (dependent on the number of submeshes generated)
Added test to verify that convex decomposition flag is parsed and valid collisions are generated.
Other changes:
the m_erp2 value is now only set when there are meshes in the scene. The param was reduced to improve stability in https://github.com/gazebosim/gz-physics/pull/600. I think we do not need to do it globally when there are no meshes in the world as the instability seems to only come from meshes. The value is also bumped up a little to prevent to much penetration - This will likely need more tuning.
[ ] 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.
🎉 New feature
Depends on
Summary
Supports convex decomposition on meshes. Bullet-featherstone implementation will parse the new mesh simplification attribute introduced in https://github.com/gazebosim/sdformat/pull/1380, decompses the mesh into convex meshes, and builds
btConvexHullShape
collision shapes.Compared to
btGImpactMeshes
(which is currently used for all meshes), the convex hulls seems to be more stable, do not have gaps between meshes (collision margins can be set to 1mm instead of 1cm), and some manual testing shows potentially faster performance (dependent on the number of submeshes generated)Added test to verify that convex decomposition flag is parsed and valid collisions are generated.
Other changes:
m_erp2
value is now only set when there are meshes in the scene. The param was reduced to improve stability in https://github.com/gazebosim/gz-physics/pull/600. I think we do not need to do it globally when there are no meshes in the world as the instability seems to only come from meshes. The value is also bumped up a little to prevent to much penetration - This will likely need more tuning.To Test
Together with https://github.com/gazebosim/gz-sim/pull/2331, you can visualize the decomposed collision meshes.
Run gz sim with bullet-featherstone plugin and a world that has a model (e.g. Cordless Drill Simplified) that uses mesh decomposition:
Checklist
codecheck
passed (See contributing)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.