Quaternions & Rotation in 3D Space 1
Overview Quaternions: definition Quaternion properties Quaternions and rotation matrices Quaternion-rotation matrices relationship Spherical linear interpolation Concluding remarks 2
Quaternions i Real Part Imaginary Part 2 2 2 j k ijk 1 i i j k jk kj ki ik ij ji k j The real part for a Pure Quaternion is zero. 3
Quaternion Multiplication ; ; Using the rules in the previous slide, we can get the following definition for quaternion multiplication:. ; 4
Quaternion Multiplication ; ; 5 & simplify the quaternion multiplication to matrix multiplication ortho-normal matrices.
Quaternion Multiplication Unit quaternions: 1 For unit quaternions: 6
Quaternion Properties Quaternion conjugate: ; ;. ; For unit quaternions: ; 7
Quaternion Properties Quaternion conjugate:..... 8
Quaternions & Rotation Matrices Given the following quaternions: q is a unit quaternion. is a pure quaternion (real part is zero) ; 0; 0;.; ; 9
Quaternions & Rotation Matrices ; ;.; ; 1 The product produces the same vector. 10
Quaternions & Rotation Matrices 0; is perpendicular to. ; 0;.; ; 0; 0; 11
Quaternions & Rotation Matrices 0; ;..; 0; 0; 2 12
Quaternions & Rotation Matrices 0; 2 ; 2 From 1 & 2, one can conclude that: ; http://www.euclideanspace.com 13
Quaternions & Rotation Matrices 2 Plane to the axis & are pure quaternions & are the imaginary components of &. 14
Quaternions & Rotation Matrices ; ; 2 Plane to the axis & are pure quaternions & are the imaginary components of &. 15
Quaternions & Rotation Matrices Any 3D rotation matrix can be represented by a rotation ( ) around a unit vector ( ). This rotation can be defined by the following unit quaternion: cos 2 sin 2 sin 2 sin 2 http://www.euclideanspace.com 16
Quaternions & Rotation Matrices Rotation maintains the magnitude of a vector:... 17
Quaternions & Rotation Matrices Rotation maintains the angular deviation between two vectors:... 18
Quaternions & Rotation Matrices Rotation maintains the magnitude of a triple product: Since: Quaternion rotation maintains vector magnitude Quaternion rotation maintains angular deviation between two vectors Then:,,. Quaternion rotation maintains the magnitude of the triple product.,,,, 19
Quaternions & Rotation Matrices Quaternion/rotation matrix relationship: 20
Quaternions & Rotation Matrices Quaternion/rotation matrix relationship: 1 0 0 0 0 0 0 21
Quaternions & Rotation Matrices Quaternion to Rotation Transformation 2 2 2 2 2 2 2 2 2 2 2 2 & define the same rotation matrix 22
Quaternions & Rotation Matrices Rotation to Quaternion Transformation (Option # 1) 3 4 1 / 4 / 4 / 4 / Assumption: 10 23
Quaternions & Rotation Matrices Rotation to Quaternion Transformation (Option # 2) 3 4 1 / 4 / 4 / 4 / Assumption: 10 24
3 4 1 1/4 Quaternions & Rotation Matrices Rotation to Quaternion Transformation (Option # 3) / 4 / 4 / 4 / Assumption: 10 25
Quaternions & Rotation Matrices Rotation to Quaternion Transformation (Option # 4) 3 4 4 1 4 1 / 4 / 4 / 4 / Assumption: 10 26
Quaternions & Rotation Matrices Rotation to Quaternion Transformation Among the options, choose the one that ensures the highest numerical stability. Option # 1: is the largest among ( ). Option # 2: is the largest among ( ). Option # 3: is the largest among ( ). Option # 4: is the largest among ( ). 27
Quaternions & Rotation Matrices The product of two quaternions: ; ; 28.; ; cos ; This product is equivalent to rotation angle ( ) around the axis.
. Spherical Linear Interpolation 1 1 29
Spherical Linear Interpolation Spherical Linear Interpolation is useful for: Interpolation of derived rotation matrices from integrated GNSS/INS attitude This is the case when deriving the rotation matrices at much higher rate than that derived from GNSS/INS unit (LiDAR & Line Camera systems) Modeling variation of the rotation matrices as time dependent values for Line Camera Systems 30
Quaternions & Rotation Matrices Quaternions characteristics compared to rotation matrices: It avoids the gimbal lock problem. Happens whenever the secondary rotation is 90. Two rotations take place around the same axis in space. Quaternion multiplication requires fewer operations compared to multiplication of two rotation matrices. Quaternion-based rotation requires more operations when compared to traditional rotation of vectors. Quaternions has one constraint while rotation matrices has 6 orthogonality constraints Interpolation of quaternion rotations is much more straight forward than 3D rotation matrices. 31
Gimbal Lock http://en.wikipedia.org/wiki/gimbal_lock A set of three gimbals mounted together to allow three degrees of freedom: roll, pitch and yaw. When two gimbals rotate around the same axis, the system loses one degree of freedom. 32
Gimbal Lock Z Y X 90 33
Gimbal Lock Y X Z 90 34
Gimbal Lock Y X Z 90 &. 35
Gimbal Lock Z Y X X Z Y 90, 90, 90 36
Gimbal Lock Z Y X 180 37
Gimbal Lock X Y Z 90 38
Gimbal Lock X Z Y 0 39
Gimbal Lock Z Y X X Z Y 90, 90, 90 & 180, 90, 0!!! Singularity in the derivation of the rotation angles 40