Read Lecture 6. Representing Rotation text version

Lecture 6. Representing Rotation

Kinematic representation: goals, overview

Lecture 6. Representing Rotation

Matthew T. Mason

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Mechanics of Manipulation Spring 2012

Today's outline

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Readings, etc.

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements

We are starting chapter 3 of the text. Lots of stuff online on representing rotations. Murray, Li, and Sastry for matrix exponential. Roth, Crenshaw, Ohwovoriole, Salamin, all cited in text.

Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Analytic geometry

So far, Euclidean geometry. Why?

Insight. Visualization. Economy of expression.

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices

Now Cartesian, analytic geometry. Why?

Beyond 2D, beyond 3D. We need to work with high dimensional configuration spaces! For implementation. For additional insight. The best of all possible worlds: use both. Understand geometrical or physical meaning for all terms.

Euler angles

Agenda for kinematic representation

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements

Following the kinematic agenda:

Planar displacements. Spherical displacements. Spatial displacements. Constraints.

Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Representing planar displacements

Obvious idea 1

Displacement is rotation or translation. ^ ^ Choose a coordinate frame (O, x , y ). For rotation, (center, angle), i.e. ((x, y ), ). For translation, (x , y ). Ugly!

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Obvious idea 2

Given O, displacement is rotation about O; translation. ^ ^ Choose a coordinate frame (O, x , y ). (x , y , ).

What are representations for?

Obvious ideas didn't yield homogeneous coordinate transform matrices? We didn't consider all the uses of representations!

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle

Uses of representations

Communicate with humans and computers. Operate on points, lines and stuff. Compose. Sample, interpolate, average, smooth. Differentiate, integrate.

Rodrigues's formula Rotation matrices Euler angles

Operating on stuff

Lecture 6. Representing Rotation

Kinematic representation: goals, overview

(x , y , ) is good for communication. How would you operate on points? Composition? Averaging? Sampling? To operate on points:

Represent points by Cartesian coordinates: (x, y ). Rotate using rotation matrix. Translate using component-wise addition. Tidy it up using homogeneous coordinates. We will revisit later.

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Why representing rotations is hard.

Lecture 6. Representing Rotation

Kinematic representation: goals, overview

Rotations do not commute. Vectors are out. For computation we like to represent things with real numbers, so our representations all live in Rn . Even though SO(3) is a three-dimensional space, it has the topology of projective three space P3 , which cannot be smoothly mapped to R3 . And, we have lots of different applications, with different requirements: communication, operating on things, composition, interpolation, etc.

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Choices

Lecture 6. Representing Rotation

Kinematic representation: goals, overview

Axis-angle.

Good for communication, geometrical insight;

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Rotation matrices

Good for operating on stuff, composition, analytical insight;

Unit quaternions. (aka Euler parameters)

Good for composition, analytical insight, sampling;

Euler angles

Good for communication, geometrical insight.

Axis-angle

Euler's theorem: every spatial rotation has a rotation axis. ^ Let O, n, , be . . . ^ Let rot(n, ) be the corresponding rotation. Many to one:

^ ^ rot(-n, -) = rot(n, ) ^ ^ rot(n, + 2k ) = rot(n, ), for any integer k . So, restrict to [0, ]. But not smooth at the edges. When = 0, the rotation axis is indeterminate, giving an infinity-to-one mapping. ^ Again you can fix by adopting a convention for n, but result is not smooth. ^ (Or, what about using the product, n? Later.)

Lecture 6. Representing Rotation

n

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

What do we want from axis-angle?

Lecture 6. Representing Rotation

Kinematic representation: goals, overview

Operate on points.

Rodrigues's formula.

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Compose rotations, average, interpolate, sampling, . . .?

Not using axis-angle.

Convert to other representations? There aren't any yet. But, later we will use axis-angle big time. It's very close to quaternions.

Rodrigues's formula

Others derive Rodrigues's formula using rotation matrices: ugly and messy. The geometrical approach is clean and insightful. Given point x, decompose into components parallel and perpendicular to the rotation axis ^ ^ ^ ^ x = n(n · x) - n × (n × x) Only x is affected by the rotation, yielding Rodrigues's formula: ^ ^ ^ ^ ^ x = n(n·x)+sin (n×x)-cos n×(n×x) A common variation: ^ ^ ^ x = x+(sin ) n×x+(1-cos ) n×(n×x)

n n x n n x x

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

nn x

x

O

Rotation matrices

Choose O on rotation axis. Choose frame ^ ^ ^ (u1 , u2 , u3 ). ^ ^ ^ Let (u1 , u2 , u3 ) be the image of that frame. ^ ^ Write the ui vectors in ui coordinates, and collect them in a matrix: ^ ^ a11 u1 · u1 ^ ^ ^ u1 = a21 = u2 · u1 ^ ^ a31 u3 · u1 ^ ^ a12 u1 · u2 ^ ^ ^ u2 = a22 = u2 · u2 ^ ^ a32 u3 · u2 ^ ^ a13 u1 · u3 ^ ^ ^ u3 = a23 = u2 · u3 ^ ^ a33 u3 · u3 ^ ^ ^ A = aij = u1 |u2 |u3

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

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. ^ ^ ^ |u1 | = |u2 | = |u3 | = 1 ^ ^ ^ u3 = u1 × u2 ^ i.e. the ui are unit vectors forming a right-handed coordinate system. Such matrices are called orthonormal or rotation matrices.

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Rotating a point

Let (x1 , x2 , x3 ) be coordinates of x in frame ^ ^ ^ (u1 , u2 , u3 ). Then x is given by the same coordinates taken in ^ ^ ^ the (u1 , u2 , u3 ) frame: ^ ^ ^ x =x1 u1 + x2 u2 + x3 u3 ^ ^ ^ =x1 Au1 + x2 Au2 + x3 Au3 ^ ^ ^ =A(x1 u1 + x2 u2 + x3 u3 ) =Ax So rotating a point is implemented by ordinary matrix multiplication.

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Sub- and superscript notation for rotating a point

Lecture 6. Representing Rotation

Kinematic representation: goals, overview

Let A and B be coordinate frames. Let A x be coordinates in frame A. Let be the rotation matrix that rotates frame B to frame A. Then (see previous slide) BR represents the rotation A of the point x: B x = BR B x A Note presuperscripts all match. Both points, and xform, must be written in same coordinate frame.

BR A

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Coordinate transform

Lecture 6. Representing Rotation

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

B Ax

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices

x=

B A AR x

Euler angles

For coord xform, matrix subscript and vector superscript "cancel". Rotation from B to A is the same as coordinate transform from A to B.

Example rotation matrix

Lecture 6. Representing Rotation

B AR

=

Bx

A

By A

Bz

Kinematic representation: goals, overview

A

1 0 0 = 0 0 -1 0 1 0 How to remember what BR does? Pick a 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

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Nice things about rotation matrices

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle

Composition of rotations: {R1 ; R2 } = R2 R1 . ({x; y } means do x then do y .) Inverse of rotation matrix is its transpose BR -1 = AR = BR T . B A A Coordinate xform of a rotation matrix:

B

Rodrigues's formula Rotation matrices Euler angles

R = BR A R AR A B

^ Converting rot(n, ) to R

^ Ugly way: define frame with ^ aligned with n, use z coordinate xform of previous slide. Keen way: Rodrigues's formula! ^ ^ ^ x = x + (sin ) n × x + (1 - cos ) n × (n × x) Define "cross product matrix" N: 0 -n3 n2 0 -n1 N = n3 -n2 n1 0 so that ^ Nx = n × x

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

. . . using Rodrigues's formula . . .

Substituting the cross product matrix N into Rodrigues's formula: x = x + (sin )Nx + (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:

2 2 n1 + (1 - n1 )c n1 n2 (1 - c) + n3 s n1 n3 (1 - c) - n2 s

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

n1 n2 (1 - c) - n3 s 2 2 n2 + (1 - n2 )c n2 n3 (1 - c) + n1 s

n1 n3 (1 - c) + n2 s n2 n3 (1 - c) - n1 s 2 2 n3 + (1 - n3 )c

where c = cos and s = sin . Ugly.

Rodrigues's formula for differential rotations

Consider Rodrigues's formula for a differential rotation ^ rot(n, d). x =(I + sin dN + (1 - cos d)N 2 )x =(I + dN)x so dx =Nx 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. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

^ Converting from R to rot(n, ) . . .

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview

^ Problem: n isn't defined for = 0. We will do it indirectly. Convert R to a unit quaternion (next lecture), then to axis-angle.

Axis-angle Rodrigues's formula Rotation matrices Euler angles

Euler angles

Three numbers to describe spatial rotations. ZYZ convention: ^ (, , ) rot(, ^ ) rot(, y ) rot(, ^) z z Can we represent an arbitrary rotation? Rotate about ^ until z ^ y ^ ; z ^ Rotate about y until ^ ^ ; z z Rotate about ^ until z ^ ^ y =y . ^ Note two choices for y . . . . . . except sometimes infinite choices.

Lecture 6. Representing Rotation

Kinematic representation: goals, overview

z z

Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

x y x

Converting from Euler angles to rotation matrices

notation

Define frames {0}, {1}, {2}, {3} so that ^ rot(, z) maps {0} to {1}, etc., As before is the rotation matrix rotating frame {i} to frame {j}, written in frame {i} coordinates. Let k(ij R) be the same matrix, written in frame {k } coordinates. Then the correct sequence, written in a common coordinate frame, would be

0 3R iR j

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

= 0 (2 R) 0 (1R) 0 (0 R) 3 2 1

Moving frame versus fixed frame

Switch to moving frame

Use the coordinate transform of a matrix formula:

0 3R

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

= = =

0 2 (3 R) 0 (1 R) 0 R 2 1 (0 R 2 R 2 R) (0 R 1 R 1 R) 0 R 2 3 0 1 2 0 1 0 1 2 1R 2R 3R

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Wow! You can switch between moving frame and fixed frame, if you also switch the order! You could also have derived the above, just by interpreting 0 R as a coordinate transform. 3

From (, , ) to R

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements

0 3R

= 0R 1R 2R 1 2 3 c -s 0 = s c 0 0 0 1 c c c - s s s c c + c s = -s c

Spatial rotations

Preview

c 0 s c -s 0 0 1 0 s c 0 -s 0 c 0 0 1 -c c s - s c c s -s c s + c c s s s s c

Axis-angle Rodrigues's formula Rotation matrices Euler angles

From R to (, , ) the ugly way

Case 1: r33 = 1, = 0. - is indeterminate. cos( + ) - sin( + ) 0 R = sin( + ) cos( + ) 0 0 0 1 Case 2: r33 = -1, = or - . + is indeterminate. - cos( - ) - sin( - ) 0 0 R = - sin( - ) cos( - ) 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. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

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 = tan-1 (r13 cos + r23 sin , r33 )

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

But what about sin = 0?

Lecture 6. Representing Rotation

Kinematic representation: goals, overview Planar displacements

How can this method work without explicitly addressing the singularity? When = 0, is determined and is not. When = , is determined and is not. If your tan-1 handles (0, 0), you can just let it go!

Spatial rotations

Preview Axis-angle Rodrigues's formula Rotation matrices Euler angles

Information

Lecture 6. Representing Rotation

31 pages

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

630618


You might also be interested in

BETA
LaserSelfMixing Interferometry for Mechatronics Applications
Lecture 6. Representing Rotation