-
Notifications
You must be signed in to change notification settings - Fork 98
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
Resolve auto inertia based on input mass #1513
Conversation
this looks good! I've added some tests in #1514 targeting this branch that you can merge into this branch if they seem reasonable |
nice, test looks good, thanks! |
I think we should also update the auto_inertial_params_proposal proposal as well, and at some point write a tutorial / documentation since the proposal has now been implemented, but I won't block this PR on either of those tasks |
added a note in the auto inertial proposal about mass in gazebosim/sdf_tutorials#100 |
I think we don't have a test involving multiple collisions with different density values attached to a link with auto-inertial and explicit mass. I think that would be ideal, but I won't block on it |
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.
Looks great overall. One of the goals for calculating the inertia based on mass was to make it possible to calculate the inertia even when density
values are not set. Do we know if that works? Maybe we can add a test?
This also means we can stop emitting a warning if a Collision is missing its <density>
if mass
is provided:
Lines 296 to 305 in 92da673
density = DensityDefault(); | |
Error densityMissingErr( | |
ErrorCode::ELEMENT_MISSING, | |
"Collision is missing a <density> child element. " | |
"Using a default density value of " + | |
std::to_string(DensityDefault()) + " kg/m^3. " | |
); | |
enforceConfigurablePolicyCondition( | |
_config.WarningsPolicy(), densityMissingErr, _errors | |
); |
thanks; I'm did the math to verify the inertia values for that test case, and it looks right but a bit complex. I'd like to have our test expectations documented, so I'll propose a slight variation of the test geometry that places the lumped center of mass at the origin to simplify the math and then document that. I can do that in a follow-up PR if other concerns are resolved before I have a chance to write it up |
If density is not explicitly set by the user, the default value should be used. Yes I can add or change a test in a follow-up PR after @scpeters updates the test for computing auto inertia involving multiple collisions
removed warning ca94a22 |
thanks! I've addessed remaining comments except the one about adding a test with no |
One last thing I thought of is whether this would break existing SDF files. If you have a link with the mass specified as well as densities in the collisions, previously, the mass was completely ignored. Now, the mass will override the densities which will likely result in different MOI values. Am I correct? |
yes this will be a behavior change so we would likely need to retarget this to |
Currently there is a warning when specifying mass with We can certainly merge this to |
here's my update to the multi-collision / multi-density test: #1515 |
Signed-off-by: Ian Chen <[email protected]> update python test Signed-off-by: Ian Chen <[email protected]> udate api doc for resolving auto inertia Signed-off-by: Ian Chen <[email protected]> Add tests for auto-inertial with explicit mass (#1514) * link_dom test: Fix typo Signed-off-by: Steve Peters <[email protected]> * Test case for auto-inertials with explicit mass Signed-off-by: Steve Peters <[email protected]> --------- Signed-off-by: Steve Peters <[email protected]> update doc add comments Signed-off-by: Ian Chen <[email protected]> add one more test with multiple collisions Signed-off-by: Ian Chen <[email protected]> Update mass expectation in auto-inertial tests The mass is no longer explicitly set in these Link tests, so replace the not-equals expectation with an expectation of what the mass should be. Signed-off-by: Steve Peters <[email protected]> fix build Signed-off-by: Ian Chen <[email protected]> remove empty line Signed-off-by: Ian Chen <[email protected]> remove density warning, fix typo Signed-off-by: Ian Chen <[email protected]> Update multiple-collision test with justification (#1515) Modifies the auto-inertial test with multiple collisions with different densities so that the lumped center of gravity is at the link origin and derives the expected moment of inertia values. Signed-off-by: Steve Peters <[email protected]>
d0226c6
to
2d466af
Compare
rebased changes to |
It looks like the warning is unconditionally removed, regardless of whether |
Signed-off-by: Ian Chen <[email protected]>
I went with the option to add a |
Yes, that looks good; I want to see if we can add a test that verifies the presence / absence of the errors / warnings depending on that new flag |
see #1520 |
d9e897b
to
b1b22f7
Compare
Signed-off-by: Steve Peters <[email protected]>
merged! |
🎉 New feature
Closes #1482
Summary
Support auto-inertia computation using mass and density. Implemented based on the suggestions in #1482 (comment) and #1482 (comment)
inertia is first auto resolved from all collisions as usual. If mass is specified, we normalize the inertia to get unit inertia, then scaling is applied to match the desired mass.
Marked as draft to get feedback on implementation and correctness of mathChecklist
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.