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

Update auto inertial calculation tutorial #2782

Open
wants to merge 1 commit into
base: gz-sim9
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions tutorials/auto_inertia_calculation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,14 @@ density values for each and the inertia values from each would be aggregated to
the final inertia of the link. However, if there are no collisions present,
an `ELEMENT_MISSING` error would be thrown.

It is **important** to note here that if `auto` is set to `true` and the user has
still provided values through the `<mass>`, `<pose>` and `<inertia>` tags, they
would be **overwritten** by the automatically computed values.
**Important Notes**
* If `auto` is set to `true` and the user has still provided values through the
`<pose>` and `<inertia>` tags, they would be **overwritten** by the
automatically computed values.
* In libSDFormat versions equal to or newer than 14.7.0 and 15.2.0, if `<mass>`
is specified, it takes precedence over the `<density>` property. The link's
inertial parameters will be scaled to match the specified mass while respecting
the ratio of collision density values.

> **Note:** Use SDF Spec version 1.11 or greater to utilize the new tags and attributes of this feature.

Expand Down Expand Up @@ -151,11 +156,22 @@ the center of mass in this case).

## Key Points on Mesh Inertia Calculator

The mesh inertia calculator is implemented based on the method described in
this [document](https://www.geometrictools.com/Documentation/PolyhedralMassProperties.pdf)(pdf).
The method is suited for solid, simple polyhedrons of constant mass density.

Here are some key points to consider when using automatic inertia calculation with 3D Meshes:
* Water-tight triangle meshes are required for the Mesh Inertia Calculator.
* Since the vertex data is used for inertia calculations, high vertex count would be
needed for near ideal values. However, it is recommended to use basic shapes with the
geometry tag (Box, Capsule, Cylinder, Ellipsoid and Sphere) as collision geometries get
a better overall simulation performance or RTF.
* Currently, the mesh inertia calculator does not work well with meshes having submeshes.
Therefore, they are not recommended for automatic computation.
* In the case that the mesh inertia calculator fails to produce valid inertia,
it will attempt to correct the auto-calculated mass matrix if it is strictly
positive and within a certain tolerance of satisfying the triangle inequality.
If that fails, an error will be logged.
* For complex, non-water-tight meshes, it is recommended to enable
[mesh optimization](http://sdformat.org/spec?ver=1.12&elem=geometry#mesh_optimization)
for the mesh collision in SDF by setting it to `convex_hull` or
`convex_decomposition`. The mesh inertia calculator will then compute inertia
based on the decomposed convex hull submeshes.
Loading