Quaternion properties: addition. Introduction to quaternions. Quaternion properties: multiplication. Derivation of multiplication

Similar documents
Animating orientation. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

Quaternions and Rotations

Animation Curves and Splines 2

Transformations: 2D Transforms

Quaternion Rotations AUI Course Denbigh Starkey

12.1 Quaternions and Rotations

Quaternions and Rotations

Quaternions and Rotations

Animation and Quaternions

Quaternions and Rotations

Quaternions & Rotation in 3D Space

Lecture Note 3: Rotational Motion

CS 445 / 645 Introduction to Computer Graphics. Lecture 21 Representing Rotations

Rotation with Quaternions

CS770/870 Spring 2017 Quaternions

Quaternions and Euler Angles

Transformations Week 9, Lecture 18

Fundamentals of Computer Animation

Visual Recognition: Image Formation

Computer Animation II

3D Kinematics. Consists of two parts

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

a a= a a =a a 1 =1 Division turned out to be equivalent to multiplication: a b= a b =a 1 b

2D TRANSFORMATIONS AND MATRICES

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

FIVE YEARS OLD. P r o f e s s o r ikobbins B. Stoeckei ol is s h o w n b y the J u n e 1 pig c r o p

Rotations in 3D Graphics and the Gimbal Lock

3D Modelling: Animation Fundamentals & Unit Quaternions

CS354 Computer Graphics Rotations and Quaternions

Orientation & Quaternions

ME 597: AUTONOMOUS MOBILE ROBOTICS SECTION 2 COORDINATE TRANSFORMS. Prof. Steven Waslander

Quaternions. Mike Bailey. A Useful Concept: Spherical Linear Interpolation. sin(1 t) sin t

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Lecture «Robot Dynamics»: Kinematics 2

3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. x y z. x y z. glvertex3f(x, y,z);

Le s s on 02. Basic methods in Computer Animation

2D and 3D Transformations AUI Course Denbigh Starkey

Quaternions and Exponentials

2D and 3D Coordinate Systems and Transformations

CS612 - Algorithms in Bioinformatics

Fundamentals of Computer Animation

1 Historical Notes. Kinematics 5: Quaternions

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL

Quaternions in Practice

QUATERNIONS AND ROTATIONS

Vector Calculus: Understanding the Cross Product

Transformations. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Objectives. transformation. General Transformations. Affine Transformations. Notation. Pipeline Implementation. Introduce standard transformations

CMSC 425: Lecture 6 Affine Transformations and Rotations

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

Inertial Measurement Units II!

Introduction to quaternions. Mathematics. Operations

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

Reading. Topics in Articulated Animation. Character Representation. Animation. q i. t 1 t 2. Articulated models: Character Models are rich, complex

GEOMETRIC TRANSFORMATIONS AND VIEWING

Fundamentals of Structural Geology Exercise: concepts from chapter 2

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

INF3320 Computer Graphics and Discrete Geometry

EE Kinematics & Inverse Kinematics

Aalto CS-C3100 Computer Graphics, Fall 2016

Chapter 6. Curves and Surfaces. 6.1 Graphs as Surfaces

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation

Coordinate transformations. 5554: Packet 8 1

Section 4.2 selected answers Math 131 Multivariate Calculus D Joyce, Spring 2014

Splines & Quaternions (splines.txt) by Jochen Wilhelmy a.k.a. digisnap

Rotation and Orientation: Fundamentals. Perelyaev Sergei VARNA, 2011

Hw 4 Due Feb 22. D(fg) x y z (

Computer Graphics Geometric Transformations

A Detailed Look into Forward and Inverse Kinematics

CS 475 / CS 675 Computer Graphics. Lecture 16 : Interpolation for Animation

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

OPENRAVE TUTORIAL. Robot Autonomy Spring 2014

COMP 558 lecture 19 Nov. 17, 2010

Transformations (Rotations with Quaternions) October 24, 2005

3D Transformations and Complex Representations. Computer Graphics CMU /15-662, Fall 2016

Animation. Animation

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Specifying Complex Scenes

Kinematical Animation.

Computer Animation III

Realization of orientation interpolation of 6-axis articulated robot using quaternion

Lab 2A Finding Position and Interpolation with Quaternions

Transformations. Questions on Assignment 1? Announcements

CS5620 Intro to Computer Graphics

Rotations (and other transformations) Rotation as rotation matrix. Storage. Apply to vector matrix vector multiply (15 flops)

Hello, welcome to the video lecture series on Digital Image Processing. So in today's lecture

Supplementary Material: The Rotation Matrix

MATHEMATICS FOR ENGINEERING TUTORIAL 5 COORDINATE SYSTEMS

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

UNIT 2 2D TRANSFORMATIONS

CS-184: Computer Graphics. Today. Lecture #5: 3D Transformations and Rotations. Transformations in 3D Rotations

Analysis of Euler Angles in a Simple Two-Axis Gimbals Set

Quaternions. Ken Shoemake Department of Computer and Information Science University of Pennsylvania Philadelphia, PA 19104

Planar Robot Kinematics

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms

Construction Portfolio #4

Quaternions: From Classical Mechanics to Computer Graphics, and Beyond

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

Transcription:

Introduction to quaternions Definition: A quaternion q consists of a scalar part s, s, and a vector part v ( xyz,,, v 3 : q where, [ s, v q [ s, ( xyz,, q s+ ix + jy + kz i 2 j 2 k 2 1 ij ji k k Quaternion properties: addition Definition: q [ s, v [ s, ( x, yz, q' [ s', v' [ s',( x', y', z' q+ q' [ s + s', v+ v' ( s + s' + i( x+ x' + j( y+ y' + k( z + z' Addition is: associative commutative Quaternion properties: multiplication Definition: qq' [ ss' v v', v v' + sv' + s'v qq' [ s, v [ s', v' Derivation of multiplication ( s + ix + jy + kz ( s' + ix' + jy' + kz' qq' ss' + s( ix' + jy' + kz' + ixs' + ix( ix' + jy' + kz' + ( jys' + jy( ix' + jy' + kz' + kzs' + kz( ix' + jy' + kz' Note: qq' ss' + sv' + s'v+ ix( ix' + jy' + kz' + a b a x b x + a y b y + a z b z b a jy( ix' + jy' + kz' + kz( ix' + jy' + kz' a b ( a y b z a z b y, a z b x a x b z, a x b y a y b x b a qq' ss' + sv' + s'v ( xx' + yy' + zz' + ix( jy' + kz' + jy( ix' + kz' + kz( ix' + jy'

Derivation of multiplication (continued qq' ss' + sv' + s'v ( xx' + yy' + zz' + ix( jy' + kz' + jy( ix' + kz' + kz( ix' + jy' Derivation of multiplication (continued qq' ss' + sv' + s'v ( xx' + yy' + zz' + xy'k xz'j yx'k + yz'i + zx'j zy'i Now: ij k, ik j, ji k, jk i, ki j, kj i qq' ss' + sv' + s'v ( xx' + yy' + zz' + ( yz' zy' i + ( zx' xz' j + ( xy' yx' k qq' ss' + sv' + s'v ( xx' + yy' + zz' + xy'k xz'j yx'k + yz'i + zx'j zy'i qq' ss' + sv' + s'v v v' + v v' [ ss' v v', v v' + sv' + s'v Quaternion properties Quaternion properties Conjugate: q qq Inverse: q q 2 q 1 Note: qq [ s 2 ( v ( v, v ( v + sv + s( v [ + v v, 0 s 2 Note: qq 1 q 1 q qq q 2 q 2 q 2 [ 1, 0 q s 2 + x 2 + y 2 + z 2 Unit quaternion: q 1

Quaternion rotations Quaternion rotation Let, Any unit quaternion can be expressed as: q [ cos( θ 2, sin( θ 2 kˆ where, p ( p x, p y, p z denote the Cartesian coordinates of a point in 3-space. otation of p by θ about the vector kˆ to : kˆ ( k x, k y, k z. p [ 0, p [ 0, Such a unit quaternion represents a rotation of vector kˆ. θ about the qpq Quaternion rotation: angle-axis equivalence emember: qpq qq' [ ss' v v', v v' + sv' + s'v [ s, v [ 0, p [ s, v Quaternion rotation: angle-axis equivalence Scalar part: (Why? Mathematica Vector part I: [ s( v p + ( v p v + s( p v, ( v p v s( p v + s( v p + s 2 p+ v( v p s( v p + ( v p v + s( p v 0 [ v p, v p+ sp [ s, v s( p v + s( v p 2s( v p [ s( v p + ( v p v + s( p v, ( v p v s( p v + s( v p + s 2 p+ v( v p [ 0, ( v p v + 2s( v p + s 2 p+ v( v p

Quaternion rotation: angle-axis equivalence [ 0, ( v p v + 2s( v p + s 2 p+ v( v p Quaternion rotation: angle-axis equivalence ( s 2 v vp + 2s( v p + 2( v pv Vector part II: ( v p v ( v vp ( v pv (Why? Mathematica emember unit quaternion: q [ cos( θ 2, sin( θ 2 kˆ [ 0, ( s 2 v vp + 2s( v p + 2( v pv ( s 2 v vp + 2s( v p + 2( v pv [ cos 2 ( θ 2 sin 2 ( θ 2 p + 2cos( θ 2 sin( θ 2 kˆ p + 2sin 2 ( θ 2 ( kˆ pkˆ Quaternion rotation: angle-axis equivalence Quaternion rotation: angle-axis equivalence cosθ cos 2 ( θ 2 sin 2 ( θ 2 ( cosθp + ( sinθkˆ p + ( 1 cosθ ( kˆ pkˆ sinθ 2cos( θ 2 sin( θ 2 ( cθp + ( sθkˆ p + ( vθ ( kˆ pkˆ ( 1 cosθ ( 1 cos 2 ( θ 2 + sin 2 ( θ 2 2sin 2 ( θ 2 [ cos 2 ( θ 2 sin 2 ( θ 2 p + 2cos( θ 2 sin( θ 2 kˆ p + 2sin 2 ( θ 2 ( kˆ pkˆ ( cosθp + ( sinθkˆ p + ( 1 cosθ ( kˆ pkˆ where, cθ sθ cosθ sinθ vθ 1 cosθ Equivalent to ( θp? kˆ (Best answered by Mathematica.

Quaternion rotation: angle-axis equivalence Answer from Mathematica: ( θp kˆ Quaternion rotation: summary otation through quaternions: qpq ( k 2 x vθ + cθ ( k x k y vθ k z sθ ( k x k z vθ + k y sθ ( θ kˆ ( k x k y vθ + k z sθ ( k 2 y vθ + cθ ( k y k z vθ k x sθ odrigues formula: ( k x k z vθ k y sθ ( k y k z vθ + k x sθ ( k 2 y vθ + cθ ( cθp + ( sθkˆ p + ( vθ ( kˆ pkˆ Conclusion: same as derived earlier! Composite quaternion rotations Conjugate multiplication Assume two rotations: q o followed by q 1 : p (first rotation qq' [ ss' v v', v v' + sv' + s'v ( q 1 [ s 0, v 0 [ s 1, v 1 (multiplication ' q 1 q 1 (second rotation [ s 0 s 1 v 0 v 1, v 0 v 1 s 0 v 0 s 1 v 1 ' q 1 ( p q 1 ' ( q 1 pq ( 0 q 1 ' ( q 1 pq ( 0 q 1 ' ( q 1 pq ( 1 ( q 1 ([ s 1, v 1 [ s 0, v 0 [ s 1 s 0 v 1 v 0, v 1 v 0 + s 0 v 1 + s 1 v 0 [ s 1 s 0 v 1 v 0, ( v 1 v 0 + s 0 v 1 + s 1 v 0 [ s 0 s 1 v 0 v 1, v 0 v 1 s 0 v 0 s 1 v 1 ( q 1 ( q 1

Quaternion to angle-axis representation Quaternion to rotation matrix Unit quaternion: q [ s, v q [ cos( θ 2, sin( θ 2 kˆ θ 2atan( v, s kˆ v v Given: q [ s, ( xyz,, what is r 12 r 13 r 21 r 22 r 23 r 31 r 32 r 33? Quaternion to rotation matrix Quaternion to rotation matrix (cont. ( s 2 v vp + 2s( v p + 2( v pv Now: ( s 2 v vp s 2 x 2 ( y 2 z 2 100 010 001 0 z y 2s( v p 2s z 0 x p 2( v pv 2 y x 0 p x 2 xy xz xy y 2 yz p xz yz z 2 ( s 2 x 2 y 2 z 2 2 x 2 xy xz xy y 2 yz xz yz z 2 p 100 010 001 0 z y + 2s z 0 x + y x 0 (...see Mathematica

Quaternion to rotation matrix (cont. otation matrix to quaternion 1 2( y 2 + z 2 2( xy sz 2( xz + sy 2( xy + sz 1 2( x 2 + z 2 2( yz sx 2( xz sy 2( yz + sx 1 2( x 2 + y 2 p Given: r 12 r 13 r 21 r 22 r 23 Therefore, a unit quaternion q [ s, ( xyz,, corresponds to: 1 2( y 2 + z 2 2( xy sz 2( xz + sy 2( xy + sz 1 2( x 2 + z 2 2( yz sx 2( xz sy 2( yz + sx 1 2( x 2 + y 2 r 31 r 32 r 33 what is q [ s, ( xyz,,? otation matrix to quaternion otation matrix to quaternion 1 2( y 2 + z 2 2( xy sz 2( xz + sy 2( xy + sz 1 2( x 2 + z 2 2( yz sx 2( xz sy 2( yz + sx 1 2( x 2 + y 2 s 2 + x 2 y 2 z 2 2( xy sz 2( xz + sy 2( xy + sz s 2 x 2 + y 2 z 2 2( yz sx 2( xz sy 2( yz + sx s 2 x 2 y 2 + z 2 or s 2 + x 2 y 2 z 2 2( xy sz 2( xz + sy 2( xy + sz s 2 x 2 + y 2 z 2 2( yz sx 2( xz sy 2( yz + sx s 2 x 2 y 2 + z 2 3s 2 x 2 y 2 z 2 + 1 3s 2 x 2 y 2 z 2 + ( s 2 + x 2 + y 2 + z 2 + 1 4s 2

otation matrix to quaternion otation matrix to quaternion + 1 4s 2 s 2 ( 1 4 ( 1 + 1 2( y 2 + z 2 2( xy sz 2( xz + sy 2( xy + sz 1 2( x 2 + z 2 2( yz sx 2( xz sy 2( yz + sx 1 2( x 2 + y 2 Similarly: x 2 ( 1 4 ( 1 + r 22 r 33 y 2 ( 1 4 ( 1 r 33 z 2 ( 1 4 ( 1 r 22 r 32 r 23 2( yz + sx 2( yz sx 4sx sx ( 1 4 ( r 32 r 23 sy ( 1 4 ( r 13 r 31 sz ( 1 4 ( r 21 r 12 xy ( 1 4 ( r 12 + r 21 xz ( 1 4 ( r 13 + r 31 yz ( 1 4 ( r 23 + r 32 otation matrix to quaternion s 2 ( 1 4 ( 1 + x 2 ( 1 4 ( 1 + r 22 r 33 y 2 ( 1 4 ( 1 r 33 Quaternion advantages 1. Do not suffer from singularities, as 3-angle conventions do. 2. Most compact way of representing rotations without redundancy or singularity. z 2 ( 1 4 ( 1 r 22 sx ( 1 4 ( r 32 r 23 sy ( 1 4 ( r 13 r 31 sz ( 1 4 ( r 21 r 12 xy ( 1 4 ( r 12 + r 21 xz ( 1 4 ( r 13 + r 31 yz ( 1 4 ( r 23 + r 32 Now what?

Quaternion advantages (cont. 3. Distance metric between rotations: dqp (, min[ Eqp (,, Eq (, p Eqp (, ( s q s p 2 + ( x q x p 2 + ( y q y p 2 + ( z q z p 2 4. Finite-precision re-normalization of compound rotations. 5. For simulation purposes, easy to generate a uniformly random distribution of rotations in quaternion space. Trajectory generation between rotations Linear interpolation (Lerp: where, Lerp(, h fq ( 0, h -------------------------------, h [ 01,, fq ( 0, h fq ( 0, h ( 1 h + q 1 h. 6. Computation of shortest-path, smooth, continuous-velocity trajectories between two rotations (represented as unit quaternions. Trajectory generation between rotations Spherical Linear interpolation (Slerp: Constant velocity Shortest path Linear interpolation (Lerp velocity Slerp(, h ( q 1 q 1 0 h, h [ 01, or equivalently as, Slerp(, h ( q 1 h, h [ 01, (why? Nonconstant velocity... So what s the difference?

Why nonconstant velocity? Spherical linear interpolation (Slerp velocity Constant velocity...