-
Notifications
You must be signed in to change notification settings - Fork 292
fix: validate contact surface parameters to prevent LCP solver crashes (DART 6.16) #2435
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-6.16 #2435 +/- ##
================================================
+ Coverage 58.74% 58.81% +0.06%
================================================
Files 385 385
Lines 32194 32241 +47
Branches 3884 3893 +9
================================================
+ Hits 18911 18961 +50
+ Misses 13283 13280 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
c3698ba to
63e535f
Compare
|
@codex review This PR has been rebased on release-6.16. Updated CHANGELOG with correct PR number and resolved merge conflict. The validation approach using |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Add validation for NaN/Inf/negative friction, restitution, and slip compliance values in ContactSurface and SoftContactConstraint. Invalid values now log a warning and fall back to defaults. This prevents assertion failures in the LCP solver when malformed SDF files (e.g., <mu>NaN</mu>) propagate invalid values through the constraint system. Backport of fix from main branch. Fixes gazebosim/gz-physics#841
Fully qualify constraint::DART_DEFAULT_FRICTION_COEFF and constraint::DART_DEFAULT_RESTITUTION_COEFF to avoid ambiguity with dynamics namespace constants.
63e535f to
8e2b4a2
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
ContactSurfaceandSoftContactConstraintBackport of #2434 to release-6.16
Problem
When malformed SDF files contain invalid friction values (e.g.,
<mu>NaN</mu>), these propagate through DART's constraint system and cause an assertion failure indSolveLCP:This crashes simulations in gz-physics and any other downstream consumers.
Solution
Validate contact surface parameters at extraction time in:
DefaultContactSurfaceHandler::computeFrictionCoefficient()DefaultContactSurfaceHandler::computePrimaryFrictionCoefficient()DefaultContactSurfaceHandler::computeSecondaryFrictionCoefficient()DefaultContactSurfaceHandler::computePrimarySlipCompliance()DefaultContactSurfaceHandler::computeSecondarySlipCompliance()DefaultContactSurfaceHandler::computeRestitutionCoefficient()SoftContactConstraint::computeFrictionCoefficient()SoftContactConstraint::computeRestitutionCoefficient()Invalid values are rejected with a warning and replaced with safe defaults.
Testing
Related Issues
Related to gazebosim/gz-physics#841
Checklist