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

Parsing the SDFormat inertia auto=true attribute #21101

Open
jwnimmer-tri opened this issue Mar 6, 2024 · 1 comment
Open

Parsing the SDFormat inertia auto=true attribute #21101

jwnimmer-tri opened this issue Mar 6, 2024 · 1 comment
Assignees

Comments

@jwnimmer-tri
Copy link
Collaborator

jwnimmer-tri commented Mar 6, 2024

Is your feature request related to a problem? Please describe.

There are situations like #20730 where users run an asset conversion tool to produce an SDFormat file. The tool emits redundant information (scaled geometry scale + density-based inertia). Later if the user decides the geometry scale is wrong, they might adjust that piece but forget to adjust the inertia.

Or even without such a conversion tool in play, it's onerous to have to type in the inertia just to get up and running with something sensible. We have fix_inertia that can help automate the process, but it still means dealing with manual file reprocessing and remembering to re-run the fixer any time you change the geometry.

Describe the solution you'd like

Implement the standardized attribute <inertial auto="true"> so that inertia will be automatically calculated, instead of making the user type in numbers that they might have trouble describing correctly.

Describe alternatives you've considered

Tell users to write MJCF files instead of SDFormat files. MJCF has better defaults, so the user doesn't need to opt-in to the auto=true logic.

Additional context

There is a whole discussion about mesh calculation methods in the SDFormat specification. Someone should study it more carefully, but at first glance my reaction is that we should just use the same logic we already have for fix_inertia and direct-*.obj parsing.

Once we have this feature ready, we should probably upgrade mesh_to_model to use it. That way, it will be much safer for users to hand-edit the file afterwards.

@jwnimmer-tri
Copy link
Collaborator Author

jwnimmer-tri commented Mar 6, 2024

Possibly we would want to help finish out the gazebosim/sdformat#1482 enhancement, too. It is probably an important usability win.

In the meantime, probably mesh_to_model can work around it by converting the user-provided mass into volume-influenced density, and only put the density in the file. That's still redundant in a sense, but the specific redundancy feels to me somewhat less dangerous than the status quo. If they see a density of 1e-9 they will hopefully quickly correlate that with why their mug is flying around like a grain of sand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants