Professional Documents
Culture Documents
01 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.02 Lecture 3
CONTENTS
1. Rotation about Global Cartesian Axes
3. Roll-Pitch-Yaw Angles
4. Euler Angles
5. Axis-Angle Rotation
7. Homogeneous Transformation
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.03 Lecture 3
• Consider
- local coordinate frame 𝑂𝑥𝑦𝑧
attaches to the rigid body 𝑩
- global coordinate frame 𝑂𝑍𝑌𝑍
• Determine
𝑶 - Transformation matrices for
point 𝑷 between two coordinates
• Point 𝑶 of the body 𝑩 is fixed to the ground 𝑮 and is the origin of both
coordinate frames
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.04 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.05 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.06 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.08 Lecture 3
The slab and the point 𝑷 in first, second, third, and fourth positions
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.09 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.11 Lecture 3
𝐵 −1 𝐺
𝒓2 = 𝑸𝑍,60 𝒓2
𝑥2 −1
𝑐𝑜𝑠60 −𝑠𝑖𝑛60 0 4 4.5981
⟹ 𝑦2 = 𝑠𝑖𝑛60 𝑐𝑜𝑠60 0 3 = −1.9641
𝑧2 0 0 1 2 2.0
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.12 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.13 Lecture 3
𝐺
𝑸𝐵 = 𝑸𝑋,𝛾 𝑸𝑌,𝛽 𝑸𝑍,𝛼 (2.38)
1 0 0 𝑐𝑜𝑠𝛽 0 𝑠𝑖𝑛𝛽 𝑐𝑜𝑠𝛼 −𝑠𝑖𝑛𝛼 0
= 0 𝑐𝑜𝑠𝛾 −𝑠𝑖𝑛𝛾 0 1 0 𝑠𝑖𝑛𝛼 𝑐𝑜𝑠𝛼 0
0 𝑠𝑖𝑛𝛾 𝑐𝑜𝑠𝛾 −𝑠𝑖𝑛𝛽 0 𝑐𝑜𝑠𝛽 0 0 1
𝑐𝛼𝑐𝛽 −𝑐𝛽𝑠𝛼 𝑠𝛽
= 𝑐𝛾𝑠𝛼 + 𝑐𝛼𝑠𝛽𝑠𝛾 𝑐𝛼𝑐𝛾 − 𝑠𝛼𝑠𝛽𝑠𝛾 −𝑐𝛽𝑠𝛾
𝑠𝛼𝑠𝛾 − 𝑐𝛼𝑐𝛾𝑠𝛽 𝑐𝛼𝑠𝛾 + 𝑐𝛾𝑠𝛼𝑠𝛽 𝑐𝛽𝑐𝛾
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.14 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.15 Lecture 3
𝑸𝑋,𝛾 𝑸𝑌,𝛽 𝑸𝑍,𝛼 𝑸𝑍,𝛾 𝑸𝑌,𝛽 𝑸𝑋,𝛼 𝑸𝑋,𝛾 𝑸𝑌,𝛽 𝑸𝑋,𝛼 𝑸𝑋,𝛾 𝑸𝑍,𝛽 𝑸𝑋,𝛼
𝑸𝑌,𝛾 𝑸𝑍,𝛽 𝑸𝑋,𝛼 𝑸𝑌,𝛾 𝑸𝑋,𝛽 𝑸𝑍,𝛼 𝑸𝑌,𝛾 𝑸𝑍,𝛽 𝑸𝑌,𝛼 𝑸𝑌,𝛾 𝑸𝑋,𝛽 𝑸𝑌,𝛼
𝑸𝑍,𝛾 𝑸𝑋,𝛽 𝑸𝑌,𝛼 𝑸𝑋,𝛾 𝑸𝑍,𝛽 𝑸𝑌,𝛼 𝑸𝑍,𝛾 𝑸𝑋,𝛽 𝑸𝑍,𝛼 𝑸𝑍,𝛾 𝑸𝑌,𝛽 𝑸𝑍,𝛼
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.16 Lecture 3
𝑐𝑜𝑠𝜃 0 −𝑠𝑖𝑛𝜃
𝑨𝑦,𝜃 = 0 1 0
𝑠𝑖𝑛𝜃 0 𝑐𝑜𝑠𝜃
1 0 0
𝑨𝑥,𝜓 = 0 𝑐𝑜𝑠𝜓 𝑠𝑖𝑛𝜓
0 −𝑠𝑖𝑛𝜓 𝑐𝑜𝑠𝜓
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.19 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.20 Lecture 3
𝑇
𝑋 𝑐𝑜𝑠60 𝑠𝑖𝑛60 0 4 −0.60
𝑌 = −𝑠𝑖𝑛60 𝑐𝑜𝑠60 0 3 = 4.96
𝑍 0 0 1 2 2.0
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.21 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.22 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.23 Lecture 3
𝐵
𝑨𝐺 = 𝑨𝑦,𝜓 𝑨𝑥,𝜃 𝑨𝑧,𝜑
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.25 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.26 Lecture 3
3. ROLL-PITCH-YAW ANGLES
• The rotation about the 𝑋-axis of the global coordinate frame is called a
roll, the rotation about the 𝑌-axis of the global coordinate frame is called
a pitch, and the rotation about the 𝑍-axis of the global coordinate frame is
called a yaw
• This figure illustrates 450 roll, pitch, and yaw rotation about the axes of
a global coordinate frame
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.27 Lecture 3
3. ROLL-PITCH-YAW ANGLES
• Given the roll, pitch, and yaw angles, we can compute the overall
rotation matrix
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.28 Lecture 3
3. ROLL-PITCH-YAW ANGLES
• Also we are able to compute the equivalent roll, pitch, and yaw angles
when a rotation matrix is given. Suppose that 𝑟𝑖𝑗 indicates the element of
row 𝑖 and column 𝑗 of the roll-pitch-yaw rotation matrix (2.55)
• Then the roll angle is
𝑟32
𝛼 = 𝑡𝑎𝑛−1
𝑟33
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.29 Lecture 3
3. ROLL-PITCH-YAW ANGLES
• Example 11 (Determination of roll-pitch-yaw angles)
Determine the required roll-pitch-yaw angles to make the 𝑥-axis of the
body coordinate 𝑩 parallel to 𝒖 = 𝑰 + 2𝑱 + 3𝑲, while 𝑦-axis remains in
(𝑋, 𝑌)-plane?
We have
𝐺 𝒖 1 2 3
𝒊= = 𝑰+ 𝑱+ 𝑲
𝒖 14 14 14
𝐺
𝒋 = 𝑰 ∙ 𝒋 𝑰 + 𝑱 ∙ 𝒋 𝑱 = 𝑐𝑜𝑠𝜃 𝑰 + 𝑠𝑖𝑛𝜃𝑱
The axes 𝐺 𝒊 and 𝐺 𝒋 must be orthogonal, therefore
1/ 14 𝑐𝑜𝑠𝜃
2/ 14 ∙ 𝑠𝑖𝑛𝜃 = 0 ⇒ 𝜃 = −26.560
3/ 14 0
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.30 Lecture 3
3. ROLL-PITCH-YAW ANGLES
1/ 14 0.894 0.358
Find 𝐺 𝒌 by a cross product: 𝐺 𝐺 𝐺
𝒌 = 𝒊 × 𝒋 = 2/ 14 × −0.447 = 0.717
3/ 14 0 −0.597
4. EULER ANGLES
• The rotation about the 𝑍 -axis of the global coordinate is called
precession, the rotation about the 𝑥-axis of the local coordinate is called
nutation, and the rotation about the 𝑧-axis of the local coordinate is
called spin
• The precession-nutation-spin rotation angles are also called Euler angles
• Euler angles rotation matrix has many application in rigid body
kinematics
• To find Euler angles rotation matrix to go from the global frame
𝐺(𝑂𝑋𝑌𝑍) to the final body frame 𝐵(𝑂𝑥𝑦𝑧), we employ a body frame
𝐵′(𝑂𝑥 ′ 𝑦 ′ 𝑧′) that shown in Fig 2.12 that before the first rotation coincides
with the global frame
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.32 Lecture 3
4. EULER ANGLES
• Let there be at first a rotation 𝜑 about the 𝑧′-axis. Because 𝑍-axis and
𝑧′-axis are coincident, we have
𝐵′ 𝐵′
𝒓 = 𝑨𝐺 𝐺 𝒓
𝑐𝑜𝑠𝜑 𝑠𝑖𝑛𝜑 0
𝐵′
𝑨𝐺 = 𝑨𝑧,𝜑 = −𝑠𝑖𝑛𝜑 𝑐𝑜𝑠𝜑 0
0 0 1
• Next we consider the 𝑩′(𝑂𝑥 ′ 𝑦 ′ 𝑧′) frame as a new fixed global frame and
introduce a new body frame 𝑩′′(𝑂𝑥 ′′ 𝑦 ′′ 𝑧′′). Before the second rotation,
the two frame coincide
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.33 Lecture 3
4. EULER ANGLES
• Then, we execute a 𝜃 rotation about 𝑥′′-axis as shown in Fig 2.13. The
transformation between 𝑩′(𝑂𝑥 ′ 𝑦 ′ 𝑧′) and 𝑩′′(𝑂𝑥 ′′ 𝑦 ′′ 𝑧′′) is
𝐵 ′′ 𝐵 ′′ 𝐵′
𝒓= 𝑨𝐵′ 𝒓
1 0 0
𝐵 ′′
𝑨𝐵′ = 𝑨𝑥,𝜃 = 0 𝑐𝑜𝑠𝜃 𝑠𝑖𝑛𝜃
0 −𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃
4. EULER ANGLES
• We now execute a 𝜓 rotation about the 𝑧′′-axis as shown in Fig 2.14. The
transformation between 𝑩′′(𝑂𝑥 ′′ 𝑦 ′′ 𝑧′′) and 𝑩(𝑂𝑥𝑦𝑧) is
𝐵 𝐵 𝐵 ′′
𝒓 = 𝑨𝐵′′ 𝒓
𝑐𝑜𝑠𝜓 𝑠𝑖𝑛𝜓 0
𝐵
𝑨𝐵′′ = 𝑨𝑧,𝜓 = −𝑠𝑖𝑛𝜓 𝑐𝑜𝑠𝜓 0
0 0 1
By the rule of composition of rotation, the
transformation from 𝑮(𝑂𝑋𝑌𝑍) to 𝑩(𝑂𝑥𝑦𝑧) is
𝐵
𝒓 = 𝐵𝑨𝐺 𝐺 𝒓
𝐵
𝑨𝐺 = 𝑨𝑧,𝜓 𝑨𝑥,𝜃 𝑨𝑧,𝜑
𝑐𝜑𝑐𝜓 − 𝑐𝜃𝑠𝜑𝑠𝜓 𝑐𝜓𝑠𝜑 + 𝑐𝜃𝑐𝜑𝑠𝜓 𝑠𝜃𝑠𝜓
= −𝑐𝜑𝑠𝜓 − 𝑐𝜃𝑐𝜓𝑠𝜑 −𝑠𝜑𝑠𝜓 + 𝑐𝜃𝑐𝜑𝑐𝜓 𝑠𝜃𝑐𝜓
𝑠𝜃𝑠𝜑 −𝑐𝜑𝑠𝜃 𝑐𝜃
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.35 Lecture 3
4. EULER ANGLES
• Example 18 (Euler angle rotation matrix)
The Euler or precession-nutation-spin rotation matrix for 𝜑 = 79.150 ,
𝜃 = 41.410 , and 𝜓 = −40.70 would be found by substituting 𝜑, 𝜃 and 𝜓
in equation (2.106)
𝐵
𝑨𝐺 = 𝑨𝑧,−40.7 𝑨𝑥,41.41 𝑨𝑧,79.15
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.36 Lecture 3
4. EULER ANGLES
• Example 19 (Euler angles of a local rotation matrix)
The local rotation matrix after rotation 300 about the 𝑧-axis, then rotation
300 about the 𝑥-axis, and then 300 about the 𝑦-axis is
𝐵
𝑨𝐺 = 𝑨𝑦,30 𝑨𝑥,30 𝑨𝑧,30
0.63 0.65 −0.43
= −0.43 0.75 0.50
0.65 −0.125 0.75
The Euler angles of the corresponding rotation matrix are
𝜃 = 𝑐𝑜𝑠 −1 𝑟33 = 𝑐𝑜𝑠 −1 0.75 = 41.410
−1
𝑟31 −1
0.65
𝜑 = −𝑡𝑎𝑛 = −𝑡𝑎𝑛 = 79.150
𝑟32 −0.125
−1
𝑟13 −1
−0.43
𝜓 = 𝑡𝑎𝑛 = 𝑡𝑎𝑛 = −40.70
𝑟23 0.50
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.37 Lecture 3
4. EULER ANGLES
• Example 20 (Relative rotation matrix of two bodies)
𝐵
Consider a rigid body 𝑩1 with an orientation matrix 1𝑨𝐺 made by Euler
angles 𝜑 = 300 , 𝜃 = −450 , 𝜓 = 600 , and another rigid body 𝑩2 having
𝜑 = 100 , 𝜃 = 250 , 𝜓 = −150 , the individual rotation matrices are
𝐵1 𝐵2
𝑨𝐺 = 𝑨𝑧,60 𝑨𝑥,−45 𝑨𝑧,30 𝑨𝐺 = 𝑨𝑧,−15 𝑨𝑥,25 𝑨𝑧,10
0.127 0.78 −0.612 0.992 −0.0633 −0.109
= −0.927 −0.127 −0.354 = 0.103 0.907 0.408
−0.354 0.612 0.707 0.0734 −0.416 0.906
The relative rotation matrix to map 𝑩2 to 𝑩1 may be found by
0.992 0.103 0.0734
𝐵1 𝐵1
𝑨𝐵2 = 𝑨𝐺 𝐺 𝑨𝐵2 = −0.0633 0.907 −0.416
−0.109 0.408 0.906
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.38 Lecture 3
5. AXIS-ANGLE ROTATION
• We can decompose any rotation 𝜙 of a rigid body with a fixed point 𝑶,
about a globally fixed axis 𝒖 into three rotations about three given non
coplanar axes
• The final orientation of a rigid body after a finite number of rotations is
equivalent to a unique rotation about a unique axis
𝒖
𝜙
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.39 Lecture 3
5. AXIS-ANGLE ROTATION
• Two parameters are necessary to define the direction of a line through
𝑶 and one is necessary to define the amount of rotation of a rigid body
about this line
• Let the body frame 𝑩(𝑂𝑥𝑦𝑧) rotate 𝜙 about a line indicated by a unit
vector 𝒖 with direction cosines 𝑢1 , 𝑢2 , 𝑢3
𝒖 = 𝑢1 𝑰 + 𝑢2 𝑱 + 𝑢3 𝑲
𝜓
𝑢12 + 𝑢22 + 𝑢32 = 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
5. AXIS-ANGLE ROTATION
• A transformation matrix 𝐺 𝑹𝐵 that maps the coordinates in the local frame
𝑩(𝑂𝑥𝑦𝑧) to the corresponding coordinates in the global frame 𝑮(𝑂𝑋𝑌𝑍)
𝐺
𝒓 = 𝐺 𝑹𝐵 𝐵 𝒓
𝐺
𝑹𝐵 = 𝑹𝑢,𝜙 = 𝐈 cos 𝜙 + 𝒖𝒖𝑇 𝑣𝑒𝑟𝑠 𝜙 + 𝒖 sin 𝜙
𝐺
𝑹𝐵
𝑢12 𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙 𝑢1 𝑢2 𝑣𝑒𝑟𝑠𝜙 − 𝑢3 𝑠𝜙 𝑢1 𝑢3 𝑣𝑒𝑟𝑠𝜙 + 𝑢2 𝑠𝜙
= 𝑢1 𝑢2 𝑣𝑒𝑟𝑠𝜙 + 𝑢3 𝑠𝜙 𝑢22 𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙 𝑢2 𝑢3 𝑣𝑒𝑟𝑠𝜙 − 𝑢1 𝑠𝜙
𝑢1 𝑢3 𝑣𝑒𝑟𝑠𝜙 − 𝑢2 𝑠𝜙 𝑢2 𝑢3 𝑣𝑒𝑟𝑠𝜙 + 𝑢1 𝑠𝜙 𝑢32 𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙
where (3.5)
𝜙 2
𝑣𝑒𝑟𝑠 𝜙 = 𝑣𝑒𝑟𝑠𝑖𝑛𝑒 𝜙 = 1 − cos 𝜙 = 2𝑠𝑖𝑛
2
and 𝒖 is the skew-symmetric matrix corresponding to the vector 𝒖
0 −𝑢3 𝑢2
𝒖 = 𝑢3 0 −𝑢1
−𝑢2 𝑢1 0
Robotics 3.41 Lecture 3
5. AXIS-ANGLE ROTATION
• A matrix 𝒖 is skew-symmetric if
𝒖 𝑇 = −𝒖
• Given a transformation matrix 𝐺 𝑹𝐵 we can obtain the axis 𝒖 and angle 𝜙
of the rotation by
1
𝒖= ( 𝐺 𝑹𝐵 − 𝐺 𝑹𝑇𝐵 )
2 sin 𝜙
1
cos 𝜙 = 𝑡𝑟 𝐺 𝑹𝐵 − 1
2
Where
𝑡𝑟 𝐺 𝑹𝐵 = 𝑟11 + 𝑟22 + 𝑟33
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.42 Lecture 3
5. AXIS-ANGLE ROTATION
• Example 40 (Axis-angle rotation when 𝒖 = 𝑲)
If the local frame 𝑩(𝑂𝑥𝑦𝑧) rotates about the 𝑍-axis, then
𝒖=𝑲
And the transformation matrix (3.5) reduces to
0𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙 0𝑣𝑒𝑟𝑠𝜙 − 1𝑠𝜙 0𝑣𝑒𝑟𝑠𝜙 + 0𝑠𝜙
𝐺
𝑹𝐵 = 0𝑣𝑒𝑟𝑠𝜙 + 1𝑠𝜙 0𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙 0𝑣𝑒𝑟𝑠𝜙 − 0𝑠𝜙
0𝑣𝑒𝑟𝑠𝜙 − 0𝑠𝜙 0𝑣𝑒𝑟𝑠𝜙 + 0𝑠𝜙 1𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙
𝑐𝑜𝑠𝜙 −𝑠𝑖𝑛𝜙 0
= 𝑠𝑖𝑛𝜙 𝑐𝑜𝑠𝜙 0
0 0 1
Which is equivalent to the rotation matrix about the 𝑍-axis of global
frame in (2.20)
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.43 Lecture 3
5. AXIS-ANGLE ROTATION
• Example 41 (Rotation about a rotated local axis)
If the body coordinate frame 𝑂𝑥𝑦𝑧 rotate 𝜑 about the global 𝑍-axis, then
the 𝑥-axis would be along 𝒖𝑥
𝑐𝑜𝑠𝜑 −𝑠𝑖𝑛𝜑 0 1 𝑐𝑜𝑠𝜑
𝒖𝑥 = 𝐺 𝑹𝑍,𝜑 𝒊 = 𝑠𝑖𝑛𝜑 𝑐𝑜𝑠𝜑 0 0 = 𝑠𝑖𝑛𝜑
0 0 1 0 0
Rotation 𝜃 about 𝒖𝑥 = 𝑐𝑜𝑠𝜑 𝑰 + 𝑠𝑖𝑛𝜑 𝑱 is defined by Rodriguez’s
formula (3.5)
𝑐𝑜𝑠 2 𝜑 𝑣𝑒𝑟𝑠𝜃 + 𝑐𝜃 𝑐𝜑 𝑠𝜑 𝑣𝑒𝑟𝑠𝜃 𝑠𝜑𝑠𝜃
𝐺
𝑹𝑢𝑥 ,𝜃 = 𝑐𝜑 𝑠𝜑 𝑣𝑒𝑟𝑠𝜃 𝑠𝑖𝑛2 𝜑 𝑣𝑒𝑟𝑠𝜃 + 𝑐𝜃 −𝑐𝜑𝑠𝜃
−𝑠𝜑𝑠𝜃 𝑐𝜑𝑠𝜃 𝑐𝜃
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.44 Lecture 3
5. AXIS-ANGLE ROTATION
Now, rotation 𝜑 about the global 𝑍-axis followed by rotation 𝜃 about the
local 𝑥-axis is transformed by
𝐺
𝑹𝐵 = 𝐺 𝑹𝑢𝑥,𝜃 𝐺 𝑹𝑍,𝜑
𝑐𝑜𝑠𝜑 −𝑐𝑜𝑠𝜃𝑠𝑖𝑛𝜑 𝑠𝑖𝑛𝜃𝑠𝑖𝑛𝜑
= 𝑠𝑖𝑛𝜑 𝑐𝑜𝑠𝜃𝑐𝑜𝑠𝜑 −𝑐𝑜𝑠𝜑𝑠𝑖𝑛𝜃
0 𝑠𝑖𝑛𝜃 𝑐𝑜𝑠𝜃
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.45 Lecture 3
5. AXIS-ANGLE ROTATION
• Example 42 (Axis and angle of rotation)
Consider a cubic rigid body with a fixed point at A and a unit length of
edges as is shown in Fig 3.2. If we turn the cube 450 about 𝒖 =
1 1 1 𝑇 then we can find the global coordinates of its corner using
Rodriguez transformation matrix as follows
0.57735
𝜋 𝒖
𝜙=4 𝒖 = 3 = 0.57735
0.57735
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.46 Lecture 3
5. AXIS-ANGLE ROTATION
The local coordinates of the corners are
𝑩 𝑩 𝑩 𝑩 𝑩 𝑩 𝑩
𝒓𝑩 𝒓𝑪 𝒓𝑫 𝒓𝑬 𝒓𝑭 𝒓𝑮 𝒓𝑯
𝑥 1 1 0 0 1 1 0
𝑦 0 1 1 0 0 1 1
𝑧 0 0 0 1 1 1 1
5. AXIS-ANGLE ROTATION
• Example 43 (Axis and angle of a rotation matrix)
A body coordinate frame, 𝑩, undergoes three Euler rotation 𝜑, 𝜃, 𝜓 =
300 , 450 , 600 with respect to a global frame 𝑮. The rotation matrix to
transform coordinates of 𝑩 to 𝑮 is
𝐺 𝐵 𝑇 𝑇
𝑹𝐵 = = 𝑹𝑧,𝜓 𝑹𝑥,𝜃 𝑹𝑧,𝜑 = 𝑹𝑇𝑧,𝜑 𝑹𝑇𝑥,𝜃 𝑹𝑇𝑧,𝜓
𝑹𝐺
0.12683 −0.92678 0.35355
= 0.78033 −0.12683 −0.61237
0.61237 0.35355 0.70711
The unique angle-axis of rotation for this rotation matrix are
1 𝐺
𝜙 = 𝑐𝑜𝑠 −1 𝑡𝑟 𝑹𝐵 − 1
2
= 𝑐𝑜𝑠 −1 −0.14645 = 980
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.48 Lecture 3
5. AXIS-ANGLE ROTATION
1 0.0 −0.86285 −0.13082
𝐺
𝒖= 𝑹𝐵 − 𝐺 𝑹𝑇𝐵 = 0.86285 0.0 −0.48822
2𝑠𝑖𝑛𝜙
0.13082 0.48822 0.0
0.48822
𝒖 = −0.13082
0.86285
As a double check, we may verify the angle-axis rotation formula and
derive the same rotation matrix.
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.49 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.50 Lecture 3
𝐺
𝒅: displacement / translation of B with respect to G
𝐺
𝑹𝐵 : rotation matrix to map 𝐵𝒓 to 𝐺 𝒓 when 𝐺 𝒅 = 0
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.51 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.52 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.53 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.54 Lecture 3
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.56 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• An arbitrary point 𝑷 of a rigid body attached to the local frame 𝑩 is
denoted by 𝐵𝒓𝑃 and 𝐺 𝒓𝑃 in different frames. The vector 𝐺 𝒅 indicates the
position of origin 𝒐 of the body frame in the global frame. Therefore, a
general motion of a rigid body 𝑩(𝑜𝑥𝑦𝑧) in the global frame 𝑮(𝑂𝑋𝑌𝑍) is
a combination of rotation 𝐺 𝑹𝐵 and translation 𝐺 𝒅
𝐺
𝒓 = 𝐺 𝑹𝐵 𝐵 𝒓 + 𝐺 𝒅
7. HOMOGENEOUS TRANSFORMATION
𝐺
• Introducing a new 4x4 homogeneous transformation matrix 𝑻𝐵 , helps
us show a rigid motion by a single matrix transformation
𝐺
𝒓 = 𝐺 𝑻𝐵 𝐵𝒓
Where
𝑟11 𝑟12 𝑟13 𝑋0
𝑟23 𝑌0
𝑻𝐵 = 𝑟21
𝐺 𝑟22
𝑟31 𝑟32 𝑟33 𝑍0
0 0 0 1
𝐺 𝐺 𝐺 𝐺
≡ 𝑹𝐵 𝒅 ≡ 𝑹𝐵 𝒅
0 0 0 1 0 1
𝑋𝑃 𝑥𝑃 𝑋0
𝐺 𝑌𝑃 𝐵 𝑦𝑃 𝐺
And 𝒓= 𝒓= 𝑧 𝒅 = 𝑌0
𝑍𝑃 𝑃
1 𝑍0
1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.59 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.60 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 76 (Rotation and translation of a body coordinate frame)
A body coordinate frame 𝑩(𝑜𝑥𝑦𝑧), that is originally coincident with
global coordinate frame 𝑮(𝑂𝑋𝑌𝑍), rotates 450 about the 𝑋-axis and
translates to 3 5 7 1 𝑇
The matrix representation of the global position of a point is
𝐺
𝒓 = 𝐺 𝑻𝐵 𝐵𝒓
𝑋 1 0 0 3 𝑥
𝑐𝑜𝑠45 −𝑠𝑖𝑛45 5 𝑦
⇒ 𝑌 = 0
𝑍 0 𝑠𝑖𝑛45 𝑐𝑜𝑠45 7 𝑧
1 0 0 0 1 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.61 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 77 (An axis-angle rotation and a translation)
Consider a cubic rigid body with a unit length of edges at the corner of
the first quadrant. If we turn the cube 450 about 𝐮 = 1 1 1 𝑇 then
𝜋
𝜙= 4
𝐮 0.57735
𝒖= = 0.57735
3 0.57735
And its Rodriguez transformation matrix is
𝑹𝑢,𝜙 = 𝑰 𝑐𝑜𝑠𝜙 + 𝒖𝒖𝑇 𝑣𝑒𝑟𝑠𝜙 + 𝒖 𝑠𝑖𝑛𝜙
0.80474 −0.31062 0.50588
= 0.50588 0.80474 −0.31062
−0.31062 0.50588 0.80474
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.62 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.63 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.64 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• The advantage of simplicity to work with homogeneous transformation
matrices come with the penalty of losing the orthogonality property. If we
show 𝐺 𝑻𝐵 by
𝐺 𝐺 𝐺 𝐺
𝐺
𝑻𝐵 = 𝑰 𝒅 𝑹𝐵 0 = 𝑹𝐵 𝒅
0 1 0 1 0 1
then
𝐺 𝐺 −1
𝐵
𝑻𝐺 = 𝐺 𝑻−1 𝑹𝐵 𝒅
𝐵 =
0 1
𝐺
= 𝑹𝑇𝐵 − 𝐺 𝑹𝑇𝐵 𝐺 𝒅
0 1
Showing that
𝐺 −1 𝐺
𝑻𝐵 𝑻𝐵 = 𝑰4
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.65 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 88 (Inverse of a homogeneous transformation matrix)
Assume that
0.643 −0.766 0 −1
𝐺 𝐺
𝐺
𝑻𝐵 = 0.766 0.643 0 0.5 = 𝑹𝐵 𝒅
0 0 1 0.2 0 1
0 0 0 1
Then
0.643 −0.766 0 −1
𝐺 𝐺
𝑹𝐵 = 0.766 0.643 0 𝒅 = 0.5
0 0 1 0.2
0.643 0.766 0 0.26
𝐺
Therefore 𝐵
𝑻𝐺 = 𝑹𝑇𝐵 − 𝐺 𝑹𝑇𝐵 𝐺 𝒅 = −0.766 0.643 0 −1.087
0 1 0 0 1 −0.2
0 0 0 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.66 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 89 (Transformation matrix and coordinate of points)
It is possible and sometimes convenient to describe a rigid body motion
in terms of know displacement of specified points fixed in the body
Assume 𝑨, 𝑩, 𝑪 and 𝑫 are 4 points at two different positions
𝑨1 2,4,1 𝑩1 2,6,1 𝑪1 1,5,2 𝑫1 3,5,2
𝑨2 5,1,1 𝑩2 7,1,1 𝑪2 6,2,1 𝑫2 6,2,3
There must be a transformation matrix 𝑻 to map the initial positions to the
final
2 2 1 3 5 7 6 6
𝑻 4 6 5 5 = 1 1 2 2
1 1 2 2 1 1 1 3
1 1 1 1 1 1 1 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.67 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
And hence
−1
5 7 6 6 2
1 3 2
𝑻 = 1 1 2 2 4
5 5 6
1 1 1 3 1
2 2 1
1 1 1 1 1
1 1 1
5 7 6 6 0 −1/2 −1/2 7/2
0 1/2 −1/2 −3/2
= 1 1 2 2
1 1 1 3 −1/2 0 1/2 1/2
1 1 1 1 1/2 0 1/2 −3/2
0 1 0 1
= 0 0 1 0
1 0 1 −2
0 0 0 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.68 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 90 (Quick inverse transformation)
For numerical calculation, it is more practical to decompose a
transformation matrix into translation times rotation, and take advantage
of the inverse of matrix multiplication
Consider a transformation matrix
𝑟11 𝑟12 𝑟13 𝑟14
𝑟21 𝑟22 𝑟23 𝑟24
𝑻 = = 𝑫 𝑹
𝑟31 𝑟32 𝑟33 𝑟34
0 0 0 1
1 0 0 𝑟14 𝑟11 𝑟12 𝑟13 0
0 1 0 𝑟24 𝑟21 𝑟22 𝑟23 0
=
0 0 1 𝑟34 𝑟31 𝑟32 𝑟33 0
0 0 0 1 0 0 0 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.69 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
Therefore
𝑻−1 = 𝑫𝑹 −1 = 𝑹−1 𝑫−1 = 𝑹𝑇 𝑫−1
𝑟11 𝑟21 𝑟31 0 1 0 0 −𝑟14
𝑟12 𝑟22 𝑟32 0 0 1 0 −𝑟24
=
𝑟13 𝑟23 𝑟33 0 0 0 1 −𝑟34
0 0 0 1 0 0 0 1
𝑟11 𝑟21 𝑟31 −𝑟11 𝑟14 − 𝑟21 𝑟24 − 𝑟31 𝑟34
𝑟12 𝑟22 𝑟32 −𝑟12 𝑟14 − 𝑟22 𝑟24 − 𝑟32 𝑟34
=
𝑟13 𝑟23 𝑟33 −𝑟13 𝑟14 − 𝑟23 𝑟24 − 𝑟33 𝑟34
0 0 0 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.70 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
The transformation matrices to transform coordinates from frame 𝑩 to 𝑨,
and from frame 𝑪 to 𝑩 are
𝐴 𝐴 𝐵 𝐵
𝑻𝐵 =𝐴 𝑹 𝐵 𝒅1 𝐵
𝑻𝐶 = 𝑹𝐶 𝒅2
0 1 0 1
Hence, the transformation matrix from 𝑪 to 𝑨 is
𝐴 𝐴 𝐵 𝐵
𝐴
𝑻𝐶 = 𝑻𝐵 𝐴 𝐵
𝑻𝐶 = 𝑹 𝐵 𝒅1 𝑹 𝐶 𝒅2
0 1 0 1
𝐴 𝐵 𝐴 𝐵 𝐴
= 𝑹 𝐵 𝑹 𝐶 𝑹 𝐵 𝒅 2 + 𝒅1
0 1
𝐴 𝐴
= 𝑹𝐶 𝒅2
0 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.71 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
And therefore, the inverse transformation is
𝐴 𝑇𝐴 𝐴 𝑇
𝑻𝐴 = 𝐶 − 𝑹𝐶 𝒅2 𝑹𝐶
0 1
The value of homogeneous coordinates are better appreciated when several
displacements occur in succession which, for instance, can be written as
𝐺
𝑻4 = 𝐺 𝑻1 1𝑻2 2𝑻3 3𝑻4
Rather than
𝐺
𝑹4 4𝒓𝑃 + 𝐺 𝒅4
= 𝐺 𝑹1 1
𝑹2 2
𝑹3 3
𝑹4 4𝒓𝑃 + 3𝒅4 + 2𝒅3 + 1𝒅2 + 𝐺 𝒅1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.72 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 92 (Homogeneous transformation for multiple frames)
The coordinates of 𝑷 in the global frame 𝑮(𝑂𝑋𝑌𝑍) can be found by using
the homogeneous transformation matrices
The position of 𝑷 in frame 𝑩2 (𝑥2 𝑦2 𝑧2 ) is indicated by 2𝒓𝑃 . Therefore,
its position in frame 𝑩1 𝑥1 𝑦1 𝑧1 is
𝑥1 𝑥2
𝑦1 1 1 𝑦2
𝑹 2 𝒅 2
𝑧1 = 0 1 𝑧2
1 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.73 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
And therefore, its position in the global frame 𝑮(𝑂𝑋𝑌𝑍) would be
𝑋 𝑥1
𝑌 = 𝐺 𝑹1 𝐺 𝒅1 𝑦1
𝑍 0 1 𝑧1
1 1
𝑥2
𝐺 𝐺 1 1 𝑦2
= 𝑹 1 𝒅1 𝑹 2 𝒅 2
0 1 0 1 𝑧2
1
𝑥2
𝐺 1 𝐺 1 𝐺 𝑦2
= 𝑹 1 𝑹 2 𝑹 1 𝒅2 + 𝒅1
0 1 𝑧2
1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.74 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 93 (Rotation about an axis not going through origin)
The homogeneous transformation matrix can represent rotations about an
axis going through a point different from the origin
We set a local frame 𝑩 at point 𝑷 parallel to the global frame 𝑮. Then, a
rotation around 𝒖 can be expressed as a translation along −𝒅, to bring the
body frame 𝑩 to the global frame 𝑮, followed by a rotation 𝒖 and a
reverse translation along 𝒅
𝐺
𝑻𝐵 = 𝑫𝑑,𝑑 𝑹𝑢,𝜙 𝑫𝑑,−𝑑
𝑰 𝒅 𝑹𝑢,𝜙 0 𝑰 −𝒅
=
0 1 0 1 0 1
𝑹𝑢,𝜙 𝒅 − 𝑹𝑢,𝜙 𝒅
=
0 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.75 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
Where
𝑢12 𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙 𝑢1 𝑢2 𝑣𝑒𝑟𝑠𝜙 − 𝑢3 𝑠𝜙 𝑢1 𝑢3 𝑣𝑒𝑟𝑠𝜙 + 𝑢2 𝑠𝜙
𝑹𝑢,𝜙 = 𝑢1 𝑢2 𝑣𝑒𝑟𝑠𝜙 + 𝑢3 𝑠𝜙 𝑢22 𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙 𝑢2 𝑢3 𝑣𝑒𝑟𝑠𝜙 − 𝑢1 𝑠𝜙
𝑢1 𝑢3 𝑣𝑒𝑟𝑠𝜙 − 𝑢2 𝑠𝜙 𝑢2 𝑢3 𝑣𝑒𝑟𝑠𝜙 + 𝑢1 𝑠𝜙 𝑢32 𝑣𝑒𝑟𝑠𝜙 + 𝑐𝜙
And
𝒅 − 𝑹𝑢,𝜙 𝒅 =
𝑑1 1 − 𝑢12 𝑣𝑒𝑟𝑠𝜙 − 𝑢1 𝑣𝑒𝑟𝑠𝜙 𝑑2 𝑢2 + 𝑑3 𝑢3 + 𝑠𝜙 𝑑2 𝑢3 − 𝑑3 𝑢2
𝑑2 1 − 𝑢22 𝑣𝑒𝑟𝑠𝜙 − 𝑢2 𝑣𝑒𝑟𝑠𝜙 𝑑3 𝑢3 + 𝑑1 𝑢1 + 𝑠𝜙 𝑑3 𝑢1 − 𝑑1 𝑢3
𝑑3 1 − 𝑢32 𝑣𝑒𝑟𝑠𝜙 − 𝑢3 𝑣𝑒𝑟𝑠𝜙 𝑑1 𝑢1 + 𝑑2 𝑢2 + 𝑠𝜙 𝑑1 𝑢2 − 𝑑2 𝑢1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.76 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
• Example 94 (A rotating cylinder)
Imagine a cylinder with radius 𝑅 = 2 that its axis 𝒖 is at 𝒅
0 2
𝒖= 0 𝒅= 0
1 0
If the cylinder turns 900 about its axis then every point on the periphery
of the cylinder will move 900 on a circle parallel to 𝑥, 𝑦 -plane. The
transformation of this motion is
𝐺 𝑰 𝒅 𝑹𝐾,𝜋2 0 𝑰 −𝒅
𝑻𝐵 = 𝑫𝑑,𝑑 𝑹𝑢,𝜙 𝑫𝑑,−𝑑 =
0 1 0 1 0 1
0 −1 0 2
= 1 0 0 −2
0 0 1 0
0 0 0 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong
Robotics 3.77 Lecture 3
7. HOMOGENEOUS TRANSFORMATION
Consider a point on the cylinder that was on the origin. After the rotation,
the point would be seen at
𝐺
𝒓 = 𝐺 𝑻𝐵 𝐵𝒓
0 −1 0 2 0 2
= 1 0 0 −2 0 = −2
0 0 1 0 0 0
0 0 0 1 1 1
HCM City Univ. of Technology, Faculty of Mechanical Engineering Phung Tri Cong