GitHub - andreasBihlmaier/pysdf: Python library to parse SDF into class hierarchy and export URDF
目前执行成功的是ubuntu18.04 python2
mkdir -p catkin_ws/src
cd catkin_ws/src
git clone https://github.com/andreasBihlmaier/pysdf
pip install .
mkdir build && cmake .. && sudo make install
cd ../../
catkin_make
执行成功效果:
/pysdf/scripts$ python sdf2urdf.py [-p plotfile.png] model.sdf model.urdf
检查urdf合法性:?
sudo apt-get install liburdfdom-tools
check_urdf model.rudf
遇到问题的问题:
Python 2.7.17 (default, Mar? 8 2023, 18:40:28)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysdf
----------------------------------------------------------
Path (/home/*/catkin_ws/src/) does not exist.
Please either set/change MESH_WORKSPACE_PATH, or change
the catkin_ws_path variable inside pysdf/parse.py
----------------------------------------------------------
pysdf_ws$ rosrun pysdf sdf2urdf.py ~/model_editor_models/Untitled_smaple_sf_1/model.sdf ~/model_editor_models/Untitled_smaple_sf_1/model.urdf
Traceback (most recent call last):
? File "/home/zy/guojuntao/pysdf_ws/src/pysdf/scripts/sdf2urdf.py", line 6, in <module>
??? import pysdf
? File "/home/zy/guojuntao/pysdf_ws/devel/lib/python2.7/dist-packages/pysdf/__init__.py", line 34, in <module>
??? exec(__fh.read())
? File "<string>", line 1, in <module>
? File "/home/zy/guojuntao/pysdf_ws/src/pysdf/src/pysdf/parse.py", line 11, in <module>
??? from tf.transformations import *
? File "/opt/ros/melodic/lib/python2.7/dist-packages/tf/__init__.py", line 30, in <module>
??? from tf2_ros import TransformException as Exception, ConnectivityException, LookupException, ExtrapolationException
? File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_ros/__init__.py", line 38, in <module>
??? from tf2_py import *
? File "/opt/ros/melodic/lib/python2.7/dist-packages/tf2_py/__init__.py", line 38, in <module>
??? from ._tf2 import *
ImportError: dynamic module does not define module export function (PyInit__tf2)