+ All Categories
Home > Documents > robotics

robotics

Date post: 01-Feb-2016
Category:
Upload: anthler
View: 2 times
Download: 0 times
Share this document with a friend
Description:
chapter 2
Popular Tags:
36
Contents Contents i 1 Nomenclature i 2 Geometric modeling 1 2.1 Vector spaces ............................. 1 1. Vector space properties.......... 1 2. Linear mappings. ............ 2 3. Algebras.................. 2 2.2 Coordinates .............................. 3 4. R n spaces. ................ 3 5. Charts. .................. 4 6. Array notation. ............. 4 7. Metric spaces. .............. 6 8. Real inner product spaces. ....... 6 9. Euclidean spaces. ............ 8 10. Cartesian point coordinates. ...... 9 11. Cartesian vector coordinates....... 9 2.3 Orthogonal matrices - basic tools .................. 10 12. Euclidean spaces. ............ 11 13. Direction cosines and coordinate map notation. ................. 11 14. Elementary direction cosines matrices. . 13 2.4 Orthogonal matrices - systematic notation ............. 16 15. Summary of orthogonal matrix notation. 16 16. ia) Frame unit vectors. ......... 16 17. iia) Coordinate charts. ......... 17 18. ib) Direction cosines. .......... 18 19. iib) Coordinate maps........... 19 20. iiia) Rotations............... 21 21. iiib) Rotations using coordinates. ... 22 22. Some orthogonal matrix identities.... 23 23. Moving frame rotations and Euler angles. 23 24. Fixed frame rotations........... 26 January 7, 2009 10:21
Transcript
Page 1: robotics

Contents

Contents i

1 Nomenclature i

2 Geometric modeling 12.1 Vector spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1. Vector space properties. . . . . . . . . . 12. Linear mappings. . . . . . . . . . . . . 23. Algebras. . . . . . . . . . . . . . . . . . 2

2.2 Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34. Rn spaces. . . . . . . . . . . . . . . . . 35. Charts. . . . . . . . . . . . . . . . . . . 46. Array notation. . . . . . . . . . . . . . 47. Metric spaces. . . . . . . . . . . . . . . 68. Real inner product spaces. . . . . . . . 69. Euclidean spaces. . . . . . . . . . . . . 810. Cartesian point coordinates. . . . . . . 911. Cartesian vector coordinates. . . . . . . 9

2.3 Orthogonal matrices - basic tools . . . . . . . . . . . . . . . . . . 1012. Euclidean spaces. . . . . . . . . . . . . 1113. Direction cosines and coordinate map

notation. . . . . . . . . . . . . . . . . . 1114. Elementary direction cosines matrices. . 13

2.4 Orthogonal matrices - systematic notation . . . . . . . . . . . . . 1615. Summary of orthogonal matrix notation. 1616. ia) Frame unit vectors. . . . . . . . . . 1617. iia) Coordinate charts. . . . . . . . . . 1718. ib) Direction cosines. . . . . . . . . . . 1819. iib) Coordinate maps. . . . . . . . . . . 1920. iiia) Rotations. . . . . . . . . . . . . . . 2121. iiib) Rotations using coordinates. . . . 2222. Some orthogonal matrix identities. . . . 2323. Moving frame rotations and Euler angles. 2324. Fixed frame rotations. . . . . . . . . . . 26

January 7, 2009 10:21

Page 2: robotics

ii CONTENTS

25. Active and passive rotations . . . . . . 27

January 7, 2009 10:21

Page 3: robotics

Chapter 2

Geometric modeling

2.1 Vector spacesThis section briefly reviews some fundamental mathematical concepts aboutvector spaces without the use of coordinates.

1. Vector space properties. Vector spaces are also known as linear spaces.They are fundamental in engineering and science for the linear modeling ofphysical phenomena.Informally, a vector space V = {a, b, . . . } is a set of elements a, b, . . . , called

vectors, that is closed under the operation of addition and the operation ofmultiplication by scalars α, β, . . . from a field F ,

αa+ βb ∈ V

In a topological vector space the operations of vector addition and scalarmultiplication are continuous such as when the field F is the real numbers R orthe complex numbers C. For the most part we will assume that we are workingwith a topological vector space over the field of real numbers R.Expressions of the type

α1a+ α2b+ · · ·+ αrd

are known as linear combinations. A vector subset {a, b, . . . , d} is said to belinearly independent if and only if

α1a+ α2b+ · · ·+ αrd = 0

is uniquely satisfied by α1 = α2 = · · · = αr = 0. All possible linear combinationsof the vectors are said to span a subspace of rank r and the vector subset{a, b, · · · , d} is said to be a basis for the subspace. Vectors which are not linearlyindependent are called linearly dependent. The dimension n of a vector spaceis the maximum rank of all its possible subspaces. The notation V n denotes ann-dimensional vector space.

January 7, 2009 10:21

Page 4: robotics

2 Chapter 2 Geometric modeling

φ

1φ−

( )aφ( )bφ

( )a bφ α β+

mV

( )aφ( )bφ

( )a bφ α β+

mVnVb

a bα β+

anVb

a bα β+

a

Figure 2.1: A homomorphism preserves linearity and scaling. It is an isomorphism ifinvertible.

2. Linear mappings. A linear mapping φ : V n → V m is a transformationfrom V n with elements {a, b, · · · } to another vector space V m with mappedelements {φ (a) , φ (b) , · · · } satisfying the linearity condition

φ (αa+ βb) = αφ (a) + βφ (b)

and is called a homomorphism on vector spaces, Figure 2.1.If m = n and φ−1 exists then the mapping is called an isomorphism. When

operating on a set of vectors an isomorphism preserves its rank.For given m and n, the set of all homomorphisms φ : V n → V m forms

another vector space V mn with dimension mn so αφ1 + βφ2 ∈ V mn.If m = 1 then φ is called a linear form and it maps vectors to scalars,

φ : V n → V 1. The set of all such linear forms is a vector space of dimension nsince V mn = V (1)n. The mapping is used to abstractly introduce and representV n∗, a vector space which is said to be dual to V n. Elements of V n∗ are alsocalled covectors and their analogous relation with vectors become evident uponthe introduction of coordinates.

Remark 1. In describing abstract vector spaces it is important to note what has notbeen necessary to mention, namely: coordinates, inner or dot products, cross products,magnitudes, angles, directions, etc. These are all additional structures that are placedon vector spaces and form what is usually referred to in engineering as vector analysis.

3. Algebras. An algebra is a vector space V with a product × defined be-tween vectors,

a× b ∈ V

that is associative over scalars

α (a× b) = (αa)× b = a× (αb)

for all a, b in V and α in field F .

Example 2. The most familiar vector product is the cross product × of Euclideanvector analysis. It is a particular instance of the Lie product that requires a differen-tiable vector space. The cross product is anticommunitive since a× b = −b× a.

January 7, 2009 10:21

Page 5: robotics

2.2 Coordinates 3

Exercise 3. For the cross product show that a× a = 0.

Example 4. The composition of compatible homomorphisms is a product. Let φ :V n → V n be such a mapping and thus φ ∈ V n2 . For any two compatible mappingsφ1, φ2 define the ◦ product for all a ∈ V n by the composition,

(φ2 ◦ φ1) (a) ≡ φ2 (φ1 (a))

so φ2 ◦ φ1 ∈ V n2 . It is direct to show that the scalar associative property is satisfiedand thus ◦ is a product on V n2 . If the homomorphisms are represented as matricesthen their composition is just the matrix product φ2φ1.

Exercise 5. Show that the scalar associative property for the product composition ◦is satisfied, i.e., α (φ2 ◦ φ1) = (αφ2) ◦ φ1 = φ2 ◦ (αφ1).

2.2 CoordinatesCoordinates are introduced to perform numerical calculations and simplify equa-tions. However, coordinates are an external feature that are imposed on vectorspaces and one must be careful not to equate properties of vectors with proper-ties of their coordinate representations. Some mathematical presentations aredistinguished as coordinate-free, as in the above treatment, to avoid any such“contamination” but the style can be tedious. Coordinates and array notationare important tools but it is easy to forget that they are simply representationsand are not the actual entity. The difference is similar to the name of a personand the actual person.For the most part we will be dealing with real coordinates which simplifies the

presentation. Occasionally it will be necessary to consider complex coordinatesand for those cases the required properties will be considered as needed.

4. Rn spaces. A real number can be represented by an infinitely long deci-mal number such as 0.765 . . . . Geometrically, the set of real numbers R may beput into a one-to-one correspondence with points on an infinitely long straightline called the real line. Each number is then called the coordinate of the point.Note that the correspondence not unique since, for example, any pair of distinctpoints could be made to correspond to 0 and 1.For simplicity, Rn is described as a space composed of n-copies of the real

line. More formally it is defined as the Cartesian product as Rn = R×R×· · ·×Rso the coordinates of a point in Rn are simply given by an ordered n-tuple ofreal numbers, e.g. (a1, a2, . . . , an).The coordinates of points in Rn are made into a topological vector space by

defining vector addition a+ b and scalar multiplication αa on the n-tuples,

(a1, a2, . . . , an) + (b1, b2, . . . , bn) = (a1 + b1, a2 + b2, . . . , an + bn)

α (a1, a2, . . . , an) = (αa1, αa2, . . . , αan)

In this way points in Rn are associated with vectors in V n.

January 7, 2009 10:21

Page 6: robotics

4 Chapter 2 Geometric modeling

5. Charts. Amanifold is a structure that can be assigned coordinates aboutevery small neighborhood of its elements (i.e. open sets). For the earth a tangentplane at each location is used to produce a map with rectangular coordinatesin R2.A coordinate chart is the invertible function that assigns coordinates to

an open set of elements. To include every element in an open set it may benecessary to use several overlapping and compatible charts which together forman atlas. The terms come from mapping the earth’s surface where each point isidentified by a unique latitude and longitude (in R2) except at the poles sincethe longitudes are longer unique. It is necessary to use atleast two overlappingcharts to cover a sphere. (Topologically, you can not stretch a single sheet ofrubber to cover a sphere without overlap. You can however stretch two sheetsover the north and south poles so that they overlap around the equator.) V n isan especially simple manifold that can be covered by a single chart to Rn.

6. Array notation. Vector coordinates are arranged into columns so thevector a is represented as

a =

⎡⎢⎢⎢⎣a1a2...an

⎤⎥⎥⎥⎦and is called a column vector. When considered as an array it has n rows and1 column and is abbreviated as n× 1.For conciseness we use a common corruption of notation so a stands for both

the vector itself and its array representation. This convention is also applies tothe following mappings.

A homomorphism φ : V n → V m is represented as an m × n array withdoubly indexed subscripts,

φ =

⎡⎢⎢⎢⎣φ11 φ12 · · · φ1nφ21 φ22 · · · φ2n...

.... . .

...φm1 φm2 · · · φmn

⎤⎥⎥⎥⎦so the transformation φ (a) is given by matrix multiplication,

φa =

⎡⎢⎢⎢⎣φ11 φ12 · · · φ1nφ21 φ22 · · · φ2n...

.... . .

...φm1 φm2 · · · φmn

⎤⎥⎥⎥⎦⎡⎢⎢⎢⎣

a1a2...an

⎤⎥⎥⎥⎦ =⎡⎢⎢⎢⎣

φ11a1 + φ12a2 + · · ·+ φ1nanφ21a1 + φ22a2 + · · ·+ φ2nan

...φm1a1 + φm2a2 + · · ·+ φmnan

⎤⎥⎥⎥⎦

January 7, 2009 10:21

Page 7: robotics

2.2 Coordinates 5

A linear form φ : V n → V 1 (→ R) is represented with a 1× n array,

£φ11 φ12 · · · φ1n

¤⎡⎢⎢⎢⎣

a1a2...an

⎤⎥⎥⎥⎦ = £ φ11a1 + φ12a2 + · · ·+ φ1nan¤

The array φ is called a row covector and represents a covector of the dual vectorspace V n∗. For symmetry with vectors, the covector components are reindexedwith single subscripts and it is written as a column vector so the linear form,V n∗ × V n → R, is given by

eTa =

⎡⎢⎢⎢⎣e1e2...en

⎤⎥⎥⎥⎦T ⎡⎢⎢⎢⎣

a1a2...an

⎤⎥⎥⎥⎦ = £ e1a1 + e2a2 + · · ·+ enan¤

where the transpose operator (·)T interchanges array rows and columns.

Remark 6. The linear form eTa appears very similar to be what is often called a“standard inner product” but they are very different. Inner products involve eithertwo vectors or two covectors and are usually associated with a metric (e.g. the cosine ofan angle). A linear form is a product of a vector and covector and exists independentlyof a metric.

Example 7. In tensor analysis it is common to express vectors and covectors usingsuperscripts and subscripts so the linear form becomes

eTa = e1a1 + e2a

2 + · · ·+ enan

Following the Einstein convention, raised indices are used for vector components andare called contravariant components; lowered indices are used for covector componentsand are called covariant components.Matrices and higher order tensors can have mixtures of indices and multiplicationfollows a rule for canceling matched raised and lowered indices. This makes mappingsinvolving V and V ∗ explicit. For second order tensor mappings of vectors there arefour such possibilities,

V n → V m , bi = φij aj

V n∗ → V m , ci = φij ejV n∗ → V m∗, fi = φji ejV n → V m∗, gi = φij a

j

where a, b, c are vectors, e, f , g are covectors, i = 1 · · ·m and j = 1 · · ·n. Oftenthe summation signs are not written since they are implied from matching upper andlower indice letters (j in the above examples). While very elegant and useful, we willnot use the convention and instead represent all components using subscripts.

January 7, 2009 10:21

Page 8: robotics

6 Chapter 2 Geometric modeling

7. Metric spaces. It is natural to associate coordinates with distances usinga reference standard called a metric which, for example, could be a uniformlymarked ruler. However, one of the results of 19th century geometry is that realnumbers can be assigned to a line without a correspondence to magnitudes. Asdescribed by the mathematician and philosopher Bertand Russell1 ,

. . . they are a set of numbers, arbitrarily but systematically assigned todifferent points, like the numbers of houses in a street, and serving only,from a philosophical standpoint, as convenient designations for pointswhich the investigation wishes to distinguish. But for the brevity of thealphabet, in fact, they might, as in Euclid, be replaced by letters.

The ability to label the so-called projective real line without using a metricdoes not seem to be well known or appreciated in current mathematical liter-ature. If the ideal point is removed (e.g. the “point at infinity”) the labelingapplies to the real line and by extension to Rn. Often Rn is mislabeled as ann-dimensional Euclidean space; it is not since Euclidean spaces require the ex-istence of particular metrics (e.g. the Pythagorean theorem). More generally,if Rn is endowed with a metric it is simply called a metric space. Examplesinclude elliptic and hyperbolic spaces which are also known as non-Euclideanspaces.If a metrical quantity, such as distance or angle, is to remain invariant under

the mapping of elements, then this imposes an additional restriction on thetypes mappings that can act on the space.

8. Real inner product spaces. So far we have introduced two types ofmultiplication involving vectors, scaling and a vector product. In both casesthe result is another vector. When coordinates are introduced then a linearmapping can be represented by matrix multiplication. That is not a new productoperation but just a result from the representation.A third type of product is the inner product that maps two vectors a and

b into a scalar denoted by ha, bi so we have h·, ·i : V n × V n → R where weare assuming vectors over the field of real numbers. Inner products are used toestablish metrics which enable the introduction of measurements such as angleand distance.A proper inner product over the real numbers has the following properties:

ha, ai ≥ 0 (nonnegative)ha, ai = 0 iff a = 0 (nondegenerate)ha, di = hd, ai (communitive)hαa+ βb, di = α ha, di+ β hb, di (linear)

Note that from the last two properties, the inner product is also linear in the lastargument. When complex numbers are considered then the properties must be

1Russell, Bertrand A. W., An Essay on the Foundation of Geometry, Cambridge UniversityPress, 1897.

January 7, 2009 10:21

Page 9: robotics

2.2 Coordinates 7

redefined by introducing complex conjugates. There are also variations for animproper inner product where the first and second properties can be violated.Assuming an implicit array notation the inner product has a simple form,

ha, bi = aTφb

which is much more compact than

ha, bi =

⎡⎢⎢⎢⎣a1a2...an

⎤⎥⎥⎥⎦T ⎡⎢⎢⎢⎣

φ11 φ12 · · · φ1nφ21 φ22 · · · φ2n...

.... . .

...φn1 φn2 · · · φnn

⎤⎥⎥⎥⎦⎡⎢⎢⎢⎣

b1b2...bn

⎤⎥⎥⎥⎦By the communitive property it follows that φ must be symmetric, φ = φT .An inner product is also known as a quadratic form. While higher forms exist,linear and quadratic forms are certainly the most important.The inner product on vectors induces an inner product on covectors h·, ·i :

V n∗ × V n∗ → R,he, fi = eTφ−1f

Remark 8. Since φ is symmetric the inner product for covectors can also be expressedas he, fi = eTφ−T f where φ−T ≡ φ−1

T= φT

−1. This form is somewhat preferable

since invertible, nonsymmetric transformations on dual spaces are related by the (·)−Toperator.

Inner products are used to define metrics on vectors turning a vector spaceinto an inner product space. The magnitude of a vector is defined as,

kak ≡pha, ai =

paTφa

A unit vector has a magnitude 1 and is given by,

a

kak

The angle θ between two unit vectors is defined by,

cos θ ≡¿

a

kak ,b

kbk

À=

ha, bipha, ai

phb, bi

=aTφbp

aTφapbTφb

which is also taken as the angle between non-unit vectors a and b.An orthogonal transformation O : V n → V n is an isomorphism that leaves

the inner product unchanged so consequentally it does not alter magnitudes orangles,

ha, bi = hOa,Obi

January 7, 2009 10:21

Page 10: robotics

8 Chapter 2 Geometric modeling

or in terms of array operations,

aTφb = (Oa)T φ (Ob)

= aT¡OTφO

¢b

Since a and b are arbitrary vectors then an orthogonal transformation mustsatisfy

φ = OTφO

Example 9. It is necessary to show that the definition of cos θ is well-defined. Firstly,if the vectors a and b are interchanged then the angle between them is reversed butcos θ remains invariant since ha, bi = aTφb = bTφa = hb, ai. Secondly, to show that−1 ≤ cos θ ≤ 1 we have for any scalar μ,

0 ≤ ka− μbk2 = (a− μb)T φ (a− μb)

Since it is necessary that kak , kbk 6= 0 we are free to select

μ =aTφb

bTφb

and when substituted in gives

aTφb2

(aTφa) (bTφb)≤ 1

or cos2 θ ≤ 1 with the assumed definition which is equivalent to the desired condition.

9. Euclidean spaces. A three dimensional Euclidean space means that itsproperties are governed by Euclid’s five postulates. Often times Euclidean spaceis referred to as “flat space” and exists independently of any particular repre-sentation.Distances are measured by the Pythagorean formula and the interior angles

of every triangle sum to π radians, Figure 2.2. Measures for areas and volumesfollow from these. By imposing these metric constraints on R3 a system of coor-dinates may developed. Examples include Cartesian, spherical, and cylindricalcoordinates among others.If the space is one or two dimensional it is respectively referred to as the

Euclidean line or plane. It is also possible to consistently define n-dimensionalEuclidean spaces by generalizing the metric definitions.The group of Euclidean mappings does not alter distances between points or

angles between lines. The mappings are be classified as rotations, translations,and reflections. Of these rotations and translations do not alter “handedness”and together form the group of rigid body transformations.These properties are extended to vectors through the inner product.

January 7, 2009 10:21

Page 11: robotics

2.2 Coordinates 9

ab

c

α βγ

α β γ π+ + =2 2 2d a b c= + +

d

ab

c

α βγ

α β γ π+ + =2 2 2d a b c= + +

d

Figure 2.2: Euclidean measures of distance and angle.

10. Cartesian point coordinates. Points in Euclidean space will be rep-resented using Cartesian coordinates based on standard rectangular referenceframes, Figure 2.3. A rectangular frame is an ordered set of three axes meetingorthogonally at a point called the origin and often times several different framesare used to simplify the description of a complicated system.A trailing subscript i, j, k, . . . or 0, 1, 2, . . . is generally used to index a

frame (or a later a body) so frame i has origin oi and unit vectors xi, yi, and zialong the axis directions. Without confusion, a trailing x, y, or z is also used toindicate respective coordinates so for point p its coordinates in an unspecifiedcoordinate frame are

¡px py pz

¢whereas in frame i they are written as¡

ipx ipy ipz¢, Figure 2.3a. A leading subscript is indicates the frame used

to express the coordinates as directed distances along its axes.

11. Cartesian vector coordinates. A vector p is assumed to exist inde-pendently of any particular representation. It has the properties of position,magnitude, and orientation. Vectors are drawn as an arrow whose tail locationdenotes position, shaft length denotes magnitude, and arrowhead denotes orien-tation. If the magnitude is unity it is a unit vector. When a vector is associatedwith every point in space they form a vector field which can be used to preciselydefine what are known as free vectors and line vectors.The Cartesian coordinates of a vector are its orthogonal projections along

the axes.Figures 2.3b and 2.3c show two cases: firstly, vector p originates from oi and

is called a position vector with respect to frame i; secondly, vector p is offsetfrom oi. For simplicity the development is illustrated with position vectors butalso it applies to vectors offset from the origin. A position vector has the samecoordinates as the point at the tip so position vectors are also a representationof points with respect to a given frame.Similar to points, a leading subscript on the vector ip indicates that the

coordinates of vector p are projected onto frame i. The components are alsowritten as a 3× 1 array,

ip =

⎡⎣ ipxipyipz

⎤⎦with the trailing x, y, z subscripts labeling each of the three projection axes.

January 7, 2009 10:21

Page 12: robotics

10 Chapter 2 Geometric modeling

ioi xp

i ypi zp p

ix

iy

iz

ioi xp

i ypi zp

p

ix

iy

iz

i xpi yp

i zpp

io

ix

iy

iz

(a) (b) (c)

Figure 2.3: Coordinates as orthogonal projections along the coordinate axes for (a) apoint, (b) a position vector, and (c) a vector offset from the origin.

Vector coordinates can also be expressed in terms of inner products,

ip =

⎡⎣ hxi, pihyi, pihzi, pi

⎤⎦where φ = 1, the identity matrix. An common alternate for the inner productnotation is the equivalent dot product notation,

ip =

⎡⎣ xi · pyi · pzi · p

⎤⎦2.3 Orthogonal matrices - basic toolsEuclidean space and rectangular coordinate frames are closely connected withthe group of special orthogonal matrices SO (3). Six distinct interpretations ofSO (3) elements are presented in three groupings:

Orientationia) frame unit vectorsib) direction cosines

Descriptorsiia) coordinate chartsiib) coordinate maps

Displacementsiiia) rotations of a frame, body, or spaceiiib) rotations of a frame, body, or space using coordinates

The three interpretations each have a coordinate-free representation in ia), iia),and iiia) and a coordinate dependent representation in ib), iib), and iiib).The multiplicity of forms shows that special orthogonal matrices have various

important applications; however, this multiplicity can also introduce confusion.

January 7, 2009 10:21

Page 13: robotics

2.3 Orthogonal matrices - basic tools 11

To facilitate the application of each interpretation we introduce a novel anddistinctive set of notation. Further, by a simple extension we can include thecoordinate-free notation as special cases of the coordinate dependent notation.The multiplicity of notation adds preciseness at the cost of there being several

ways to label an orthogonal matrix. As a pedalogical compromise for expedi-ency, in §13. we briefly introduce a working knowledge of the notation for theib) direction cosines and the iib) coordinate maps. This is followed by a dis-cussion of the important elementary direction cosine matrices in §14.. Togetherthese constitute the main tools used in subsequent analyses. A more completedevelopment follows in §15. - §25. but can be omitted on an initial reading.

12. Euclidean spaces. For Euclidean spaces the inner product ha, bi =aTφb is specified by setting φ = 1 (the identity matrix) so the orthogonal trans-formation O satisfying φ = OTφO in §8. has the property,

OTO = OOT = 1

As a consequence the inverse is given by the transpose,

O−1 = OT

For a proper orthogonal matrix the determinant is unity,

|O| = +1

In n dimensions the set of all such matrices O with the operation of matrixmultiplication is known as SO(n), the special orthogonal group or the rotationgroup. SO (n) is not a communitive group since in general OiOj 6= OjOi.The set of improper orthogonal matrices has |O| = −1 and do not form

a group since the closure property is violated, e.g. |OiOj | = +1. These areknown as reflection matrices and when combined with the elements of SO (n)form O (n), the orthogonal group whose elements have determinants ±1. SO (n)is a subgroup of O (n).Since we are primarily interested 3 dimensional Euclidean geometry we will

focus on SO (3) and simply refer to its elements as orthogonal matrices.

13. Direction cosines and coordinate map notation. The axes of framej are given by the unit vectors xj , yj , and zj . Since they are just vectors theircomponents can be specified with respect to an arbitrary frame i as ixj , iyj ,and izj where the leading subscript indicates the frame used for components.Arranging them as columns of a 3× 3 array gives an orthogonal matrix calledthe direction cosines matrix,

iOj ≡ [ ixj iyj izj ]

The physical meaning of the direction cosines matrix is that it represents theorientation, with respect to frame i, of frame j. Relative orientations of threeframes follow the product rule,

iOk = (iOj)(jOk)

January 7, 2009 10:21

Page 14: robotics

12 Chapter 2 Geometric modeling

where for emphasis the pair of cancelling subscripts is underlined.The coordinate map interpretation ijO uses the exact same matrix with a

different subscript notation

ijO = iOj

to transform the coordinates of vector p to frame i from frame j,

ip = (ijO)jp

where for emphasis the pair of cancelling subscripts is underlined. The compo-sition of successive coordinate maps follows the product rule,

ikO = (ijO)(jkO)

Example 10. The direction cosine notation is illustrated in Figure 2.4 with threeframes drawn on a cube with sides of length 2 so it easy to determine coordinates byinspection. Using frame i as a reference, the coordinates of the frame j directions are

iOj = [ ixj iyj izj ] =

⎡⎣ 0 −1 00 0 1−1 0 0

⎤⎦because xj is in the−zi direction, yj is in the−xi direction, and zj is in the yi direction.Similarly using frame j as a reference, the coordinates of the frame k directions are

jOk = [ jxk jyk jzk] =

⎡⎣ 0 0 1−1 0 00 −1 0

⎤⎦Using frame i as a reference, the coordinates of frame k are determined from theproduct rule,

[ ixk iyk izk] = iOk = (iOj) (jOk)

=

⎡⎣ 1 0 00 −1 00 0 −1

⎤⎦ =⎡⎣ 0 −1 0

0 0 1−1 0 0

⎤⎦⎡⎣ 0 0 1−1 0 00 −1 0

⎤⎦The result is readily verified by inspection since xk is in the xi direction, yk is in the−yi direction, and zk is in the −zi direction.

Example 11. The coordinate map notation is also illustrated in Figure 2.4 with thethree frames and the vector p. Using frame i as a reference, vector p is in the yi, ziplane with coordinates,

ip =

⎡⎣ 022

⎤⎦

January 7, 2009 10:21

Page 15: robotics

2.3 Orthogonal matrices - basic tools 13

ix

jx

iy

jy

jz

iz

p

kxky

kz

Figure 2.4: Frames i, j, k and vector p on a 2× 2× 2 cube.

The coordinates of p in frames j and k are determined using coordinate maps and theequivalent direction cosines from Example 2.5,

jp = (jiO) ip = (ijO)Tip = (iOj)

Tip

=

⎡⎣ 0 −1 00 0 1−1 0 0

⎤⎦T ⎡⎣ 022

⎤⎦ =⎡⎣ −2

02

⎤⎦kp = (kiO) ip = (ikO)

Tip = (iOk)

Tip

=

⎡⎣ 1 0 00 −1 00 0 −1

⎤⎦T ⎡⎣ 022

⎤⎦ =⎡⎣ 0−2−2

⎤⎦The results are readily verified by inspection of the figure.

14. Elementary direction cosines matrices. If frames i and j have acommon frame axis then the direction cosine matrix iOj simplifies considerably.The three cases shown in Figure 2.5 yield the elementary cosine matrices,

iOj = O(xi, α) = [ ixj iyj izj ] =

⎡⎣ 1 0 00 cα −sα0 sα cα

⎤⎦iOj = O(yi, β) = [ ixj iyj izj ] =

⎡⎣ cβ 0 sβ0 1 0

−sβ 0 cβ

⎤⎦iOj = O(zi, θ) = [ ixj iyj izj ] =

⎡⎣ cθ −sθ 0sθ cθ 00 0 1

⎤⎦

January 7, 2009 10:21

Page 16: robotics

14 Chapter 2 Geometric modeling

iz

iy,i jx x

jz

jycα

sα−α

α

cαsα

iz

ix ,i jy y

jz

jxsβ−

β

β

cβix iy

,i jz z

jx

jyθ θcθ

cθsθ−

(a) (b) (c)

Figure 2.5: Elementary direction cosine matrices are generated by frames with common(a) x axes, (b) y axes, and (c) z axes.

though they are better known in the literature as elementary rotation matrices2.The notation O(xi, α), for example, means that the common frame axis is givenby xi (or alternatively by xj) and that the angle between the remaining axesis α. For each matrix the pattern of cos and sin are similar except that theplacement of the − sign differs for O(yi, β).

Elementary direction cosine matrices are very important since they are usedto model the relative orientation of bodies connected together by hinges or revo-lute joints. Further, every general direction cosine matrix can be (nonuniquely)decomposed into the product three elementary direction cosine matrices to gen-erate an Euler angle representation of orientation.

Example 12. Cameras can be made to point in various directions by mounting themon a set of gimbals that permits rotations about the vertical and horizontal directions.In Figure 2.6 the vertical rotation angle is an azimuth angle θ about the commonzi, zj axes which remain fixed in space. The horizontial rotation angle is an elevationangle α about the common xj , xk axes which move with the camera. (Alternativelythese are commonly called the pan and tilt angles respectively.) Frame i representsground, frame k represents the camera, and frame j is intermediate. Using elementary

2 In this context often the transposes of these matrices are used instead. There is nodefinitive convention but the one used here is most commonly found in the robotics literature.

January 7, 2009 10:21

Page 17: robotics

2.3 Orthogonal matrices - basic tools 15

kykz

θ

iy

ix

jy

α

θ,j kx x

α

,i jz z

α

θ

kykz θ

α

,i jz z

,j kx x

Figure 2.6: Azimuth angle θ and elevation angle α specify the orientation, in frame i,of frame k via the intermediary frame j.

direction cosine matrices the relative orientations are,

iOj =

⎡⎣ cθ −sθ 0sθ cθ 00 0 1

⎤⎦jOk =

⎡⎣ 1 0 00 cα −sα0 sα cα

⎤⎦iOk = (iOj) (jOk) =

⎡⎣ cθ −sθ 0sθ cθ 00 0 1

⎤⎦⎡⎣ 1 0 00 cα −sα0 sα cα

⎤⎦=

⎡⎣ cθ −sθcα sθsαsθ cθcα −cθsα0 sα cα

⎤⎦If the lens of the camera is pointing along the yk axis then its coordinates in the groundframe i are iyk = −sθcα cθcα sα

T.

Exercise 13. Using Figure 2.5 verify that the columns of the elementary directioncosine matrices are the projections on frame i of frame j.

Exercise 14. Show that by replacing angles with their negatives it yields the inverseelementary direction cosines matrices, e.g. O(xi,−α) = O−1(xi, α).

Exercise 15. In Example 12. suppose iyk = a b cTis a desired direction for

the camera. Show that there are two such sets of azimuth-elevation angles, θ(1), α(1)

and θ(2), α(2) . Show how the two sets are related and sketch on a figure. Discuss

the occurrence of numerical problems for special cases and propose an algorithm thataddresses them.

January 7, 2009 10:21

Page 18: robotics

16 Chapter 2 Geometric modeling

2.4 Orthogonal matrices - systematic notation

15. Summary of orthogonal matrix notation. The six interpretationsof orthogonal matrices are identified with unique notations in Table 2.1 alongwith their product compositions. Their development and application follow in§16. - §21..To demonstrate notational consistency, the notation for the coordinate-

dependent cases, ia), iia), and iiia), is extended to the coordinate-free cases, ib),iib), iiib), by introducing an indeterminate subscript as a frame placeholder.

Symbol Name Definition Product notation

ia) Ojframe unitvectors

Oj ≡ [xj yj zj ] − −

ib) iOjdirectioncosines iOj ≡ [ ixj iyj izj ] iOk = (iOj)(jOk) −

iia) OTi

coordinatechart

OTi = [xi yi zi]

T − ip = (OTi ) p

iib) ijOcoordinatemap ijO ≡ OT

i Oj ikO = (ijO)(jkO) ip = (ijO) jp

iiia) Ojirotationoperator

Oji ≡ OjOTi Oki = (Okj)(Oji) pj = (Oji) pi

iiib) lOjirotation op.in frame l lOji ≡ OT

l (OjOTi )Ol lOki = (lOkj)(lOji) lpj = (lOj i) lpi

Table 2.1: Orthogonal matrix interpretations and notation. In the product notationcancelling subscripts are underlined for emphasis.

16. ia) Frame unit vectors. Frame j axes are specified by the unit vectorsxj , yj, and zj as the columns of a 3× 3 orthogonal matrix

Oj ≡£xj yj zj

¤The columns are said to be orthonormal since they have unit magnitudes andare pairwise orthogonal,

xTj xj = yTj yj = zTj zj = 1 (normality)

xTj yj = yTj zj = zTj xj = 0 (orthogonality)

Similar relations apply to the rows and together they are equivalent to

OTj Oj = OjO

Tj = 1

which satisfies the criterion for an orthogonal matrix. Since we are assuming aright-handed coordinate frame then |Oj | = +1 so it is also proper.

January 7, 2009 10:21

Page 19: robotics

2.4 Orthogonal matrices - systematic notation 17

The nine elements of the 3 × 3 matrix Oj are constrained by the six equa-tions expressing normality and orthogonality. Thus the orthogonal matrix isrepresented by 9− 6 = 3 independent quantities.Vectors xj , yj , and zj may be assumed to have Cartesian coordinates with

respect to some unspecified frame. Coordinates with respect to an explicitlyspecified frame yield direction cosines.

Remark 16. It is possible to extend the direction cosine notation in §13. and §18.to frame unit vectors by introducing a null operator, say ¤, as a place holder for anindeterminate frame to yield ¤Oj ≡ ¤ xj ¤ yj ¤ zj .

Exercise 17. Verify that the normality and orthogonality relations for xj , yj , and zjare equivalent to OT

j Oj = 1.

17. iia) Coordinate charts. The dot product a · b is between vector quan-tities is independent of any vector representation. However, if this is understoodand we assume an underlying Cartesian representation with orthogonal coordi-nate axes, then it becomes of practical advantage to use the equivalent arraynotation aT b so the components of p become

ip =

⎡⎣ ipxipyipz

⎤⎦ =⎡⎣ xi · p

yi · pzi · p

⎤⎦ =⎡⎣ xTi p

yTi pzTi p

⎤⎦=£xi yi zi

¤Tp

to yield,

ip = OTi p

where OTi is the operator that maps vector p into frame i coordinates. Topolog-

ically it is known as a coordinate chart that maps elements (e.g. vectors) ontopoints of Rn.The inverse coordinate chart operator Oi restores the vector p from its com-

ponents ip,

p = (Oi) ip

Expanding into components

p = xi (ipx) + yi (ipy) + zi (ipz)

shows that p is formed as a linear combination of the axes directions with thescalar multipliers being the components.Even though the coordinate chart and the frame unit vectors interpretations

both use the form Oi their distinct applications are noteworthy.

Remark 18. Continuing Remark 16., the coordinate map notation is extended tocoordinate charts using an indeterminate frame indicated by ¤. A vector becomes¤ p ≡ p, the coordinate chart becomes i¤O ≡ OT

i , and the mapping becomes ip =(i¤O) ¤ p with the ¤ subscript cancelling out. The inverse coordinate chart becomes¤ iO = Oi and the inverse mapping becomes ¤ p = (¤ iO) ip.

January 7, 2009 10:21

Page 20: robotics

18 Chapter 2 Geometric modeling

Remark 19. Analogous to the vector p, the element Oi is a tensor quantity and notjust a matrix of components. The product OT

i p is represented as p ·Oi in dyadic nota-tion (a vector and tensor notation) which is independent of coordinate representation.This convention will not be used to take advantage of matrix algebra.

18. ib) Direction cosines. Since the directions xj , yj , and zj of frame jare unit vectors, they can be assigned coordinates in frame i using the coordinatechart OT

i ,

ixj = OTi xj ,

iyj = OTi yj ,

izj = OTi zj

Combining the equations gives£ixj iyj izj

¤= OT

i

£xj yj zj

¤or more compactly,

iOj = OTi Oj

where iOj is defined as the direction cosine matrix,

iOj ≡£

ixj iyj izj¤

iOj is interpreted as the coordinates in frame i of the frame j directions andexpresses their relative orientation. Similar to the notation ip, the leading sub-script of iOj indicates the frame used for coordinates.The composition of direction cosine matrices is given by a very simple rule

that cancels matching adjacent subscripts,

iOk = (iOj)(jOk)

and follows directly from,

iOk = OTi Ok =

¡OTi Oj

¢ ¡OTj Ok

¢= (iOj)(jOk)

Products without matching adjacent subscripts, such as (iOj)(kOl), are stillvalid within SO (3) but don’t yield a result with a simplified notation and willnot be used often.The direction cosine inverse is given by simply reversing the subscripts,

iO−1j = jOi

which of course is just the transposed matrix iOTj .

January 7, 2009 10:21

Page 21: robotics

2.4 Orthogonal matrices - systematic notation 19

ix

iy

iz

jx

jyjz

j ix x∠ j ix y∠

j ix z∠

ix

iy

iz

jx

jyjz

i jy y∠

i jx y∠

i jz y∠

ix

iy

iz

jx

jyjz

i jz z∠

i jy z∠i jx z∠

Figure 2.7: The direction cosine angles from frame i to frame j.

Example 20. Expansion of iOj gives the explicit component form of the directioncosine matrix,

iOj = OTi Oj

= xi yi ziT

xj yj zj

=

⎡⎣ xTi xj xTi yj xTi zjyTi xj yTi yj yTi zjzTi xj zTi yj zTi zj

⎤⎦ =⎡⎣ xi · xj xi · yj xi · zj

yi · xj yi · yj yi · zjzi · xj zi · yj zi · zj

⎤⎦=

⎡⎣ cos (∠xixj) cos (∠xiyj) cos (∠xizj)cos (∠yixj) cos (∠yiyj) cos (∠yizj)cos (∠zixj) cos (∠ziyj) cos (∠zizj)

⎤⎦where, for example, ∠xixj is the angle between xi and xj . The nine angles betweeneach pairing of axes are illustrated in Figure 2.7.

Remark 21. It is emphasized that jOj = 1 because the directions of frame j are beingprojected onto itself and all of the direction cosine angles are either 0, yielding ones onthe diagonal, or π

2 , yielding zeros off the diagonals. Note that Oj ≡ [xj yj zj ] is not theidentity matrix but just represents three orthogonal unit vectors whose componentsmay be taken in any frame but are otherwise indeterminate.

Exercise 22. Using the the direction cosine matrix with general angles in Example20., derive the elementary direction cosine matrices in Figure 2.5.

Exercise 23. Show that iOj ≡ (mOi)T ( mOj) where frame m is arbitrary. That

is, relative directions cosines can be calculated from two direction cosine matricesspecified with respect to the same frame.

19. iib) Coordinate maps. Figure 2.8 shows a vector p with coordinatesexpressed in both frame i and frame j. Using the coordinate charts

ip = OTi p

jp = OTj p

January 7, 2009 10:21

Page 22: robotics

20 Chapter 2 Geometric modeling

ioi xp

i ypi zp p

ix

iy

iz

jo

j xp

j yp

j zpp

jx

jyjz

Figure 2.8: Vector p is expressed using coordinates in either frame i or frame j.

and eliminating p yields,

ip = ijO jp

whereijO ≡ OT

i Oj

is called a coordinate map.ijO transforms a vector with components in frame j to the same vector with

components in frame i. Notice that the leading j subscripts of ijO and jp areadjacent and effectively cancel out. Further, ijO is also exactly equivalent toiOj since they can both be expressed as OT

i Oj,

ijO = iOj

so there are two distinct interpretations for the same matrix.It is instructive to view the mapping as a sequence of operations,

ip = OTi p = OT

i (Oj jp)

orip←−

OTi

p←−Oj

jp

First the frame j coordinates jp are operated on by Oj to yield the vector pwhich is then projected by OT

i to the frame i coordinates ip.The leading subscripts of ijO indicate the frames of the coordinate map in

the sense i← j. Composition of coordinate maps follow a very simple rule withcancelling adjacent subscripts,

ikO =³ijO´³

jkO´

which follows from the discussion of the direction cosine matrices in §18.. Thetransformation of components from frame k to frame i is accomplished via theintermediate frame j whose subscripts cancel. This generalizes to any numberof matrices.

January 7, 2009 10:21

Page 23: robotics

2.4 Orthogonal matrices - systematic notation 21

io

ix

iy

iz

jo

jx

jy

jzjp

ip

Figure 2.9: Vector pi is transformed into pj by a rotation.

The inverse mapping is simply given by reversing the subscripts,

ijO−1 = jiO

which of course is just given by the transpose ijOT .

20. iiia) Rotations. A rotation is a rigid displacement of space where atleast one point remains stationary. However, if one point remains stationaryit can be shown that there is an entire line of stationary points called the axisof rotation. A second interpretation, instead of displacing a space, is that arotation is a mapping from one space to another.Figure 2.9 shows frame i and vector pi on the left side, and the resulting

rotation into frame j and vector pj on the right side. Since the displacementis rigid pi and pj have the same coordinate values with respect to their ownframes,

ipi = jpj

Introducing the coordinate charts

ipi = OTi pi

jpj = OTj pj

yields,

pj = Oji pi

whereOji ≡ OjO

Ti

is called a rotation operator and belongs to SO (3). It is distinct from thecoordinate map and the direction cosine forms OT

j Oi = jiO = jOi due to thelocation of the transpose operator.The mapping can also be viewed as a sequence of operations,

pj = Oj (jpj) = Oj (ipi) = Oj

¡OTi pi¢

January 7, 2009 10:21

Page 24: robotics

22 Chapter 2 Geometric modeling

orpj ←−

Ojjpj ←−

=ipi ←−

OTi

pi

First pi is mapped by the chart OTi onto frame i coordinates ipi, which is

equivalent to jpj , which is then mapped by the inverse chart Oj to vector pj .The trailing subscripts of Oji indicates the rotation of frames in the sense

j ← i. Rotation composition follows a very simple rule with cancelling adjacentsubscripts,

Oki =³Okj

´³Oji

´since (Okj) (Oji) =

¡OkO

Tj

¢ ¡OjO

Ti

¢= Oki. The rotation from frame i to frame

k is accomplished by first rotating frame i to the intermediate frame j and thenfrom frame j to frame k. This generalizes to any number of matrices.The inverse mapping is simply given by reversing the subscripts,

O−1ji = Oij

which of course is just the transpose OTji.

21. iiib) Rotations using coordinates. The rotation operator Oji is atransformation between vector quantities and not between their coordinates inany particular frame. To perform the rotation using frame l coordinates, pi andpj are mapped using coordinate chart OT

l ,

pj = Oji pi

OTl pj = OT

l Oji Ol

¡OTl pi¢

to yield

lpj = (lOji) lpi

where

lOji ≡ OTl (Oji)Ol

= OTl (OjO

Ti )Ol

and lOji is the rotation operator expressed in frame l. Rearranging the lastexpression also gives a useful form for calculations in terms of direction cosines(or coordinate maps),

lOji = ( lOj)¡lO

Ti

¢The composition of rotations is similar to the coordinate-free form,³

lOkj

´³lOji

´= lOki

except each of the rotations is expressed in frame l.

January 7, 2009 10:21

Page 25: robotics

2.4 Orthogonal matrices - systematic notation 23

1. Direction cosines 3. Rotation

iOj ≡ OTi Oj lOji ≡ OT

l OjiOl

(a) = (lOi)T (lOj) (a) = OT

l (OjOTi )Ol

(b) = ijO (b) = (lOj) (lOi)T

(c) = (jOi)T (c) = (lOij)

T

(d) iOi = 1 (d) iOji = iOj

(e) jOji = iOj

2. Coordinate map (f) lOii = 1

(a) ijO = OTi Oj (g) (iOlk) (iOkj) (iOji)

(b) = (lOi)T(lOj) = (iOji) (jOkj) (kOlk)

(c) = iOj (h) = (jOji) (kOkj) (lOlk)(d) = jiO

T

(e) iiO = 1

Table 2.2: Orthogonal matrix identities.

Remark 24. Continuing Remark 18., the coordinate-dependent rotation operator no-tation is extended to coordinate-free rotation operators using an indeterminate frameindicated by ¤. A vector becomes ¤ p ≡ p, the rotation operator becomes ¤Oji ≡ Oji,and the mapping becomes ¤ pj = (¤Oji) ¤ pi so the leading subscripts are all ¤.

Example 25. In §14. it was noted that elementary direction cosine matrices are alsoknown as elementary rotation matrices. To see the exact relationship consider therotation lOji and let l = i so we are using coordinates in frame i,

iOji = OTi (Oji)Oi = OT

i (OjOTi )Oi = OT

i Oj = iOj

Similarly if instead frame j is used instead then, jOji = iOj . Therefore if an elemen-tary rotation operator is expressed with coordinates in either the intial or terminalframes it is equivalent to an elementary direction cosine matrix.

22. Some orthogonal matrix identities. The identities in Table 2.2 re-late direction cosines, coordinate maps, and rotation operators in a given frame.Identity 3(g) relates three consecutive rotations done with respect to a “fixed”coordinate frame i, to the rotations performed in reverse order for a “moving”coordinate frame that becomes coincident with frames k, j, and i. Identity 3(h)is similar.

23. Moving frame rotations and Euler angles. The 9 components ofa 3 × 3 orthogonal matrix are constrained by 3 orthogonality conditions and3 normality conditions to yield 9 − 3 − 3 = 3 independent parameters as dis-cussed in §16.. Consequently, an orthogonal matrix can be decomposed as aproduct of three elementary rotation matrices (i.e. direction cosine matrices)with the 3 independent parameters being rotation angles. The decomposition

January 7, 2009 10:21

Page 26: robotics

24 Chapter 2 Geometric modeling

kylx

ly

φψ

θ

( )ijklx ix iy( )ijkly

( )ijklz ( )ijklz

( )jklx

( )jkly

ix iy

( )ijz

( )jklx

( )kly( )klz

jy

ix iy

( )ijz

( )jkx

( )klz

jy

(a) Successive rotations about moving frame l axes.

ψ( )ijklx ( )ijkly

( )ijklz

θkylx

ly

ixiy

( )ijz

( )jkx

( )klz

jy

( )ijkx lx

( )ijklz

( )ijky

ly

( )ijkx ( )ijy

kyly

( )ijz( )klz

φlx

(b) Successive rotations about fixed frame i axes.

kylx

ly

ix iy

( )ijz

( )jkx

( )klz

jy

kylx

ly

( )ijz( )klz

lxly

ψ−

( )ijklx( )ijkly

( )ijklz

( )ijkx

( )ijklz

( )ijkyθ−

( )ijkx

( )ijyφ−

(c) Successive rotations in the negative directions about moving frame iaxes.

Figure 2.10: (a) Moving frame rotations about zi by φ, xj by θ, and then zk by ψ.(b) Fixed frame rotations about zi by ψ, xi by θ, and zi by φ. (c) Moving framerotations about zk by −ψ, xj by −θ, and zi by −φ (right to left figures). The figureswere generated using φ = 30◦, θ = 30◦, and ψ = 60◦

is not unique and various conventions, notations, and names are common in theliterature. Two concepts are uniform, the sequence of rotations can be specifiedwith respect to a “fixed frame” or to a “moving frame”, which is also called a“body frame”.Figure 2.10(a) shows a sequence of rotations specified about a moving frame

l. In the first figure frames i, j, k, and l are coincident. For conciseness,the notation x(ijkl) means that the x axes of those frames are coincident andsimilarly for other variables with ( ) in the subscript. First we examine therotations in the moving frame l and then in §24. relate them to rotations in thefixed frame i.In Figure 2.10(a) the sequential movements are:

1. A rotation by angle φ about axis z(ijkl) displaces frames j, k, and l.2. A rotation by angle θ about axis x(jkl) displaces frames k, and l.

January 7, 2009 10:21

Page 27: robotics

2.4 Orthogonal matrices - systematic notation 25

3. A rotation by angle ψ about axis z(kl) displaces frame l.

In each case the rotation is about an axis of frame l, but for each rotationthe frame has moved to another orientation. Thus one could imagine frames i,j, and k as being markers for places that were previously occupied by movingframe l. The set (φ, θ, ψ) are known as Euler angles and are sufficient to specify,with respect to frame i, the location of (the final) frame l.

Remark 26. Common names for Euler angles are precession angle for φ, nutationangle for θ, and spin angle for ψ It is not uncommon to also find the reverse conventionwith ψ used for precession and φ for spin.. In Example 12. the precession angle wascalled the azimuth or pan angle and the nutation angle was called the elevation or tiltangle, but different symbols were used.

Remark 27. Instead of labeling the succession of moving frames as i, j, k, and l it iscommon to see a notation using primes such as l, l0, l00, and l000 so it is clear that thesame frame l is moving through different orientations.

Remark 28. In the literature there is no agreement on a standard sequence of rota-tions for Euler angles. There are 12 possible variations,

xyx yxy zxyxyz yxz zxzxzx yzx zyxxzy yzy zyz

where, for example, zxz indicates the sequence in Figure 2.10(a) but zyz is also acommon convention. The sequence zyx is known as Tait-Bryan rotations and theangles are called roll, pitch, and yaw respectively. Notice that no two consecutiveletters are the same such as xxy since consecutive rotations are about the same axis,such as in xxz, can be replaced by a single rotation equal to the sum of the two anglesto give xz.

Example 29. An expression is developed for iOli, the net rotation from frame i toframe l with frame i coordinates, in terms of rotations about the moving frame withmoving frame coordinates. The direction cosines matrix iOl is given by the productrelation,

iOl = (iOj) (jOk) (kOl)

From Table 2.2 identity 3(d) (or Example 25.) iOji = iOj and similar relations give

iOli = (iOji) (jOkj) (kOlk)

where i, j, k, and l denote the successive locations of the moving frame l. This isan example of rotation matrix multiplication that does not have the cancellation ofadjacent subscripts described in §21. but yields a simple result. Also the order of therotation matrices is reversed from what occurs when one rotates successively aboutthe fixed frame, see §21.. Note that this expression is general in the sense that it isnot necessary for the moving frame rotations to be along one of the coordinate axesas in Figure 2.10(a), though this is most common case.

January 7, 2009 10:21

Page 28: robotics

26 Chapter 2 Geometric modeling

Example 30. Continuing the previous example, in Figure 2.10(a) each of the rotationsis about a coordinate axis specified by the elementary rotation matrices (i.e. directioncosine matrices) in §14.,

iOli = (iOji) (jOkj) (kOlk)

= (iOj) (jOk) (kOl)

= O(zi, φ)O(xj , θ)O(zk, ψ)

=

⎡⎣ cφ −sφ 0sφ cφ 00 0 1

⎤⎦⎡⎣ 1 0 00 cθ −sθ0 sθ cθ

⎤⎦⎡⎣ cψ −sψ 0sψ cψ 00 0 1

⎤⎦=

⎡⎣ cφcψ − sφcθsψ −cφsψ − sφcθcψ sφsθsφcψ + cφcθsψ −sφsψ + cφcθcψ −cφsθ

sθsψ sθcψ cθ

⎤⎦Exercise 31. For Figure 2.10(a) assume that the angles are turning at the rates ofφ̇, θ̇, ψ̇ about the current φ, θ, ψ orientation. The angular velocity, with respect toframe i, of frame l is ωil = φ̇zi + θ̇xj + ψ̇zk. Let q̇≡ [φ̇ θ̇ ψ̇]T .

(a) Determine the matrix iM that transforms Euler angle rates to angular velocityusing frame i coordinates, iωil = iMq̇. Is iM an orthogonal matrix?

(b) Determine the matrix lM that transforms Euler angle rates to angular velocityusing frame l coordinates, lωil = lMq̇. Is lMq̇ an orthogonal matrix? (Hint:first use zi = zj , xj = xk, and zk = zl.)

Example 32. Exercise 33. Using Example 30. the Euler angles determine the rota-tion matrix by direct substitution. For the inverse problem develop an algorithm todetermine the Euler angles φ, θ, ψ from the components of iOli where for brevity thecomponents are written as

iOli = iOl = ixl iyl izl

=

⎡⎣ xx yx zxxy yy zyxz yz zz

⎤⎦How many solutions are there? Which values of the Euler angles can cause problemswith the algorithm? Are the problems algorithmic or geometric? If they are theformer, they can be eliminated by a more robust algorithm.

24. Fixed frame rotations. Successive fixed frame rotations have alreadybeen discussed in §20. and 21. with a simple product rule. Here we are concernedwith their connection to rotations in a moving frame.In Figure 2.10(b) the sequential movements are about frame i axes:

1. A rotation by angle ψ about axis z(ijkl) displaces frame l.

2. A rotation by angle θ about axis x(ijk) displaces frames k, and l.

3. A rotation by angle φ about axis z(ij) displaces frames j, k, and l.

January 7, 2009 10:21

Page 29: robotics

2.4 Orthogonal matrices - systematic notation 27

In each case frame i is considered fixed while frames j, k, and l rotate to otherorientations. The sequence of rotation angles, ψ, θ, φ is just the opposite ofthe moving frame case. Comparing the final panels of Figures 2.10(a) and (b)shows that all of the frames end up at identical orientations. This is not thesame thing as claiming that the rotations are communitive since they are not.That would require that the sequence of rotations and its reverse both takeplace in the fixed frame or both take place in the moving frame.

Example 34. An expression is developed for iOli, the net rotation from frame i toframe l with frame i coordinates, in terms of rotations about the fixed frame withfixed frame coordinates and follows directly from the product rule given in §21. andTable 2.1, iiib),

iOli = (iOlk) (iOkj) (iOji)

Note that only the last term in the expression, iOji, is an elementary rotation matrix.

Remark 35. Combining the results of Examples 29. and 34. yields the identity inTable 2.2 3(g),

(iOji) (jOkj) (kOlk) = (iOlk) (iOkj) (iOji)

Thus the left side sequence of moving frame rotations are equal to the right sidesequence of fixed frame rotations in the reverse order.

Example 36. Exercise 37. Express iOkj and iOlk as products of elementary rota-tion matrices.

Exercise 38. A change of coordinates for vectors from frame l to frame i is ip =(ilO) lp. For rotation matrices prove an analogous change of coordinates formula fromframe l to frame i is given by the congruence transformation,

(iOjk) = (ilO) (lOjk) (ilO)T

More generally this is also a similarity transformation since (ilO)T = (ilO)

−1.

25. Active and passive rotations With respect to frame i, the orientationof frame j can be related to rotation matrices in two ways. First assume thatframes i and j are initially coincident. In the active rotation interpretationframe i remains fixed and frame j is rotated, say for example through angleφ about z(ij). In the passive rotation interpretation frame j is held fixed andframe i is rotated backward by the same amount, given by −φ about z(ij) in theexample. In both instances the same relative orientations of the frames results.The passive interpretation is applied in Figure 2.10(c) from right to left

where frames i, j, k, and l are initially coincident at the terminal orientation.The sequence of movements is:

1. A rotation by angle −ψ about axis z(ijkl) displaces frames i, j, and k.2. A rotation by angle −θ about axis x(ijk) displaces frames i, and j.3. A rotation by angle −φ about axis z(ij) displaces frame i.

January 7, 2009 10:21

Page 30: robotics

28 Chapter 2 Geometric modeling

Thus one could imagine frames j, k, and l as being markers for places that werepreviously occupied by frame i which is now considered the moving frame whilethe initial frame l is now considered fixed. The sequence of rotation angles is(−ψ,−θ,−φ).The final relative orientation of frames i and l is the same as inFigure 2.10(a) and (b).

Example 39. Using frame i for coordinates the transformation from frame l to framei is given by the product rule for sequential rotations,

iOil = (iOij) (iOjk) (iOkl)

Inverting both sides gives

iOli = (iOlk) (iOkj) (iOji)

which is the same result found for iOli using the sequence in Figure 2.10(b). Further,as shown Remark 35. and given in Table 2.2, identity 3(g), this is equivalent to the(forward) moving frame expression,

iOli = (iOji) (jOkj) (kOlk)

and upon inverting gives the expression for the reverse moving frame,

iOil = (kOkl) (jOjk) (iOij)

Example 40. Continuing the previous example, in Figure 2.10(c) each of the rotationsis about a coordinate axis specified by the elementary rotation matrices (i.e. directioncosine matrices) in §14. but through angles in the opposite directions,

iOil = (kOkl) (jOjk) (iOij)

= (kOl) (kOj) (jOi)

= O(zi,−ψ)O(xj ,−θ)O(zi,−φ)

=

⎡⎣ c−ψ −s−ψ 0s−ψ c−ψ 00 0 1

⎤⎦⎡⎣ 1 0 00 c−θ −s−θ0 s−θ c−θ

⎤⎦⎡⎣ c−φ −s−φ 0s−φ c−φ 00 0 1

⎤⎦=

⎡⎣ cψcφ − sψcθsφ cψsφ + sψcθcφ sψsθ−sψcφ − cψcθsφ −sψsφ + cψcθcφ cψsθ

sθsφ −sθcφ cθ

⎤⎦

January 7, 2009 10:21

Page 31: robotics

2.5 Homogeneous transformation matrices - basic tools 29

2.5 Homogeneous transformation matrices - ba-sic tools

Position vectors are point-bound vectors emanating from the origin of a coor-dinate frame and can represent points. Using homogeneous coordinates theirEuclidean transformations are performed by multiplication with homogeneoustransformation matrices.Two basic applications of homogeneous transformation matrices are devel-

oped: i) the relative location of two frames and, ii) the mapping of positionvectors between frames. A third application for rigid body displacements is de-ferred. The discussion largely follows and extends Section 2.3 but adds positionto orientation.

26. Homogeneous coordinates. Infinity is an important concept in alge-bra and geometry but presents challenges when using coordinates since ∞ isnot a number. Homogeneous coordinates represent infinite quanitities using or-dinary finite numbers by introducing an additional coordinate and then onlyattaching a meaning to the ratio of coordinates. Beyond this, homogeneouscoordinates enable a balanced treatment dual geometrical elements similar tothe representation of vectors and covectors. They also enable a clear notationaldistinction between position vectors and free vectors. There are many forms ofhomogeneous coordinates which differ by normalization conventions and includebarycentric and areal coordinates.As an example consider the equation of a circle

x2 + y2 + ax+ by + c = 0

where in this section we are temporarily using (x, y) for a point on a plane andnot as unit vectors. Introducing the substitutions,

x =xw, y =

yw

and clearing fractions yields,

x2 + y2 + axw+ byw+w2 = 0

The equation is homogeneous in the sense that each term has the same de-gree (2nd degree) in (x,y,w) which are called homogeneous coordinates. Theoriginal equation and variables (x, y) are referred to as inhomogeneous. Thehomogeneous coordinates are not unique but can be scaled by any λ 6= 0 since(λx, λy, λw) yield the same ratios and thus the same (x, y). Therefore we onlyattach a meaning to ratios such as x

y ,xw , . . . and not to the individual coordi-

nates themselves. The equation is restored to its inhomgeneous form by dividingthrough with w2 and making the substitutions for x and y, or more simply bysetting w = 1 and changing x and y to x and y. Homogeneous coordinates ofthe form (x,y, 1) or equivalently (x, y, 1) are said to be normalized.

January 16, 2009 10:46

Page 32: robotics

30 Chapter 2 Geometric modeling

W=113W=

W 0→∞

YX

(a) (b)

Figure 2.11: (a) Points generated along a line to infinity, (b) Parallel lines intersectingin a point at infinity.

For points in the space there are four homogeneous coordinates (x,y, z,w)with

x =xw, y =

yw, y =

zw

Homogeneous coordinates of points are used frequently in projective geom-etry, computer graphics, and machine vision applications. In latter sections wewill only make limited use of them directly and instead focus on the propertiesof homogeneous transformation matrices.

Example 41. When w → 0 the ratios (x, y) = xw ,

yw become infinite but the ratio

yx is generally finite. To investigate this give x and y fixed values and let w varycontinuously from 1 to 0. In Figure 2.11(a) this generates points on a line with slopeyx . When w = 0 the point (x,y, 0) is infinitely distant from the origin.

Example 42. Two lines in a plane always intersect in a single finite point unless theyare parallel. Figure 2.11(b) shows a fixed line and a line that is rotated. As the twolines become parallel the intersection point becomes infinitely distant. In fact all lineswith the same slope intersect at this point. Using points at infinity we can say withoutqualification that two lines in the plane always intersect in a single point. This leadsto two interpretations for (x,y, 0). First it denotes a point that is infinitely distant inthe direction y

x and second it can be used to simply denote the direction itself.

Remark 43. A standard notation to refer to the ratio of homogeneous coordinates is(x : y : z : w). This convention avoids using fractions to denote specific ratios such asxy ,

xw , . . . .

Remark 44. With respect to the Euclidean metric, finite points in space have thenormalized homogeneous coordinates (x,y, z, 1) and infinitely distant points have thenormalized form (x,y, z, 0) with x2+y2+z2 = 1.

Remark 45. In the Euclidean plane the set of infinitely distant points lie on the lineat infinity whose equation is simply w = 0. If infinity is approached along the twodirections of an ordinary line the same point at infinity is reached, that is we associate+∞ and −∞ on a line with a single point. If they were separate points, for example,then a pair of parallel lines would intersect in two points creating an exception to theintersection property. In Euclidean space the set of infinitely distant points lie on theplane at infinity whose equation is w = 0.

January 16, 2009 10:46

Page 33: robotics

2.5 Homogeneous transformation matrices - basic tools 31

Exercise 46. In Figure 2.11(b) let the parallel lines have the form ax+by+ci =0, i = 1, 2. Show that the intersection point is (−b,a, 0). What is the geometricinterpretation of (a,b) if a2+b2 = 1?

Exercise 47. Show that every circle in the plane contains the two circular points atinfinity, (1 : i : 0) and (1 : −i : 0), where i is the imaginary unit.

Exercise 48. Two conic sections in the plane always intersect in four points providedthe counting includes points that are finite, imaginary, repeated, and/or infinitelydistant. Analytically show that two circles can never meet in more that two realpoints. Also prove it by a synthetic argument without equations using Exercise 47..

Example 49. In planar geometry the equation

ax+ by + c = 0

is usually recognized as the equation of a line by assuming that (a,b,c) are fixedparameters and (x, y) are variables. The set of all such points that satisfies the equationis called the locus of a line, that is the set of all points that are coincident with someline, Figure 2.12(a). Instead of using an equation to specify a line it is equivalentto give the values (a,b,c) which are called homogeneous line coordinates since theirratios (a : b : c) uniquely determine the line. Conversely, consider that (x, y) are fixedparameters and that (a,b,c) are variables. The set of all such lines that satisfies theequation is called the envelope of a point, that is the set of all lines that are coincidentwith some point, Figure 2.12(b). Instead of using the point coordinates (x, y) to specifya point it is equivalent to specify the equation.The equation is made symmetrical by introducing point coordinates homogeneous,

ax+ by + cw = 0

so point coordinates and line coordinates have equal standing. Forms of this typeare the basis for duality in geometry and homogeneous coordinates are best suited toexpress dual relations.For constrast, the equation can be made more symmetrical than the original by intro-ducing inhomogeneous line coordinates (a, b),

ax+ by + 1 = 0

wherea ≡ a

c, b ≡ b

cUnfortunately a line through the origin requires c = 0 and thus a → ∞, b → ∞ sothis form is rarely used. That is analogous with points at infinity where w = 0 andx→∞, y →∞.

27. Location and frame mapping notation. Just as direction cosine ma-trices specify the relative orientation between two frames (or bodies or spaces),homogeneous transformation matrices specify the relative orientation and po-sition between two frames. Together orientation and position is one way of

January 16, 2009 10:46

Page 34: robotics

32 Chapter 2 Geometric modeling

(a) (b)

Figure 2.12: (a) Locus of points on a line. (b) Envelope of lines on a point.

specifying relative location. This section is analogous to the summary in §13.for orthogonal matrices.Figure 2.13 shows two frames. Their relative orientation is given by the

direction cosines [ixj iyj izj ] and the relative position of origin oj in frame icoordinates is given by the position vector ip(oioj). Introducing homogeneouscoordinates and assembling into a 4 × 4 matrix yields the homogeneous trans-formation matrix

iBj ≡∙

ixj iyj izj ip(oioj)0 0 0 1

¸

jo

jx

jyjz

io

ix

iy

iz

( )i jp oo

Figure 2.13: Frame i and is used to locate frame j axes directions and origin position.

With respect to frame i, iBj represents the location of frame j. The first threecolumns specify orientation and the last column specifies is the location of originpoint oj . A more compact is

iBj ≡∙

iOj ip(oioj)0 1

¸ µ∙3× 3 3× 11× 3 1× 1

¸¶with the dimensions of the matrix blocks shown.The composition rule is

iBk = (iBj)(jBk)

where for emphasis the cancelling subscripts are underlined. The inverse map

January 16, 2009 10:46

Page 35: robotics

2.5 Homogeneous transformation matrices - basic tools 33

is

iB−1j =

∙iO

Tj − iO

Tj ip(oioj)

0 1

¸and also iB

−1j = jBi.

To develop the frame mapping, Figure 2.14 shows frames i and j, an arbitrarypoint c, and three position vectors related by the vector addition

p(oic) = p(oioj) + p(ojc)

jo

jx

jyjz

io

ix

iy

iz

( )i jp o o

c ( )jp o c( )ip o c

Figure 2.14: Position vectors from origins oi and oj to point c.

Expressing the vectors in frame i and then mapping p(ojc) to frame j gives,

ip(oic) = ip(oioj) + ip(ojc)

ip(oic) = ip(oioj) + ijO jp(ojc)

or the product form,

iP (c) = ijB jP (c)

where

iP (c) =

∙ip(oic)1

¸, jP (c) =

∙jp(ojc)1

¸ijB =

∙ijO ip(oioj)0 1

¸iP (c) iP (c) and jP (c) are the normalized homogeneous coordinates of the posi-tion vectors to point c and the leading subscripts indicate the coordinate framedirections and origin. Since ijO = iOj we immediately have

ijB = iBj

so the exact same matrix is used with two subscript notations to indicate twodistinct meanings.

January 16, 2009 10:46

Page 36: robotics

34 Chapter 2 Geometric modeling

A free vector does not have a specific location so a frame mapping onlyaffects the orientation aspect. For example the direction jxj maps as∙

ixj0

¸= ijB

∙jxj0

¸so it is unaffected by the separation of the origins p(oioj). If the free vector isinterpreted as an infinitely distant point then changing the frame origin fromone finite point to another does not change its infinite distance.Coordinate maps follow composition rule,

ikB = (ijB)(jkB)

where for emphasis the pair of cancelling subscripts is underlined. The inversemap is given by

ijB−1 =

∙ijO

T − ijOTip(oioj)

0 1

¸which also can be expressed as at ijB−1 = jiB.

Exercise 50. Use iOk = (iOj)(jOk) to verify the product rule iBk = (iBj)(jBk).

January 16, 2009 10:46


Recommended