Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

6.

Representing Rotation
Mechanics of Manipulation
Matt Mason
matt.mason@cs.cmu.edu

http://www.cs.cmu.edu/~mason

Carnegie Mellon

Lecture 6. Mechanics of Manipulation – p.1


Lecture 6. Representing Rotation.

Chapter 1 Manipulation 1 Chapter 5 Rigid Body Statics 93 Chapter 8 Dynamics 181


1.1 Case 1: Manipulation by a human 1 5.1 Forces acting on rigid bodies 93 8.1 Newton’s laws 181
1.2 Case 2: An automated assembly system 3 5.2 Polyhedral convex cones 99 8.2 A particle in three dimensions 181
1.3 Issues in manipulation 5 5.3 Contact wrenches and wrench cones 102 8.3 Moment of force; moment of momentum 183
1.4 A taxonomy of manipulation techniques 7 5.4 Cones in velocity twist space 104 8.4 Dynamics of a system of particles 184
1.5 Bibliographic notes 8 5.5 The oriented plane 105 8.5 Rigid body dynamics 186
Exercises 8 5.6 Instantaneous centers and Reuleaux’s method 109 8.6 The angular inertia matrix 189
5.7 Line of force; moment labeling 110 8.7 Motion of a freely rotating body 195
Chapter 2 Kinematics 11 5.8 Force dual 112 8.8 Planar single contact problems 197
2.1 Preliminaries 11 5.9 Summary 117 8.9 Graphical methods for the plane 203
2.2 Planar kinematics 15 5.10 Bibliographic notes 117 8.10 Planar multiple-contact problems 205
2.3 Spherical kinematics 20 Exercises 118 8.11 Bibliographic notes 207
2.4 Spatial kinematics 22 Exercises 208
2.5 Kinematic constraint 25 Chapter 6 Friction 121
2.6 Kinematic mechanisms 34 6.1 Coulomb’s Law 121 Chapter 9 Impact 211
2.7 Bibliographic notes 36 6.2 Single degree-of-freedom problems 123 9.1 A particle 211
Exercises 37 6.3 Planar single contact problems 126 9.2 Rigid body impact 217
6.4 Graphical representation of friction cones 127 9.3 Bibliographic notes 223
Chapter 3 Kinematic Representation 41 6.5 Static equilibrium problems 128 Exercises 223
3.1 Representation of spatial rotations 41 6.6 Planar sliding 130
3.2 Representation of spatial displacements 58 6.7 Bibliographic notes 139 Chapter 10 Dynamic Manipulation 225
3.3 Kinematic constraints 68 Exercises 139 10.1 Quasidynamic manipulation 225
3.4 Bibliographic notes 72 10.2 Brie y dynamic manipulation 229
Exercises 72 Chapter 7 Quasistatic Manipulation 143 10.3 Continuously dynamic manipulation 230
7.1 Grasping and fixturing 143 10.4 Bibliographic notes 232
Chapter 4 Kinematic Manipulation 77 7.2 Pushing 147 Exercises 235
4.1 Path planning 77 7.3 Stable pushing 153
4.2 Path planning for nonholonomic systems 84 7.4 Parts orienting 162 Appendix A Infinity 237
4.3 Kinematic models of contact 86 7.5 Assembly 168
4.4 Bibliographic notes 88 7.6 Bibliographic notes 173
Exercises 88 Exercises 175

Lecture 6. Mechanics of Manipulation – p.2


Outline.
• Generalities
• Axis-angle
• Rodrigues’s formula
• Rotation matrices
• Euler angles

Lecture 6. Mechanics of Manipulation – p.3


Why representing rotations is hard.
• Rotations do not commute.
• The topology of spatial rotations does not permit a smooth
embedding in Euclidean three space.

Lecture 6. Mechanics of Manipulation – p.4


Choices
• More than three numbers
• Rotation matrices
• Unit quaternions. (aka Euler parameters)
• Many-to-one
• Axis times angle (matrix exponential)
• Unsmooth and many-to-one
• Euler angles
• Unsmooth and many-to-one and more than three numbers
• Axis-angle

Lecture 6. Mechanics of Manipulation – p.5


Axis-angle
Recall Euler’s theorem: every spatial
rotation leaves a line of fixed points:
the rotation axis. n
Let O, n̂, θ, be . . .
Let rot(n̂, θ) be the correspond-
ing rotation.
Many to one:
rot(−n̂, −θ) = rot(n̂, θ)
rot(n̂, θ + 2kπ) = rot(n̂, θ), for any
integer k .
When θ = 0, the rotation axis is
indeterminate, giving an infinity-
to-one mapping.

Lecture 6. Mechanics of Manipulation – p.6


Representation
What do we want from a representation? For a start:
• Rotate points;
Rodrigues’s formula
• Compose rotations;
Using axis-angle? Ugh.
• (Convert to other representations.)

Lecture 6. Mechanics of Manipulation – p.7


Rodrigues’s formula
Others derive Rodrigues’s formula us-
ing rotation matrices, missing the ge- n
n n x
ometrical aspects.
Given point x, decompose into n x
components parallel and x
perpendicular to the rotation axis
nn x
x
x = n̂(n̂ · x) − n̂ × (n̂ × x)

Only x⊥ is affected by the O


rotation, yielding Rodrigues’s
formula:

x0 = n̂(n̂·x)+sin θ (n̂×x)−cos θ n̂×(n̂×x)

A common variation:

x0 = x+(sin θ) n̂×x+(1−cos θ) n̂×(n̂×x)


Lecture 6. Mechanics of Manipulation – p.8
Rotation matrices
Choose O on rotation axis. Choose frame (û1 , û2 , û3 ).
Let (û01 , û02 , û03 ) be the image of that frame.
Write the û0i vectors in ûi coordinates, and collect them in a
matrix:

û1 · û1
   0

a11
û01 =  a21  =  û2 · û01 
   

a31 û3 · û01


û1 · û2
   0

a12
û02 =  a22  =  û2 · û02 
   

a32 û3 · û02


û1 · û3
   0

a13
û03 =  a23  =  û2 · û03 
   

a33 û3 · û03


Lecture 6. Mechanics of Manipulation – p.9
So many numbers
A rotation matrix has nine numbers,
but spatial rotations have only three degrees of freedom,
leaving six excess numbers . . .
There are six constraints that hold among the nine numbers.

|û01 | = |û02 | = |û03 | = 1


û03 = û01 × û02

i.e. the û0i are unit vectors forming a right-handed coordinate


system.
Such matrices are called orthonormal or rotation matrices.

Lecture 6. Mechanics of Manipulation – p.10


Rotating a point
Let (x1 , x2 , x3 ) be coordinates of x in frame (û1 , û2 , û3 ).
Then x0 is given by the same coordinates taken in the (û01 , û02 , û03 )
frame:

x0 =x1 û01 + x2 û02 + x3 û03


=x1 Aû1 + x2 Aû2 + x3 Aû3
=A(x1 û1 + x2 û2 + x3 û3 )
=Ax

So rotating a point is implemented by ordinary matrix


multiplication.

Lecture 6. Mechanics of Manipulation – p.11


Rotating a point
Let A and B be coordinate frames. Notation:
x a point
x a geometrical vector, directed from an origin O to the point x;
or, a vector of three numbers, representing x in an unspecified
frame
A
x a vector of three numbers, representing x in the A frame

AR be the rotation matrix that rotates frame B to frame A.


Let B

AR represents the rotation of the point


Then (see previous slide) B
x:
x =B
B 0
AR x
B

Note presuperscripts all match. Both points, and xform, must be


written in same coordinate frame.

Lecture 6. Mechanics of Manipulation – p.12


Coordinate transform
There is another use for B
AR:
A
x and B x represent the same point, in frames A and B resp.
To transform from A to B :
B
x=B
AR A
x

For coord xform, matrix subscript and vector superscript


“cancel”.

Rotation from B to A is the same as coordinate transform from A to

B.

Lecture 6. Mechanics of Manipulation – p.13


Example rotation matrix
 
B
AR = B
xA B
yA B
zA
 
1 0 0
= 0 0 −1 
 

0 1 0

How to remember what B AR does?


Pick a coordinate axis and see. The
x axis isn’t very interesting, so try y :
    
1 0 0 0 0
 0 0 −1   1  =  0 
    

0 1 0 0 1

Lecture 6. Mechanics of Manipulation – p.14


Nice things about rotation matrices
• Composition of rotations: {R1 ; R2 } = R2 R1 .
({x; y} means do x then do y .)
• Inverse of rotation matrix is its transpose B
AR
−1
BR = AR .
=A B T

• Coordinate xform of a rotation matrix:


B
R=B
AR A A
R BR

Lecture 6. Mechanics of Manipulation – p.15


Converting rot(n̂, θ) to R
Ugly way: define frame with ẑ aligned with n̂, use coordinate
xform of previous slide.
Keen way: Rodrigues’s formula!

x0 = x + (sin θ) n̂ × x + (1 − cos θ) n̂ × (n̂ × x)

Define “cross product matrix” N :


 
0 −n3 n2
N =  n3 0 −n1 
 

−n2 n1 0

so that
N x = n̂ × x

Lecture 6. Mechanics of Manipulation – p.16


. . . using Rodrigues’s formula . . .
Substituting the cross product matrix N into Rodrigues’s
formula:
x0 = x + (sin θ)N x + (1 − cos θ)N 2 x
Factoring out x

R = I + (sin θ)N + (1 − cos θ)N 2

That’s it! Rodrigues’s formula in matrix form. If you want to you


could expand it:
 
n21 + (1 − n21 )cθ n1 n2 (1 − cθ) − n3 sθ n1 n3 (1 − cθ) + n2 sθ
 n1 n2 (1 − cθ) + n3 sθ n22 + (1 − n22 )cθ n2 n3 (1 − cθ) − n1 sθ 
 

n1 n3 (1 − cθ) − n2 sθ n2 n3 (1 − cθ) + n1 sθ n23 + (1 − n23 )cθ

where cθ = cos θ and sθ = sin θ. Ugly.

Lecture 6. Mechanics of Manipulation – p.17


Rodrigues’s formula for differential rotations
Consider Rodrigues’s formula for a differential rotation rot(n̂, dθ).

x0 =(I + sin dθN + (1 − cos dθ)N 2 )x


=(I + dθN )x

so

dx =N x dθ
=n̂ × x dθ

It follows easily that differential rotations are vectors: you can scale
them and add them up. We adopt the convention of representing
angular velocity by the unit vector n̂ times the angular velocity.

Lecture 6. Mechanics of Manipulation – p.18


Converting from R to rot(n̂, θ) . . .
Problem: n̂ isn’t defined for θ = 0.
We will do it indirectly. Convert R to a unit quaternion (next
lecture), then to axis-angle.

Lecture 6. Mechanics of Manipulation – p.19


Euler angles
Three numbers to describe
spatial rotations. ZY Z z
convention:
z
(α, β, γ) 7→ rot(γ, ẑ00 ) rot(β, ŷ0 ) rot(α, ẑ) y

Can we represent an arbitrary x


rotation? y
Rotate α about ẑ until
ŷ0 ⊥ ẑ000 ; x
Rotate β about ŷ0 until
ẑ00 k ẑ000 ;
Rotate γ about ẑ00 until
ŷ00 = ŷ000 .
Note two choices for ŷ0 . . .
. . . except sometimes infinite
choices. Lecture 6. Mechanics of Manipulation – p.20
From (α, β, γ) to R
Expand rot(α, ẑ) rot(β, ŷ) rot(γ, ẑ)
(Why is that the right order?)

cα −sα 0 cβ 0 s β cγ −sγ 0
   

 sα cα 0   0 1 0   sγ cγ 0 
   

0 0 1 − sβ 0 c β 0 0 1

cα cβ cγ − sα sγ −cα cβ sγ − sα cγ cα sβ
 

=  sα cβ cγ + cα sγ −sα cβ sγ + cα cγ sα sβ  (1)
 

− sβ cγ sβ sγ cβ

Lecture 6. Mechanics of Manipulation – p.21


From R to (α, β, γ) the ugly way
Case 1: r33 = 1, β = π . α − γ is indeterminate.
 
cos(α + γ) − sin(α + γ) 0
R =  sin(α + γ) cos(α + γ) 0 
 

0 0 1

Case 2: r33 = −1, β = −π . α + γ is indeterminate.


 
− cos(α − γ) − sin(α − γ) 0
R =  − sin(α − γ) cos(α − γ) 0 
 

0 0 1

For generic case: solve 3rd column for β . (Sign is free choice.)
Solve third column for α and third row for γ .
. . . but there are numerical issues . . .
Lecture 6. Mechanics of Manipulation – p.22
From R to (α, β, γ) the clean way
Let

σ =α+γ
δ =α−γ

Then

r22 + r11 = cos σ(1 + cos β)


r22 − r11 = cos δ(1 − cos β)
r21 + r12 = sin δ(1 − cos β)
r21 − r12 = sin σ(1 + cos β)

(No special cases for cos β = ±1?)


Solve for σ and δ , then for α and γ , then finally
−1
β= tan
Lecture 6. (r13 cos α + r23 sin α, r33 ) Mechanics of Manipulation – p.23
Next: Quaternions.

Chapter 1 Manipulation 1 Chapter 5 Rigid Body Statics 93 Chapter 8 Dynamics 181


1.1 Case 1: Manipulation by a human 1 5.1 Forces acting on rigid bodies 93 8.1 Newton’s laws 181
1.2 Case 2: An automated assembly system 3 5.2 Polyhedral convex cones 99 8.2 A particle in three dimensions 181
1.3 Issues in manipulation 5 5.3 Contact wrenches and wrench cones 102 8.3 Moment of force; moment of momentum 183
1.4 A taxonomy of manipulation techniques 7 5.4 Cones in velocity twist space 104 8.4 Dynamics of a system of particles 184
1.5 Bibliographic notes 8 5.5 The oriented plane 105 8.5 Rigid body dynamics 186
Exercises 8 5.6 Instantaneous centers and Reuleaux’s method 109 8.6 The angular inertia matrix 189
5.7 Line of force; moment labeling 110 8.7 Motion of a freely rotating body 195
Chapter 2 Kinematics 11 5.8 Force dual 112 8.8 Planar single contact problems 197
2.1 Preliminaries 11 5.9 Summary 117 8.9 Graphical methods for the plane 203
2.2 Planar kinematics 15 5.10 Bibliographic notes 117 8.10 Planar multiple-contact problems 205
2.3 Spherical kinematics 20 Exercises 118 8.11 Bibliographic notes 207
2.4 Spatial kinematics 22 Exercises 208
2.5 Kinematic constraint 25 Chapter 6 Friction 121
2.6 Kinematic mechanisms 34 6.1 Coulomb’s Law 121 Chapter 9 Impact 211
2.7 Bibliographic notes 36 6.2 Single degree-of-freedom problems 123 9.1 A particle 211
Exercises 37 6.3 Planar single contact problems 126 9.2 Rigid body impact 217
6.4 Graphical representation of friction cones 127 9.3 Bibliographic notes 223
Chapter 3 Kinematic Representation 41 6.5 Static equilibrium problems 128 Exercises 223
3.1 Representation of spatial rotations 41 6.6 Planar sliding 130
3.2 Representation of spatial displacements 58 6.7 Bibliographic notes 139 Chapter 10 Dynamic Manipulation 225
3.3 Kinematic constraints 68 Exercises 139 10.1 Quasidynamic manipulation 225
3.4 Bibliographic notes 72 10.2 Brie y dynamic manipulation 229
Exercises 72 Chapter 7 Quasistatic Manipulation 143 10.3 Continuously dynamic manipulation 230
7.1 Grasping and fixturing 143 10.4 Bibliographic notes 232
Chapter 4 Kinematic Manipulation 77 7.2 Pushing 147 Exercises 235
4.1 Path planning 77 7.3 Stable pushing 153
4.2 Path planning for nonholonomic systems 84 7.4 Parts orienting 162 Appendix A Infinity 237
4.3 Kinematic models of contact 86 7.5 Assembly 168
4.4 Bibliographic notes 88 7.6 Bibliographic notes 173
Exercises 88 Exercises 175

Lecture 6. Mechanics of Manipulation – p.24

You might also like