Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.

Slides:



Advertisements
Similar presentations
Common Variable Types in Elasticity
Advertisements

CS 450: COMPUTER GRAPHICS LINEAR ALGEBRA REVIEW SPRING 2015 DR. MICHAEL J. REALE.
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
P. Axelrad, D. Lawrence ASEN3200 Spring 2006 ATTITUDE REPRESENTATION l Attitude cannot be represented by vector in 3-dimensional space, like position or.
Chris Hall Aerospace and Ocean Engineering
3D Kinematics Eric Whitman 1/24/2010. Rigid Body State: 2D p.
A Physicists’ Introduction to Tensors
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
Ch. 7: Dynamics.
Ch. 2: Rigid Body Motions and Homogeneous Transforms
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3D orientation.
Chapter 3 Determinants and Matrices
GG313 Lecture 12 Matrix Operations Sept 29, 2005.
CSCE 689: Computer Animation Rotation Representation and Interpolation
Mechanics of Rigid Bodies
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
Screw Rotation and Other Rotational Forms
An Introduction to Robot Kinematics
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
ME451 Kinematics and Dynamics of Machine Systems Review of Matrix Algebra – 2.2 Review of Elements of Calculus – 2.5 Vel. and Acc. of a point fixed in.
1 C01 – Advanced Robotics for Autonomous Manipulation Department of Mechanical EngineeringME 696 – Advanced Topics in Mechanical Engineering.
Mathematical Fundamentals
Rotations and Translations
Game Physics – Part IV Moving to 3D
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
ME451 Kinematics and Dynamics of Machine Systems Review of Linear Algebra 2.1 through 2.4 Th, Sept. 08 © Dan Negrut, 2011 ME451, UW-Madison TexPoint fonts.
Chapter 4.1 Mathematical Concepts
Modern Navigation Thomas Herring
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Adding Vectors, Rules When two vectors are added, the sum is independent of the order of the addition. This is the Commutative Law of Addition.
CSCE 552 Spring 2011 Math By Jijun Tang. Layered.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Rotations and Translations
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
ME451 Kinematics and Dynamics of Machine Systems Review of Linear Algebra 2.1 through 2.4 Tu, Sept. 07 © Dan Negrut, 2009 ME451, UW-Madison TexPoint fonts.
Advanced Computer Graphics Spring 2014
Sect. 4.2: Orthogonal Transformations
ME451 Kinematics and Dynamics of Machine Systems Review of Linear Algebra 2.1, 2.2, 2.3 September 06, 2013 Radu Serban University of Wisconsin-Madison.
What is Kinematics. Kinematics studies the motion of bodies.
Comparing Two Motions Jehee Lee Seoul National University.
Affine Geometry.
Computer Graphics Matrices
Graphics Lecture 2: Slide 1 Lecture 2 Transformations for animation.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
Euler Angles This means, that we can represent an orientation with 3 numbers Assuming we limit ourselves to 3 rotations without successive rotations about.
Computer Graphics I, Fall 2010 Transformations.
INTRODUCTION TO DYNAMICS ANALYSIS OF ROBOTS (Part 1)
Chapter 3 Lecture 5: Vectors HW1 (problems): 1.18, 1.27, 2.11, 2.17, 2.21, 2.35, 2.51, 2.67 Due Thursday, Feb. 11.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
1 Objective To provide background material in support of topics in Digital Image Processing that are based on matrices and/or vectors. Review Matrices.
Fundamentals of Computer Animation Orientation and Rotation.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Sect. 4.5: Cayley-Klein Parameters 3 independent quantities are needed to specify a rigid body orientation. Most often, we choose them to be the Euler.
MTH108 Business Math I Lecture 20.
Ch. 2: Rigid Body Motions and Homogeneous Transforms
Rotational Kinematics
A definition we will encounter: Groups
VIRTUAL ENVIRONMENT.
Physics 319 Classical Mechanics
Presentation transcript:

Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts Directorate Page: 1 Introduction to the Theory and Application of Quaternions Part 1 of 2 (“Introduction to Quaternions”)

Learning from the Past, Looking to the Future Overview Part 1 of 2 – Introduction to Quaternions – Definition, mathematical pre-requisites, and quaternion properties – Comparison with Euler angles and direction cosine matrix (DCM) Part 2 of 2 - Working with quaternions – How quaternions are used for kinematics – Defining quaternions for a particular coordinate frame rotation – Using quaternions for coordinate transformations of vectors – Calculation of DCM from quaternion, and vice-versa – Time Propagation of quaternions – Using quaternions for a single axis rotation to align one coordinate frame with another Page: 2

Learning from the Past, Looking to the Future What are quaternions? Quaternions are mathematical abstractions “Invented” or discovered by several mathematicians in nineteenth century, notably Sir William R. Hamilton, a famous British mathematician In math terms, a quaternion is a type of tensor. In simple terms, a tensor can be categorized as: – A rank 0 tensor is a scalar Invariant with respect to any particular reference frame – A rank 1 tensor is a vector Dependent on a particular reference frame Can be transformed from one frame to another Size of the vector (number of elements) is dependent on the application – A rank 2 tensor is a matrix Linear transformation (such as direction cosine matrix) is a rank 2 tensor Moment of inertia tensor is a rank 2 tensor Size of the matrix (number of rows and columns) is dependent on the application – A tensor can be covariant, or contravariant, depending on what type of transformation law it “obeys” Page: 3

Learning from the Past, Looking to the Future How do quaternions compare with vectors? Like vectors: – Quaternions are ordered groups of real numbers (although some people represent quaternion mathematical operations with complex number notation) – Quaternions have mathematical properties with respect to mathematical operations (commutative, associative, etc.) – Quaternions can be added, subtracted, multiplied, divided (and more!) Unlike vectors: – Quaternions have four elements, instead of three Actually, vectors aren’t limited to three elements, but in kinematics and dynamics, we usually think of 3-element vectors to represent 3- dimensional motion Page: 4

Learning from the Past, Looking to the Future How are quaternions represented? Usually, quaternions are expressed as a scalar and a 3-element vector: – q = ( s, V ) = s + x i + y j + z k or = q 0 + q 1 i + q 2 j + q 3 k, where i,j,k are basis vectors of some reference frame – The scalar can represent time or a rotation angle (or anything else!) In kinematics use, the scalar part is usually related to a right hand rule rotation angle about the direction specified by the vector part In mechanics use, the scalar is usually related to time, and the vector represents position, velocity, or acceleration Quaternions have virtually unlimited applications In this presentation, we will concentrate on the kinematics use of quaternions for coordinate transformations, etc. Page: 5

Learning from the Past, Looking to the Future How are quaternions used in kinematics? – q = ( , V ) –  is rotation of some object, or reference frame about direction specified by vector, V – A more common way to express q: q = [ cos(  /2), n sin(  /2) ] where n is unit vector along V ( or, n = V / | V | ) – Latter form is convenient, in that it is a unit quaternion (its magnitude = 1), which simplifies the mathematics – In the latter form, the elements of the quaternion are also known as the “Euler parameters” which describe the rotation Page: 6 x y z  V n

Learning from the Past, Looking to the Future Addition / Subtraction Properties of Quaternions Quaternion addition / subtraction – If q 1 = ( s 1, V 1 ) and q 2 = ( s 2, V 2 ) – q 1 + q 2 = ( ( s 1 + s 2 ), ( V 1 + V 2 ) ) – q 1 - q 2 = ( ( s 1 - s 2 ), ( V 1 - V 2 ) ) Note that some define subtraction using “scale” factors: q 1 - q 2 = ( ( s 1 - s 2 ), ( V 1 - V 2 ) / 3 ) This form preserves the holonomic characteristics of quaternions – Quaternion addition is associative and commutative (subtraction is associative, but not commutative) q 1 ± ( q 2 ± q 3 ) = ( q 1 ± q 2 ) ± q 3 q 1 + q 2 = q 2 + q 1 q 1 - q 2 ≠ q 2 - q 1 Page: 7

Learning from the Past, Looking to the Future Multiplication Properties of Quaternions Quaternion multiplication is associative, but not commutative – q 1 * ( q 2 * q 3 ) = ( q 1 * q 2 ) * q 3 – q 1 * q 2 ≠ q 2 * q 1 – If q 1 = ( s 1, V 1 ) and q 2 = ( s 2, V 2 ), then the product of q 1 and q 2 is q 1 * q 2 = ( ( s 1 s 2 – V 1 · V 2 ), ( s 1 V 2 + s 2 V 1 + V 1 ×V 2 ) ) Other forms for quaternion multiplication are presented later An interesting fact is that multiplication of two quaternions with zero scalar parts (two pure vectors) produces a quaternion with the negative dot product of the two vectors as its scalar part, and the cross product of the two vectors as its vector part – Hamilton reportedly used this fact to implement dot and cross products before modern vector algebra was “invented” Page: 8

Learning from the Past, Looking to the Future Other Properties of Quaternions Quaternion conjugate is similar to conjugate of complex numbers – If q = ( s, V ), the conjugate of q is q* = (s, -V ) – The conjugate of the conjugate of a quaternion returns the original quaternion: ( q* ) * = (s, +V ) = q Quaternion magnitude, or norm: – If q = ( s, V ), where V = xi + yj + zk – the norm of q is | q | = √ s 2 + x 2 + y 2 + z 2 Page: 9

Learning from the Past, Looking to the Future Quaternion Inverse and Conjugate Product of quaternion and its conjugate: – q q* = ( (s 2 + | V | 2 ), ( s (-V) + sV + V × V ) ) = ( (s 2 + x 2 + y 2 + z 2 ), 0 ) = | q | 2 Quaternion inverse: – From the equation above, it follows that ( q q* ) / | q | 2 = 1, or q -1 = q* / | q | 2 e.g. – quaternion’s inverse is its conjugate divided by its norm squared Unit quaternion: – Defined as | q | = 1 – The inverse of a unit quaternion is its conjugate Page: 10

Learning from the Past, Looking to the Future Multiplication of Quaternion by a scalar Multiplication of quaternion by scalar: – If q = ( s, V ), then, k q = ( ks, kV ) = q 2 for any real k Multiplication of quaternion by negative one: – Consider a special quaternion, q M1 defined as: q M1 = ( -1, 0 n ) = scalar -1, written as quaternion – Note that q M1 = ( -1, 0 n ) can be expressed q M1 = ( cos(  /2), n sin(  /2) ), where  ±2  n q M1 = [ cos( ±  n ) ), n sin( ±  n ) ] = [ -1, 0 ], where n = 1, 3, 5, … – Multiplication of any quaternion by -1, (or q M1 ) gives the same quaternion rotated about its vector direction by ±2  n, so that the orientation defined by the quaternion is unchanged  Multiplication of a quaternion by -1 does not change the orientation defined by the quaternion Quite often, people will multiply a quaternion by -1 if the scalar part is negative Page: 11

Learning from the Past, Looking to the Future Quaternion Multiplication Another way to multiply two quaternions: – If q 1 = ( s 1, V 1 ) and q 2 = ( s 2, V 2 ) – Recall from earlier slide that the product of q 1 and q 2 can be computed from q 1 * q 2 = ( ( s 1 s 2 – V 1 · V 2 ), ( s 1 V 2 + s 2 V 1 + V 1 ×V 2 ) ) – This product can be computed manually as follows: Define the product of basis vectors i, j, and k as: i j = k, j k = i, k i = j j i = -k, k j = -i, i k = -j i i = -1, j j = -1, k k = -1 Note: these multiplications are NOT commutative – Compute product q 1 * q 2 term by term: q 1 * q 2 = ( s 1 + x 1 i + y 1 j + z 1 k ) * ( s 2 + x 2 i + y 2 j + z 2 k ) = s 1 s 2 + s 1 x 2 i + s 1 y 2 j + s 1 z 2 k + x 1 s 2 i + x 1 x 2 (-1) + x 1 y 2 k + x 1 z 2 (-j) + y 1 s 2 j + y 1 x 2 (-k) + y 1 y 2 (-1) + y 1 z 2 i + z 1 s 2 k +z 1 x 2 j + z 1 y 2 (-i) + z 1 z 2 (-1) Page: 12

Learning from the Past, Looking to the Future Quaternion Multiplication - Continued Another way to multiply two quaternions - continued: – Group scalar and i, j, k items in term by term product of q 1 * q 2 : q 1 * q 2 = ( s 1 s 2 - x 1 x 2 - y 1 y 2 - z 1 z 2 ) + i ( s 1 x 2 + x 1 s 2 + y 1 z 2 - z 1 y 2 ) + j ( s 1 y 2 - x 1 z 2 + y 1 s 2 + z 1 x 2 ) + k ( s 1 z 2 + x 1 y 2 - y 1 x 2 + z 1 s 2 ) or q 1 * q 2 = ( s, ( xi + yj + zk ) ) where s = s 1 s 2 - x 1 x 2 - y 1 y 2 - z 1 z 2 x = s 1 x 2 + x 1 s 2 + y 1 z 2 - z 1 y 2 y = s 1 y 2 - x 1 z 2 + y 1 s 2 + z 1 x 2 z = s 1 z 2 + x 1 y 2 - y 1 x 2 + z 1 s 2 Page: 13

Learning from the Past, Looking to the Future Quaternion Multiplication - Matrix / Vector form – From expression on previous chart one can express quaternion multiplication as one of the two equivalent matrix / vector products: q 1 * q 2 = Q 1 * q 2 or = Q 2 * q 1 where – Q 1 is referred to as the “quaternion matrix” – Q 2 is referred to as the “quaternion transmuted matrix” – Note that both are skew symmetric matrices and have the following properties: quaternion scalar part down the diagonal quaternion in first column and quaternion conjugate in first row Shaded part of quaternion matrix is similar to the matrix form of a cross product operation (except the latter has zeros down the diagonal) Page: 14

Learning from the Past, Looking to the Future Quaternion Multiplication - Definition of Scalar Part On the previous page, the quaternions to be multiplied were represented as column vectors with the scalar part as the first element, as follows; If q = ( q 0, q 1 i, q 2 j, q 3 k ), then But, occasionally some people represent quaternions as column vectors with the scalar part as the fourth element as follows; If q = (q 1 i, q 2 j, q 3 k, q 4 ), then If represented in this latter form, the matrix / vector forms for quaternion multiplication shown on the previous page will not be correct Page: 15

Learning from the Past, Looking to the Future Euler angles Euler angles define the orientation of one frame relative to another specified by three sequential rotations about x, y, and / or z axes in any “convenient” sequence, as dictated by the application (or user’s preference) Provides an “intuitive” representation of the relative orientation of two reference frames Can’t easily transform vectors directly with Euler angles, must compute DCM or other transformation methods first Although rarely used, can integrate Euler angle rates to simulate vehicle angular motion – Requires only 3 state equations for 3-D angular motion – Usually requires smaller integration step size than propagating DCMs or quaternions, since rate of change of Euler angles is larger than that of DCM elements – Some orientations, coupled with specific Euler angle sequences can result in singularities in Euler angle rates Page: 16

Learning from the Past, Looking to the Future Time Propagation of Euler angles Euler rates for typical yaw-pitch-roll Euler sequence of a reference frame relative to another frame: where p, q, r = angular rates of second frame relative to initial frame, measured with respect to the second frame’s axes The roll Euler angle rate,  dot, is directly proportional to x-axis angular rate, p, of the vehicle, so that a smaller integration step size required, since it varies rapidly Singularity in  -dot,  -dot (rates  ∞) for yaw-pitch-roll sequence when cos  = 0 (  = ±90 degrees) Page: 17

Learning from the Past, Looking to the Future Direction Cosine Matrices (DCM) DCMs provide method for transforming vectors from one reference frame to another, usually implemented as matrix multiplication operations Rows of DCM are direction cosines of the x R -y R -z R axes of the rotated frame relative to those of the reference frame (X-Y-Z): = transformation From XYZ frame axes to x R y R z R frame axes where i,j,k are basis vectors of rotated frame, and I,J,K are basis vectors of the reference frame DCM is orthogonal: inverse of DCM is same as its transpose, and each row and column of DCM has RSS value of 1  can be used to reduce number of states to be propagated Page: 18

Learning from the Past, Looking to the Future Time Propagation of DCMs DCMs avoid propagation singularities that Euler angles can have Since DCM is orthogonal its magnitude is invariant, so where p,q, and r = angular rate of rotated reference frame axes relative to initial reference frame, expressed in the rotated reference frame axes Allows a larger integration step size than integrating Euler angle rates, since derivatives of DCM are proportional to the angular rates, p, q, and r, multiplied by the elements of the DCM, which are less than or equal to 1 (e.g. – the magnitudes of rate of change of the DCM elements is smaller than the vehicle body axis angular rates) Requires 9 state equations (actually only 6 if row / column orthogonality constraints are used) Page: 19

Learning from the Past, Looking to the Future Multiple axis rotations with DCMs DCMs usually represent multiple sequential axis rotations: – DCMs of any Euler angle sequence can be computed by chaining simple 1-axis rotation DCMs in proper sequence: – Note the order of multiplication of the simple DCMs (is important for comparison with quaternions to follow!) – For yaw-pitch-roll Euler sequence: Page: 20

Learning from the Past, Looking to the Future Singularities in Euler angles from DCMs – Continuing from the DCM product on the previous page: – This illustrates the ambiguity possible with Euler angles For rotations about three independent axes, if the intermediate (second) rotation is ±90°, the DCM cannot be used to compute unique values of the other two angles BUT, the DCM is still valid, and its rates are finite, even at the ±90° angle! This ambiguity is consistent with the singularity in the Euler angle rates when  = ±90° (shown a few slides ago) Page: 21 Note: this equation can only determine  ±  : there are no unique values

Learning from the Past, Looking to the Future Introduction to Quaternions Part 1 of 2 Summary In Part 1, we have covered the following topics – Definition of quaternions – Mathematical properties – Alternate expressions for quaternion multiplication, including matrix/vector forms – How quaternions differ from DCMs and Euler angles In Part 2, “Working with Quaternions”, we will cover the following: – How quaternions are used for kinematics – Defining quaternions for a particular coordinate frame rotation – Using quaternions for coordinate transformations of vectors – Calculation of DCM from quaternion, and vice-versa – Time Propagation of quaternions – Using quaternions for a single axis rotation to align one coordinate frame with another Page: 22