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

Check if everything is still working after urdf_parser_py modification of collision and visual tags #36

Closed
traversaro opened this issue Feb 15, 2018 · 8 comments · Fixed by #48

Comments

@traversaro
Copy link
Member

traversaro commented Feb 15, 2018

We need to fix the regression in visual and collision elements introduced in ros/urdf_parser_py#26 and discussed in #38 .

@traversaro traversaro changed the title Check if everything is still working after https://github.com/ros/urdf_parser_py/pull/26 Check if everything is still working after PR Feb 15, 2018
@traversaro traversaro changed the title Check if everything is still working after PR Check if everything is still working after urdf_parser_py Feb 15, 2018
@traversaro traversaro changed the title Check if everything is still working after urdf_parser_py Check if everything is still working after urdf_parser_py modification of collision and visual tags Feb 15, 2018
@gabrielenava
Copy link

@traversaro actually it is not ok: with the latest urdf_parser_py the urdf::Link class does not work properly anymore, and both Visual and Collision tags are missing in the link definition inside the urdf.

It seems the developers of the parser also noted the lack of backward compatibility of the Link class, in fact I fixed the problem by moving my urdf_parser_py to the fork implementing this PR: see also the issue I've opened #38 (comment).

Note that in my specific case there was another installation of the library that was hiding my modifications. In fact, the urdf_parser_py comes along with ros-desktop-full installation and therefore there was another (bugged) copy of the library in my path. I had to rename the installation that comes along with ROS, so that it was possible to see the correct files.

Now it seems to me that everything is working fine.

@traversaro
Copy link
Member Author

If I remember correctly the changes in ros/urdf_parser_py#26, we can simply strictly require the latest version of urdf_parser_py and switch to use visuals and collisions instead of visual and collision.

@traversaro
Copy link
Member Author

I updated the title of the issue to reflect the current focus, after the evidence of the regression introduced in ros/urdf_parser_py#26 .

@traversaro
Copy link
Member Author

A fix for the regression was proposed in ros/urdf_parser_py#47 by @k-okada, but unfortunately upstream seems not to be interested in the PR.

prashanthr05 added a commit to prashanthr05/icub-model-generator that referenced this issue Aug 12, 2019
Using urdf_parser_py's commit 31474b9baaf7c3845b40e5a9aa87d5900a2282c3,
that precedes the regression introduced in
ros/urdf_parser_py#26 (ros/urdf_parser_py#26)
and discussed in
robotology/simmechanics-to-urdf#36 (robotology/simmechanics-to-urdf#36).
The commit used is based from the info contained in this icub-models commit:
robotology/icub-models@b69b989 (robotology/icub-models@b69b989).
prashanthr05 added a commit to robotology/icub-models-generator that referenced this issue Sep 18, 2019
Using urdf_parser_py's commit 31474b9baaf7c3845b40e5a9aa87d5900a2282c3,
that precedes the regression introduced in
ros/urdf_parser_py#26 (ros/urdf_parser_py#26)
and discussed in
robotology/simmechanics-to-urdf#36 (robotology/simmechanics-to-urdf#36).
The commit used is based from the info contained in this icub-models commit:
robotology/icub-models@b69b989 (robotology/icub-models@b69b989).
traversaro added a commit to robotology/icub-models-generator that referenced this issue Nov 29, 2019
# Fix the way the FT IMU frames are added
- add individual accelerometer and gyroscope type frames to the associated IMU frame
- fix naming conventions - sensorName to be all in small letters
- do not export these frames as zero-mass links in the urdf
- just add these frames as sensor frames to the associated link

# Use latest known working version of deps: 
Use latest confirmed working version of urdf_parser_py
Using urdf_parser_py's commit 31474b9baaf7c3845b40e5a9aa87d5900a2282c3,
that precedes the regression introduced in
ros/urdf_parser_py#26 (ros/urdf_parser_py#26)
and discussed in
robotology/simmechanics-to-urdf#36 (robotology/simmechanics-to-urdf#36).
The commit used is based from the info contained in this icub-models commit:
robotology/icub-models@b69b989 (robotology/icub-models@b69b989).

* Increase tolerance as a workaround for known asimmetry, see #125
@traversaro
Copy link
Member Author

A fix for the regression was proposed in ros/urdf_parser_py#47 by @k-okada, but unfortunately upstream seems not to be interested in the PR.

The fix has been merged in the melodic-branch and is available in release 0.4.3, while it is not available in the ros2 branch and in particular in release 1.0.0 . @gabrielenava @FabioBergonti can you test if everything works ok when using urdf_parser_py v0.4.3 ?

@FabioBergonti
Copy link
Member

@gabrielenava @FabioBergonti can you test if everything works ok when using urdf_parser_py v0.4.3 ?

@traversaro
I tested it but it didn't compile and I got this error:

Traceback (most recent call last):
  File "/usr/local/bin/simmechanics_to_urdf", line 11, in <module>
    load_entry_point('simmechanics-to-urdf==0.2', 'console_scripts', 'simmechanics_to_urdf')()
  File "build/bdist.linux-x86_64/egg/simmechanics_to_urdf/firstgen.py", line 1871, in main
  File "build/bdist.linux-x86_64/egg/simmechanics_to_urdf/firstgen.py", line 175, in convert
  File "build/bdist.linux-x86_64/egg/simmechanics_to_urdf/firstgen.py", line 202, in generateXML
  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'

The error is the same as the issue https://github.com/dic-iit/component_ironcub/issues/138

@traversaro
Copy link
Member Author

That is another urdf_parser_py bug: the default Robot class is generated without the version attribute (see https://github.com/ros/urdf_parser_py/blob/melodic-devel/src/urdf_parser_py/urdf.py#L488), but then the version attribute is required in the serialization. It is necessary to report upstream the bug (let me know if you want me to handle that, even if I do not know when I will be able to do so).

An easy way to reproduce the bug is:

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

that gives the 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'

while the following call works fine:

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

that prints:

<robot name="robot_name" version="1.0" />

@AlexAntn
Copy link

I have tried running the URDF toolchain and noticed that with the most recent versions of urdf_parser_py (namely, master and 1.1.0) the simmechanics-to-urdf is not generating a correct URDF file.

The generated file has no links to any of the meshes, which results in the model not being successfully loaded when launching it in gazebo.

This should be reproducible by following the installation procedure and using the most recent versions for urdf_parser_py, and trying to create a URDF file with it (I used the icub3 files present here https://github.com/robotology/icub-models-generator/tree/921c4cbd5eefd94e95437ad3bb01793aff3ace68/simmechanics/data/icub3)

cc @traversaro

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 a pull request may close this issue.

4 participants