theg4sh / sdf2urdf

Converter gazebo's sdf to urdf.
22 stars 4 forks source link

Issues with python 3 and gazebo11? #2

Closed NirobNabil closed 1 year ago

NirobNabil commented 3 years ago

I'm guessing this script was written for python2 so it was not tested with python3.

I'm not exactly sure if it is a problem with python3 but it gave me pyparsing import error when i ran the script with "./sdf2urdf.py". but it worked when ran with "python3 ./sdf2urdf.py"

it also had some problem importing GazeboMaterialFile script. i had to replace from GazeboMaterialFile import * with from .GazeboMaterialFile import *.

At the uriToPath function in sdf2urdf.py it was giving me error saying expected byte-like object, not 'str'. After some digging, i deleted the encode('utf-8') parts and it ran without any error.

Also in my machine GAZEBO_MODEL_PATH was not set. does gazebo11 not set the environment variable by default? i had to manually set the environment variable for uriToPath to work.

theg4sh commented 2 years ago

@NirobNabil hi, thank you for reporting the issue.

Made a few changes in #4 based on your issue report. I think it is good idea to migrate to python3 due to python2.7 is mostly deprecated (it was used while developing this script).

Currently I'm now working with ROS, so can't completely test it. Could you check changes in branch of #4 with your SDFs?