tf2 소개


👉🏼 A package that lets the user keep track of multiple coordinate frames over time

👉🏼 maintains the relationship between coordinate frames in a tree structure buffered in time

👉🏼 lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/aa4d3c69-6003-4824-9778-f2f841222384/Untitled.png

tf2 이해하기 (with turtle_tf2 demo)


혹시나 설치가 안되어 있으면,

$ sudo apt install ros-noetic-turtle-tf2

데모 실행

$ roslaunch turtle_tf2 turtle_tf2_demo_cpp.launch

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/dc02120d-c7f1-4d3e-b6c6-703297c07cc0/Untitled.png

$ roslaunch turtle_tf2 turtle_tf2_demo_cpp.launch
.... 

NODES
  /
    sim (turtlesim/turtlesim_node)
    teleop (turtlesim/turtle_teleop_key)
    turtle1_tf2_broadcaster (turtle_tf2/turtle_tf2_broadcaster)
    turtle2_tf2_broadcaster (turtle_tf2/turtle_tf2_broadcaster)
    turtle_pointer (turtle_tf2/turtle_tf2_listener)

auto-starting new master
process[master]: started with pid [7115]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to ee213ef2-a870-11ea-9128-00e18c79612a
process[rosout-1]: started with pid [7126]
started core service [/rosout]
process[sim-2]: started with pid [7132]
process[teleop-3]: started with pid [7134]
process[turtle1_tf2_broadcaster-4]: started with pid [7135]
Reading from keyboard
---------------------------
Use arrow keys to move the turtle. 'q' to quit.
process[turtle2_tf2_broadcaster-5]: started with pid [7142]
process[turtle_pointer-6]: started with pid [7147]
[ INFO] [1591501357.959344835]: waitForService: Service [/spawn] has not been advertised, waiting...
[ INFO] [1591501358.021799912]: waitForService: Service [/spawn] is now available.
[ WARN] [1591501358.049035936]: "turtle2" passed to lookupTransform argument target_frame does not exist.

💡 키보드의 화살표를 눌러 거북이를 이동해 봅시다. 어떤 일이 발생하나요?

💡 만약 저렇게 프로그램을 작성해야 한다면 어떻게 해야 할까요?