Closed iche033 closed 5 months ago
Attention: Patch coverage is 98.52941%
with 1 lines
in your changes are missing coverage. Please review.
Project coverage is 78.91%. Comparing base (
492b124
) to head (1f2aaa7
). Report is 15 commits behind head on main.:exclamation: Current head 1f2aaa7 differs from pull request most recent head fec9fad. Consider uploading reports for the commit fec9fad to get more accurate results
Files | Patch % | Lines |
---|---|---|
bullet-featherstone/src/SDFFeatures.cc | 98.48% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I think convex_decomposition and convex_hull operations should apply to the fusion of all submeshes, unless only a single submesh is specified, in which case it would act only on that submesh. In the unoptimized case, we could also consider merging to a single mesh shape instead of using btCompoundShape (this can happen in separate pull requests)
hmm ok to make this happen, we'll need to:
common::SubMesh
es into one (before calling gz::common::ConvexDecomposition
with that one combined submesh)I'll work on these changes
hmm ok to make this happen, we'll need to:
- update sdf description - currently it explicitly states decomposition is for each submesh
- add a new function to merge multiple common::SubMeshes into one (before calling gz::common::ConvexDecomposition with that one combined submesh)
I'll work on these changes
https://github.com/gazebosim/sdformat/pull/1386 https://github.com/gazebosim/gz-common/pull/588
I'm getting some unexpected penetration with convex_decomposition. I've attached the .sdf files.
I found that by setting a small m_globalCfm
value, it's able to prevent this penetration, e.g.
diff --git a/bullet-featherstone/src/Base.cc b/bullet-featherstone/src/Base.cc
index ac66f574..80a04ced 100644
--- a/bullet-featherstone/src/Base.cc
+++ b/bullet-featherstone/src/Base.cc
@@ -49,6 +49,7 @@ WorldInfo::WorldInfo(std::string name_)
// the penentration impulse depends on the erp2 parameter so set to a small
// value (default in bullet is 0.2).
this->world->getSolverInfo().m_erp2 = btScalar(0.02);
+ this->world->getSolverInfo().m_globalCfm = btScalar(0.001);
by default m_globalCfm
is 0
🎉 New feature
Replaces #603
Depends on
Summary
Supports convex decomposition on meshes. Bullet-featherstone implementation will parse the new mesh ~simplification~ optimization 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 too prevent to much penetration - This will likely need more tuning as we do more testing with bullet.To Test
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.