我无法在 python 代码中使用 tf2_ros 库。我正在使用 ros Melodic。
import tf2_ros
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)
我尝试使用 python 的 tf2 库,但出现导入错误。只是我需要导入 tf2 库,并且我需要将此库与 python3 和 ros melodic 一起使用。
你安装了tf2_ros库吗?如果没有,则在 Ubunutu 上使用以下命令安装
install python-tf2-ros