-
Notifications
You must be signed in to change notification settings - Fork 7
Frame transformations in ROS [2425]
The tf system in ROS keeps track of multiple coordinate frames and maintains the relationship between them in a tree structure.
ros2 launch mecharm slider_control.launch.py
RobotModel
option on the left sidebar to remove the robot visualisation
You are now left with a schematic 3D representation of all the robot links and their reference frames, as shown above.
Here, the x, y, and z axes of each frame are represented by red, green, and blue lines respectively. The parent-child relationship between the coordinate frames is shown through an arrow (purple pointer tip) pointing from the child to its parent frame.
From a terminal window, you can visualise the computed transformations between any two frames in the TF tree.
ros2 run tf2_ros tf2_echo base link6
and you'll see some translation and rotation parameters, also represented as a homogeneous transformation matrix:
At time 1738847304.925373256
- Translation: [0.168, 0.000, 0.243]
- Rotation: in Quaternion [-0.500, 0.500, -0.500, 0.500]
- Rotation: in RPY (radian) [-1.570, -0.000, -1.571]
- Rotation: in RPY (degree) [-89.980, -0.000, -90.000]
- Matrix:
-0.000 0.000 1.000 0.168
-1.000 -0.000 -0.000 0.000
0.000 -1.000 0.000 0.243
0.000 0.000 0.000 1.000
ros2 run tf2_ros tf2_echo link4 link5
?
joint5
(shown as joint5_to_joint4
in the joint state publisher)? What rotation
ros2 run tf2_ros tf2_echo link4 link5
Parts for the workshops are extracted, edited from and/or inspired by the following sources.
- Official ROS humble tutorials: https://docs.ros.org/en/humble/Tutorials.html
- Elephant Robotics docs: https://docs.elephantrobotics.com/docs/gitbook-en/