問題の説明
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)