ROS noetic rosrun tf view_frames 报错

问题描述

在Ubuntu 20.04上运行代码lanx@lanx:~$ rosrun tf view_frames查看tf树的时候报错如下:

Listening to /tf for 5.0 seconds
Done Listening
b'dot - graphviz version 2.43.0 (0)\n'
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/tf/view_frames", line 119, in <module>
    generate(dot_graph)
  File "/opt/ros/noetic/lib/tf/view_frames", line 89, in generate
    m = r.search(vstr)
TypeError: cannot use a string pattern on a bytes-like object

解决方案

在命令框中输入:

sudo gedit /opt/ros/noetic/lib/tf/view_frames

然后搜索 m = r.search(vstr)(89行),在这行前面添加 vstr=str(vstr)即可。

原来为:

vstr=str(vstr)

修改后:

vstr=str(vstr)
m = r.search(vstr)

猜你喜欢

转载自blog.csdn.net/qq_16775293/article/details/127353012