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: Update fixed constraint behavior #632

Closed iche033 closed 4 months ago

iche033 commented 4 months ago

🎉 New feature

Summary

There is an inconsistency between how fixed constraints work in dartsim and bullet-featherstone. Currently when a fixed constraint's parent link moves, the behavior in the two physics engine is:

Since there is desire to have both types of behavior so a new feature is added to toggle behavior of a fixed constraint:

By default, this property is true, i.e. child is always welded to parent link, so we do not break the fixed constraint behavior in dartsim. The bullet-featherstone fixed constraint implementation is updated to match this behavior. This is achieved by setting the pose of child at each iteration - not ideal but gives the expected behavior. Additionally, the bullet-featherstone plugin implements SetFixedJointWeldChildToParentFeature and lets users disable welding of links.

Update

Other changes to bullet-featherstone's fixed constraint implementation include:

Added new tests:

known issues:

Test it

Here's an example showing the behavior of fixed constraint in bullet-featherstone plugin before and after the changes. The two models are connected using the Detachable Joint plugin. The red box is the parent while the blue box is the child.

Before:

bullet_fixed_joint

After (matches dartsim fixed constraint behavior):

bullet_fixed_joint_updated

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.

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 92.23301% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 79.04%. Comparing base (92e02c3) to head (c921141). Report is 16 commits behind head on gz-physics7.

:exclamation: Current head c921141 differs from pull request most recent head a112092

Please upload reports for the commit a112092 to get more accurate results.

Files Patch % Lines
bullet-featherstone/src/JointFeatures.cc 92.42% 5 Missing :warning:
bullet-featherstone/src/FreeGroupFeatures.cc 90.62% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## gz-physics7 #632 +/- ## =============================================== + Coverage 78.32% 79.04% +0.71% =============================================== Files 140 140 Lines 8069 8240 +171 =============================================== + Hits 6320 6513 +193 + Misses 1749 1727 -22 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.