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 policy for handling CalculateInertial failures (backport #1543) #1546

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Feb 14, 2025

🎉 New feature

Alternative to #1542

Summary

If Geometry::CalculateInertial() fails to calculate valid inertial values, the current behavior is to report a LINK_INERTIA_INVALID error and write no inertial values. The changes in #1542 would change Mesh::CalculteInertial() to return default inertial values by default if no valid values are found.

This pull request adds a policy enum to ParserConfig to retain the current error behavior by default, but also provides an option to warn and use default inertial values when invalid inertial values are calculated.

Draft PR until more testing is added

Test it

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 #1543 done by [Mergify](https://mergify.com).

If CalculateInertial fails to find valid inertial values,
report an error by default, but allow users to choose
a policy that uses default inertial values with a warning
instead of a hard failure.

The policy is used in Collision::CalculateInertial and tested.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Ian Chen <ichen@openrobotics.org>
Co-authored-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 39826d4)
@mergify mergify bot requested review from azeey and scpeters as code owners February 14, 2025 23:49
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Feb 14, 2025
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.47%. Comparing base (ff9b3ad) to head (de8e5b6).
Report is 64 commits behind head on sdf14.

Additional details and impacted files
@@            Coverage Diff             @@
##            sdf14    #1546      +/-   ##
==========================================
+ Coverage   92.42%   92.47%   +0.04%     
==========================================
  Files         134      138       +4     
  Lines       17751    18358     +607     
==========================================
+ Hits        16406    16976     +570     
- Misses       1345     1382      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iche033 iche033 merged commit 5cd1440 into sdf14 Feb 18, 2025
16 checks passed
@iche033 iche033 deleted the mergify/bp/sdf14/pr-1543 branch February 18, 2025 17:46
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