Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bullet-featherstone: Fix finding free group for a body with fixed base #700

Open
wants to merge 5 commits into
base: gz-physics8
Choose a base branch
from

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Nov 1, 2024

🦟 Bug fix

Fixes gazebosim/gz-sim#2663

Summary

Finding free group for a body that has a fixed base results an invalid ID, which causes set world pose from gz-sim to fail, see gazebosim/gz-sim#2663. This PR removes the fixed base body check and I verified that set world pose works for a body with fixed base.

Another minor change - I noticed that finding free group for links has the same check. Currently free groups only works for models in bullet-featherstone so I updated the function to just call FindFreeGroupForModel.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • 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.

@github-actions github-actions bot added the 🏛️ ionic Gazebo Ionic label Nov 1, 2024
Signed-off-by: Ian Chen <[email protected]>
@iche033 iche033 added the Bullet Bullet engine label Nov 1, 2024
@@ -316,6 +316,71 @@ TEST_F(FreeGroupFeaturesTest, FreeGroupSetWorldPosePrincipalAxesOffset)
}
}

TEST_F(FreeGroupFeaturesTest, FreeGroupSetWorldPoseStaticModel)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check how it behaves with non-static models attached to the world with a fixed joint?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated code to make sure non-static model with a world joint can not be moved, also added a test a7e6eb5

Signed-off-by: Ian Chen <[email protected]>
if (joint.second->fixedConstraint)
{
if (joint.second->fixedConstraint->getMultiBodyB() == model->body.get())
{
return this->GenerateInvalidId();
}
}
// Reject if the model has a world joint
if (std::size_t(joint.second->model) == std::size_t(_modelID))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good for matching the behavior of DART, but we might want to consider the allowing models with world joints to move. I think it would be more consistent with also allowing static models to move. I won't block on this, but I'd like to hear @scpeters thoughts on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bullet Bullet engine 🏛️ ionic Gazebo Ionic
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

GUI transform of static objects fails with Bullet-featherstone
2 participants