ROS_TF_02 - 8BitsCoding/RobotMentor GitHub Wiki
TF02 : TF๋ณด๋ ๋ฒ
๊ธฐ๋ณธ์ ์ผ๋ก ์๋์ ๊ฐ์ ๋ช ๋ น์ด๋ฅผ ์ด๋ค.
rosrun tf view_framesrosrun rqt_tf_tree rqt_tf_treerostopic echo /tfrosrun tf tf_echo turtle1 turtle2rviz
ROS_TF_00์ ์คํํ๊ณ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํด๋ณด์.
rosrun tf view_frames
$ roscd
$ cd ../src
$ rosrun tf view_frames
Listening to /tf for 5.000000 seconds
Done Listening
dot - graphviz version 2.38.0 (20140413.2041)
Detected dot version 2.38
frames.pdf generated
์์ฑ๋ frames.pdf๋ฅผ ์ด๋ฉด Tf๋ฅผ ํ์ธ๊ฐ๋ฅ
- Broadcaster : TF๋ฐ์ดํฐ์ Broadcaster ์ด๋ฆ
- Average rate :
- Most recent transform :
- Buffer length :
rosrun rqt_tf_tree rqt_tf_tree
rosrun tf view_frames์ ๊ฐ์์ผ์ ํ๋ค.
rostopic echo /tf
$ rostopic echo /tf
# ๊ณ์ ์ ์
$ rostopic echo -n1 /tf
# ํ๋๋ง ์ ์
์๋์ ๊ฐ์ด ์ ์๋จ
transforms:
-
header:
seq: 0
stamp:
secs: 1061
nsecs: 428000000
frame_id: "/world"
child_frame_id: "turtle1"
transform:
translation:
x: -142.712346642
y: -0.299754442675
z: 4.40982934542e-05
rotation:
x: 1.35657372794e-07
y: -4.40980891938e-05
z: 0.00307624963478
w: 0.999995267361
---
transforms:
-
header:
seq: 0
stamp:
secs: 1061
nsecs: 428000000
frame_id: "/world"
child_frame_id: "turtle2"
transform:
translation:
x: -142.062306102
y: -0.29577356045
z: 0.0400071808782
rotation:
x: -2.29094600411e-05
y: 9.61150034062e-07
z: -0.999995488711
w: 0.00300366972049
---
rosrun tf tf_echo turtle1 turtle2
๋ Frame์ Tf๋ฅผ ์ ์ํด์ค๋ค.
$ rosrun tf tf_echo turtle1 turtle2
At time 1163.227
- Translation: [0.650, -0.000, 0.040]
- Rotation: in Quaternion [0.000, -0.000, 1.000, 0.000]
in RPY (radian) [-0.000, -0.000, 3.141]
in RPY (degree) [-0.000, -0.003, 179.992]
rviz
$ rosrun rviz rviz
- Rviz๊ฐ ์ ์๋๊ณ
- Global Options์ Fixed Frame์ world(base frame)๋ก ๋๋ค.
- Add๋ฒํผ์ ํด๋ฆญํ์ฌ TF๋ฅผ ์ ํ์ Rvizํ๋ฉด์ TF๊ฐ ์ ์๊ฐ๋๋ค.