-
Notifications
You must be signed in to change notification settings - Fork 103
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 #1543
Conversation
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. Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
thanks! the approach looks good. Is the expectation that we would set |
yes, I would lean towwards keeping the default behavior in sdformat and updating gz-sim |
added another test in Collision_TEST.cc in dc0242d |
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@Mergifyio backport sdf14 |
✅ Backports have been created
|
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)
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)
🎉 New feature
Alternative to #1542
Summary
If
Geometry::CalculateInertial()
fails to calculate valid inertial values, the current behavior is to report aLINK_INERTIA_INVALID
error and write no inertial values. The changes in #1542 would changeMesh::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
codecheck
passed (See contributing)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.