ROS2入门教程-查看TF树
ROS2入门教程-查看TF树
说明:
- 本教程介绍如果在ROS2下可视化查看tf树
操作步骤
下面就以查看仿真中tb3的tf树为例
启动tb3
$ roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch
- 查看tf树
$ ros2 run tf2_tools view_frames.py
[INFO] [1635134794.445248107] [view_frames]: Listening to tf data during 5 seconds...
[INFO] [1635134799.462196002] [view_frames]: Generating graph in frames.pdf file...
[INFO] [1635134799.471982193] [view_frames]: Result:tf2_msgs.srv.FrameGraph_Response(frame_yaml="base_link: \n parent: 'base_footprint'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nbase_footprint: \n parent: 'odom'\n broadcaster: 'default_authority'\n rate: 20.202\n most_recent_transform: 1635134799.428046\n oldest_transform: 1635134794.478135\n buffer_length: 4.950\ncaster_back_link: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nimu_link: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nbase_scan: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 10000.000\n most_recent_transform: 0.000000\n oldest_transform: 0.000000\n buffer_length: 0.000\nwheel_left_link: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 12.041\n most_recent_transform: 1635134799.428046\n oldest_transform: 1635134794.528159\n buffer_length: 4.900\nwheel_right_link: \n parent: 'base_link'\n broadcaster: 'default_authority'\n rate: 12.041\n most_recent_transform: 1635134799.428046\n oldest_transform: 1635134794.528159\n buffer_length: 4.900\n")
/opt/ros/foxy/lib/tf2_tools/view_frames.py:75: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
data = yaml.load(result.frame_yaml)
程序会在约5秒后在当前目录下生成
frames.gv
和frames.pdf
两个文件打开生成的
frames.pdf
文件
$ xdg-open frames.pdf
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号