Read Lecture 6. Representing Rotation text version

`Lecture 6. Representing RotationKinematic representation: goals, overviewLecture 6. Representing RotationMatthew T. MasonPlanar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesMechanics of Manipulation Spring 2012Today's outlineLecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotations Preview Axis-angle Rodrigues's formula Rotation matrices Euler anglesKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesReadings, etc.Lecture 6. Representing RotationKinematic representation: goals, overview Planar displacementsWe 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 rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesAnalytic geometrySo far, Euclidean geometry. Why?Insight. Visualization. Economy of expression.Lecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matricesNow 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 representationLecture 6. Representing RotationKinematic representation: goals, overview Planar displacementsFollowing the kinematic agenda:Planar displacements. Spherical displacements. Spatial displacements. Constraints.Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesRepresenting planar displacementsObvious idea 1Displacement 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 RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesObvious idea 2Given 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 RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angleUses of representationsCommunicate 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 stuffLecture 6. Representing RotationKinematic 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 rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesWhy representing rotations is hard.Lecture 6. Representing RotationKinematic representation: goals, overviewRotations 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 rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesChoicesLecture 6. Representing RotationKinematic representation: goals, overviewAxis-angle.Good for communication, geometrical insight;Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesRotation matricesGood for operating on stuff, composition, analytical insight;Unit quaternions. (aka Euler parameters)Good for composition, analytical insight, sampling;Euler anglesGood for communication, geometrical insight.Axis-angleEuler'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 RotationnKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesWhat do we want from axis-angle?Lecture 6. Representing RotationKinematic representation: goals, overviewOperate on points.Rodrigues's formula.Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesCompose 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 formulaOthers 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 xLecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesnn xxORotation matricesChoose 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 |u3Lecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview 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 RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesRotating a pointLet (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 RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesSub- and superscript notation for rotating a pointLecture 6. Representing RotationKinematic representation: goals, overviewLet 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 APlanar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesCoordinate transformLecture 6. Representing RotationThere 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 AxKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matricesx=B A AR xEuler anglesFor coord xform, matrix subscript and vector superscript &quot;cancel&quot;. Rotation from B to A is the same as coordinate transform from A to B.Example rotation matrixLecture 6. Representing RotationB AR= BxABy ABzKinematic representation: goals, overviewA1 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 1Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesNice things about rotation matricesLecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angleComposition 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:BRodrigues's formula Rotation matrices Euler anglesR = 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 &quot;cross product matrix&quot; N:   0 -n3 n2 0 -n1  N =  n3 -n2 n1 0 so that ^ Nx = n × xLecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview 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 sLecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesn1 n2 (1 - c) - n3 s 2 2 n2 + (1 - n2 )c n2 n3 (1 - c) + n1 sn1 n3 (1 - c) + n2 s n2 n3 (1 - c) - n1 s  2 2 n3 + (1 - n3 )cwhere c = cos  and s = sin . Ugly.Rodrigues's formula for differential rotationsConsider 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 RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler angles^ Converting from R to rot(n, ) . . .Lecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview^ 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 anglesThree 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 RotationKinematic representation: goals, overviewz zPlanar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesx y xConverting from Euler angles to rotation matricesnotationDefine 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 be0 3R iR jLecture 6. Representing RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler angles= 0 (2 R) 0 (1R) 0 (0 R) 3 2 1Moving frame versus fixed frameSwitch to moving frameUse the coordinate transform of a matrix formula:0 3RLecture 6. Representing RotationKinematic 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 3RPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesWow! 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 RLecture 6. Representing RotationKinematic representation: goals, overview Planar displacements0 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 cSpatial rotationsPreviewc 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 cAxis-angle Rodrigues's formula Rotation matrices Euler anglesFrom R to (, , ) the ugly wayCase 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 RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesFrom R to (, , ) the clean wayLet  =+  =- 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 RotationKinematic representation: goals, overview Planar displacements Spatial rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler anglesBut what about sin  = 0?Lecture 6. Representing RotationKinematic representation: goals, overview Planar displacementsHow 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 rotationsPreview Axis-angle Rodrigues's formula Rotation matrices Euler angles`

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