gazebosim / gz-physics

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

[bullet-featherstone] Fix attaching fixed joint #610

Closed iche033 closed 3 months ago

iche033 commented 3 months ago

🦟 Bug fix

Fixes attaching fixed joint between 2 models.

Summary

When 2 models are attached by a fixed joint in bullet-featherstone, their rotations are not maintained (only the translation was set). This PR fixes the issue.

Test it

Before the fix, when you try to create a detachable joint in gz sim (which uses a fixed joint) between two models with rotations, the parent's rotation will be rotated to match the child's, making the models unstable.

I updated the joint_features test to use models with rotations.

To test with gz sim: run the box_attach.sdf world with bullet-featherstone:

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

Hit play to create the detachable joint and the boxes become unstable:

bullet_box_attach

After the fix, the box should remain stable when the joint is created.

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 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.33%. Comparing base (7d30e47) to head (8476306).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## gz-physics7 #610 +/- ## ============================================ Coverage 78.32% 78.33% ============================================ Files 140 140 Lines 8069 8072 +3 ============================================ + Hits 6320 6323 +3 Misses 1749 1749 ```

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