## ROS坐标系

ROS坐标系使用右手法则，Z轴朝上， X轴到Y轴是逆时针。

## TF Tool

view_frames

rosrun tf view_frames
evince frames.pdf

rqt_tf_tree

rosrun rqt_tf_tree rqt_tf_tree

Tturtle1_turtle2=Tturtle1_worldTworld_turtle2

rosrun tf tf_echo [reference_frame] [target_frame]
rosrun tf tf_echo turtle1 turtle2

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]

## 教程

http://wiki.ros.org/tf/Tutorials/Introduction%20to%20tf

### demo

roslaunch turtle_tf turtle_tf_demo.launch

ROS的坐标系，最终归结为三个标准框架，可以简化许多常见的机器人问题：

1）全局准确，但局部不连续的帧（’map”）
2）全局不准确，但局部光滑框架（’odom”）

# 编程

## tf坐标变换

from tf import transformations as t

(trans, rot) = transformer.lookupTransform(frame1, frame2, rospy.Time(0))
transform = t.concatenate_matrices(t.translation_matrix(trans), t.quaternion_matrix(rot))
inversed_transform = t.inverse_matrix(transform)

## Wait for transforms

listener.waitForTransform("/turtle2", "/carrot1", rospy.Time(), rospy.Duration(4.0))
while not rospy.is_shutdown():
try:
now = rospy.Time.now()
listener.waitForTransform("/turtle2", "/carrot1", now, rospy.Duration(4.0))
(trans,rot) = listener.lookupTransform("/turtle2", "/carrot1", now)

## 通过坐标的相互关系控制机器人移动

2016-07-07 20:39:19

#### ROS探索总结（十二）——坐标系统

2013-07-05 19:55:12

#### ROS中常见坐标系定义及基本单位

2016-08-19 10:12:24

#### ros中常见各坐标系之间衔接关系

2017-05-09 20:58:47

#### 在Rviz中显示坐标系方法探究

2016-11-01 16:42:45

#### 由浅到深理解ROS（6）-坐标转换

2016-11-21 13:31:36

#### ROS坐标系

2016-07-29 15:51:31

#### ROS-tf坐标转换

2016-04-29 14:05:22

#### 学习ROS笔记之TF——learning tf（一）

2014-04-18 10:20:55

#### ROS代码经验系列-- tf进行位置查询变换

2015-11-26 20:22:40

ROS的坐标系TF