gazebosim / gz-physics

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

bullet-featherstone: Support convex decomposition for meshes #603

Closed iche033 closed 6 months ago

iche033 commented 6 months ago

🎉 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:

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:

gz sim -v 4 your_test_world.sdf --physics-engine gz-physics-bullet-featherstone-plugin

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.

iche033 commented 6 months ago

replaced by #606 - > main