Rigid Motions and Homogeneous Transformations: 2.1 Representing Positions
Rigid Motions and Homogeneous Transformations: 2.1 Representing Positions
Rigid Motions and Homogeneous Transformations: 2.1 Representing Positions
2.1
Representing Positions
Before developing representation schemes for points and vectors, it is instructive to distinguish between the two fundamental approaches to geometric reasoning: the synthetic
1
Since we make extensive use of elementary matrix theory, the reader may wish to review Appendix A
before beginning this chapter.
33
34
Figure 2.1: Two coordinate frames, a point p, and two vectors ~v1 and ~v2 .
approach and the analytic approach. In the former, one reasons directly about geometric entities (e.g., points or lines), while in the latter, one represents these entities using
coordinates or equations, and reasoning is performed via algebraic manipulations.
Consider Figure 2.1. Using the synthetic approach, without ever assigning coordinates
to points or vectors, one can say that x0 is perpendicular to y0 , or that ~v1 ~v2 defines a
vector that is perpendicular to the plane containing ~v1 and ~v2 , in this case pointing out of
the page.
In robotics, one typically uses analytic reasoning, since robot tasks are often defined in a
Cartesian workspace, using Cartesian coordinates. Of course, in order to assign coordinates
it is necessary to specify a coordinate frame. Consider again Figure 2.1. We could specify
the coordinates of the point p with respect to either frame o0 x0 y0 or frame o1 x1 y1 . In
the former case, we might assign to p the coordinate vector (5, 6)T , and in the latter case
(3, 4)T . So that the reference frame will always be clear, we will adopt a notation in which
a superscript is used to denote the reference frame. Thus, we would write
5
3
0
1
p =
,
p =
(2.1)
6
4
Geometrically, a point corresponds to a specific location in space. We stress here that
p 6= p0 and p 6= p1 , i.e., p is a geometric entity, a point in space, while both p0 and p1
are coordinate vectors that represent the location of this point in space with respect to
coordinate frames o0 x0 y0 and o1 x1 y1 , respectively.
Since the origin of a coordinate system is just a point in space, we can assign coordinates
that represent the position of the origin of one coordinate system with respect to another.
In Figure 2.1, for example,
10
10
.
(2.2)
,
o10 =
o01 =
5
5
In cases where there is only a single coordinate frame, or in which the reference frame
is obvious, we will often omit the superscript. This is a slight abuse of notation, and the
35
reader is advised to bear in mind the difference between the geometric entity called p and
any particular coordinate vector that is assigned to represent p. The former is invariant
with respect to the choice of coordinate systems, while the latter obviously depends on the
choice of coordinate frames.
While a point corresponds to a specific location in space, a vector specifies a direction
and a magnitude. Vectors can be used, for example, to represent displacements or forces.
Therefore, while the point p is not equivalent to the vector ~v1 , the displacement from the
origin o0 to the point p is given by the vector ~v1 . In this text, we will use the term vector
to refer to what are sometimes called free vectors, i.e., vectors that are not constrained to
be located at a particular point in space. Under this convention, it is clear that points and
vectors are not equivalent, since points refer to specific locations in space, but a vector can
be moved to any location in space. Under this convention, two vectors are equal if they
have the same direction and the same magnitude.
When assigning coordinates to vectors, we use the same notational convention that we
used when assigning coordinates to points. Thus, ~v1 and ~v2 are geometric entities that
are invariant with respect to the choice of coordinate systems, but the representation by
coordinates of these vectors depends directly on the choice of reference coordinate frame.
In the example of Figure 2.1, we would obtain
v10 =
5
6
v11 =
8
1
v20 =
5
1
v21 =
3
4
(2.3)
2.2
Representing Rotations
In order to represent the relative position and orientation of one rigid body with respect
to another, we will rigidly attach coordinate frames to each body, and then specify the
geometric relationships between these coordinate frames. In Section 2.1 we have already
seen how one can represent the position of the origin of one frame with respect to another
frame. In this section, we address the problem of describing the orientation of one coordinate
frame relative to another frame. We begin with the case of rotations in the plane, and then
generalize our results to the case of orientations in a three dimensional space.
36
x1
sin
x0
o0 , o1
cos
2.2.1
Figure 2.2 shows two coordinate frames, with frame o1 x1 y1 being obtained by rotating frame
o0 x0 y0 by an angle . Perhaps the most obvious way to represent the relative orientation
of these two frames is to merely specify the angle of rotation, . There are two immediate
disadvantages to such a representation. First, there is a discontinuity in the mapping from
relative orientation to the value of in a neighborhood of = 0. In particular, for = 2,
small changes in orientation can produce large changes in the value of (i.e., a rotation by
causes to wrap around to zero). Second, this choice of representation does not scale
well to the three dimensional case, with which we shall be primarily concerned in this text.
A slightly less obvious way to specify the orientation is to specify the coordinate vectors
for the axes of frame o1 x1 y1 with respect to coordinate frame o0 x0 y0 . In particular, we can
build a matrix of the form:
R10 = [x01 |y10 ] .
(2.4)
A matrix in this form is called a rotation matrix. Rotation matrices have a number of
special properties, which we will discuss below.
In the two dimensional case, it is straightforward to compute the entries of this matrix.
As illustrated in Figure 2.2,
sin
cos
0
0
,
(2.5)
,
y1 =
x1 =
cos
sin
which gives
0
1
R =
cos sin
sin
cos
(2.6)
Note that we have continued to use the notational convention of allowing the superscript
to denote the reference frame. Thus, R10 is a matrix whose column vectors are the coordinates
of the axes of frame o1 x1 y1 expressed relative to frame o0 x0 y0 .
37
Although we have derived the entries for R10 in terms of the angle , it is not necessary
that we do so. An alternative approach, and one that scales nicely to the three dimensional
case, is to build the rotation matrix by projecting the axes of frame o1 x1 y1 onto the coordinate axes of frame o0 x0 y0 . Recalling that the dot product of two unit vectors gives the
projection of one onto the other, we obtain
x1 x0
y1 x0
x01 =
,
y10 =
,
(2.7)
x1 y0
y1 y0
which can be combined to obtain the rotation matrix
x1 x0 y1 x0
0
.
R1 =
x1 y0 y1 y0
(2.8)
Thus the columns of R10 specify the direction cosines of the coordinate axes of o1 x1 y1 relative
to the coordinate axes of o0 x0 y0 . For example, the first column (x1 x0 , x1 y0 )T of R10 specifies
the direction of x1 relative to the frame o0 x0 y0 . Note that the right hand sides of these
equations are defined in terms of geometric entities, and not in terms of their coordinates.
Examining Figure 2.2 it can be seen that this method of defining the rotation matrix by
projection gives the same result as was obtained in equation (2.6).
If we desired instead to describe the orientation of frame o0 x0 y0 with respect to the
frame o1 x1 y1 (i.e., if we desired to use the frame o1 x1 y1 as the reference frame), we would
construct a rotation matrix of the form
x0 x1 y0 x1
1
.
(2.9)
R0 =
x0 y1 y0 y1
Since the inner product is commutative, (i.e. xi yj = yj xi ), we see that
R01 = (R10 )T .
(2.10)
(2.11)
Such a matrix is said to be orthogonal. The column vectors of R10 are of unit length and
mutually orthogonal (Problem 2-1). It can also be shown (Problem 2-2) that det R10 = 1.
If we restrict ourselves to right-handed coordinate systems, as defined in Appendix A, then
det R10 = +1 (Problem 2-3). All rotation matrices have the properties of being orthogonal
matrices with determinant +1. It is customary to refer to the set of all 2 2 rotation
matrices by the symbol SO(2)2 . The properties of such matrices are summarized in Figure
2.3.
2
38
2.2.2
cos() sin()
sin()
cos()
cos sin
sin cos
cos sin
sin
cos
T
(2.12)
The projection technique described above scales nicely to the three dimensional case.
In three dimensions, each axis of the frame o1 x1 y1 z1 is projected onto coordinate frame
o0 x0 y0 z0 . The resulting rotation matrix is given by
not corrrect
x1 x0 y1 x0 z1 x0
R10 = x1 y1 y1 y0 z1 y0 .
x1 z1 y1 z0 z1 z0
(2.13)
As was the case for rotation matrices in two dimensions, matrices in this form are
orthogonal, with determinant equal to 1. In this case, 3 3 rotation matrices belong to the
group SO(3). The properties listed in Figure 2.3 also apply to rotation matrices in SO(3).
Example 2.1 Suppose the frame o1 x1 y1 z1 is rotated through an angle about the z0 -axis,
and it is desired to find the resulting transformation matrix R10 . Note that by convention
the positive sense for the angle is given by the right hand rule; that is, a positive rotation
of degrees about the z-axis would advance a right-hand threaded screw along the positive
z-axis. From Figure 2.4 we see that
39
cos
y1
x0
sin
sin
cos
x1
y0
y1 x0 = sin
x1 y0 = sin
y1 y0 = cos
(2.14)
z 0 z1 = 1
and all other dot products are zero. Thus the transformation R10 has a particularly simple
form in this case, namely
cos sin 0
(2.15)
R10 = sin cos 0 .
0
0
1
(2.16)
(2.17)
Rz, 1 = Rz, .
(2.18)
40
Similarly the basic rotation matrices representing rotations about the x and y-axes are
given as (Problem 2-5)
1
0
0
(2.19)
Rx, = 0 cos sin
0 sin cos
cos 0 sin
0
1
0
(2.20)
Ry, =
sin 0 cos
which also satisfy properties analogous to (2.16)-(2.18).
Example 2.2 Consider the frames o0 x0 y0 z0 and o1 x1 y1 z1 shown in Figure 2.5. Projecting the unit vectors x1 , y1 , z1 onto x0 , y0 , z0 gives the coordinates of x1 , y1 , z1 in the
T
o0 x0 y0 z0 frame. We see that the coordinates of x1 are 12 , 0, 12 , the coordinates of y1
T
1
are 12 , 0,
and the coordinates of z1 are (0, 1, 0)T . The rotation matrix R10 specifying
2
the orientation of o1 x1 y1 z1 relative to o0 x0 y0 z0 has these as its column vectors, that is,
1
0
2
2
0 1 .
(2.21)
R10 = 0
1
1
0
2
2
z0
x1
45
x0
y0 , z1
y1
2.3
Rotational Transformations
Figure 2.6 shows a rigid object S to which a coordinate frame o1 x1 y1 z1 is attached. Given
the coordinates p1 of the point p (i.e., given the coordinates of p with respect to the frame
41
S
y1
z1
x1
o
y0
x0
(2.22)
In a similar way, we can obtain an expression for the coordinates p0 by projecting the point
p onto the coordinate axes of the frame o0 x0 y0 z0 , giving
p x0
p0 = p y 0 .
p z0
(2.23)
p0
x1 x0 y1 x0 z1 x0
u
= x1 y0 y1 y0 z1 y0 v .
x1 z0 y1 z0 z1 z0
w
(2.24)
(2.25)
(2.26)
But the matrix in this final equation is merely the rotation matrix R10 , which leads to
p0 = R10 p1 .
(2.27)
42
Thus, the rotation matrix R10 can be used not only to represent the orientation of coordinate frame o1 x1 y1 z1 with respect to frame o0 x0 y0 z0 , but also to transform the coordinates
of a point from one frame to another. Thus, if a given point is expressed relative to o1 x1 y1 z1
by coordinates p1 , then R10 p1 represents the same point expressed relative to the frame
o0 x0 y0 z0 .
We have now seen how rotation matrices can be used to relate the orientation of one
frame to another frame, and to assign coordinate representations to points and vectors. For
example, given a point p in space, we have shown how a rotation matrix can be used to
derive coordinates for p with respect to different coordinate frames whose orientations are
related by a rotation matrix. We can also use rotation matrices to represent rigid motions
that correspond to pure rotation. Consider Figure 2.7. One corner of the block in Figure
2.7(a) is located at the point pa in space. Figure 2.7(b) shows the same block after it has
been rotated about z0 by the angle . In Figure 2.7(b), the same corner of the block is
now located at point pb in space. It is possible to derive the coordinates for pb given only
the coordinates for pa and the rotation matrix that corresponds to the rotation about z0 .
To see how this can be accomplished, imagine that a coordinate frame is rigidly attached
to the block in Figure 2.7(a), such that it is coincident with the frame o0 x0 y0 z0 . After the
rotation by , the blocks coordinate frame, which is rigidly attached to the block, is also
rotated by . If we denote this rotated frame by o1 x1 y1 z1 , we obtain
1
0 0
(2.28)
R10 = Rz, = 0 1 0 .
0
0 1
In the local coordinate frame o1 x1 y1 z1 , the point pb has the coordinate representation p1b .
To obtain its coordinates with respect to frame o0 x0 y0 z0 , we merely apply the coordinate
transformation equation (2.27), giving
p0b = Rz, p1b .
(2.29)
The key thing to notice is that the local coordinates, p1b , of the corner of the block do not
change as the block rotates, since they are defined in terms of the blocks own coordinate
frame. Therefore, when the blocks frame is aligned with the reference frame o0 x0 y0 z0
(i.e., before the rotation is performed), the coordinates p1b = p0a , since before the rotation
is performed, the point pa is coincident with the corner of the block. Therefore, we can
substitute p0a into the previous equation to obtain
p0b = Rz, p0a .
(2.30)
This equation shows us how to use a rotation matrix to represent a rotational motion. In
particular, if the point pb is obtained by rotating the point pa as defined by the rotation
matrix R, then the coordinates of pb with respect to the reference frame are given by
p0b = Rp0a .
(2.31)
43
z0
z0
pa
pb
y0
y0
x0
x0
(a)
(b)
Figure 2.7: The block in (b) is obtained by rotating the block in (a) by about z0 .
z0
v#0
y0
v#1
x0
44
This same approach can be used to rotate vectors with respect to a coordinate frame,
as the following example illustrates.
Example 2.3 The vector ~v with coordinates v 0 = (0, 1, 1)T is rotated about y0 by
shown in Figure 2.8. The resulting vector ~v1 has coordinates given by
v10 = Ry, v 0
2
0 0 1
1
0
0 1 0
1 = 1 .
=
0
1
1 0 0
as
(2.32)
(2.33)
2.3.1
Summary
We have seen that a rotation matrix, either R SO(3) or R SO(2), can be interpreted
in three distinct ways:
1. It represents a coordinate transformation relating the coordinates of a point p in two
different frames.
2. It gives the orientation of a transformed coordinate frame with respect to a fixed
coordinate frame.
3. It is an operator taking a vector and rotating it to a new vector in the same coordinate
system.
The particular interpretation of a given rotation matrix R that is being used must then be
made clear by the context.
2.4
Composition of Rotations
2.4.1
Recall that the matrix R10 in Equation (2.27) represents a rotational transformation between
the frames o0 x0 y0 z0 and o1 x1 y1 z1 . Suppose we now add a third coordinate frame o2 x2 y2 z2