ROS TF 官方文檔 翻譯

Package Summary

tf is a package that lets the user keep track of multiple coordinate frames over time. tf maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.

tf是一個軟件包,可讓用戶隨時間跟蹤多個座標系。 tf保持時間緩衝的樹結構中的座標系之間的關係,並允許用戶在任意所需的時間點在任意兩個座標系之間轉換點,向量等。

Migration: Since ROS Hydro, tf has been "deprecated" in favor of tf2. tf2 is an iteration on tf providing generally the same feature set more efficiently. As well as adding a few new features.

遷移:自ROS Hydro以來,tf被“棄用”,而轉而使用tf2。 tf2是tf的迭代,通常可以更有效地提供相同的功能集。 以及添加了一些新功能。
As tf2 is a major change the tf API has been maintained in its current form. Since tf2 has a superset of the tf features with a subset of the dependencies the tf implementation has been removed and replaced with calls to tf2 under the hood. This will mean that all users will be compatible with tf2. It is recommended for new work to use tf2 directly as it has a cleaner interface. However tf will continue to be supported for through at least J Turtle.

由於tf2是一項重大更改,因此tf API已保持其當前形式。 由於tf2具有tf功能的超集以及部分依賴項,因此tf實現已被刪除,並在幕後被對tf2的調用所取代。 這意味着所有用戶都將與tf2兼容。 建議新工作直接使用tf2,因爲它的界面更乾淨。 但是,至少將通過J Turtle繼續支持tf。

  • Maintainer status: maintained
  • Maintainer: Tully Foote <tfoote AT osrfoundation DOT org>
  • Author: Tully Foote, Eitan Marder-Eppstein, Wim Meeussen
  • License: BSD
  • Source: git https://github.com/ros/geometry.git (branch: melodic-devel)

 

目錄

  1. What does tf do? Why should I use tf?
  2. Paper
  3. Tutorials
  4. Code API Overview
  5. Frequently asked questions
  6. Command-line Tools
    1. tf_monitor
    2. tf_echo
    3. static_transform_publisher
    4. view_frames
    5. roswtf plugin
  7. Nodes

 

 

What does tf do? Why should I use tf?

You want to see what tf can do instead of just reading about it? Check out the tf introduction demo.

您想看看tf可以做什麼,而不僅僅是閱讀它? 查看tf簡介演示。

A robotic system typically has many 3D coordinate frames that change over time, such as a world frame, base frame, gripper frame, head frame, etc. tf keeps track of all these frames over time, and allows you to ask questions like:

機器人系統通常具有隨時間變化的許多3D座標框架,例如世界框架,基礎框架,抓手框架,頭部框架等。tf隨時間跟蹤所有這些框架,並允許您提出以下問題:

  • Where was the head frame relative to the world frame, 5 seconds ago?
  • 5秒鐘前,頭部框架相對於世界框架在哪裏?
  • What is the pose of the object in my gripper relative to my base?
  • 夾具中物體相對於底座的姿勢是什麼?
  • What is the current pose of the base frame in the map frame?
  • 地圖框架中基礎框架的當前姿勢是什麼?

tf can operate in a distributed system. This means all the information about the coordinate frames of a robot is available to all ROS components on any computer in the system. There is no central server of transform information.

tf可以在分佈式系統中運行。 這意味着有關機械手座標系的所有信息可用於系統中任何計算機上的所有ROS組件。 沒有轉換信息的中央服務器。

For more information on the design see /Design

有關設計的更多信息,請參見/ Design。

 

Paper論文

There is a paper on tf presented at TePRA 2013 Papers/TePRA2013_Foote

在TePRA 2013論文/ TePRA2013_Foote上有一篇關於tf的論文

Tutorials 教程

We created a set of tutorials that walk you through using tf, step by step. You can get started on the introduction to tf tutorial. For a complete list of all tf and tf-related tutorials check out the tutorials page.

我們創建了一組教程,逐步引導您使用tf。 您可以開始學習tf教程。 有關所有與tf和tf相關的教程的完整列表,請查看 tutorials 頁面。

There are essentially two tasks that any user would use tf for, listening for transforms and broadcasting transforms.

任何用戶基本上都會使用tf進行兩項任務,即監聽轉換和廣播轉換。

Anyone using tf will need to listen for transforms:

任何使用tf的人都需要聽轉換:

  • Listening for transforms - Receive and buffer all coordinate frames that are broadcasted in the system, and query for specific transforms between frames. Check out the writing a tf listener tutorial (Python) (C++).

  • 接收並緩衝系統中廣播的所有座標幀,並查詢幀之間的特定轉換。 查看編寫tf偵聽器教程(Python) (C++)的方法。

To extend the capabilities of a robot you will need to start broadcasting transforms.

要擴展機器人的功能,您將需要開始廣播轉換。

  • Broadcasting transforms - Send out the relative pose of coordinate frames to the rest of the system. A system can have many broadcasters that each provide information about a different part of the robot. Check out the writing a tf broadcaster tutorial (Python) (C++).

  • 將座標系的相對姿勢發送給系統的其餘部分。 一個系統可以有許多廣播者,每個廣播者提供有關機器人不同部分的信息。 查看編寫tf廣播員教程 (Python) (C++)的內容。

Once you are finished with the basic tutorials, you can move on to learn about tf and time. The tf and time tutorial (Python) (C++) teaches the basic principles of tf and time. The advanced tutorial about tf and time (Python) (C++) teaches the principles of time traveling with tf.

完成基本教程後,您可以繼續學習tf和時間。 tf和時間教程(Python) (C++) 教授tf和時間的基本原理。 有關tf和時間 (Python) (C++) 的高級教程講授了使用tf和time的基本原理。

Code API Overview

tf API Overview:

Frequently asked questions

 

Command-line Tools 命令行工具

Although tf is mainly a code library meant to be used within ROS nodes, it comes with a large set of command-line tools that assist in the debugging and creation of tf coordinate frames. These tools include:

儘管tf主要是打算在ROS節點內使用的代碼庫,但它帶有大量的命令行工具,可幫助調試和創建tf座標系。 這些工具包括:

You may also wish to use the tf_remap node, which is a utility node for remapping coordinate transforms.

您可能還希望使用tf_remap節點,它是用於重新映射座標變換的實用程序節點。

 

tf_monitor

tf_monitor

  • Print information about the current coordinate transform tree to console. For example:
  • 將有關當前座標變換樹的信息輸出到控制檯。 例如:
$ rosrun tf tf_monitor
RESULTS: for all Frames

Frames:
Frame: /base_footprint published by /robot_pose_ekf Average Delay: 0.0469324 Max Delay: 0.0501503
Frame: /base_laser_link published by /robot_state_publisher Average Delay: 0.00891066 Max Delay: 0.009591
Frame: /base_link published by /robot_state_publisher Average Delay: 0.00891147 Max Delay: 0.009592
0.00891431 Max Delay: 0.009595

... editing for the sake of brevity ...

Broadcasters:
Node: /realtime_loop 94.7371 Hz, Average Delay: 0.000599916 Max Delay: 0.001337
Node: /robot_pose_ekf 30.8259 Hz, Average Delay: 0.0469324 Max Delay: 0.0501503
Node: /robot_state_publisher 25.8099 Hz, Average Delay: 0.0089224 Max Delay: 0.00960276

tf_monitor <source_frame> <target_target>

  • Monitor a specific transform. For example, to monitor the transform from /base_footprint to /odom:

  • 監視特定的轉換。 例如,監視從/ base_footprint到/ odom的轉換:

$ rosrun tf tf_monitor /base_footprint /odom
RESULTS: for /base_footprint to /odom
Chain currently is: /base_footprint -> /odom
Net delay     avg = 0.00371811: max = 0.012472

Frames:
Frame: /base_footprint published by /robot_pose_ekf Average Delay: 0.0465218 Max Delay: 0.051754
Frame: /odom published by /realtime_loop Average Delay: 0.00062444 Max Delay: 0.001553

Broadcasters:
Node: /realtime_loop 95.3222 Hz, Average Delay: 0.00062444 Max Delay: 0.001553
Node: /robot_pose_ekf 30.9654 Hz, Average Delay: 0.0465218 Max Delay: 0.051754
Node: /robot_state_publisher 25.9839 Hz, Average Delay: 0.00903061 Max Delay: 0.00939562

 

 

tf_echo

tf_echo <source_frame> <target_frame>

  • Print information about a particular transformation between a source_frame and a target_frame. For example, to echo the transform between /map and /odom:

  • 打印有關source_frame和target_frame之間的特定轉換的信息。 例如,回顯/ map和/ odom之間的轉換:

$ rosrun tf tf_echo /map /odom
At time 1263248513.809
- Translation: [2.398, 6.783, 0.000]
- Rotation: in Quaternion [0.000, 0.000, -0.707, 0.707]
in RPY [0.000, -0.000, -1.570]

static_transform_publisher

static_transform_publisher x y z yaw pitch roll frame_id child_frame_id period_in_ms

  • Publish a static coordinate transform to tf using an x/y/z offset in meters and yaw/pitch/roll in radians. (yaw is rotation about Z, pitch is rotation about Y, and roll is rotation about X). The period, in milliseconds, specifies how often to send a transform. 100ms (10hz) is a good value.
  • 使用x/y/z偏移(米)和偏航/俯仰/滾轉弧度將靜態座標變換髮布到tf。(偏航是圍繞Z旋轉,俯仰是圍繞Y旋轉,橫搖是圍繞X旋轉)。週期(以毫秒爲單位)指定發送轉換的頻率。100毫秒(10赫茲)是一個很好的數值。

static_transform_publisher x y z qx qy qz qw frame_id child_frame_id  period_in_ms

  • Publish a static coordinate transform to tf using an x/y/z offset in meters and quaternion. The period, in milliseconds, specifies how often to send a transform. 100ms (10hz) is a good value.
  • 使用以米和四元數表示的x / y / z偏移量將靜態座標轉換髮布到tf。 週期(以毫秒爲單位)指定發送轉換的頻率。 100ms(10hz)是一個不錯的選擇。

static_transform_publisher is designed both as a command-line tool for manual use, as well as for use within roslaunch files for setting static transforms. For example:

static_transform_publisher被設計爲手動使用的命令行工具,也可以在roslaunch文件中用於設置靜態轉換。例如:

切換行號顯示

   1 <launch>
   2 <node pkg="tf" type="static_transform_publisher" name="link1_broadcaster" args="1 0 0 0 0 0 1 link1_parent link1 100" />
   3 </launch>

view_frames

view_frames is a graphical debugging tool that creates a PDF graph of your current transform tree.

view_frames是一個圖形調試工具,可創建當前轉換樹的PDF圖形。

$ rosrun tf view_frames

You probably want to view the graph when you are done, so a typical usage on Ubuntu systems is:

您可能希望在完成後查看圖形,因此在Ubuntu系統上的典型用法是:

$ rosrun tf view_frames
$ evince frames.pdf

Therefore an helpful shortcut to add in your .bashrc is:

因此,添加.bashrc的有用快捷方式是:

alias tf='cd /var/tmp && rosrun tf view_frames && evince frames.pdf &'

NOTE: See also rqt_tf_tree that allows dynamic introspection of the frames.

注意:另請參見rqt_tf_tree,它允許對幀進行動態自檢。

roswtf plugin 

roswtf 插件

roswtf tf comes with a plugin for roswtf that automatically runs whenever you run roswtf. This plugin will analyze your current tf configuration and attempt to find common problems. To run, just invoke roswtf normally:

roswtf tf帶有roswtf插件,該插件在您運行roswtf時自動運行。 該插件將分析您當前的tf配置,並嘗試查找常見問題。 要運行,只需正常調用roswtf:

$ roswtf

 

Nodes

tf_remap

tf_remap listens to the /tf_old topic and republishes transforms on the /tf topic. This is mainly used with out-of-date bag files that need their coordinate frame IDs updated. The typical operation for this node is to play the bag file with /tf:=/tf_old. The tf_remap node is run with a ~mappings parameter that describes the mapping of frame IDs from old to new.

tf_remap偵聽/ tf_old主題,並重新發布有關/ tf主題的轉換。 這主要用於需要更新其座標框架ID的過時包文件。 該節點的典型操作是使用/ tf:= /tf_old 播放bag文件。 tf_remap節點使用〜mappings參數運行,該參數描述幀ID從舊到新的映射。

Subscribed Topics

訂閱主題

/tf_old (tf/tfMessage)

  • Old transform tree. This is usually published by remapping playback of a bag file. You may need to set use_sim_time true for the bag file transforms to be accepted.
  • 舊的變換樹。 這通常是通過重新映射bag文件的播放來發布的。 您可能需要將use_sim_time設置爲true才能接受bag文件轉換。

Published Topics

/tf (tf/tfMessage)

  • Current transform tree. This is the normal /tf topic.
  • 當前變換樹。 這是正常的/ tf主題。

Parameters

~mappings ([ {str: str} ], default: [])

  • List of dictionaries that map old tf frame IDs to new frame IDs. Each dictionary in the list must have an "old" and "new" key.
  • 將舊的tf frame ID映射到新的frameID的詞典列表。 列表中的每個字典都必須具有“old”和“new”關鍵字。

 

change_notifier

change_notifier listens to /tf and periodically republishes any transforms that have changed by a given amount on the /tf_changes topic.

change_notifier 偵聽/ tf,並定期重新發布所有轉換( 由 / tf_changes主題給定的數據改變引起的 ) 。

Subscribed Topics

訂閱主題

/tf (tf/tfMessage)

  • Transform tree.

Published Topics

發佈主題

/tf_changes (tf/tfMessage)

  • Reduced transform tree.

Parameters

~polling_frequency (float, default: 10.0)

  • Frequency (hz) at which to check for any changes to the transform tree.
  • 檢查變換樹是否有任何更改的頻率(hz)。

~translational_update_distance (float, default: 0.1)

  • Minimum distance between the origin of two frames for the transform to be considered changed.
  • 兩個幀的原點之間的最小距離,被認爲是改變了。

~angular_update_distance (float, default: 0.1)

  • Minimum angle between the rotation of two frames for the transform to be considered changed.
  • 兩個幀之間的旋轉之間的最小角度,被認爲是改變了。

 

 

# Keywords Transformation, Transformations, coordinate transform

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章