Transcription of 1 HOMOGENEOUS TRANSFORMATIONS - Ira A. Fulton …
1 1 HOMOGENEOUS TRANSFORMATIONS . Purpose: The purpose of this chapter is to introduce you to the HOMOGENEOUS Transformation. This simple 4 x 4 transformation is used in the geometry engines of CAD systems and in the kinematics model in robot controllers. It is very useful for examining rigid-body position and orientation (pose) of a sequence of robotic links and joint frames. Script Notation: Pre super- and pre sub-scripts are often used to denote frames of reference B. C = transformation of frame C relative to frame B. C p = vector located in frame C. Tsai uses a pre and post script notation . C = transformation of frame C relative to frame B. C p = vector located in frame C. The notation in these notes is understood graphically by the figures and does not always use the scripting approach.
2 You should be able to interpret these various notations. H, a 4x4 matrix, will be used to represent a HOMOGENEOUS transformation. H can represent translation, rotation, stretching or shrinking (scaling), and perspective TRANSFORMATIONS , and is of the general form ax bx cx px H= ay by cy py az bz cz pz ( ). d1 d2 d3 1. Thus, given a vector u, its transformation v is represented by v=Hu ( ). 1-1. z v z v H u u H. y y x x (a) Operator Interpretation (b) Frame Interpretation Figure 1-1 Interpreting the HOMOGENEOUS transformation The vector u having components ux, uy, uz must be expanded to a 4x1 vector of the form: ux uy u= ( ). uz 1. For the case of pure translation the point or vector u is translated by H when ax = 1, ay = az = 0. bx = 0, by = 1, bz = 0. cx = cy = 0, cz = 1.
3 D 1 = d2 = d3 = 0. so that H becomes 1 0 0 px H(p) = 0 1 0 py 0 0 1 pz 0 0 0 1. and pT = px , py , pz represent the translation components along the x, y, z axes, respectively. 1-2. z v H(p). u p p z x p y y x Figure 1-2 Translation : -1 0. 0 10. If u = 2 , determine H(p) required to translate u to point v = -5. 1 1. Soln: v = H(p)u implies that 1 0 0 px -1 1+ px . 0 p . 10 = 0 1 0 py 0 = 2 +yp . -5 0 0 1 pz 2 z . 1 000 1 1 1 . Thus, -1 + px = 0 px = 1. py = 10. 2 + pz = -5 pz = -7. which gives 1 0 0 1. 0. H(p) = 0 1 0 10. 0 1 -7. 0 0 0 1. 1-3. The scaling transformation Hs represents a scaling of vector u when all off-diagonal terms are zero and when ax = a, by = b, cz = c are not equal to 1. a000. Hs = 00 b0 0c 00. 0001. z Hs v u cu z uz y ux uy au x bu y x Figure 1-3 Scaling transformation Rotation TRANSFORMATIONS The rotation transformation is contained in the 3x3 submatrix of H which we will denote by R.
4 R p (3 x 3) (3 x 1). H(R,p) = dT 1. (1 x 3) (1 x 1) ( ). If there is no rotation then R = I = the identity 3 x 3 matrix. If there is rotation only, then dT = 0T, and p = 0. For the special case of rotation about the x axis, R assumes the form 1 0 0. R (x, ) = 0 cos -sin . 0 sin cos ( ). 1-4. z z' v . u y'. y . x, x'. Figure 1-4 Rotation of a vector We designate the rotated frame by the x'y'z' axes and the original frame by the xyz axes. The effect of rotating u to v is to change its coordinates with respect to the xyz axes but not with respect to the x'y'z' axes. Note that v in the x'y'z' axes has the same coordinates as u in the xyz axes. z z'. v y'.. u .. y Figure 1-5 Rotation about the x axis The coordinates of v in xyz are vx = ux vy = uy cos - uz sin . vz = uy sin + uz cos.
5 Since the coordinates of v in x'y'z' are same as u in xyz. Thus, v = R(x, ) u and can be expanded to the HOMOGENEOUS form vx ux vy R (x, ) 0 uy v = vz = T = H (x, ) u 0 1 uz 1 1. Similarly, rotations about y and z axes by give 1-5. cos 0 sin . R (y, ) = 0 1 0. -sin 0 cos ( ). cos -sin 0. R (z, ) = sin cos 0. 0 0 1 ( ). Multiple Rotations : Rotate u by 90o about +z and 90o about +y, where xyz are the fixed base reference axes. What are the final coordinates of the vector u after these two rotations in the base xyz axes? If the rotation order changed, will the final coordinates be the same? Let uT = [0 1 0]. Soln: v = R (z,90 ) u "rotate u to v". w = R (y,90 ) v "rotate v to w". Thus w = R (y,90 ) R (z,90 ) u 0 0 1 0 1 0 0 . w = 0 1 0 1 0 0 1 . 1 0 0 0 0 1 0 . 0 0 1 1 0.
6 W = 0 1 0 0 = 0 . 1 0 0 0 1 . Rotations are not commutative. Thus R (y,90 ) R (z,90 ) R (z,90 ) R (y,90 ). Frame Transformation Interpretation 1-6. The columns of H represent the 4 vectors describing a second frame. The first three, when normalized, are the direction cosines of the second frame axes relative to the first reference frame. The last vector locates the secondary frame origin in the reference frame. To illustrate this interpretation, consider the previous example and Figure 1-6. In particular note the multiple 90 rotations from xyz to x'y'z' and then to x y z . z, z', y". y'. 90 1. 90 . 2. y, x', x". x,z". Figure 1-6 Multiple rotations Considering the previous example, note that H can be interpreted as two subsequent rotational TRANSFORMATIONS . 0 0 1 0.
7 H = 10 0 0 0 = R (y, 90o ) R (z, 90o ) 0. 1 0 0 0T 1. 0 0 0 1. The columns of H ultimately represent (orient and position) a secondary frame x"y"z". relative to the original xyz frame: 0 0 1. x" oriented by 10 , y" by 0 , and z" by 1. 0 relative to the xyz frame. Since the origins 0. 0 0 0. 0. of both frames are the same, the last column is 00 . 1. In the more general case of both rotation and displacement the first 3 columns represent the secondary axes orientation with respect to the base axes and the fourth column locates the secondary origin relative to the base origin. Given a rotation only described by R (rotation only) and a pure translation described by p, does 1-7. ? H(p) H(R) = H(R) H(p). where R 0. H(R) =. 0T 1. and I p H(p) =. 0T 1. First consider rotation R, and then translation p, to get I p R 0 u w = H(p) H(R) u =.
8 0T 1 0T 1. R p w = u = H (R, p ) u 0T 1 ( ). Next, consider translation first, then rotation: I p R Rp w = H(R) H(p) u = RT 0. T u = T u 0 1 0 1 0 1 ( ). The w's are different in ( ) and ( ) and thus H(p) H(R) H(R) H(p). The usual procedures for locating points in translated and rotated reference frames relative to the base axes is to rotate the frame first, then translate the frame origin, , apply ( ). Relative TRANSFORMATIONS Since H(R,p) = H(p) H(R) H(R) H(p) , what does H(R) H(p) represent? Expanding for w, R Rp w = H(R) H(p) u = u = R (u + p ). 0T 1 ( ). where u is understood to be in the form of the expanded vector [u 1]T. From ( ) we note that the effect of translating first is to cause the rotation R of u relative to the base frame after it has been translated by p.
9 Generalizing: 1-8. If we postmultiply a transformation representing a frame (relative to base axes) by a second transformation (relative to the frame of the first transformation), we make the transformation with respect to the frame axes of the first transformation. Premultiplying the frame transformation by the second transformation causes the transformation to be made with respect to the base reference frame. Example (Paul) : Given frame 1 0 0 20. 0 0 -1 10. C= 0 1 0 0. 0 0 0 1. and transformation 0 -1 0 10. H = 10 00 0. 1. 0. 0. 0 0 0 1. locate frame X = H C and frame Y = C H. First, 0 -1 0 10 1 0 0 20 0 0 1 0. X = HC = 10 00 0. 1. 0. 0. 0. 0. 0 -1. 1 0. 10 = 1 0. 0 0 1. 0 20. 0 0. 0 0 0 1 0 0 0 1 0 0 0 1. 0 0 1. This can be illustrated by Figure 1-7 where we note that 1 , 0 , and 0 locate the x", 0 1 0.
10 Y", z" axes with respect to the x, y, and z axes, respectively. 1-9. Z. y'. y". x'. z'. X 10. Y. y x". 20 z". C. z X 10. x Figure 1-7 X = H C. Next, we reverse the order to calculate Y = C H. 1 0 0 20 0 -1 0 10 0 -1 0 30. Y = 00 0. 1. -1 10 1. 0 0 0. 0. 0. 0 0 = 0 0. 1 0 1 0. -1 10. 0 0. 0 0 0 1 0 0 0 1 0 0 0 1. as illustrated by the following figure: Z. y Y. x 10. 20. z C. x 10. Y. y z X. Figure 1-8 Y = C H. 1-10. Note that postmultiplying causes H to be made relative to frame C rather than relative to XYZ base axes. Inverse TRANSFORMATIONS Given u and the rotational transformation R, the coordinates of u after being rotated by R. are defined by v = Ru. The inverse question is given v, what u when rotated by R will give v? This is found by premultiplying by R-1, the inverse of R, where R-1R = I.