sdf转urdf

2023-12-27 13:17:41

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)

pysdf - ROS Wiki

文章来源:https://blog.csdn.net/qq_37464479/article/details/135237067
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。