robotology / simmechanics-to-urdf

Script for converting simmechanics XML files to URDF
34 stars 8 forks source link

simmechanics-to-urdf not working for me #47

Closed ale-git closed 3 years ago

ale-git commented 3 years ago

When I try to generate the Mk3 hand URDF model I get the error:

ale@IITICUBLAP193:~/Documents/Projects/icub-model-generator/simmechanics/data/hand_mk3$ ./convertModel.sh 
/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py:689: SyntaxWarning: "is" with a literal. Did you mean "=="?
/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py:1600: SyntaxWarning: "is" with a literal. Did you mean "=="?
/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py:689: SyntaxWarning: "is" with a literal. Did you mean "=="?
/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py:1600: SyntaxWarning: "is" with a literal. Did you mean "=="?
/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py:369: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
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 "/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py", line 1969, in main
  File "/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py", line 238, in convert
  File "/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py", line 1596, in addXMLBlobs
  File "/usr/local/lib/python3.8/dist-packages/simmechanics_to_urdf-0.2-py3.8.egg/simmechanics_to_urdf/firstgen.py", line 1603, in addXMLBlob
TypeError: append() argument must be xml.etree.ElementTree.Element, not lxml.etree._Element
Error: File doesn't exist[left_hand_mk3.urdf]
Error [parser.cc:334] Error finding file [left_hand_mk3.urdf].
Error: SDF parsing the xml failed

The source is here:

https://github.com/ale-git/icub-model-generator/tree/devel/simmechanics/data/hand_mk3

traversaro commented 3 years ago

Hi @ale-git, on which distribution are you? How did you installed urdf_parser_py and simmechanics_to_urdf?

ale-git commented 3 years ago

Hi @traversaro , I'm on Ubuntu 20.04 in WSL 2. I did as described here https://github.com/robotology/simmechanics-to-urdf

git clone https://github.com/ros/urdf_parser_py
cd urdf_parser_py
sudo python setup.py install
git clone https://github.com/robotology/simmechanics-to-urdf
cd simmechanics-to-urdf
sudo python setup.py install
traversaro commented 3 years ago

Hi @ale-git , I think your problem can be solved by using a specific commit of urdf_parser_py, see https://github.com/robotology/simmechanics-to-urdf/pull/48 . You can read more about this problem at https://github.com/robotology/simmechanics-to-urdf/issues/36 .

fiorisi commented 3 years ago

@ale-git following the @traversaro suggestion I was able to generate the model. image

I still have this warning (see the suggested page ): image

traversaro commented 3 years ago

Hi @fiorisi, I opened a separate issue in https://github.com/robotology/simmechanics-to-urdf/issues/49 for the warning, that however should not affect the output of the conversion.

traversaro commented 3 years ago

@ale-git @fiorisi as the specific problem of which version to use is now documented in https://github.com/robotology/simmechanics-to-urdf/pull/48/files and the cleanup of how dependencies are obtained is tracked in https://github.com/robotology/simmechanics-to-urdf/issues/46, probably we can close this issue?

fiorisi commented 3 years ago

@ale-git @fiorisi as the specific problem of which version to use is now documented in https://github.com/robotology/simmechanics-to-urdf/pull/48/files and the cleanup of how dependencies are obtained is tracked in #46, probably we can close this issue?

Yes @traversaro. Thanks again for your support!