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

Default Robot class is generated without the version attribute #59

Closed
FabioBergonti opened this issue May 22, 2020 · 3 comments
Closed

Comments

@FabioBergonti
Copy link

The robot class is generated without the version attribute and if I run:

import urdf_parser_py
import xml
xml.etree.ElementTree.tostring(urdf_parser_py.urdf.URDF("robot_name").to_xml())

I got this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/urdf_parser_py/xml_reflection/core.py", line 588, in to_xml
  File "build/bdist.linux-x86_64/egg/urdf_parser_py/xml_reflection/core.py", line 581, in write_xml
  File "build/bdist.linux-x86_64/egg/urdf_parser_py/xml_reflection/core.py", line 554, in add_to_xml
  File "build/bdist.linux-x86_64/egg/urdf_parser_py/xml_reflection/core.py", line 336, in add_to_xml
AttributeError: 'Robot' object has no attribute 'version'

Is it possible to set the default robot class with version attribute equal to 1.0?
In this way I can avoid to specify every time the robot version.

import urdf_parser_py
import xml
xml.etree.ElementTree.tostring(urdf_parser_py.urdf.URDF("robot_name", 1.0).to_xml())

I did these tests on melodic-devel branch

@clalancette
Copy link
Contributor

This is definitely a problem; thanks for pointing it out. Please see #62 for a fix.

@FabioBergonti
Copy link
Author

This is definitely a problem; thanks for pointing it out. Please see #62 for a fix.

Thank you @clalancette
I checked the PR and I confirm that it solves the problem

@clalancette
Copy link
Contributor

Since we merged in #62 ages ago, closing this out.

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

No branches or pull requests

2 participants