-
Notifications
You must be signed in to change notification settings - Fork 289
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
Support mesh optimization params in mesh inertial calculator #2770
Conversation
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
test/worlds/models/cylinder_dae_convex_decomposition/model.config
Outdated
Show resolved
Hide resolved
<model name="cylinder_dae_convex_decomposition"> | ||
<link name="cylinder_dae_convex_decomposition"> | ||
<pose>0 0 0 0 0 0</pose> | ||
<inertial auto="true" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be curious to compare the change in inertial properties before and after this PR when a fixed mass is specified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the description with inertial results from using a fixed mass. The difference is small.
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gz-sim9 #2770 +/- ##
==========================================
Coverage ? 68.93%
==========================================
Files ? 345
Lines ? 33292
Branches ? 0
==========================================
Hits ? 22949
Misses ? 10343
Partials ? 0 ☔ View full report in Codecov by Sentry. |
🎉 New feature
Summary
When
//inertial/@auto
is set to true, gz-sim auto computes inertial values for meshes using the MeshInertialCalculator. The calculator however uses the original mesh and ignores any//mesh/@optimization
properties.This PR extends the MeshInertialCalculator to work with optimized meshes. Main changes are:
Note that the optimized meshes are stored in the MeshManager singleton, which means later when loading the physics system (which in turn needs these optimized meshes for creating collisions), it can just get the optimized meshes directly from the MeshManager cache without having to do mesh optimization again.
Test it
Here's an example of doing mesh inertial calculation for the Cordless Drill Simplified model. The mesh in this model has convex decomposition enabled, and here are the auto computed inertial values before and after the changes in this PR:
Before:
After:
Note that the optimized mesh has larger volume due to convex decomposition which leads to larger mass.
Here are the results with a fixed mass of: 1.50252
Before (no convex decomposition):
After:
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.