sdf转urdf

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
cd 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.urdf

遇到问题的问题:

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/pysdf_ws/src/pysdf/scripts/sdf2urdf.py", line 6, in <module>
    import pysdf
  File "/home/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/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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值