Skip to content

Conversation

k-okada
Copy link
Contributor

@k-okada k-okada commented May 1, 2019

On indigo, to set visual and collisions on links, we write

        robot = urdf.Robot(name = 'test')
        link = urdf.Link(name = 'link',
                         visual = urdf.Visual(geometry = urdf.Cylinder(length = 1, radius = 1),
                                              material = urdf.Material(name = 'mat')))
        robot.add_link(link)

or

        robot = urdf.Robot(name = 'test')
        link = urdf.Link(name = 'link')
        link.visual = urdf.Visual(geometry = urdf.Cylinder(length = 1, radius = 1),
                                  material = urdf.Material(name = 'mat'))
        robot.add_link(link)

However, since melodic both method did not work well when we write URDF strings from these data as reported on #45. It only outputs <robot> and <link> tag without <visual> and <collision>.
And , to output <visual> and <collision> in URDF, we have to write

        robot = urdf.Robot(name = 'test')
        link = urdf.Link(name = 'link')
        link.add_aggregate('visual', urdf.Visual(geometry = urdf.Cylinder(length = 1, radius = 1),
                                                 material = urdf.Material(name = 'mat')))
        robot.add_link(link)

, but this is not work on Indigo machine.

This PR enable melodic users to continue using indigo-style code.

k-okada added 3 commits May 1, 2019 13:56
Link(visual=...) does not set <visual> on <link> since 0.4.0, breaks backward compatibility
@traversaro
Copy link
Contributor

Hi @clalancette @sloretz , let us know if there is anything we can do to help in merging this PR, thanks!

Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

This looks generally OK to me. @k-okada can you please rebase?

@sloretz sloretz requested a review from clalancette March 9, 2020 23:26
@sloretz
Copy link
Contributor

sloretz commented Mar 9, 2020

This looks generally OK to me. @k-okada can you please rebase?

Brought up to date and made a few fixes for the version attribute.

@clalancette clalancette merged commit 4378f06 into ros:melodic-devel Mar 11, 2020
AdrianZw pushed a commit to AdrianZw/urdf_parser_py that referenced this pull request Jul 11, 2023
* add test to build robot model from python urdf classes

* add more tests on python urdf build

* update backward compatibility

Link(visual=...) does not set <visual> on <link> since 0.4.0, breaks backward compatibility

* Robot accepts version kwarg

Signed-off-by: Shane Loretz <[email protected]>
Co-authored-by: Shane Loretz <[email protected]>
AdrianZw pushed a commit to AdrianZw/urdf_parser_py that referenced this pull request Jul 11, 2023
* add test to build robot model from python urdf classes

* add more tests on python urdf build

* update backward compatibility

Link(visual=...) does not set <visual> on <link> since 0.4.0, breaks backward compatibility

* Robot accepts version kwarg

Signed-off-by: Shane Loretz <[email protected]>
Co-authored-by: Shane Loretz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants