ROS_TF_02 - 8BitsCoding/RobotMentor GitHub Wiki

TF02 : TF๋ณด๋Š” ๋ฒ•

๊ธฐ๋ณธ์ ์œผ๋กœ ์•„๋ž˜์™€ ๊ฐ™์€ ๋ช…๋ น์–ด๋ฅผ ์“ด๋‹ค.

  • rosrun tf view_frames
  • rosrun rqt_tf_tree rqt_tf_tree
  • rostopic echo /tf
  • rosrun tf tf_echo turtle1 turtle2
  • rviz

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๊ฐ€ ์ „์‹œ๊ฐ€๋œ๋‹ค.