Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jan 14, 2025

🎉 New feature

Closes #1348

Summary

The ability to automatically compute inertial values by setting the //inertial/@auto attribute to true is very convenient, but it is difficult to see what inertial values were computed. This adds a --expand-auto-inertials argument to gz sdf --print to show the auto-computed inertial values in the printed output.

To enable this behavior, a new enum value SAVE_CALCULATION_IN_ELEMENT is added to ConfigureResolveAutoInertials in ParserConfig.hh, and the Link will store auto-computed inertial values directly in its sdf::Element when this configuration is set.

I am seeing a failing test on macOS locally but want to see if it is an issue on other platforms. EDIT: fixed in 2ffda3d.

Test it

  • Run INTEGRATION_link_dom to verify the functionality of the Link class with SAVE_CALCULATION_IN_ELEMENT
  • Run UNIT_gz_TEST to verify the --expand-auto-inertials parameter to gz sdf --print
  • If you build this in a colcon workspace with gz-tools2, then gz sdf --print test/sdf/inertial_stats_auto.sdf with and without --expand-auto-inertials should demonstrate the feature.

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.


This is an automatic backport of pull request #1422 done by [Mergify](https://mergify.com).

#1422)

The ability to automatically compute inertial values by setting
the `//inertial/@auto` attribute to true is very convenient, but it
is difficult to see what inertial values were computed. This adds
an `--expand-auto-inertials` argument to `gz sdf --print` to
show the auto-computed inertial values in the printed output.
Note that it does not compute inertial values for mesh shapes.

To enable this behavior, a new enum value
SAVE_CALCULATION_IN_ELEMENT is added to
ConfigureResolveAutoInertials in ParserConfig.hh, and the Link
will store auto-computed inertial values directly in its
sdf::Element when this configuration is set.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
(cherry picked from commit 3f84210)
@iche033 iche033 merged commit a29007d into sdf14 Jan 14, 2025
13 checks passed
@iche033 iche033 deleted the mergify/bp/sdf14/pr-1422 branch January 14, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎵 harmonic Gazebo Harmonic

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants