sudo apt-get install ros-noetic-turtle-tf
roslaunch turtle_tf turtle_tf_demo.launch
#rosrun turtlesim turtle_teleop_key
只有一只乌龟,还报错,跟python有关??
cd /usr/bin
sudo cp python3 python
rosrun turtlesim turtle_teleop_key
rosrun tf view_frames
出错
1 Listening to /tf for 5.0 seconds
2 Done Listening
3 b’dot - graphviz version 2.42.3 (0)\n’
4 Traceback (most recent call last):
5 File “/opt/ros/melodic/lib/tf/view_frames”, line 119, in
6 generate(dot_graph)
7 File “/opt/ros/melodic/lib/tf/view_frames”, line 89, in generate
8 m = r.search(vstr)
9 TypeError: cannot use a string pattern on a bytes-like object
解决方法:
终端中运行
1 sudo vim /opt/ros/noetic/lib/tf/view_frames
然后打开的VIM编辑中修改代码
其中修改m = r.search(vstr.decode(‘utf-8’))
按o进入编辑模式,按esc退出 输入:wq,
这里:一定不能遗漏!!!!!
rosrun tf view_frames
rosrun tf tf_echo turtle1 turtle2
rosun rviz rviz -d rospack find turtle_tf
/rviz/turtle_rviz.rviz