Professional Documents
Culture Documents
Homogeneous Coordinates
wy
,
w
and
(2)
wz
(3)
w
In general, a homogeneous representation refers to any n-dimensional space
problem which is described by an (n + 1)-dimensional space problem. The term
homogeneous comes from the fact that the mathematical equations used to
describe such problems contain no explicit constants. The motivation for using
such a representation lies in the fact that many geometrical problems possess
simpler solutions in the higher dimensional space which can then be projected
back into the original representation.
A simple example which illustrates one such benefit of homogeneous coordinates is the ease with which infinity can be represented. When using ordinary
coordinates there is no satisfactory representation of infinity. However, in homogeneous coordinates, infinity can be represented by w = 0 with the ratio
of the other three coordinates preserved in order to specify direction. While
the ability to represent infinity may not be significant for many applications,
it does serve to illustrate some of the practical issues involved in physically
storing positional coordinates in a fixed bit computer representation. In this
respect, the scale factor w represents a convenient method of implementing a
tradeoff between resolution and dynamic range given a fixed number of bits for
the representation.
From (1) to (3) it is clear that for any given set of ordinary coordinates there
is a one dimensional infinity of homogeneous coordinate representations. Geometrically, one can consider the mapping from four-dimensional homogeneous
coordinate space to three-dimensional ordinary coordinate space as a projection
z=
of a point through the origin onto the hyperplane w = 1. This non-linear projective transformation is the key to producing perspective displays for computer
graphic simulations.
As stated above, the use of homogeneous coordinates in robotics is usually
restricted such that the scale factor w is set identically equal to 1. Thus in
the remainder of this work the homogeneous coordinates representing a threedimensional position will be given by the vector notation [x y z 1]T . Although
at first glance this representation may appear trivial it still provides significant
advantages when relating the positions and orientations of objects through the
use of homogeneous transformations which is the topic of the next section.
Homogeneous Transformations
R33 p31
A=
(4)
f13 s11
The 3 x 3 orthogonal matrix R is sometimes called the rotation matrix and
is composed of the direction cosines which relate the two coordinate systems.
This matrix can be considered to be composed of three columns as follows:
nx ox a x
R = ny oy ay
(5)
nz oz az
where these columns represent the coordinate axes of one system with respect
to another. The notational convention comes from the terms approach vector
used for the z axis, orientation vector for the y axis and normal vector for the
x axis denoting the common normal required to fully specify a right-handed
coordinate system [Pau81]. The term rotation matrix results from its ability to
specify an arbitrary rotation transformation about any axis which goes through
the origin. In particular, the three basic rotation matrices which represent a
rotation of about the x, y, and z axes respectively, are given by the matrices
1
0
0
R(x, ) = 0 cos sin ,
(6)
0 sin
cos
cos
0
R(y, ) =
sin
2
0 sin
1
0 ,
0 cos
(7)
and
cos
R(z, ) = sin
0
sin
cos
0
0
0
1
(8)
x + px
1 0 0 px
x
y + py 0 1 0 py y
(10)
z + pz = 0 0 1 pz z
1
0 0 0 1
1
The remaining components of the homogeneous transformation matrix are
the 1 x 3 row vector f and the scalar s. The vector f is useful in specifying
perspective transformations by modifying the homogeneous coordinate component w to be a function of the other three coordinates. This will result in
a non-linear projective transformation when the three-dimensional coordinates
are normalized by dividing by the scale factor w. While used extensively when
generating computer graphic displays, in robotics work the vector f is usually
defined as zero. Likewise, the scalar s which represents an overall scale factor in
the transformation is typically restricted to 1 so that the overall homogeneous
3
p n
RT
p o
A1 =
(11)
p a
0 0 0
1
In order to avoid ambiguity when using homogeneous transformation matrices to describe the relationships between coordinate systems it is conventional
to attach the name of the related coordinate systems to the variable specifying the transformation. The name of the source coordinate system is typically
appended as a subscript with the destination coordinate system added as a
preceding superscript [Pau81]. Thus the transformation denoted by 0 A1 refers
to the transformation A which relates the mapping from objects described in
coordinate system 1 to coordinate system 0. Likewise vectors are preceded by
a superscript which identifies the particular coordinate system with respect to
which they are specified. Thus the description of a vector v in two different
coordinate systems can be related by the equation
0
v=
A1 1 v.
(12)
Orientation Specification
oz a y
,
2 sin
a x nz
ky =
2 sin
kx =
(14)
(15)
and
ny ox
.
(16)
2 sin
The above equations clearly reflect the fact that the axis of rotation is not
physically well defined for small angles of rotation. Note, however, that the
same ill-conditioning occurs when approaches 180 , a case which is physically
well defined. To avoid these ill-conditioned equations, an alternate formulation
can be applied [Pau81]. In any event, the above discussion illustrates some of
the drawbacks inherent in a rotation matrix specification of orientation.
kz =
3.1
Euler Angles
angles are commonly referred to as roll, pitch, and yaw, indicating the amount
of rotation about the z, y, and x axes, respectively. The rotation matrix for an
orientation specified in this manner can be obtained by multiplying the appropriate basic rotation matrices (see (6) to (8)) in the proper order. In this case,
the resultant rotation matrix is given by
R(, , )
(17)
arctan
arctan
ny
nx
nz
nx cos + ny sin
oz
arctan .
az
(19)
(20)
(21)
Note that the above equations are singular when cos = 0. This type of difficulty
is not unique to the roll, pitch and yaw convention but is shared by all 24 possible
combinations. All sets of space-three and body-three angles have a singularity
when the cosine of the second angle is equal to zero. Likewise, all sets of spacetwo and body-two angles have a singularity when the sine of the second angle is
equal to zero. Physically, this occurs because these cases result in an alignment
of the first axis of rotation with the third axis of rotation. Thus the first and
third angles of rotation are not independent and cannot be distinguished, a case
often referred to as gimbal lock. Consequently, for some applications two sets
of Euler angles are used, one from the three axis set and one from the two axis
set, with the least ill-conditioned set of equations being employed. In addition
to the above difficulties, there is also no simple way of combining two rotations
which are described in terms of Euler angles.
3.2
Quaternions
Since the axis and angle of rotation required to achieve a given orientation have
a physically meaningful interpretation, they too are used to specify orientation.
While the magnitude of the angle of rotation can be used to scale the axis of
rotation, these quantities are frequently represented as the pair (, k) where k
6
(22)
Unfortunately, the equations for combining two rotations specified in this manner is unduly complex. For this reason, representations which scale the pair
by trigonometric functions of /2 are commonly employed. One such representation, called the Rodrigues vector [KLL83] is a result of multiplying the axis
of rotation k by the quantity tan(/2). Unfortunately, this representation can
result in numerical inaccuracy since the magnitude of the Rodrigues vector can
become infinite.
Ideally, one would like a representation which explicitly contains the geometric information of axis and angle of rotation in a numerically well-conditioned
manner along with a straightforward method of combining successive rotations.
Such a representation is possible through the use of quaternions, a mathematical entity composed of a scalar and vector pair denoted here as (s, v). The axis
and angle of rotation required to achieve an orientation can be represented by
the unit quaternion (cos(/2), k sin(/2)) where the magnitude of quaternions
is defined as
|(s, v)|2 = s2 + v v.
(23)
The vector portion of this pair is sometimes call the Euler vector with the set
of four scalar quantities also known as Euler parameters [KLL83].
For calculations involving quaternions, the following four operations are defined:
(s1 , v1 ) (s2 , v2 ) = (s1 s2 v1 v2 , s1 v2 + s2 v1 + v1 v2 )
(24)
(s1 , v1 ) + (s2 , v2 ) = (s1 + s2 , v1 + v2 )
(25)
s1 (s2 , v2 ) = (s1 s2 , s1 v2 )
(26)
(s, v)1 =
(s, v)
|(s, v)|2
(27)
(30)
which is identical to (22). The associativity of quaternion multiplication allows successive rotations to be combined by simply multiplying their respective
7
(31)
Conclusion
References
[KLL83] T R Kane, P W Likins, and D A Levinson. Spacecraft Dynamics.
McGraw-Hill, New York, 1983.
[Max51] E A Maxwell. General Homogeneous Coordinates in Space of Three
Dimensions. Cambridge University Press, London, 1951.
[Max63] E A Maxwell. The Methods of Plane Projective Geometry Based on
the Use of General Homogeneous Coordinates. Cambridge University
Press, London, 1963.
[NS79]
[Pau81] R P Paul. Robot Manipulators: Mathematics, Programming, and Control. MIT Press, Cambridge, Mass., 1981.
[RA76]
[Tay79] R H Taylor. Planning and execution of straight line manipulator trajectories. IBM Journal of Research and Development, 23(4):424436,
1979.