You are on page 1of 12

1 HOMOGENEOUS TRANSFORMATIONS

Purpose:

The purpose of this chapter is to introduce you to the Homogeneous Transformation. This
simple 4 x 4 transformation is used in the geometry engines of CAD systems and in the
kinematics model in robot controllers. It is very useful for examining rigid-body position and
orientation (pose) of a sequence of robotic links and joint frames.

Script Notation:

Pre super- and pre sub-scripts are often used to denote frames of reference
B
C = transformation of frame C relative to frame B

C p = vector located in frame C

Tsai uses a pre and post script notation


Β
C = transformation of frame C relative to frame B

C p = vector located in frame C

The notation in these notes is understood graphically by the figures and does not
always use the scripting approach. You should be able to interpret these various
notations.

H, a 4x4 matrix, will be used to represent a homogeneous transformation. H can


represent translation, rotation, stretching or shrinking (scaling), and perspective
transformations, and is of the general form

ax bx cx px
H= ay by cy py
az bz cz pz (1.1)
d1 d2 d3 1

Thus, given a vector u, its transformation v is represented by

v=Hu (1.2)

1-1
z v
z v
H u
u
H
y y
x x

(a) Operator Interpretation (b) Frame Interpretation

Figure 1-1 Interpreting the homogeneous transformation

The vector u having components ux, uy, uz must be expanded to a 4x1 vector of the form:

ux
uy
u= (1.3)
uz
1

For the case of pure translation the point or vector u is translated by H when

ax = 1, ay = az = 0
bx = 0, by = 1, bz = 0
cx = cy = 0, cz = 1
d 1 = d2 = d3 = 0

so that H becomes

1 0 0 px
H(p) = 0 1 0 py
0 0 1 pz
0 0 0 1

and pT = px , py , pz represent the translation components along the x, y, z axes,


respectively.

1-2
z
v

H(p)
u p
p z
x

p
y

x
Figure 1-2 Translation

Example1.1:

-1 0
0 10
If u = 2 , determine H(p) required to translate u to point v = -5
1 1
Soln:

v = H(p)u implies that

1 0 0 px -1 −1+ px 
0  p 
10 = 0 1 0 py 0 =  2 +yp 
-5 0 0 1 pz 2  z 
1 000 1 1  1 

Thus,
-1 + px = 0 ⇒ px = 1

py = 10

2 + pz = -5 ⇒ pz = -7

which gives
1 0 0 1
0
H(p) = 0 1 0 10
0 1 -7
0 0 0 1

1-3
The scaling transformation Hs represents a scaling of vector u when all off-diagonal
terms are zero and when ax = a, by = b, cz = c are not equal to 1.

a000
Hs = 00 b0 0c 00
0001

Hs
v
u

cu z
uz

y
ux
uy au x

bu y
x

Figure 1-3 Scaling transformation

1.1 Rotation Transformations


The rotation transformation is contained in the 3x3 submatrix of H which we will denote
by R

R p
(3 x 3) (3 x 1)
H(R,p) = dT 1
(1 x 3) (1 x 1) (1.4)

If there is no rotation then R = I = the identity 3 x 3 matrix. If there is rotation only, then
dT = 0T, and p = 0.

For the special case of rotation θ about the x axis, R assumes the form

1 0 0
R (x,θ) = 0 cos θ -sin θ
0 sin θ cos θ (1.5)

1-4
z
z’ v
θ
θ u
y’
θ y

x, x’
Figure 1-4 Rotation of a vector

We designate the rotated frame by the x’y’z’ axes and the original frame by the xyz axes.
The effect of rotating u to v is to change its coordinates with respect to the xyz axes but
not with respect to the x’y’z’ axes. Note that v in the x’y’z’ axes has the same coordinates
as u in the xyz axes.

z
z’
θ v
y’

θ
u θ
α
α y

Figure 1-5 Rotation about the x axis

The coordinates of v in xyz are

vx = ux
vy = uy cos θ - uz sin θ
vz = uy sin θ + uz cos θ

since the coordinates of v in x’y’z’ are same as u in xyz. Thus, v = R(x,θ) u and can be
expanded to the homogeneous form
vx ux
vy R (x,θ) 0 uy
v = vz = T = H (x,θ) u
0 1 uz
1 1

Similarly, rotations about y and z axes by θ give

1-5
cos θ 0 sin θ
R (y,θ) = 0 1 0
-sin θ 0 cos θ (1.6)

cos θ -sin θ 0
R (z,θ) = sin θ cos θ 0
0 0 1 (1.7)

1.2 Multiple Rotations


Example1.2:

Rotate u by 90o about +z and 90o about +y, where xyz are the fixed base reference
axes. What are the final coordinates of the vector u after these two rotations in the
base xyz axes? If the rotation order changed, will the final coordinates be the same?
Let uT = [0 1 0].

Soln:

v = R (z,90•) u "rotate u to v"

w = R (y,90•) v "rotate v to w"

Thus

w = R (y,90•) R (z,90•) u

 0 0 1  0 − 1 0  0 
w =  0 1 0 1 0 0 1 
− 1 0 0 0 0 1  0

 0 0 1  − 1 0
w =  0 1 0   0  = 0 
− 1 0 0  0  1

Rotations are not commutative. Thus

R (y,90•) R (z,90•) ≠ R (z,90•) R (y,90•)

1.3 Frame Transformation Interpretation

1-6
The columns of H represent the 4 vectors describing a second frame. The first three,
when normalized, are the direction cosines of the second frame axes relative to the first
reference frame. The last vector locates the secondary frame origin in the reference
frame.

To illustrate this interpretation, consider the previous example and Figure 1-6. In
particular note the multiple 90° rotations from xyz to x'y'z' and then to x”y”z”.
z, z', y"
y’

90° 1
90°
2
y, x', x"

x,z"

Figure 1-6 Multiple rotations

Considering the previous example, note that H can be interpreted as two subsequent
rotational transformations.

0 0 1 0
H = 10 0 0 0 = R (y, 90o ) R (z, 90o ) 0
1 0 0 0T 1
0 0 0 1

The columns of H ultimately represent (orient and position) a secondary frame x"y"z"
relative to the original xyz frame:

0 0 1
x" oriented by 10 , y" by 0 , and z" by
1
0 relative to the xyz frame. Since the origins
0
0 0 0
0
of both frames are the same, the last column is 00 .
1

In the more general case of both rotation and displacement the first 3 columns represent
the secondary axes orientation with respect to the base axes and the fourth column locates
the secondary origin relative to the base origin.

Given a rotation only described by R (rotation only) and a pure translation described by
p, does

1-7
?
H(p) H(R) = H(R) H(p)

where
R 0
H(R) =
0T 1

and
I p
H(p) =
0T 1

First consider rotation R, and then translation p, to get

I p R 0 u
w = H(p) H(R) u =
0T 1 0T 1

R p
w = u = H (R, p ) u
0T 1 (1.8)

Next, consider translation first, then rotation:

I p R Rp
w = H(R) H(p) u = RT 0
T u = T u
0 1 0 1 0 1 (1.9)

The w’s are different in (1.8) and (1.9) and thus

H(p) H(R) • H(R) H(p)

The usual procedures for locating points in translated and rotated reference frames
relative to the base axes is to rotate the frame first, then translate the frame origin,
i.e., apply (1.8).

1.4 Relative Transformations


Since H(R,p) = H(p) H(R) • H(R) H(p) , what does H(R) H(p) represent? Expanding for
w,

R Rp
w = H(R) H(p) u = u = R (u + p )
0T 1 (1.10)

where u is understood to be in the form of the expanded vector [u 1]T.

From (1.10) we note that the effect of translating first is to cause the rotation R of u
relative to the base frame after it has been translated by p.

Generalizing:

1-8
If we postmultiply a transformation representing a frame (relative to base axes) by a
second transformation (relative to the frame of the first transformation), we make the
transformation with respect to the frame axes of the first transformation.
Premultiplying the frame transformation by the second transformation causes the
transformation to be made with respect to the base reference frame.

Example (Paul)1.3:

Given frame
1 0 0 20
0 0 -1 10
C= 0 1 0 0
0 0 0 1

and transformation

0 -1 0 10
H = 10 00 0
1
0
0
0 0 0 1

locate frame X = H C and frame Y = C H

First,

0 -1 0 10 1 0 0 20 0 0 1 0
X = HC = 10 00 0
1
0
0
0
0
0 -1
1 0
10 = 1 0
0 0 1
0 20
0 0
0 0 0 1 0 0 0 1 0 0 0 1

0 0 1
This can be illustrated by Figure 1-7 where we note that 1 , 0 , and 0 locate the x",
0 1 0
y", z" axes with respect to the x, y, and z axes, respectively.

1-9
Z

y’
y"
x’
z’
X 10
Y
y x"
20 z"
C
z

X 10
x

Figure 1-7 X = H C

Next, we reverse the order to calculate Y = C H

1 0 0 20 0 -1 0 10 0 -1 0 30
Y = 00 0
1
-1 10 1
0 0 0
0
0
0 0 = 0 0
1 0 1 0
-1 10
0 0
0 0 0 1 0 0 0 1 0 0 0 1

as illustrated by the following figure:


Z

y
Y
x 10
20
z C

x 10
Y
y
z
X

Figure 1-8 Y = C H

1-10
Note that postmultiplying causes H to be made relative to frame C rather than relative
to XYZ base axes.

1.5 Inverse Transformations


Given u and the rotational transformation R, the coordinates of u after being rotated by R
are defined by v = Ru. The inverse question is given v, what u when rotated by R will
give v? This is found by premultiplying by R-1, the inverse of R, where R-1R = I.
-1 -1
R v = R R u =I u = u (1.11)

-1
Thus, u = R v. Note that the inverse is only defined for square matrices with the rank
equal to the number of columns (or rows).
-1 -1 T
Now how do we determine R ? Without proof it will be stated that R = R (Prove for
T T
any case by simply showing that R R = R R = I).

Similarly for any displacement matrix H (R, p), we can pose a similar question to get u =
H-1 v. What is the inverse of a displacement transformation? Without proof:

ax ay az -pT⋅ a
bx by bz -p T⋅ b RT -RTp
-1
H = = (1.12)
cx cy cz -pT⋅ c 0T 1
0 0 0 1

To prove, show that H -1 H = I ,

RT -RTp R p RTR (RTp - RTp I 0


= = =I
0T 1 0T 1 0T 1 0T 1

Remember the rules for square matrices A, B, C having rank n that

(A B C )T = CT B T AT (1.13)

(A B C )-1 = C-1 B -1 A-1 (1.14)

1.6 Homogeneous Transformations Summary


A 4 x 4 homogeneous transformation consists of three components:

1-11
• rotational, orthogonal 3x3 sub-matrix which is comprised of columns of direction
cosines used to orient the axes of one frame relative to another.

• column vector in 4th column represents the origin of second frame relative to first
frame, resolved in the first frame.

• 0’s in 4th row except for 1 in 4,4 position.

The homogeneous transformation effectively merges a frame orientation matrix and


frame translation vector into one matrix. The order of the operation should be viewed as
rotation first, then translation.

The homogeneous transformation can be viewed as a position/orientation relationship of


one frame relative to another frame called the reference frame.

The order of multiplying frames is important since A B ≠ B A. A B can be interpreted


as frame A described relative to the first or base frame while frame B is described relative
to frame A (usual way). We can also interpret B in the base frame transformed by A in
the base frame. Both interpretations give same result.

1-12

You might also like