Rotations and Translations

30
Rotations and Translations Euler Theorem + Quaternions

description

Rotations and Translations. Euler Theorem + Quaternions . Representing a Point 3D. A three-dimensional point A is a reference coordinate system here. Rotation along the Z axis. In general:. Using Rotation Matrices. Combining Rotation and Translation. Extension to 4x4. - PowerPoint PPT Presentation

Transcript of Rotations and Translations

Page 1: Rotations and Translations

Rotations and TranslationsEuler Theorem + Quaternions

Page 2: Rotations and Translations

Representing a Point 3D A three-dimensional point

A is a reference coordinate system

here

z

y

xA

ppp

P

Page 3: Rotations and Translations

Rotation along the Z axis In general:

AX

BX

AYBY

1000cossin0sincos

ZABR

Page 4: Rotations and Translations

Using Rotation Matrices

PRP BAB

A

Page 5: Rotations and Translations

Combining Rotation and Translation

BORGABA

BA PPRP

AX

BX

PB

BORGAP

PAAY

BY

Page 6: Rotations and Translations

Extension to 4x4

110001

PPRP BBORG

AAB

A

We can define a 4x4 matrix operator and use a 4x1 position vector

Page 7: Rotations and Translations

Formula

PTP BAB

A

Page 8: Rotations and Translations

Notes Homogeneous transforms are

useful in writing compact equations; a computer program would not use them because of the time wasted multiplying ones and zeros. This representation is mainly for our convenience.

For the details turn to chapter 2.

Page 9: Rotations and Translations

Euler’s Theorem Any two independent orthonormal

coordinate frames can be related by a sequence of rotations (not more than three) about coordinate axes, where no two successive rotations may be about the same axis.

Page 10: Rotations and Translations

Euler Angles This means, that we can represent

an orientation with 3 numbers Assuming we limit ourselves to 3

rotations without successive rotations about the same axis:

Page 11: Rotations and Translations

Example

Page 12: Rotations and Translations

Another Example Suppose we want to use ZXZ

rotation, Rotation along Z axis, Rotation along X axis, Rotation along Z axis,

Page 13: Rotations and Translations

Example - Cont

Let’s see what happens if,

Page 14: Rotations and Translations

Example – Cont 2

Changing 's and 's values in the above matrix has the same effects: the rotation's angle changes, but the rotation's axis remains in the direction

Page 15: Rotations and Translations

Gimbal Lock

Gimbal Lock Animation

Page 16: Rotations and Translations

Euler Angle - Matlab If we want to rotate Roll,Pitch and Yaw Roll 0.1 degrees Pitch 0.2 degrees Yaw 0.3 degrees

>> rotx(0.1)*roty(0.2)*rotz(0.3)ans = 0.9363 -0.2896 0.1987 0.3130 0.9447 -0.0978 -0.1593 0.1538 0.9752

Page 17: Rotations and Translations

Euler Angle – Matlab cont.>> rpy2r(0.1,0.2,0.3) ans =

0.9363 -0.2896 0.1987 0.3130 0.9447 -0.0978 -0.1593 0.1538 0.9752

Page 18: Rotations and Translations

Euler Theorem In three-dimensional space, any

displacement of a rigid body such that a point on the rigid body remains fixed, is equivalent to a single rotation about some axis that runs through the fixed point.

Page 19: Rotations and Translations

Euler Theorem - MatlabR = 0.9363 -0.2896 0.1987 0.3130 0.9447 -0.0978 -0.1593 0.1538 0.9752[theta, v] = tr2angvec(R)

theta =

0.3816

v =

0.3379 0.4807 0.8092

Page 20: Rotations and Translations

Euler Theorem – Matlab cont.>> angvec2r(0.3816, [0.3379,0.4807,0.8092])

ans =

0.9363 -0.2897 0.1987 0.3130 0.9447 -0.0979 -0.1593 0.1538 0.9752

Page 21: Rotations and Translations

3D Rotations - MatlabR = rotx(pi/2);trplot(R)

tranimate(R)

Page 22: Rotations and Translations

HW

Page 23: Rotations and Translations

Quaternions The quaternion group has 8

members:

Their product is defined by the equation:

, , , 1i j k

2 2 2 1i j k ijk

Page 24: Rotations and Translations

Example Calculate

2

?1

( 1)

ijijkijkk k

k ijkk ijk ijij k

Page 25: Rotations and Translations

Quaternions - Algebra Using the same methods, we can

get to the following:

Page 26: Rotations and Translations

Quaternions AlgebraWe will call the following linear

combination a quaternion. It can be written also as:

All the combinations of Q where a,b,c,s are real numbers is called the quaternion algebra.

Q s ia jb kc s v

, , ,Q s a b c

Page 27: Rotations and Translations

Quaternion AlgebraBy Euler’s theorem every rotation can be

represented as a rotation around some axis

with angle . In quaternion terms:

Composition of rotations is equivalent to quaternion multiplication.

K

1 2 3 42 2ˆ ˆ( , ) (cos( ) sin( ) ) ( , , , )Rot K K

Page 28: Rotations and Translations

ExampleWe want to represent a rotation around

x-axis by 90 , and then around z-axis by 90 :

31 1

2 2 2

(cos(45 ) sin(45 ) )(cos(45 ) sin(45 ) )( )( ) cos(60 )

3( ) ,120

3

o o o o

o

o

k ii j ki j k

i j kRot

Page 29: Rotations and Translations

Rotating with quaternionsWe can describe a rotation of a given

vector v around a unit vector u by angle :

this action is called conjugation.

* Pay attention to the inverse of q (like in complex numbers) !

Page 30: Rotations and Translations

Rotating with quaternionsThe rotation matrix corresponding to a rotation by the unit quaternion z = a + bi + cj + dk (with |z| = 1) is given by:

Its also possible to calculate the quaternion from rotation matrix:Look at Craig (chapter 2 p.50 )