Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
URDF->SDF handle links with no inertia or small mass #1238
URDF->SDF handle links with no inertia or small mass #1238
Changes from 44 commits
a7d8a24
15845d8
bcd9459
90bfe5f
09e148e
053f70e
c5f757d
9b0aca3
d829d50
089b8a7
4887eae
cb6d540
d4de275
ecdad41
2d01243
1e5a2da
27bf7b7
d0a2770
2f86ca7
e1b488b
a880d4f
bfb68c8
dff421c
dd687c3
3d2bf35
c53243c
c9a7f4b
d29328b
a575e1c
99db618
0e8c8fb
86ac8a6
5d2d26c
b495dd9
a53f9c7
0479650
432a1cb
d9c9cb4
8976110
774d86b
b290786
bb9fa63
509bb50
a0d457a
ba52e6f
94382d7
6aa625c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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.
Codecov says these two lines are not covered. Is it a false negative?
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 believe so! This test will cause the
break
, https://github.com/gazebosim/sdformat/pull/1238/files#diff-fc2484863e209b4368da90c08381488ec4b010f386c642b1ea1e8bcf82cf6f02R2141-R2190Could this be due to the code only checking
!jointReductionHappens
and not do anything ifjointReductionHappens
is true?I'm not too sure how to see if this gets reported again, is it just https://app.codecov.io/gh/gazebosim/sdformat/pull/1238? Looks alright at the moment
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 tested with gdb, and looks like it really isn't covered. Apparently, a massless link with a non-fixed parent joint and a fixed child joint is reduced before
CreateSDF
is ever called :sdformat/src/parser_urdf.cc
Lines 3385 to 3398 in ba52e6f
This means, the massless link now has mass from the lumped child links. So, I guess if we encounter a massless link here, it would only be if:
Can you verify my logic? Does that maybe simplify anything?
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.
Yup, I can recreate it with
gdb
too, it doesn't even allow me to set a breakpoint there, probably got optimized away by the compiler. Looking at the code, I can verify that is the intended behavior too.94382d7, 6aa625c, I've refactored the fixed child joint logic and reduced the number of checks we are doing overall (only if parent joint is reduced)
I kept the use of
Errors
, instead of usingsdfwarn << Error(...)
directly, to make easier when we do introduce passingErrors
into these functions in the future.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.
@azeey, per VC, regarding whether or not a similar situation for reduced parent joints is a bug, I don't believe it is a bug, just that checks happen after . Before this PR, joints are lumped recursively onto their parents with L3387 (shared by you above), and relies on https://github.com/gazebosim/sdformat/pull/1238/files#diff-2bc5ca23bcfc66fe173f513399bec8065b1cb4e607d741566517d7368e6bce0fL2705 to not create the link (whose's inertia has been lumped) if the parent joint is reduced, but the urdf link still contains the mass values
so there will be cases where
CreateSDF
is called on a massless link, https://github.com/gazebosim/sdformat/pull/1238/files#diff-2bc5ca23bcfc66fe173f513399bec8065b1cb4e607d741566517d7368e6bce0fL2713, where the parent has already been reduced, hence the need to check if the parent has been reduced.on the otherhand, as you surmised, a massless link
A
with a fixed child joint, and child linkB
with mass, will already haveB
's mass lumped into it inCreateSDF
, so it should always have mass unless joint lumping was turned off.