ROS进二阶学习笔记(1) TF 学习笔记1:TF介绍 + tf工具
来源:互联网 发布:数据透视域 编辑:程序博客网 时间:2024/04/27 19:22
ROS进二阶学习笔记(1) TF 学习笔记1: -- TF介绍 + tf工具
Ref: http://wiki.ros.org/tf/Tutorials#Learning_tf
>>Ref: http://wiki.ros.org/tf/Tutorials/Introduction%20to%20tf
惭愧的是,时隔10个月,重新来学习tf的东西。
1. Running the Demo
Now that we're done getting the turtle_tf tutorial package, let's run the demo.
$ roslaunch turtle_tf turtle_tf_demo.launchOnce the turtlesim is started you can drive the center turtle around in the turtlesim using the keyboard arrow keys,select the roslaunch terminal window so that your keystrokes will be captured to drive the turtle.
关于这个demo,解释一下:
- demo 用了tf library
- 建立了3个frame: a world frame, a turtle1 frame, and a turtle2 frame
- 一个tf broadcaster : publish the turtle coordinate frames
- 一个tf listener:
- compute the difference in the turtle frames
- move one turtle to follow the other
就做了上述的几件事情。
开始剖析具体使用tf来做这个demo的步骤之前,先了解一下TF Tools
2. tf Tools
We can use tf tools to look at what tf is doing behind the scenes. 用tf tools来看看背后的tf在怎么工作:
- view_frames
- rqt_tf_tree --rosrun rqt_tf_tree rqt_tf_tree
- tf_echo -- 打印具体tf数据出来
- rviz + tf
2.1 Using view_frames
view_frames creates a diagram of the frames being broadcast by tf over ROS.
$ rosrun tf view_frames
You will see:
Transform Listener initingListening to /tf for 5.000000 secondsDone Listeningdot - Graphviz version 2.16 (Fri Feb 8 12:52:03 UTC 2008)Detected dot version 2.16frames.pdf generated
Here a tf listener is listening to the frames that are being broadcast over ROS and drawing a tree of how the frames are connected. To view the tree:
$ evince frames.pdf
- see thatworld is the parent of the turtle1 and turtle2 frames
2.2 Using rqt_tf_tree
rqt_tf_tree is a runtime tool for visualizing the tree of frames being broadcast over ROS. You can refresh the tree simply by the refresh bottom in the top-left corner of the diagram.
Usage:
rosrun rqt_tf_tree rqt_tf_tree
Or simply:
rqt &Then chooserqt_tf_tree fromPlugins tab.
2.3 Using tf_echo
tf_echo reports the transform between any two frames broadcast over ROS.
Usage:
rosrun tf tf_echo [reference_frame] [target_frame]
Let's look at the transform of the turtle2 frame with respect to turtle1 frame which is equivalent to :
$ rosrun tf tf_echo turtle1 turtle2
You will see the transform displayed as the tf_echo listener receives the frames broadcast over ROS.
At time 1416409795.450- Translation: [0.000, 0.000, 0.000]- Rotation: in Quaternion [0.000, 0.000, 0.914, 0.405] in RPY [0.000, -0.000, 2.308]At time 1416409796.441- Translation: [0.000, 0.000, 0.000]- Rotation: in Quaternion [0.000, 0.000, 0.914, 0.405] in RPY [0.000, -0.000, 2.308]At time 1416409797.450- Translation: [0.000, 0.000, 0.000]- Rotation: in Quaternion [0.000, 0.000, 0.914, 0.405] in RPY [0.000, -0.000, 2.308]At time 1416409798.441- Translation: [0.000, 0.000, 0.000]- Rotation: in Quaternion [0.000, 0.000, 0.914, 0.405] in RPY [0.000, -0.000, 2.308]At time 1416409799.433- Translation: [0.000, 0.000, 0.000]- Rotation: in Quaternion [0.000, 0.000, 0.691, 0.723] in RPY [0.000, -0.000, 1.526]
我认为重点就是要理解这个tf_echo命令出来的数据具体是什么含义。这个有点矩阵的意思。
这里就是 rosrun tf tf_echo frameA freameB 命令,输出的是: B 相对于 A 的坐标。T1_2 = T1_o * To_2 (Ta_b的几何意义是:b走Ta_b将到达a)
这里最容易搞混。后面还会有更多的内容来帮助理解。
2.3 Using rviz + tf
Let's look at our turtle frames using rviz. Let's startrviz with the turtle_tf configuration file using the-d option forrviz:
这里你要看tf在rviz里的话,得先有一个配置文件: turtle_tf
$ rosrun rviz rviz -d `rospack find turtle_tf`/rviz/turtle_rviz.rviz
- In the side bar , see the frames broadcast by tf
Now that we have examined the turtle_tf_demo, let's look at how to write the broadcaster(Python)(C++) for this demo.
- ROS进二阶学习笔记(1) TF 学习笔记1:TF介绍 + tf工具
- ROS进二阶学习笔记(1) TF 学习笔记2: -- TF Broadcaster 编写 (Python)
- ROS进二阶学习笔记(1) TF 学习笔记3 -- TF Listener 编写 (Python)and Adding frame(Python)
- ROS--TF学习--介绍
- 【笔记】TF学习1-9
- 学习ROS笔记之TF——learning tf(二)
- 学习ROS笔记之TF——learning tf(一)
- 学习ROS笔记之TF——learning tf(二)
- ROS tf工具使用笔记
- ROS学习笔记:tf的学习与使用(一)
- ROS学习笔记:tf的学习和使用(二)
- TF框架学习笔记
- 学习ROS笔记之TF——learning tf(一)
- tensorflow学习笔记(三十):tf.gradients 与 tf.stop_gradient()
- ROS-TF学习-欧拉角
- TF-Slim学习(1)
- TF/IDF概念学习笔记
- #tensorflow学习笔记#tf.gather
- 网络安全-主要的安全漏洞及防御
- Java日期处理工具类
- 【Easy UI】easyui 异步上传文件
- Tableau Server9.1.2 配置集群
- arm-linux启动过程
- ROS进二阶学习笔记(1) TF 学习笔记1:TF介绍 + tf工具
- python面向对象(乐高编程语言)
- OS X El Capitan 下使用 git svn 出错的问题
- 【AMI BIOS入门】添加item-POWERLED_CONFIGURATION
- Android去除启动时黑屏
- AssetBundle在安卓中的解析的教程
- CSS盒子模型
- Android OnTouchEvent OnTouchListner 方法区别
- 基于MVP开发模式的简单Android项目