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

Multiple visual and collision elements load properly as aggregates #25

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/urdf_parser_py/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,18 +352,19 @@ def joint_type(self, value): self.type = value
class Link(xmlr.Object):
def __init__(self, name=None, visual=None, inertial=None, collision=None,
origin=None):
self.aggregate_init()
self.name = name
self.visual = visual
self.inertial = inertial
self.collision = collision
self.visuals = []
self.inertials = inertial
Copy link
Contributor

@sloretz sloretz Dec 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a link may only have one <interial> tag I think this should stay as intertial

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean inertial correct?

self.collisions = []
self.origin = origin

xmlr.reflect(Link, params=[
name_attribute,
origin_element,
xmlr.AggregateElement('visual', Visual),
xmlr.AggregateElement('collision', Collision),
xmlr.Element('inertial', Inertial, False),
xmlr.Element('visual', Visual, False),
xmlr.Element('collision', Collision, False)
])


Expand Down