You are on page 1of 21

Robotics Course

LR02.1: From Position Vector to Homogeneous Transformation Matrix

By: Htet Myat Aung


VI-McE-YTU
29th May 2020
Introduction – Position Vector
Position Vector in 2D Cartesian Space Position Vector in 3D Cartesian Space
y Z

𝐴𝑃
P 𝑧

𝐴𝑃 P
𝐴𝑃 𝐴𝑃 Coordinate Frame A
𝑦
𝐴𝑃
A 𝑥
X
X
A 𝐴𝑃 𝐴𝑃
𝑥 𝑦

Coordinate Frame A
y

In 3D Equation
In 2D Equation 𝐴
𝐴 𝑃𝑥
𝐴 𝑃𝑥
𝑃= 𝐴 𝐴 𝐴
𝑃= 𝑃𝑦
𝑃𝑦
𝐴
𝑃𝑧 2
Introduction
P
In Robotics, Coordinate Frames can be more than one.

y 𝐶𝑃
𝐴
𝐵
𝑃 y 𝑃
P
B 𝐵
𝐶𝑇
B
𝐴
C
𝐵𝑇 𝐴
𝑃 𝐴
𝐵𝑇 𝐴
𝐶𝑇

A X
X
A
In Mathematical Model
𝐴
𝐵𝑇 ∙ 𝐵𝑃 = 𝐴
𝑃
In Mathematical Model
𝐴
𝐵𝑇 ∙ 𝐵𝐶 𝑇 ∙ 𝐶 𝑃 = 𝐴𝑃
𝐴 𝐶 𝐴
Transform of B relative to A
This is what we want ! 𝐶𝑇 ∙ 𝑃 = 𝑃
Point P with respect to A

3
Orientation or Rotation Matrix
Orientation (Rotation) in 2D Space (or Rotation at Z axis)
𝑦𝐴

𝐴
𝑃𝑥 = 𝐵𝑃𝑥 ∙ cos 𝜃 − 𝐵 𝑃𝑦 ∙ sin 𝜃
𝐴
𝑃𝑦 = 𝐵𝑃𝑥 ∙ sin 𝜃 + 𝐵𝑃𝑦 ∙ cos 𝜃
𝐴
𝑃𝑦 P
𝐴 𝐵
Frame B
𝐵 𝜃
𝑃𝑥 cos 𝜃 − sin 𝜃 𝑃𝑥
𝑃𝑦 𝐴𝑃 𝐵 𝐴 = ∙ 𝐵
𝑃𝑥 𝑃𝑦 sin 𝜃 cos 𝜃 𝑃𝑦

𝐴
𝜃 𝑃 = 𝐵𝐴𝑅 ∙ 𝐵𝑃
𝐴
𝑥𝐴
A 𝑃𝑥

𝐵
𝑃𝑥 Rotational Matrix
Frame A
Given: 𝐵𝑃 = 𝐵
𝑃𝑦

Unknown: 𝐴𝑃 =?
4
Example
𝑦𝐴

𝐴 cos 𝜃 − sin 𝜃 cos 45° − sin 45°


𝐵𝑅 = =
sin 𝜃 cos 𝜃 sin 45° cos 45°
B
𝐴 0.7 −0.7
𝐵𝑅 =
𝐴
𝑃𝑦 0.7 0.7
𝐵
P
𝑃𝑦 1.4 𝐵
𝑃𝑥 0.7 −0.7 2 1.4
𝐴𝑃 𝐴
𝜃 𝑃 = 𝐵𝐴𝑅 ∙ 𝐵𝑃 = ∙ =
𝜃 0.7 0.7 0 1.4
𝑥𝐴
A 1.4
𝐴
𝐴
𝑃𝑥 𝑃𝑥 1.4
𝐴 =
𝑃𝑦 1.4
2
Given: 𝐵𝑃 = , 𝜃 = 45°
0

Unknown: 𝐴𝑃 =?

5
Some Important Notes
● In 2D Space, all rotations are around Z axis.
● Determinant of Rotation is always 1.

cos 𝜃 −sin 𝜃
○ det 𝐵𝐴𝑅 = = cos 𝜃 cos 𝜃 − − sin 𝜃 sin 𝜃 = 1
sin 𝜃 cos 𝜃

● 𝐴
Orthogonal Matrix : 𝐵 𝑅= 𝐵𝐴𝑅−1= 𝐵𝐴𝑅𝑇 .

● Rotation Matrices are always Orthonormal.

○ 𝑅𝑇 𝑅 = 𝑅𝑅𝑇 = 𝐼𝑚𝑥𝑛
○ Dot Product of Every Row and Column is 0.

○ Norm of Every Row and Column is 1.


6
Prove: Norm of Every Row and Column is 1. (knowledge)

Taking as Infinity Norm;


𝑛

𝑅 ∞
= max ෍ |𝑟𝑖𝑗 | for 𝑅𝑚𝑥𝑛
1≤𝑖≤𝑚
𝑗=1
𝑅 ∞
= max σ2𝑗=1 |𝑟𝑖𝑗 | = max |cos 𝜃| + − sin 𝜃| , |sin 𝜃| + |cos 𝜃
1≤𝑖≤2

Let’s say 𝜃 = 90°,

= max |0 | + −1|, |1 | + |0 = max 1,1 = 1

7
Frame Description

In Robotics Frame => one Position vector and a Rotation Matrix.

Note : Frame is a coordinate system , giving a position vector which locates its {EE}
origin (Arrow Head) relative to embedding frame (Tail).

𝐴
Vector 𝑃 locates the origin of End Effector Frame {EE}, 𝐴𝑃𝐸𝐸(𝑂𝑅𝐺) 𝐴
𝑃

{A}

8
Frame Description

{A}
{C}

Frame {A} and Frame {B} => Relative to Universal


Coordinate Frame {U} , Frame {C} is relative to Frame
{A} (not Vice Versa**)
{B}
{U}

9
Translated Frames
Frame {A} and Frame {B} => same orientation => {B} Only
differs from {A} by translation => given by 𝐴𝑃𝐵(𝑂𝑅𝐺) => a
vector that locates the origin of {B} relative to {A}. 𝑃

In 3 Dimensional Plane,

𝐵
𝐴 𝐴 𝐴 𝑃
𝑃= 𝑃𝐵(𝑂𝑅𝐺) + 𝐵𝑃 𝑃

{B}

Mapping a vector from one frame to another. 𝐴


𝑃𝐵(𝑂𝑅𝐺)
{A}

10
Translated Frames
Frame {A} and Frame {B} => same orientation => {B} Only
differs from {A} by translation => given by 𝐴𝑃𝐵(𝑂𝑅𝐺) => a
vector that locates the origin of {B} relative to {A}.

𝐵 𝑃
In 2 Dimensional Plane 𝑃

{B}
𝐴
𝑃𝐵(𝑌𝑂𝑅𝐺) 𝐴
𝑃
𝐴
𝑃 = 𝐴𝑃𝐵(𝑂𝑅𝐺) + 𝐵𝑃
𝐴
𝐴 𝑃𝐵(𝑋𝑂𝑅𝐺)
𝑃= 𝐴 + 𝐵𝑃
𝑃𝐵(𝑌𝑂𝑅𝐺) 𝐴
{A} 𝑃𝐵(𝑋𝑂𝑅𝐺)
𝐴 𝑡𝑥
𝑃= + 𝐵𝑃
𝑡𝑦
𝑡𝑥 and 𝑡𝑦 mean translated distance of {A}.
Mapping a vector from one frame to another.

11
Translations + Rotations
In 2 Dimensional Plane
𝑃
𝐴
𝑃 = 𝐴𝑃𝐵(𝑂𝑅𝐺) + 𝐵𝐴𝑅 ∙ 𝐵𝑃 𝐵
𝐴 𝑃
𝑃

𝐴
𝐴
𝑃𝐵(𝑋𝑂𝑅𝐺 ) 𝜃
𝑃= 𝐴 + 𝐵𝐴𝑅 ∙ 𝐵𝑃
𝑃𝐵(𝑌𝑂𝑅𝐺 ) 𝐴
𝑃𝐵(𝑌𝑂𝑅𝐺) {B}

Known as General Transformation Mapping.


Note : A complicated Calculations can be occur if there is 𝐴
{A} 𝑃𝐵(𝑋𝑂𝑅𝐺)
more than 2 coordinate frames.

12
Homogeneous Transformation in 2D Frame
𝐴
𝑃 = 𝐵𝐴𝑇 ∙ 𝐵𝑃 𝑃

𝐴 𝐵
𝐴 𝐴 𝐴 𝐵 𝑃 𝑃
𝑃 = 𝐵𝑅 𝑃𝐵(𝑂𝑅𝐺) 𝑃
1 0 0 1 1 𝜃
𝐴 {B}
𝑃𝐵(𝑌𝑂𝑅𝐺)
𝐴 𝐴 𝐴
𝑃𝐵(𝑂𝑅𝐺)
𝐴 𝐵𝑅 𝑃𝐵(𝑂𝑅𝐺)
𝐵𝑇 =
0 0 1
{A} 𝐴
𝑃𝐵(𝑋𝑂𝑅𝐺)
Note:
• “1” is added as last element of 2x1 vectors
• a row [0 0 1] is added as the last row of 3x3
Matrix.

13
Example: Frame Rotating around Z axis
Given : Frame {B} : rotated relative to frame {A} about Z by 30°,
Translated 10 units in 𝑋𝐴 and 5 units in 𝑌𝐴 𝑃
𝐵 𝑇
𝑃 = 3.0 7.0 0.0 {B}
𝐴 𝑌𝐴 𝐵
Unknown : 𝑃 𝑃
𝐴 𝐴
𝐴 𝑃
𝐴 𝐵𝑅 𝑃𝐵(𝑂𝑅𝐺) 𝜃
Answer : 𝐵𝑇 = , Assumed as 2 Dimensional Frame 5
0 0 1
cos 𝜃 −sin 𝜃 10
𝐴 sin 𝜃 cos 𝜃 𝐴
𝐵 𝑇 = 5 , 𝜃 = 30° 𝑃𝐵(𝑂𝑅𝐺)
0 0 1
3.0 3.0 𝑋𝐴
3.0 {A} 10
𝐵
𝑃 = 7.0 = = 7.0 (“1” is added as last element of 2x1 vectors)
7.0
0.0 1
𝐴
𝑃𝑥
𝐴
𝐴
𝑃 = 𝐵𝐴𝑇 ∙ 𝐵𝑃 = 𝑃𝑦
𝐴
𝑃𝑧
1
This is what we want

14
3 Dimensional Homogeneous Transformation
𝐴
𝑃= 𝐴
𝑁𝑡ℎ𝑇 ∙ 𝑁𝑡ℎ𝑃

𝐴
𝐴
𝑃 = 𝑁𝑡ℎ𝐴𝑅 𝑃𝑁𝑡ℎ(𝑂𝑅𝐺) 𝑁𝑡ℎ
𝑃
𝑃
1 0 0 0 1 1

𝑁𝑡ℎ
𝑃𝑥 𝑃
𝐴 𝐴
𝑁𝑡ℎ𝑅3𝑥3 𝑃𝑁𝑡ℎ 𝑂𝑅𝐺 𝑃 𝐴
𝑃
𝐴
𝑁𝑡ℎ𝑇 = 3𝑥1
, 𝑁𝑡ℎ𝑃 = 𝑦
0 0 01𝑥3 11𝑥1 𝑃𝑧
1 {Nth}

In 3D => Rotation can be around any Arbitrary Axis. 𝐴


𝑁𝑡ℎ𝑇
In 2D => Rotation only around Z Axis. {A}

Rotation Matrices have different form depending on


which axis we are rotating around.

15
3 Dimensional Homogeneous Transformation

Rotation around X axis Rotation around Y axis Rotation around Z axis


𝑍𝐴 𝑍𝐴 𝑍𝐴
𝑍𝐴 ′

𝜃 𝑍𝐴 ′ 𝜃
𝑌𝐴 ′
𝑌𝐴 ′
𝑌𝐴 𝑌𝐴 𝜃
𝑌𝐴

𝑋𝐴 𝑋𝐴
𝑋𝐴
𝑋𝐴 ′ 𝑋𝐴 ′

1 0 0 cos 𝜃 0 sin 𝜃 cos 𝜃 −sin 𝜃 0


𝑅(𝜃)𝑋 = 0 cos 𝜃 − sin 𝜃 𝑅(𝜃)𝑌 = 0 1 0 𝑅(𝜃)𝑍 = sin 𝜃 cos 𝜃 0
0 sin 𝜃 cos 𝜃 −sin 𝜃 0 cos 𝜃 0 0 1

16
Transformation Equations

{𝐶}
{𝐴}
{U} -> Universal Frame

𝑈 𝐵 {𝐷}
𝑈 𝐵𝑇 ∙ 𝐷𝑇
𝐷𝑇 = ൝𝑈 𝐴 𝐶
𝐴𝑇 ∙ 𝐶 𝑇 ∙ 𝐷 𝑇
𝑈𝑇
𝐷

𝐵 𝐷𝑇
𝐷𝑇 = 𝑈𝐵𝑇 −1 ∙ 𝑈𝐴𝑇 ∙ 𝐴𝐶 𝑇 ∙ 𝐷𝐶 𝑇 , ( 𝑈𝐵𝑇 −1 𝑚𝑒𝑎𝑛𝑠 𝑈𝐵𝑇 ) {𝑈}
{𝐵}
𝐵

17
Transformation Equations

{𝐸𝐸}

𝐸𝐸
𝐶𝑇
{𝐶}

𝐸𝐸
How do we find 𝐶𝑇 =? {𝐷}

{𝐵}
𝐸𝐸 𝐵 −1
Ans: 𝐶 𝑇 = 𝐸𝐸 𝑇 ∙ 𝐷𝐵𝑇 ∙ 𝐷𝐶 𝑇

18
Exercises
1. The following frame definitions are given as known:
0.866 −0.5 0.0 11.0
𝑈 0.5 0.866 0.0 −1
𝐴𝑇 = ,
0.0 0.0 1 8.0
0 0 0 1
1 0.0 0.0 0.0
𝐵 0.0 0.866 −0.50 10.0
𝐴𝑇 = ,
0.0 0.5 0.866 −20.0
0 0 0 1
0.866 −0.5 0.0 −3.0
𝐶 0.433 0.750 −5.0 −3.0
𝑈𝑇 = ,
0.250 0.433 0.866 3.0
0 0 0 1

Draw a frame diagram (Like that of slide number 17) to show their arrangement qualitatively, and solve for 𝑩𝑪𝑻.

19
Exercises
2. Referring to the figure below, give the values of 𝐵𝐴𝑇, 𝐴𝐶𝑇, 𝐵𝐶𝑇𝑎𝑛𝑑 𝐴𝐶𝑇.

36.9°

𝑌𝐶
𝑍𝐵 𝑋𝐵
𝑍𝐴

𝑌𝐵 𝑋𝐶 𝑍𝐶
𝑋𝐴
𝑌𝐴 2

3
20
Next Course Schedule
Next Course : 1st June 2020 - Time 3 PM to 4 PM ( MMTime ) @ Google Meet

21

You might also like