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

Add debug msg to log auto computed inertial values #2749

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

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jan 30, 2025

🎉 New feature

Summary

When //inertial/@auto is set to true, the link's inertial values are auto-computed and the values are stored the link SDF DOM and also to the ECM. However, without using the Gazebo GUI, there's currently no easy method to inspect the computed inertial values (you could request gazebo to save the SDF with the computed inertial values). This PR adds debug msgs to log the auto inertial values to console.

The other place that I could put these msgs is in sdformat but this is not desirable as there are other consumers of sdformat who may not want these msgs in their console.

Test it

gz sim -v 4 auto_inertia_pendulum.sdf

example output (near the top):

(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:544] Link has auto-inertial enabled: pendulum::upper_link
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:546]   pose: -0.0333333 0 0.208333 0 0 0
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:547]   mass: 113.097
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:548]   ixx iyy izz: 13.9879 14.4749 1.05243
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:550]   ixy ixz iyz: 0 -0.785397 0
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:544] Link has auto-inertial enabled: pendulum2::upper_link
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:546]   pose: -0.000480769 0 0.975962 0 0 0
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:547]   mass: 98.0177
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:548]   ixx iyy izz: 2.26657 2.74485 0.968373
(2025-01-30 19:11:28.842) [debug] [SdfEntityCreator.cc:550]   ixy ixz iyz: 0 -0.0459894 0

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • 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.

@iche033 iche033 requested a review from mjcarroll as a code owner January 30, 2025 19:26
@github-actions github-actions bot added the 🏛️ ionic Gazebo Ionic label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏛️ ionic Gazebo Ionic
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants