chapter 2 rigid body motions and homogeneous transforms
play

Chapter 2: Rigid Body Motions and Homogeneous Transforms (original - PDF document

Chapter 2: Rigid Body Motions and Homogeneous Transforms (original slides by Steve from Harvard) Representing position Definition: coordinate frame A set n of orthonormal basis vectors spanning R n A set n of orthonormal basis vectors


  1. Chapter 2: Rigid Body Motions and Homogeneous Transforms (original slides by Steve from Harvard) Representing position • Definition: coordinate frame – A set n of orthonormal basis vectors spanning R n A set n of orthonormal basis vectors spanning R ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ 1 0 0 – For example, ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ˆ = ˆ = ˆ = i 0 , j 1 , k 0 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ 0 ⎦ ⎣ 0 ⎦ ⎣ 1 ⎦ • When representing a point p , we need to specify a coordinate frame ⎡ ⎤ 5 – With respect to o 0 : = 6 0 p ⎢ ⎥ ⎣ ⎦ – With respect to o 1 : ⎡− ⎤ 2 . 8 = 1 p ⎢ ⎥ ⎣ 4 . 2 ⎦ • v 1 and v 2 are invariant geometric entities – But the representation is dependant upon choice of coordinate frame ⎡ ⎤ ⎡ ⎤ ⎡− ⎤ ⎡− ⎤ 5 7 . 77 5 . 1 2 . 8 = = = = 0 1 0 1 v ⎢ ⎥ , v ⎢ ⎥ , v ⎢ ⎥ , v ⎢ ⎥ 1 1 2 2 ⎣ 6 ⎦ ⎣ 0 . 8 ⎦ ⎣ 1 ⎦ ⎣ 4 . 2 ⎦ 1

  2. Rotations • 2D rotations – Representing one coordinate frame in terms of another Representing one coordinate frame in terms of another [ ] R = 0 0 0 x y 1 1 1 – Where the unit vectors are defined as: θ ⎡− θ ⎡ ⎤ ⎤ cos sin = = 0 0 ˆ ˆ x x ⎢ ⎥ , y y ⎢ ⎥ 1 0 θ 1 0 θ ⎣ sin ⎦ ⎣ cos ⎦ θ − θ ⎡ ⎤ cos sin = = 0 R R ⎢ ⎢ ⎥ ⎥ 1 θ θ ⎣ sin cos ⎦ – This is a rotation matrix Alternate approach • Rotation matrices as projections – Projecting the axes of from o 1 onto the axes of frame o 0 Projecting the axes of from o 1 onto the axes of frame o 0 ⋅ ⋅ ⎡ ⎤ ⎡ ⎤ ˆ ˆ ˆ ˆ x x y x = 1 0 = 1 0 0 0 x ⎢ ⎥ , y ⎢ ⎥ 1 ⋅ 1 ⋅ ⎣ x ˆ y ˆ ⎦ ⎣ y ˆ y ˆ ⎦ 1 0 1 0 ⋅ ⋅ ⎡ ⎤ ˆ ˆ ˆ ˆ x x y x = 1 0 1 0 0 R ⎢ ⎥ 1 ⋅ ⋅ ⎣ ˆ x y ˆ y ˆ ˆ y ⎦ 1 0 1 0 ⎡ ⎡ π ⎤ ⎤ ⎛ ⎛ ⎞ ⎞ θ ⎜ θ + ⎟ ⎢ ˆ x x ˆ cos y ˆ ˆ x cos ⎥ 1 0 1 0 ⎝ ⎠ 2 = ⎢ ⎥ π ⎛ ⎞ ⎢ ⎥ ⎜ − θ ⎟ θ ˆ x y ˆ cos ˆ y y ˆ cos ⎢ ⎥ 1 0 ⎝ ⎠ 1 0 ⎣ ⎦ 2 = 2

  3. Properties of rotation matrices • Inverse rotations: • Or, another interpretation uses odd/even properties: Properties of rotation matrices • Inverse of a rotation matrix: − ⎡ ⎡ ⋅ ⋅ ⎤ ⎤ 1 1 ( ) x ˆ ˆ x ˆ ˆ y ˆ ˆ x ˆ ˆ − 1 = 0 1 0 1 0 R ⎢ ⎥ 1 ⋅ ⋅ ˆ ˆ ˆ ˆ ⎣ x y y y ⎦ 1 0 1 0 − 1 ⎡ π ⎤ ⎛ ⎞ θ ⎜ θ − ⎟ ˆ ˆ ˆ ˆ ⎢ x x cos y x cos ⎥ 1 0 1 0 ⎝ ⎠ 2 ⎢ ⎥ = ⎛ π ⎞ ⎢ ⎥ ⎜ − θ ⎟ θ x ˆ y ˆ cos y ˆ y ˆ cos ⎢ ⎥ 1 0 1 0 ⎣ ⎝ ⎠ ⎦ 2 − θ − θ 1 θ θ ⎡ ⎤ ⎡ ⎤ ( ( ) ) cos sin cos sin 1 T = = = ( ( ) ) 0 R R ⎢ ⎢ ⎥ ⎥ ⎢ ⎢ ⎥ ⎥ θ θ ⎣− θ θ 1 1 0 ⎣ sin cos ⎦ det R sin cos ⎦ 1 • The determinant of a rotation matrix is always ±1 – +1 if we only use right-handed convention 3

  4. Properties of rotation matrices • Summary: – Columns (rows) of R are mutually orthogonal Columns (rows) of R are mutually orthogonal – Each column (row) of R is a unit vector = − R T 1 R ( ) = det R 1 • The set of all n x n matrices that have these properties are called the Special Orthogonal group of order n ( ) ( ) R ∈ R ∈ SO SO n n 3D rotations • General 3D rotation: ⋅ ⋅ ⋅ ⎡ ⎤ ˆ ˆ ˆ ˆ ˆ ˆ x x y x z x 1 0 1 0 1 0 ⎢ ⎥ ( ) = ⋅ ⋅ ⋅ ∈ 0 ˆ ˆ ˆ ˆ ˆ ˆ R x y y y x y SO 3 ⎢ ⎥ 1 1 0 1 0 1 0 ⎢ ⋅ ⋅ ⋅ ⎥ ˆ ˆ ˆ ˆ ˆ ˆ ⎣ x z z z z z ⎦ 1 0 1 0 1 0 • Special cases – Basic rotation matrices ⎡ ⎤ 1 0 0 ⎢ ⎢ ⎥ ⎥ = θ θ − θ θ R R 0 0 cos cos sin sin ⎢ ⎢ ⎥ ⎥ θ x , ⎢ θ θ ⎥ 0 sin cos ⎣ ⎦ θ − θ ⎡ θ θ ⎤ ⎡ ⎤ cos 0 sin cos sin 0 ⎢ ⎥ ⎢ ⎥ = = θ θ R sin cos 0 R 0 1 0 ⎢ ⎥ ⎢ ⎥ θ θ y , z , ⎢ ⎥ ⎢ ⎥ − θ θ ⎣ sin 0 cos ⎦ ⎣ 0 0 1 ⎦ 4

  5. Properties of rotation matrices (cont’d) • SO (3) is a group under multiplication ( ) ( ) ( ) ( ) ∈ ∈ ⇒ ⇒ ∈ ∈ 1 1. Closure: Closure: if if R R , , R R SO SO 3 3 R R R R SO SO 3 3 1 1 2 2 1 1 2 2 ⎡ ⎤ 1 0 0 2. Identity: ⎢ ⎥ ( ) = ∈ I 0 1 0 SO 3 ⎢ ⎥ ⎢ ⎥ ⎣ 0 0 1 ⎦ − R T = R 1 3. Inverse: ( ) ( ) = 4. Associativity: R R R R R R Allows us to combine rotations: 1 2 3 1 2 3 = R R R ac ab bc • In general, members of SO (3) do not commute Rotational transformations • Now assume p is a fixed point on the rigid object with fixed coordinate frame o 1 frame o 1 – The point p can be represented in the frame o 0 ( p 0 ) again by the projection onto ⎡ ⋅ ⎤ the base frame 1 p x ˆ ⎢ 0 ⎥ = ⋅ 0 1 p ⎢ p y ˆ ⎥ 0 ⎢ ⎥ ⋅ 1 ⎣ p ˆ z ⎦ 0 ( ) ⎡ + + ⋅ ⎤ ˆ ˆ ˆ ˆ u x v y w z x 1 1 1 0 ⎢ ⎥ ( ) = + + ⋅ u x ˆ v y ˆ w z ˆ y ˆ ⎢ ⎥ 1 1 1 0 ( ) ⎢ + + ⋅ ⎥ ⎣ u x ˆ v y ˆ w z ˆ z ˆ ⎦ 1 1 1 0 ⋅ + ⋅ + ⋅ ⎡ ⎤ u x ˆ x ˆ v y ˆ ˆ x w z ˆ x ˆ 1 0 1 0 1 0 ⎢ ⎥ = ⋅ + ⋅ + ⋅ u x ˆ y ˆ v y ˆ y ˆ w ˆ z y ˆ ⎢ ⎥ 1 0 1 0 1 0 ⎢ ⎥ ⋅ + ⋅ + ⋅ ⎣ u x ˆ ˆ z v y ˆ ˆ z w z ˆ z ˆ ⎦ 1 0 1 0 1 0 = ⎡ ⎤ u ⎢ ⎥ = p 1 v ⎢ ⎥ ⎢ ⎥ w ⎣ ⎦ 5

  6. Rotating an Object Rotating a vector • Another interpretation of a rotation matrix: – Rotating a vector about an axis in a fixed frame Rotating a vector about an axis in a fixed frame Ex: rotate v 0 about y 0 by π /2 – ⎡ ⎤ 0 ⎢ ⎥ 0 = v 1 ⎢ ⎥ ⎢ ⎥ ⎣ 1 ⎦ 6

  7. Rotation matrix summary • Three interpretations for the role of rotation matrix: 1 1. Representing the coordinates of a point in two different frames Representing the coordinates of a point in two different frames 2. Orientation of a transformed coordinate frame with respect to a fixed frame 3. Rotating vectors in the same coordinate frame 7

  8. Similarity transforms • All coordinate frames are defined by a set of basis vectors These span R n – These span R – Ex: the unit vectors i , j , k In linear algebra, a n x n matrix A is a mapping from R n to R n • – y = Ax , where y is the image of x under the transformation A – Think of x as a linear combination of unit vectors (basis vectors), for example the unit vectors: [ ] [ ] = = T T e 1 0 ... 0 , ..., e 0 0 ... 1 1 n – If we want to represent vectors with respect to a different basis, e.g.: f 1 , …, If we want to represent vectors with respect to a different basis e g : f f n , the transformation A can be represented by: ′ = − 1 A T AT – Where the columns of T are the vectors f 1 , …, f n , – A’ is called the similarity transformation. Similarity transforms • Rotation matrices are also a change of basis – If A is a linear transformation in o 0 and B is a linear transformation in o 1 If A is a linear transformation in o 0 and B is a linear transformation in o 1 , then they are related as follows: • Ex: the frames o 0 and o 1 are related as follows: ( ) − = 1 0 0 B R AR 1 1 8

  9. Compositions of rotations • w/ respect to the current frame – Ex: three frames o 0 o 1 o 2 Ex: three frames o 0 , o 1 , o 2 = 0 0 1 p R p 1 p = R = = 0 0 1 2 0 0 1 1 1 2 R R p R R p R p 1 2 2 2 1 2 = 0 0 2 p R p 2 • This defines the composition law for successive rotations about the current reference frame: post-multiplication Compositions of rotations Ex: R represents rotation about the current y -axis by φ followed by θ • about the current z -axis about the current z axis = R R y R φ θ , z , φ φ θ − θ φ θ − φ θ φ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ cos 0 sin cos sin 0 cos cos cos sin sin ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ = θ θ = θ θ 0 1 0 sin cos 0 sin cos 0 ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ − φ φ ⎥ ⎢ ⎥ ⎢ − φ θ φ θ φ ⎥ sin 0 cos 0 0 1 sin cos sin sin cos ⎣ ⎦ ⎣ ⎦ ⎣ ⎦ • What about the reverse order? 9

Recommend


More recommend