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
Refactor urdf parser function #94
Conversation
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
if jtype in ['fixed', 'floating', 'planar']: | ||
continue | ||
name = child.getAttribute('name') | ||
self.joint_list.append(name) |
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 think that this should move to right before the if name in dependent_joints
check. That way we avoid a situation where we could add it to self.joint_list
, but then fail to add it to the free_joints
because of a missing limit.
joint_state_publisher/joint_state_publisher/joint_state_publisher.py
Outdated
Show resolved
Hide resolved
limit = joint.getElementsByTagName('limits')[0] | ||
if joint: | ||
limit_list = joint.getElementsByTagName('limits') | ||
if limit_list: |
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.
This is again changing the semantics slightly. I think here we should probably do something more like:
if limit_list: | |
if not limit_list: | |
continue |
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.
Done
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
a3493fc
to
e020d8e
Compare
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.
The more I look at it, the more I want to clean up init_collada
here to be more robust. In particular, it is assuming a lot of things about the passed-in COLLADA file, and some of those things just may not be true. I've been looking in particular at https://www.khronos.org/files/collada_spec_1_5.pdf .
So what I'm going to suggest here is that we make this PR just about refactoring init_urdf
, which is an easier problem. Once we have that in, we can do another followup PR where we refactor init_collada
so it is much more robust. @quarkytale does that make sense?
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
489d119
to
b8e42ae
Compare
Alright this should just have |
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.
A few more things to fix, this is getting closer.
joint_state_publisher/joint_state_publisher/joint_state_publisher.py
Outdated
Show resolved
Hide resolved
joint_state_publisher/joint_state_publisher/joint_state_publisher.py
Outdated
Show resolved
Hide resolved
joint_state_publisher/joint_state_publisher/joint_state_publisher.py
Outdated
Show resolved
Hide resolved
joint_state_publisher/joint_state_publisher/joint_state_publisher.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris Lalancette <clalancette@gmail.com>
7678315
to
ac35282
Compare
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.
One more small change, then this will be good to go.
joint_state_publisher/joint_state_publisher/joint_state_publisher.py
Outdated
Show resolved
Hide resolved
ac35282
to
1d94241
Compare
Signed-off-by: Dharini Dutia <dharini@openrobotics.org>
1d94241
to
05a9679
Compare
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.
This looks great to me. Thank you for this cleanup!
Making
init_collada
andinit_urdf
consistent with new changes ininit_sdf
.Changes: