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

Fix initialization of world components when enabling velocity checks #2777

Open
wants to merge 2 commits into
base: gz-sim9
Choose a base branch
from

Conversation

gabrielfpacheco
Copy link

@gabrielfpacheco gabrielfpacheco commented Feb 14, 2025

🦟 Bug fix

Fixes #2774

Summary

When using the link API to enable velocity checks for a link that does not yet have the world ECM components (WorldPose, WorldLinearVelocity, WorldAngularVelocity), typically before the physics system plugin does its first update loop, such components will be initialized with their default constructor, zeroing values that might not be zero. One more evident example is the link world pose that could have already been initialized.

  1. Add the same unit test added by this MR to gz-sim/src/Link_TEST.cc
  2. Build the package: colcon build --packages-select gz-sim9
  3. Execute the test from your build folder: ./bin/UNIT_Link_TEST --gtest-filter=*EnableVelocityChecks*
  4. You should verify the tests will fail because all world components are zero

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 Feb 14, 2025
@gabrielfpacheco gabrielfpacheco force-pushed the gp-world_components_fix branch 4 times, most recently from 8029aa8 to 369ac76 Compare February 18, 2025 16:26
Gabriel Pacheco and others added 2 commits February 18, 2025 15:25
* Not all models of test/worlds/mesh_inertia_calculation.sdf are
initialized with zero pose
* Bug gazebosim#2774 was forcing all `link.WorldPose` to be zero after calling
`link.EnableVelocityChecks`

Signed-off-by: Gabriel Pacheco <[email protected]>
@gabrielfpacheco
Copy link
Author

Friendly ping :)

@mjcarroll, @scpeters, @azeey. Could any of you guys take a quick look at this PR to see if I'm in the right track?

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

Successfully merging this pull request may close these issues.

Enable velocity checks create wrong world components for link entity in which they don't yet exist
1 participant