Presentation is loading. Please wait.

Presentation is loading. Please wait.

Rotation Matrices and Quaternion

Similar presentations


Presentation on theme: "Rotation Matrices and Quaternion"β€” Presentation transcript:

1 Rotation Matrices and Quaternion
Siamak Faal 1/2 04/20/2016

2 Orientation and Rotation
Move and Rotate The object is now at a new position and orientation.

3 Orientation and Rotation
Rotation Matrices Quaternion

4 Preliminaries and notations
Unit vectors: 𝑖 = 𝑇 ; 𝑗 = 𝑇 ; π‘˜ = 𝑇 Transpose: 𝐴 𝑇 𝑖𝑗 = 𝐴 𝑗𝑖 Inner product: π‘₯,𝑦 =π‘₯⋅𝑦= π‘₯ 𝑇 𝑦 Notation simplifications: 𝑠 πœƒ = sin πœƒ 𝑐 πœƒ = cos πœƒ 𝑠 12 = sin πœƒ 1 + πœƒ 2 𝑐 12 = cos πœƒ 1 + πœƒ 2

5 Reference Frames z y z x x y p y y {2} y {1} x x {0} x
A point p can have different coordinates in different reference frames. Frames can be fixed in space or attached to moving objects (inertial or non-inertial frames) x y z p x y {2} x y {1} x y {0}

6 Rotation Matrix A 2D example 2 𝑝 = 2 π‘₯ 𝑝 βˆ™ 2 𝑖 + 2 𝑦 𝑝 βˆ™ 2 𝑗
2 𝑝 = 2 π‘₯ 𝑝 βˆ™ 2 𝑖 𝑦 𝑝 βˆ™ 2 𝑗 1 π‘₯ 𝑝 = 2 π‘₯ 𝑝 𝑖 , 1 𝑖 𝑦 𝑝 𝑗 , 1 𝑖 1 𝑦 𝑝 = 2 π‘₯ 𝑝 𝑖 , 1 𝑗 𝑦 𝑝 𝑗 , 1 𝑗 π‘Ž,𝑏 = π‘Ž 𝑏 cos πœƒ 𝑖 = 𝑗 =1 1 π‘₯ 𝑝 𝑦 𝑝 = cos πœƒ cos πœ‹ 2 +πœƒ cos πœ‹ 2 βˆ’πœƒ cos πœƒ π‘₯ 𝑝 𝑦 𝑝 1 π‘₯ 𝑝 𝑦 𝑝 = cos πœƒ βˆ’ sin πœƒ sin πœƒ cos πœƒ π‘₯ 𝑝 𝑦 𝑝 A 2D example y y x p ΞΈ {2} x {1}

7 Rotation Matrix A 2D example
1 π‘₯ 𝑝 𝑦 𝑝 = cos πœƒ βˆ’ sin πœƒ sin πœƒ cos πœƒ π‘₯ 𝑝 𝑦 𝑝 1 𝑝 = cos πœƒ βˆ’ sin πœƒ sin πœƒ cos πœƒ 𝑝 1 𝑝 = 2 1 𝑅 2 𝑝 y y x p The 𝑅 matrix is both and operator and a description! ΞΈ {2} x {1}

8 Rotation Matrix (Direction Cosines)
𝐡 𝐴 𝑅 = 𝐴 𝑖 𝐡 𝐴 𝑗 𝐡 𝐴 π‘˜ 𝐡 𝐡 𝐴 𝑅 = 𝐡 𝑖 βˆ™ 𝐴 𝑖 𝐡 𝑗 βˆ™ 𝐴 𝑖 𝐡 π‘˜ βˆ™ 𝐴 𝑖 𝐡 𝑖 βˆ™ 𝐴 𝑗 𝐡 𝑗 βˆ™ 𝐴 𝑗 𝐡 π‘˜ βˆ™ 𝐴 𝑗 𝐡 𝑖 βˆ™ 𝐴 π‘˜ 𝐡 𝑗 βˆ™ 𝐴 π‘˜ 𝐡 π‘˜ βˆ™ 𝐴 π‘˜

9 Standard Axis Rotations
𝑅 π‘₯ πœƒ = cos πœƒ βˆ’ sin πœƒ 0 sin πœƒ cos πœƒ 𝑅 𝑦 πœƒ = cos πœƒ 0 sin πœƒ βˆ’ sin πœƒ 0 cos πœƒ 𝑅 𝑧 πœƒ = cos πœƒ βˆ’ sin πœƒ 0 sin πœƒ cos πœƒ

10 Rotation Matrix Identities
Claim: Rotation matrix from A to B is equal to the transpose of a rotation matrix from B to A 𝐡 𝐴 𝑅 = 𝐴 𝐡 𝑅 𝑇 Proof: 𝐴 𝐡 𝑅 = 𝐴 𝑖 βˆ™ 𝐡 𝑖 𝐴 𝑗 βˆ™ 𝐡 𝑖 𝐴 π‘˜ βˆ™ 𝐡 𝑖 𝐴 𝑖 βˆ™ 𝐡 𝑗 𝐴 𝑗 βˆ™ 𝐡 𝑗 𝐴 π‘˜ βˆ™ 𝐡 𝑗 𝐴 𝑖 βˆ™ 𝐡 π‘˜ 𝐴 𝑗 βˆ™ 𝐡 π‘˜ 𝐴 π‘˜ βˆ™ 𝐡 π‘˜ β‡’ 𝐴 𝐡 𝑅 𝑇 = 𝐡 𝑖 βˆ™ 𝐴 𝑖 𝐡 𝑗 βˆ™ 𝐴 𝑖 𝐡 π‘˜ βˆ™ 𝐴 𝑖 𝐡 𝑖 βˆ™ 𝐴 𝑗 𝐡 𝑗 βˆ™ 𝐴 𝑗 𝐡 π‘˜ βˆ™ 𝐴 𝑗 𝐡 𝑖 βˆ™ 𝐴 π‘˜ 𝐡 𝑗 βˆ™ 𝐴 π‘˜ 𝐡 π‘˜ βˆ™ 𝐴 π‘˜ = 𝐡 𝐴 𝑅

11 Rotation Matrix Identities
Claim: The transpose of a rotation matrix is equal to its inverse 𝐡 𝐴 𝑅 = 𝐴 𝐡 𝑅 βˆ’1 = 𝐴 𝐡 𝑅 𝑇 Proof: 𝐡 𝐴 𝑅 𝑇 𝐡 𝐴 𝑅 = 𝐴 𝑖 𝐡 𝑇 𝐴 𝑗 𝐡 𝑇 𝐴 π‘˜ 𝐡 𝑇 𝐴 𝑖 𝐡 𝐴 𝑗 𝐡 𝐴 π‘˜ 𝐡 = 𝐼 3 where 𝐼 3 is the 3Γ—3 identity matrix. Hence, 𝐴 𝐡 𝑅 βˆ’1 = 𝐴 𝐡 𝑅 𝑇

12 Rotation Matrix Identities
Claim: The determinant of a rotation matrix is 1 det 𝑅 =1 Proof: 𝑅 𝑇 𝑅=𝐼 det 𝐴 = det 𝐴 𝑇 det 𝑅 2 = det 𝐼 =Β±1 Rotation matrix preserves dimensions, hence: 𝑅𝑣 = 𝑣 𝑅𝑣 ≀ πœ† π‘šπ‘Žπ‘₯ 𝑅 𝑣 β‡’ πœ† π‘šπ‘Žπ‘₯ 𝑅 = +1 πœ† π‘šπ‘–π‘› 𝑅 𝑣 2 2 ≀ 𝑅𝑣,𝑣 β‡’ πœ† π‘šπ‘–π‘› 𝑅 𝑣 𝑇 𝑣≀ 𝑣 𝑇 𝑅 𝑇 𝑣 Using length perversity of 𝑅 implies: 𝑣 𝑇 𝑣= 𝑅𝑣,𝑣 ; thus: πœ† π‘šπ‘–π‘› 𝑅 =1 Implies that all the eigenvalues of 𝑅 are 1, consequently: det 𝑅 = πœ† 1 πœ† 2 πœ† 3 =+1

13 Rotation Matrix Identities
Claim: Multiplication of two rotation matrices is another rotation matrix 𝑅= 𝑅 1 𝑅 2 Proof: Using 𝑅 𝑇 = 𝑅 βˆ’1 and consequently 𝑅 𝑇 𝑅=𝐼: 𝑅 1 𝑅 2 𝑇 𝑅 1 𝑅 2 = 𝑅 2 𝑇 𝑅 1 𝑇 𝑅 1 𝑅 2 =𝐼 Also: det 𝑅 1 𝑅 2 = det 𝑅 1 det 𝑅 2 =+1

14 Rotation Matrix Identities
det 𝑅 =1 𝐡 𝐴 𝑅 = 𝐴 𝐡 𝑅 𝑇 𝑅 𝑇 = 𝑅 βˆ’1 𝑅 3 = 𝑅 1 𝑅 2 𝑅 1 𝑅 2 β‰  𝑅 2 𝑅 1 βˆ€π‘›>2 n is space dimension

15 Intrinsic vs. Extrinsic Rotations
Intrinsic rotations Extrinsic rotations

16 Euler Angles Leonhard Euler April 15, 1707, Basel, Switzerland
September 18, 1783, Saint Petersburg, Russia

17 Intrinsic rotations (Euler)
Rotations about β€œnew” axes z z' z' z'' πœ“ z'' πœƒ zf yf y'' y' y' y'' y x' x' x πœ™ xf x'' x'' For intrinsic rotations, rotation matrices are post-multiplied: 𝑅= 𝑅 𝑧 πœ“ 𝑅 𝑦 πœƒ 𝑅 π‘₯ πœ™

18 Extrinsic rotations Rotations about β€œfixed” axes z z z yf πœ“ zf y y xf
πœ™ πœƒ For extrinsic rotations, rotation matrices are pre-multiplied: 𝑅= 𝑅 π‘₯ πœ™ 𝑅 𝑦 πœƒ 𝑅 𝑧 πœ“

19 More on Rotation Matrix
𝑅 βˆ’1 = 𝑅 𝑇 ⇒𝑅 is an orthogonal matrix, thus for: 𝑅= π‘₯ 𝑦 𝑧 The following statements hold: π‘₯ β‹… 𝑦 = π‘₯ β‹… 𝑧 = 𝑦 β‹… 𝑧 =0 π‘₯ β‹… π‘₯ = 𝑦 β‹… 𝑦 = 𝑧 β‹… 𝑧 =1 This implies only 3 of the 9 components of 𝑅 are independent! Consequently, any orientation is achievable through 3 successive rotations about linearly independent axes.

20 Euler Angles Proper Euler angles:
z-x-z, x-y-x, y-z-y, z-y-z, x-z-x, y-x-y Tait-Bryan angles: x-y-z, y-z-x, z-x-y, x-z-y, z-y-x, y-x-z

21 z-y-x Euler Angles 𝐡 𝐴 𝑅 𝑧𝑦π‘₯ = 𝑅 𝑧 πœ“ 𝑅 𝑦 πœƒ 𝑅 π‘₯ πœ™ 𝐡 𝐴 𝑅 𝑧𝑦π‘₯ = 𝑐 πœ“ βˆ’ 𝑠 πœ“ 0 𝑠 πœ“ 𝑐 πœ“ 𝑐 πœƒ 0 𝑠 πœƒ βˆ’ 𝑠 πœƒ 0 𝑐 πœƒ 𝑐 πœ™ βˆ’ 𝑠 πœ™ 0 𝑠 πœ™ 𝑐 πœ™ 𝐡 𝐴 𝑅 𝑧𝑦π‘₯ = 𝑐 πœ“ 𝑐 πœƒ 𝑐 πœ“ 𝑠 πœƒ 𝑠 πœ™ βˆ’ 𝑠 πœ“ 𝑐 πœ™ 𝑐 πœ“ 𝑠 πœƒ 𝑐 πœ™ + 𝑠 πœ“ 𝑠 πœ™ 𝑠 πœ“ 𝑐 πœƒ 𝑠 πœ“ 𝑠 πœƒ 𝑠 πœ™ + 𝑐 πœ“ 𝑐 πœ™ 𝑠 πœ“ 𝑠 πœƒ 𝑐 πœ™ βˆ’ 𝑐 πœ“ 𝑠 πœ™ βˆ’ 𝑠 πœƒ 𝑐 πœƒ 𝑠 πœ™ 𝑐 πœƒ 𝑐 πœ™

22 z-y-x Euler Angles 𝐡 𝐴 𝑅 𝑧𝑦π‘₯ = 𝑐 πœ“ 𝑐 πœƒ 𝑐 πœ“ 𝑠 πœƒ 𝑠 πœ™ βˆ’ 𝑠 πœ“ 𝑐 πœ™ 𝑐 πœ“ 𝑠 πœƒ 𝑐 πœ™ + 𝑠 πœ“ 𝑠 πœ™ 𝑠 πœ“ 𝑐 πœƒ 𝑠 πœ“ 𝑠 πœƒ 𝑠 πœ™ + 𝑐 πœ“ 𝑐 πœ™ 𝑠 πœ“ 𝑠 πœƒ 𝑐 πœ™ βˆ’ 𝑐 πœ“ 𝑠 πœ™ βˆ’ 𝑠 πœƒ 𝑐 πœƒ 𝑠 πœ™ 𝑐 πœƒ 𝑐 πœ™ 𝐡 𝐴 𝑅 = π‘Ÿ 𝑖𝑗 if 𝑐 πœƒ β‰ 0 πœƒ=atan2 βˆ’ π‘Ÿ 31 , π‘Ÿ π‘Ÿ 21 2 πœ“=atan2 π‘Ÿ 21 𝑐 πœƒ , π‘Ÿ 11 𝑐 πœƒ πœ™=atan2 π‘Ÿ 32 𝑐 πœƒ , π‘Ÿ 33 𝑐 πœƒ if πœƒ=90Β° πœ“=0 πœ™=atan2 π‘Ÿ 12 , π‘Ÿ 22 if πœƒ=βˆ’90Β° πœ“=0 πœ™=βˆ’atan2 π‘Ÿ 12 , π‘Ÿ 22

23 Rotations in Constrained Objects
Exercise: find 2 0 𝑅 1 0 𝑅 = 𝑐 πœƒ 1 βˆ’ 𝑠 πœƒ 𝑠 πœƒ 1 𝑐 πœƒ 2 1 𝑅 = 𝑐 πœƒ 2 βˆ’ 𝑠 πœƒ 𝑠 πœƒ 2 𝑐 πœƒ 2 0 𝑅 = 1 0 𝑅 2 1 𝑅 2 0 𝑅 = 𝑐 12 βˆ’ 𝑠 𝑠 12 𝑐 y x πœƒ 2 y {2} y x πœƒ 1 {1} x {0}

24 Rotations in Constrained Objects
Example: 1 0 𝑅 = 𝑅 𝑧 πœƒ 1 45Β° 2 1 𝑅 = 𝑅 π‘₯ πœƒ 2 {2} x y z y z {3} x y {4} x z πœƒ 3 3 2 𝑅 = 𝑅 𝑧 45Β° πœƒ 2 4 3 𝑅 = 𝑅 π‘₯ πœƒ 3 {1} x y z 4 2 𝑅 = 3 2 𝑅 4 3 𝑅 4 1 𝑅 = 2 1 𝑅 4 2 𝑅 = 2 1 𝑅 3 2 𝑅 4 3 𝑅 x y z {0} πœƒ 1 4 0 𝑅 = 1 0 𝑅 4 1 𝑅 = 1 0 𝑅 2 1 𝑅 3 2 𝑅 4 3 𝑅

25 Roll-Picth-Yaw x-y-z or z-y-x Euler Angles 𝑅 1 = 𝑅 π‘₯ πœ™ 𝑅 𝑦 πœƒ 𝑅 𝑧 πœ“ 𝑅 2 = 𝑅 π‘₯ πœ™ 𝑅 𝑦 πœƒ 𝑅 𝑧 πœ“ x y z πœ™ πœ“ πœƒ

26 Rotations in free bodies
Question: If we assume any type of Euler angles, how can we guarantee that rotations are preserved? z πœ”= πœ” π‘₯ 𝑖 + πœ” 𝑦 𝑗 + πœ” π‘˜ π‘˜ πœ” 𝑧 y πœ” 𝑦 πœ” π‘₯ Answer: We can not! x

27 Rotations in free bodies
πœ” x y z x' y' z' z'' y'' x'' xf yf zf πœ“ πœƒ πœ™ πœ“ πœƒ πœ™ πœ”= πœ™ 𝑖 + 𝑅 π‘₯ πœ™ 𝑇 πœƒ 𝑗 + 𝑅 𝑦 πœƒ 𝑅 π‘₯ πœ™ 𝑇 πœ“ π‘˜

28 Singularity! Singularities at:
πœ”= πœ™ 𝑖 + 𝑅 π‘₯ πœ™ 𝑇 πœƒ 𝑗 + 𝑅 𝑦 πœƒ 𝑅 π‘₯ πœ™ 𝑇 πœ“ π‘˜ πœ” π‘₯ = πœ™ βˆ’ πœ“ sin πœƒ πœ” 𝑦 = πœ“ cos πœƒ sin πœ™ + πœƒ cos πœ™ πœ” 𝑧 = πœ“ cos πœƒ cos πœ™ βˆ’ πœƒ sin πœ™ πœ™ = πœ” π‘₯ + πœ” 𝑦 sin πœ™ tan πœƒ + πœ” 𝑧 cos πœ™ tan πœƒ πœƒ = πœ” 𝑦 cos πœ™ βˆ’ πœ” 𝑧 sin πœ™ πœ“ = πœ” 𝑦 sin πœ™ + πœ” 𝑧 cos πœ™ / cos πœƒ πœƒ= (2π‘˜βˆ’1)πœ‹ 2 Singularities at:

29 Time derivative of a Rotation Matrix
y z πœ” π‘₯ πœ” 𝑦 πœ” 𝑧 For angular velocity vector πœ” defined in body frame: πœ”= πœ” π‘₯ 𝑖 + πœ” 𝑦 𝑗 + πœ” π‘˜ π‘˜ And a rotation matrix 1 0 𝑅 that maps {1} into {0}. The time derivative of the rotation matrix is defined as: 𝑑 𝑑𝑑 𝑅 𝑑 =𝑆 πœ” 𝑅 where: 𝑆 πœ” = 0 βˆ’ πœ” 𝑧 πœ” 𝑦 πœ” 𝑧 0 βˆ’ πœ” π‘₯ βˆ’ πœ” 𝑦 πœ” π‘₯ 0 {1} {0} x y z

30 Quaternion Sir William Rowan Hamilton
August 4, 1805, Dublin, Republic of Ireland September 2, 1865, Dublin, Republic of Ireland

31 Quaternion Broom Bridge Dublin, Irland 𝑖 2 + 𝑗 2 + π‘˜ 2 =π‘–π‘—π‘˜=βˆ’1

32 End of Session 1 of 2 To be continued…

33 References: A good reference on Rotation matrices and some of the underlying theories is presented in chapter 2 of: Craig, John J. β€œIntroduction to robotics: mechanics and control.” Vol. 3. Upper Saddle River: Pearson Prentice Hall, 2005. Proof of the time derivative of a rotation matrix: Hamano, Fumio. β€œDerivative of Rotation Matrix Direct Matrix Derivation of Well Known Formula.” arXiv preprint arXiv: (2013).


Download ppt "Rotation Matrices and Quaternion"

Similar presentations


Ads by Google