-
Notifications
You must be signed in to change notification settings - Fork 97
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
//inertial/@auto: allow specifying mass instead of density #1482
Comments
One issue with using the mass instead of densities is that it's not clear what to do if you have a link with multiple collisions. How much mass would each collision contribute to the whole? |
I tried to express this briefly towards the end of the feature request:
Currently we assume uniform density within each individual shape, but allow each shape to have different densities. I can see two options for allocating a user-specified
|
This is possible, but won't be a trivial change because now inertia calculation would have to be a two step process. (1) Ask each collision to compute its volume. For meshes, we need a new API for custom MOI calculators to provide volume. (2) Compute the density and use it to calculate MOI. Since computing the volume requires loading the mesh and maybe as computationally expensive as calculating the MOI, we should make sure to not duplicate the work. |
That's a good point. I don't think option 1. that I suggested makes as much sense. I think the following would work though:
Basically, if we take the auto-computed inertial values based on the existing density parameters and then rescale the auto-computed |
I see what you mean. Yes, I think that would work. One point of clarification: when you say "based on the existing density parameters", would we allow both mass and density to be specified or are you referring to the default values? |
yes, I would suggest allowing both mass and density to be specified. If both are specified, the densities would be used for computing the mass distribution (center of mass and moment of inertia matrix), but the densities would not affect the absolute mass value in kg |
Two thoughts:
|
@scpeters shall we move this issue to gazebosim/sdformat since it's a feature request? |
Sure, we can move it to sdformat |
Thanks for bringing this up. You're right that it would be difficult to address. I believe it is also an issue with our current approach to automatic inertial calculation that also computes volumes with density to calculate mass. I think it's out of scope for this issue |
thanks for mentioning this as well; I'd like to use the same "unit inertia" approach as Drake to ensure the rotational inertia is properly scaled |
Desired behavior
Currently the
//inertial/@auto
attribute enables automatic computation of inertial properties assuming uniform density based on the shape and a density parameter. Since it can be more straightforward to measure mass by weighing an object than measuring density, center of mass, and moment of inertia, we should consider allowing the user to specify the mass and auto-compute the remaining inertial properties without using the density parameter.Alternatives considered
Implementation suggestion
Currently automatic inertial calculations can be enabled by setting
//inertial/@auto == 'true'
and specifying collision geometries in a link:Note that when #1335 is merged, density may also be specified in the
//inertial
instead of//collision
(see the pull request for details on precedence if it is specified in both places):If a user sets
//inertial/@auto == 'true'
and also specifies mass, inertial pose, or moment of inertia values, a warning is thrown and the user specified values are not used.This feature request is proposing that if a user sets
//inertial/@auto == 'true'
and specifies//inertial/mass
, that the density values should be ignored, and the inertial values calculated according to the density that would result in the user-specified mass:Additional context
The text was updated successfully, but these errors were encountered: