Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lecture 2 - Description (00-12-01)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 50

Lecture 2:

Spatial Descriptions and Transformations


Advanced Robotics
Hamed Ghafarirad

Amirkabir University of Technology / H. Ghafarirad


Outlines

 Descriptions: Positions, Orientations and Frames


 Mappings: Changing Description from Frame to Frame
 Operators
 Transformation Arithmetic
 More on Representation of Orientation
Euler Angles
Fixed Angles
Equivalent Angle-Axis
Euler Parameters

 Transformation of Free Vectors 2

Amirkabir University of Technology / H. Ghafarirad


Descriptions: Positions, Orientations and Frames
 To define position and orientation, we must define coordinate systems
and conventions for its representation.

 There is a universe coordinate system to which everything can be


referenced.

 A description is used to specify attributes of various objects.

 Objects are parts, tools, and the manipulator itself.

 Description:
 Positions
 Orientations
 An entity that contains both of these descriptions: the frame

Amirkabir University of Technology / H. Ghafarirad ← Outline


Descriptions: Positions, Orientations and Frames
 Description of a Position
 Once a coordinate system is established, locate any point with a 3 × 1
position vector.

 Vectors must be tagged identifying which coordinate system they are


defined within, e,g, 𝐴𝑃 .

 𝐴𝑃 have numerical values that indicate distances along the axes of {A}
(Projection).
𝐴
𝑝𝑥
𝐴𝑃 = 𝐴𝑝
𝑦
𝐴𝑝
𝑧
𝐴𝑝
 𝑥 = 𝐴𝑃 . 𝑋𝐴
 𝐴𝑝 = 𝐴𝑃 . 𝑌𝐴
𝑦
 𝐴𝑝 = 𝐴𝑃 . 𝑍𝐴
𝑧
4

Amirkabir University of Technology / H. Ghafarirad ← Outline


Descriptions: Positions, Orientations and Frames
 Description of a Position
 Vector Norm:
1/2
𝐴𝑃 = 𝐴𝑃 . 𝐴𝑃 1/2 = 𝐴𝑝 2 + 𝐴𝑝 2 + 𝐴𝑝 2
𝑥 𝑦 𝑧

 It is invariant of the frame.

𝐴𝑃 = 𝐴𝑃 . 𝐴𝑃 1/2 = 𝐵𝑃 . 𝐵𝑃 1/2 = 𝐵𝑃

 Q: Condition ?

Amirkabir University of Technology / H. Ghafarirad ← Outline


Descriptions: Positions, Orientations and Frames
 Description of an Orientation
 Positions of points are described with vectors and orientations of
bodies are described with an attached coordinate system.

 Attach a coordinate system to the body and then give a description of this
coordinate system relative to the reference system.

 One way to describe the coordinate system {B}:


 Write its unit vectors 𝑋𝐵 , 𝑌𝐵 , 𝑍𝐵 in terms of the coordinate system
{A}.

 They are called 𝐴𝑋𝐵 , 𝐴𝑌𝐵 , 𝐴𝑍𝐵 .

Amirkabir University of Technology / H. Ghafarirad ← Outline


Descriptions: Positions, Orientations and Frames
 Description of an Orientation
 Each component is the dot product of a pair of unit vectors.
𝑋𝐵 . 𝑋𝐴 𝐶𝑜𝑠 𝑋𝐵 , 𝑋𝐴 𝑟11
𝐴
𝑋𝐵 = 𝑋𝐵 . 𝑌𝐴 = 𝐶𝑜𝑠 𝑋𝐵 , 𝑌𝐴 = 𝑟21
𝑋𝐵 . 𝑍𝐴 𝑟31
𝐶𝑜𝑠 𝑋𝐵 , 𝑍𝐴
𝑌𝐵 . 𝑋𝐴 𝐶𝑜𝑠 𝑌𝐵 , 𝑋𝐴 𝑟12
𝐴
𝑌𝐵 = 𝑌𝐵 . 𝑌𝐴 = 𝐶𝑜𝑠 𝑌𝐵 , 𝑌𝐴 = 𝑟22
𝑌𝐵 . 𝑍𝐴 𝑟32
𝐶𝑜𝑠 𝑌𝐵 , 𝑍𝐴
𝑍𝐵 . 𝑋𝐴 𝐶𝑜𝑠 𝑍𝐵 , 𝑋𝐴 𝑟13
𝐴
𝑍𝐵 = 𝑍𝐵 . 𝑌𝐴 = 𝐶𝑜𝑠 𝑍𝐵 , 𝑌𝐴 = 𝑟23
𝑍𝐵 . 𝑍𝐴 𝑟33
𝐶𝑜𝑠 𝑍𝐵 , 𝑍𝐴
 Stack these three unit vectors together as the columns of a 3 × 3 matrix.
𝑋𝐵 . 𝑋𝐴 𝑌𝐵 . 𝑋𝐴 𝑍𝐵 . 𝑋𝐴 𝑟11 𝑟12 𝑟13
𝐴𝑅
𝐵 = 𝐴𝑋
𝐵
𝐴𝑌
𝐵
𝐴𝑍
𝐵 = 𝑋𝐵 . 𝑌𝐴 𝑌𝐵 . 𝑌𝐴 𝑍𝐵 . 𝑌𝐴 = 𝑟21 𝑟22 𝑟23
𝑋𝐵 . 𝑍𝐴 𝑌𝐵 . 𝑍𝐴 𝑍𝐵 . 𝑍𝐴 𝑟31 𝑟32 𝑟33

 It is called Rotation Matrix (R). 7


 Components of rotation matrices are direction cosines.
Amirkabir University of Technology / H. Ghafarirad ← Outline
Descriptions: Positions, Orientations and Frames
 Properties of Rotation Matrix
1) Orthonormal
 The columns all have unit magnitude, and, these unit vectors are
orthogonal.
𝐴 𝐴 𝐴
𝑋𝐵 = 𝑌𝐵 = 𝑍𝐵 = 1

𝐴
𝑋𝐵 . 𝐴𝑌𝐵 = 𝐴
𝑌𝐵 . 𝐴𝑍𝐵 = 𝐴
𝑋𝐵 . 𝐴𝑍𝐵 = 0

2) The rows of the matrix are the unit vectors of {A} expressed in {B}.
𝐵𝑋 𝑇
𝑋𝐵 . 𝑋𝐴 𝑌𝐵 . 𝑋𝐴 𝑍𝐵 . 𝑋𝐴 𝐴
𝐴 𝐵 𝑇
𝑅𝐵 = 𝐴𝑋𝐵 𝐴𝑌𝐵 𝐴𝑍𝐵 = 𝑋𝐵 . 𝑌𝐴 𝑌𝐵 . 𝑌𝐴 𝑍𝐵 . 𝑌𝐴 = 𝑌𝐴
𝑋𝐵 . 𝑍𝐴 𝑌𝐵 . 𝑍𝐴 𝑍𝐵 . 𝑍𝐴 𝐵𝑍 𝑇
𝐴
= 𝐵𝑋𝐴 𝐵𝑌𝐴 𝐵𝑍𝐴 𝑇 = 𝐵𝑅𝐴𝑇

 The description of frame {A} relative to {B} ( 𝐵𝑅𝐴 ) is the transpose of


𝐴
𝑅𝐵 .
𝐵𝑅
𝐴 = 𝐴𝑅𝐵𝑇 8

Amirkabir University of Technology / H. Ghafarirad ← Outline


Descriptions: Positions, Orientations and Frames
 Properties of Rotation Matrix
3) From linear algebra, the inverse of a orthonormal matrix is equal to its
transpose.
𝐴 𝑇
𝑅𝐵 = 𝐴𝑅𝐵−1
 To demonstrate:
𝐴 𝑇
𝑋𝐵
𝐴𝑅 𝑇 𝐴𝑅 = 𝐴 𝑇 𝐴𝑋 𝐴𝑌 𝐴𝑍 = 𝐼3
𝐵 𝐵 𝑌𝐵 𝐵 𝐵 𝐵
𝐴𝑍 𝑇
𝐵
 where 𝐼3 is the 3 × 3 identity matrix.

4)
𝑑𝑒𝑡 𝐴𝑅𝐵 = 1
 Q: Why?

5) It can be expressed by Only 3 independent numbers.


9
 Q: Why
Amirkabir University of Technology / H. Ghafarirad ← Outline
Descriptions: Positions, Orientations and Frames
 Description of a Frame
 For a frame, both position and orientation should be determined.

 For convenience, the point whose position described is chosen as the


origin of the body-attached frame.

 The description of a frame: a position vector and a rotation matrix.

 Frame {B} is described by 𝐴𝑅𝐵 and 𝐴𝑃𝐵𝑂𝑅𝐺 .


𝐵 = * 𝐴𝑅𝐵 , 𝐴𝑃𝐵𝑂𝑅𝐺 +

𝐴
 𝑃𝐵𝑂𝑅𝐺 is the vector that locates the origin of the frame {B}.

 A frame can be used as a description


of one coordinate system relative to another.

10

Amirkabir University of Technology / H. Ghafarirad ← Outline


Descriptions: Positions, Orientations and Frames
 Description of a Frame
 Frames {A} and {B} are known relative to the universe frame.
 Frame {C} is known relative to frame {A}.

 Position and orientation can be represented as frames:


Position: a frame with identity rotation-matrix and position-vector
which locates the point
Orientation: a frame whose position-vector was the zero vector. 11

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Changing Description from Frame to Frame
 Mapping between frames can be done by:
Translation
Rotation
General Transformation

 Translation
 A position defined by the vector 𝐵𝑃 .
 {A} has the same orientation as {B}
 {A} differs only by a translation, i.e. 𝐴𝑃𝐵𝑂𝑅𝐺 .
 Express this point in space in terms of frame {A}, i.e. 𝐴𝑃 .
𝐴𝑃 = 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺

12

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Changing Description from Frame to Frame
 Rotation
 A position defined by the vector 𝐵𝑃 .
 The orientation of {B} is known relative to {A} i.e. 𝐴𝑅𝐵 .
 The origins of the two frames are coincident.
 Express this point in space in terms of frame {A}, i.e. 𝐴𝑃 .

 The components of 𝐴𝑃 may be calculated by the projection as:


𝐴𝑝
𝑥
𝐴𝑃 𝐴𝑝
= 𝑦
𝐴
𝑝𝑧
𝐴𝑝
 𝑥 = 𝐵𝑋𝐴 . 𝐵𝑃
 𝐴𝑝 = 𝐵𝑌𝐴 . 𝐵𝑃 3 .
𝑦 . .
 𝐴𝑝 = 𝐵𝑍𝐴 . 𝐵𝑃
𝑧

 Q: Why?
13

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Frame to Frame
 Rotation
𝐴𝑝
𝑥
𝐴 𝐴
𝑃= 𝑝𝑦
𝐴
𝑝𝑧
𝐴
 𝑝𝑥 = 𝐵𝑋𝐴 . 𝐵𝑃
𝐴
 𝑝𝑦 = 𝐵𝑌𝐴 . 𝐵𝑃
𝐴
 𝑝𝑧 = 𝐵𝑍𝐴 . 𝐵𝑃

 Expressing in the matrix form:


𝐴𝑝 𝐵𝑋 𝑇
𝑥 𝐴
𝐴 𝐴𝑝 𝐵 𝑇 𝐵𝑃
𝑃= 𝑦 = 𝑌𝐴
𝐴𝑝 𝐵𝑍 𝑇
𝑧 𝐴

 Note that the rows of rotation matrix 𝐴𝑅𝐵 are 𝐵𝑋𝐴𝑇 , 𝐵𝑌𝐴𝑇 and 𝐵𝑍𝐴𝑇 .
𝐴𝑃 = 𝐴𝑅𝐵 𝐵𝑃
14

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Changing Description from Frame to Frame
 Rotation
 Example:
 Frame {B} that is rotated relative to frame {A} about 𝑍 by 𝜃 degrees.

 𝐵𝑃 is given.

 Find 𝐴𝑃?

15

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Changing Description from Frame to Frame
 General Transformation
 A position defined by the vector 𝐵𝑃 .
 The orientation of {B} is known relative to {A} i.e. 𝐴𝑅𝐵 .
 The vector that locates {B}'s origin is called 𝐴𝑃𝐵𝑂𝑅𝐺 .
 Express this point in space in terms of frame {A}, i.e. 𝐴𝑃 .

 Assume an intermediate frame {C}:


 the same origin of {B} and the same orientation of {A}.

 Describe 𝐵𝑃 in the intermediate frame.


𝐶
𝑃 = 𝐶𝑅𝐵 𝐵𝑃 = 𝐴𝑅𝐵 𝐵𝑃

 Then account the translation between origins.

 𝐴𝑃 = 𝐴𝑅𝐵 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺

16

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Changing Description from Frame to Frame
 General Transformation
 General transform into a single matrix form.
𝐴
𝑃 = 𝐴𝑇𝐵 𝐵𝑃

 Define a 4 × 4 matrix operator and use 4 × 1 position vectors.


𝐴𝑅 𝐴𝑃
𝐴𝑃 𝐵 𝐵𝑂𝑅𝐺 𝐵𝑃
=
1 1
0 0 0 1
 So,
𝐴𝑃
= 𝐴𝑅𝐵 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺
1=1

 𝐴𝑇 is called a Homogeneous Transformation Matrix.


𝐵

 The description of frame {B} relative to (A} is 𝐴𝑇𝐵 .


17

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Changing Description from Frame to Frame
 General Transformation
 Example:
 Frame {B} is rotated relative to frame {A} about 𝑍 by 30 degrees,
translated 10 units in 𝑋𝐴 and 5 units in 𝑌𝐴 .

 where 𝐵𝑃 = 3 7 0 𝑇 .

 Find 𝐴𝑃 ?

18

Amirkabir University of Technology / H. Ghafarirad ← Outline


Mappings: Changing Description from Frame to Frame
 General Transformation
 Special Transformations
 Translation:
𝐼3×3 𝐴𝑃
𝐵𝑂𝑅𝐺
𝐴
𝑇𝐵 = 𝑇𝑇𝑟𝑎𝑛𝑠 =
0 0 0 1
 Rotation:
0
𝐴𝑅
𝐴𝑇 = 𝑇𝑅𝑜𝑡 = 𝐵 0
𝐵
0
0 0 0 1

19

Amirkabir University of Technology / H. Ghafarirad ← Outline


Operators
 Mapping concept can be used as operators.
Translation
Rotation
Transformation

 Translation
 Moving a point 𝐴𝑃 in space a finite distance along a given vector
1
direction 𝐴𝑄 .
𝐴𝑃 = 𝐴𝑃1 + 𝐴𝑄
2
 Frame is invariant.

 Translational Operator:
𝐴𝑃 𝐴𝑃
2 = 𝑇𝑇𝑟𝑎𝑛𝑠 𝑄 1

 Q: 𝑇𝑇𝑟𝑎𝑛𝑠 𝑄 = ?

20

Amirkabir University of Technology / H. Ghafarirad ← Outline


Operators
 Translation
 It is accomplished with the same mathematics as mapping the point to a
second frame.

 When a vector is moved "forward" relative to a frame = the frame is


moved "backward“.

1 0 0 𝑞𝑥
𝑇𝑇𝑟𝑎𝑛𝑠 𝑄 = 0 1 0 𝑞𝑦
0 0 1 𝑞𝑧
0 0 0 1

 where 𝑞𝑥 , 𝑞𝑦 and 𝑞𝑧 are the components of the translation vector 𝑄 .

 Q: Sign of 𝑞𝑖 ?

21

Amirkabir University of Technology / H. Ghafarirad ← Outline


Operators
 Rotation
 Rotating a vector 𝐴𝑃1 to a new vector 𝐴𝑃2 , by means of a rotation, 𝑅.
𝐴
𝑃2 = 𝑅 𝐴𝑃1

 The rotation matrix that rotates vectors through some rotation, 𝑅 = the
rotation matrix that describes a frame rotated by 𝑅 relative to the
reference frame.
𝐴𝑃 𝐴𝑃
2 = 𝑅𝐾 𝜃 1

 "𝑅𝐾 𝜃 " performs a rotation about the axis direction 𝐾 by 𝜃 degrees.

 Q: Assume 𝐾 = 𝑍, what is 𝑅𝐾 𝜃 ?

22

Amirkabir University of Technology / H. Ghafarirad ← Outline


Operators
 Rotation
 Rotational Operator:
𝐴 𝐴
𝑃2 = 𝑇𝑅𝑜𝑡 𝜃 𝑃1

0
𝑅𝐾 𝜃 0
 𝑇𝑅𝑜𝑡 𝑅 =
0
0 0 0 1

𝑐𝑜𝑠 𝜃 −𝑠𝑖𝑛 𝜃 0 0
 𝑇𝑅𝑜𝑡 𝑅 = 𝑠𝑖𝑛 𝜃 𝑐𝑜𝑠 𝜃 0 0
0 0 1 0
0 0 0 1

23

Amirkabir University of Technology / H. Ghafarirad ← Outline


Operators
 Transformation
 Rotating and translating a vector 𝐴𝑃1 to compute a new vector 𝐴𝑃2 :
𝐴
𝑃2 = 𝑇 𝐴𝑃1

 The transform that rotates by 𝑅 and translates by 𝑄


= the transform that describes a frame rotated by 𝑅 and translated by 𝑄
relative to the reference frame.
𝑞𝑥
𝑅𝐾 𝜃 𝑞𝑦
𝑇= 𝑞𝑧
0 0 0 1

 Q: Is its sequence important?

24

Amirkabir University of Technology / H. Ghafarirad ← Outline


Transformation Arithmetic
 Compound Transformations
 Frame {C} is known relative to frame {B}, and frame {B} is known
relative to frame {A}
𝐴
𝑃 = 𝐴𝑇𝐵 𝐵𝑇𝐶 𝐶𝑃

𝐴
𝑇𝐶 = 𝐴𝑇𝐵 𝐵𝑇𝐶

𝐴𝑅 𝐴𝑃
𝐶 𝐶𝑂𝑅𝐺
𝐴𝑇
𝐶 =
0 0 0 1

 We have 𝐴𝑅𝐵 , 𝐵𝑅𝐶 , 𝐴𝑃𝐵𝑂𝑅𝐺 , 𝐵𝑃𝐶𝑂𝑅𝐺 , So

? ?
𝐴𝑇
 𝐶 =
0 0 0 1

25

Amirkabir University of Technology / H. Ghafarirad ← Outline


Transformation Arithmetic
 Compound Transformations
𝐴𝑅 𝐵𝑅 𝐴𝑅 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺
𝐵 𝐶 𝐵 𝐶𝑂𝑅𝐺
𝐴
𝑇𝐶 =
0 0 0 1

 Computation:
𝐴𝑃 = 𝐴𝑇𝐵 𝐵𝑇𝐶 𝐶𝑃 32 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛 + 24 𝐴𝑑𝑑𝑖𝑡𝑖𝑜𝑛
𝐴𝑃 = 𝐴𝑇 𝐵 𝑇 𝐶 𝑃
𝐵 𝐶 80 𝑀𝑢𝑙𝑡𝑖𝑝𝑙𝑖𝑐𝑎𝑡𝑖𝑜𝑛 + 60 𝐴𝑑𝑑𝑖𝑡𝑖𝑜𝑛

 However, the second one is better when you want to do the


transformation of many vectors many times.

26

Amirkabir University of Technology / H. Ghafarirad ← Outline


Transformation Arithmetic
 Inverting a Transform
 Frame {B} with respect to a frame {A}, 𝐴𝑇𝐵 , is known ( 𝐴𝑅𝐵 & 𝐴𝑃𝐵𝑂𝑅𝐺 ).

 Invert this transform to get a description of {A} relative to {B},


𝐵
𝑇𝐴 = ?
𝐴𝑃 = 𝐴𝑇𝐵 𝐵𝑃

27

Amirkabir University of Technology / H. Ghafarirad ← Outline


Transformation Arithmetic
 Inverting a Transform
 Frame {B} with respect to a frame {A}, 𝐴𝑇𝐵 , is known ( 𝐴𝑅𝐵 & 𝐴𝑃𝐵𝑂𝑅𝐺 )

 Invert this transform to get a description of {A} relative to {B},


𝐵
𝑇𝐴 = ?
𝐴𝑃 = 𝐴𝑇𝐵 𝐵𝑃

𝐴
𝑃 = 𝐴𝑅𝐵 𝐵𝑃 + 𝐴𝑃𝐵𝑂𝑅𝐺
𝐴𝑃 − 𝐴𝑃 𝐴 𝐵
𝐵𝑂𝑅𝐺 = 𝑅𝐵 𝑃
𝐴𝑅 −1 𝐴𝑃 − 𝐴𝑃 𝐵
𝐵 𝐵𝑂𝑅𝐺 = 𝑃
𝐴 𝑇 𝑇
𝑅𝐵 𝐴𝑃 − 𝐴𝑅𝐵 𝐴𝑃𝐵𝑂𝑅𝐺 = 𝐵𝑃

𝐴𝑅 𝑇 𝑇𝐴
𝐵 − 𝐴𝑅𝐵 𝑃𝐵𝑂𝑅𝐺
𝐵𝑇 =
𝐴
0 0 0 1
 Q: Geometrical Description = ?
 Note that 28
𝐵𝑇 −1
𝐴 = 𝐴𝑇𝐵

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 Remember rotation matrix:
𝑟11 𝑟12 𝑟13
𝐴
𝑅𝐵 = 𝑟21 𝑟22 𝑟23
𝑟31 𝑟32 𝑟33
 The nine elements are not all independent (six dependencies).

 Imagine 𝑅 as three columns, as originally introduced:


𝐴𝑅 = 𝐴 𝐴 𝐴
𝐵 𝑋𝐵 𝑌𝐵 𝑍𝐵

 These three vectors are the unit axes of some frame written in terms of
the reference frame.

 Each is a unit vector, and all three must be mutually perpendicular (six
constraints).
𝐴𝑋 𝐴𝑌 𝐴𝑍
𝐵 = 𝐵 = 𝐵 =1
𝐴 𝑋 . 𝐴𝑌 = 𝐴𝑌 . 𝐴𝑍 = 𝐴𝑋 . 𝐴𝑍
𝐵 𝐵 𝐵 𝐵 𝐵 𝐵 =0
29
 The representation is conveniently specified with three parameter.

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 Rotation matrix is also called proper orthonormal matrix, ("proper"
refers to 𝒅𝒆𝒕 𝑨𝑹𝑩 = +𝟏 )

 Cayley's formula for orthonormal matrices:


For any proper orthonormal matrix 𝑅, there exists a skew-symmetric
matrix 𝑺 such that
𝑅 = 𝐼3 − 𝑆 −1 (𝐼3 + 𝑆)

 A skew-symmetric matrix (i.e., 𝑆 = −𝑆 𝑇 ) is specified by three


parameters (𝑠𝑥 , 𝑠𝑦 , 𝑠𝑧 ).
0 −𝑠𝑥 𝑠𝑦
𝑆 = 𝑠𝑥 0 −𝑠𝑧
−𝑠𝑦 𝑠𝑧 0

 Consequently, any 3 × 3 rotation matrix can be specified by just three


parameters. 30

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 5 Methods for Representation of Orientation
 Direction Cosines (9 Dependent Parameters)
 Euler angles (3 Parameters)
 Fixed angles (3 Parameters)
 Equivalent angle-axis (4 Dependent Parameters)
 Euler parameters (4 Dependent Parameters)

31

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 Z-Y-X Euler Angles
 Start with the frame {A}
Rotate {A} about 𝑍𝐴 by an angle 𝛼 to get frame {𝐵′}
Rotate {𝐵′} about 𝑌𝐵′ by an angle 𝛽 to get frame {𝐵"}
Rotate {𝐵"} about 𝑋𝐵" by an angle 𝛾 to get frame {𝐵}

 Each rotation is performed about an axis of the moving frames.

𝐴𝑅 =? 32
 Q: 𝐵

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 Z-Y-X Euler Angles

 Using the intermediate frames {𝐵′} and {𝐵"} in order to give an


expression for 𝐴𝑅𝐵_𝑍𝑌𝑋 𝛼, 𝛽, 𝛾 .
𝐴𝑅 𝐵 ′ 𝑅 ′′ 𝐵 ′′ 𝑅
𝐵_𝑍𝑌𝑋 𝛼, 𝛽, 𝛾 = 𝐴𝑅𝐵′ 𝐵 𝐵

𝑐𝛼 −𝑠𝛼 0 𝑐𝛽 0 𝑠𝛽 1 0 0
𝐴𝑅 0 1 0 0 𝑐𝛾 −𝑠𝛾
𝐵𝑍𝑌𝑋 = 𝑅𝑍 𝛼 𝑅𝑌 𝛽 𝑅𝑋 𝛾 = 𝑠𝛼 𝑐𝛼 0
0 0 1 −𝑠𝛽 0 𝑐𝛽 0 𝑠𝛾 𝑐𝛾
 where 𝑐𝛼 = 𝑐𝑜𝑠 𝛼, 𝑠𝛼 = 𝑠𝑖𝑛 𝛼

𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾
𝐴𝑅
𝐵_𝑍𝑌𝑋 𝛼, 𝛽, 𝛾 = 𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾 33
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 Z-Y-X Euler Angles
 The Inverse Problem
 Extracting equivalent Z-Y-X Euler angles from a given rotation matrix.

 If 𝐴𝑅𝐵_𝑍𝑌𝑋 𝛼, 𝛽, 𝛾 is equated to the given rotation matrix:

𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾 𝑟11 𝑟12 𝑟13


𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾 = 𝑟21 𝑟22 𝑟23
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾 𝑟31 𝑟32 𝑟33

 9 equations & 3 unknowns.


 Due to six dependencies, 3 equations & 3 unknowns.
2 2
𝛽 = 𝐴𝑡𝑎𝑛2 −𝑟31 , 𝑟11 + 𝑟21

 𝐴𝑡𝑎𝑛2(𝑦, 𝑥) is a two-argument arc tangent function.

 Although a second solution exists for 𝛽, we always compute the single 34


solution for which −90.0° ≤ 𝛽 ≤ 90.0° to have a one-to-one mapping.
Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 Z-Y-X Euler Angles
 The Inverse Problem

𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾 𝑟11 𝑟12 𝑟13


𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾 = 𝑟21 𝑟22 𝑟23
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾 𝑟31 𝑟32 𝑟33

2 2
𝛽 = 𝐴𝑡𝑎𝑛2 −𝑟31 , 𝑟11 + 𝑟21

 As long as 𝑐𝛽 ≠ 0,
𝛼 = 𝐴𝑡𝑎𝑛2 𝑟21 /𝑐𝛽, 𝑟11 /𝑐𝛽
𝛾 = 𝐴𝑡𝑎𝑛2 𝑟32 /𝑐𝛽, 𝑟33 /𝑐𝛽

 Q: What about for 𝛽 = ±90.0° (𝑐𝛽 = 0) ?!!!


35

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 Z-Y-X Euler Angles
 The Inverse Problem
 Singularity of the Inverse Problem:
𝛼 = 𝐴𝑡𝑎𝑛2 𝑟21 /𝑐𝛽, 𝑟11 /𝑐𝛽
𝛾 = 𝐴𝑡𝑎𝑛2 𝑟32 /𝑐𝛽, 𝑟33 /𝑐𝛽

 If 𝛽 = ±90.0° (𝑐𝛽 = 0), the solution degenerates.

 For 𝛽 = +90.0° :
𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾 𝑟11 𝑟12 𝑟13
𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾 = 𝑟21 𝑟22 𝑟23
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾 𝑟31 𝑟32 𝑟33
0 𝑠𝑖𝑛 𝛾 − 𝛼 𝑐𝑜𝑠 𝛾 − 𝛼 𝑟11 𝑟12 𝑟13
0 𝑐𝑜𝑠 𝛾 − 𝛼 − 𝑠𝑖𝑛 𝛾 − 𝛼 = 𝑟21 𝑟22 𝑟23
−1 0 0 𝑟31 𝑟32 𝑟33
36
 In those cases, only the 𝛼 ± 𝛾 can be computed.
Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 Z-Y-X Euler Angles
 The Inverse Problem
 Singularity of the Inverse Problem:
 For 𝛽 = +90.0° :
0 𝑠𝑖𝑛 𝛾 − 𝛼 𝑐𝑜𝑠 𝛾 − 𝛼 𝑟11 𝑟12 𝑟13
0 𝑐𝑜𝑠 𝛾 − 𝛼 − 𝑠𝑖𝑛 𝛾 − 𝛼 = 𝑟21 𝑟22 𝑟23 .
−1 0 0 𝑟31 𝑟32 𝑟33

 One possible convention is to choose 𝛼 = 0.0 in these cases and compute


𝛾.

 If 𝛽 = ±90.0°, then a solution can be calculated to be

𝛽 = +90.0° 𝛽 = −90.0°
𝛼 = 0.0 𝛼 = 0.0
37
𝛾 = 𝐴𝑡𝑎𝑛2 (𝑟12 , 𝑟22 ) 𝛾 = −𝐴𝑡𝑎𝑛2 (𝑟12 , 𝑟22 )

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
. 90
 Z-Y-X Euler Angles .

 The Inverse Problem


 Singularity of the Inverse Problem:

 Q: What is the physical interpretation of the IK singularity?

38

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 X-Y-Z Fixed Angles
 Start with the frame {A}
 Rotate {A} about 𝑋𝐴 by an angle 𝛾 to get frame {𝐵′}
 Rotate {𝐵′} about 𝑌𝐴 by an angle 𝛽 to get frame {𝐵"}
 Rotate {𝐵"} about 𝑍𝐴 by an angle 𝛼 to get frame {𝐵}

 Each of the three rotations takes place about an axis in the fixed
reference frame {A}.
 This convention is referred to as roll, pitch, yaw angles.
39
 Q: 𝐴𝑅𝐵 =?
Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 X-Y-Z Fixed Angles
 The composition rule cannot be applied here, similarity transformation
can be used instead.

 Similarity Transformation
 A rotation matrix (as a coordinate transformation) may be viewed as
changing basis from one frame to another.

 A general linear transformation is transformed from one frame to another


using similarity transformation.

 𝑀 is a linear transformation in frame {0} and 𝑁 is the representation of


𝑀 in frame {1}.

𝑁= 0𝑅 −1 𝑀 0𝑅1
1

40

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 X-Y-Z Fixed Angles
 Using the intermediate frames {𝐵′} and {𝐵"} in order to give an
expression for 𝐴𝑅𝐵_𝑋𝑌𝑍 𝛾, 𝛽, 𝛼 .
𝐴 𝐵′ 𝐵 ′′
𝑅𝐵 = 𝐴𝑅𝐵′ 𝑅𝐵′′ 𝑅𝐵

𝐴𝑅 ′ = 𝑅 𝛾
𝐵 𝑋
𝐵′ 𝐴
𝑅𝐵′′ = 𝑅𝐵′ −1 𝑅𝑌 𝛽 𝐴
𝑅𝐵 ′
𝐵 ′′ 𝑅 = 𝐴𝑅 ′′ −1 𝑅 𝛼 𝐴𝑅 ′′
𝐵 𝐵 𝑍 𝐵

 Therefore,
𝐴
𝑅𝐵′ = 𝑅𝑋 𝛾

𝐴𝑅 ′′ = 𝐴 𝑅𝐵 ′ 𝐵′ 𝑅 ′′ = 𝐴 𝑅𝐵 ′ 𝐴𝑅 ′ −1 𝑅𝑌 𝛽 𝐴𝑅 ′ = 𝑅𝑌 𝛽 𝑅𝑋 𝛾
𝐵 𝐵 𝐵 𝐵

𝐴𝑅 = 𝐴𝑅𝐵′′ 𝐵 ′′ 𝑅 = 𝐴𝑅𝐵′′ 𝐴𝑅 ′′ −1 𝑅𝑍 𝛼 𝐴𝑅 ′′ = 𝑅𝑍 𝛼 𝑅𝑌 𝛽 𝑅𝑋 𝛾
𝐵 𝐵 𝐵 𝐵

41

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 X-Y-Z Fixed Angles
𝐴
𝑅𝐵_𝑋𝑌𝑍 𝛾, 𝛽, 𝛼 = 𝑅𝑍 𝛼 𝑅𝑌 𝛽 𝑅𝑋 𝛾
𝑐𝛼 −𝑠𝛼 0 𝑐𝛽 0 𝑠𝛽 1 0 0
= 𝑠𝛼 𝑐𝛼 0 0 1 0 0 𝑐𝛾 −𝑠𝛾
0 0 1 −𝑠𝛽 0 𝑐𝛽 0 𝑠𝛾 𝑐𝛾

 Therefore,
𝑐𝛼 𝑐𝛽 𝑐𝛼 𝑠𝛽 𝑠𝛾 − 𝑠𝛼 𝑐𝛾 𝑐𝛼 𝑠𝛽 𝑐𝛾 + 𝑠𝛼 𝑠𝛾
𝐴𝑅
𝐵_𝑋𝑌𝑍 𝛾, 𝛽, 𝛼 = 𝑠𝛼 𝑐𝛽 𝑠𝛼 𝑠𝛽 𝑠𝛾 + 𝑐𝛼 𝑐𝛾 𝑠𝛼 𝑠𝛽 𝑐𝛾 − 𝑐𝛼 𝑠𝛾
−𝑠𝛽 𝑐𝛽 𝑠𝛾 𝑐𝛽 𝑐𝛾

 Note: Three rotations taken about fixed axes 𝑒. 𝑔. 𝐴𝑅𝐵_𝑋𝑌𝑍 𝛾, 𝛽, 𝛼 yield


the same final orientation as the same three rotations taken in opposite
order about the axes of the moving frame 𝑒. 𝑔. 𝐴𝑅𝐵_𝑍𝑌𝑋 𝛼, 𝛽, 𝛾 .
42
 24 representations: 12 Euler angles series + 12 Fixed angles series.

Amirkabir University of Technology / H. Ghafarirad ← Outline


More on Representation of Orientation
 Equivalent Angle-Axis
 Start with the frame {A}
 Rotate about the unit vector 𝐴𝐾 by an angle 𝜃 according to the right-
hand rule (Based on the Euler Theorem).

 𝐴𝐾 : Equivalent axis of a finite rotation.

 It may be written as 𝐴𝑅𝐵 𝐾 , 𝜃 or 𝑅𝐾 (𝜃).

 𝐴𝐾 requires only two parameters caused


by its unit length.

 For the general axis of rotation:


𝑘𝑥 𝑘𝑥 𝑣𝜃 + 𝑐𝜃 𝑘𝑥 𝑘𝑦 𝑣𝜃 − 𝑘𝑧 𝑠𝜃 𝑘𝑥 𝑘𝑧 𝑣𝜃 + 𝑘𝑦 𝑠𝜃
𝑅𝐾 𝜃 = 𝑘𝑥 𝑘𝑦 𝑣𝜃 + 𝑘𝑧 𝑠𝜃 𝑘𝑦 𝑘𝑦 𝑣𝜃 + 𝑐𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 − 𝑘𝑥 𝑠𝜃
𝑘𝑥 𝑘𝑧 𝑣𝜃 − 𝑘𝑦 𝑠𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 + 𝑘𝑥 𝑠𝜃 𝑘𝑧 𝑘𝑧 𝑣𝜃 + 𝑐𝜃
43
𝑇
 where 𝑐𝜃 = 𝑐𝑜𝑠 𝜃, 𝑠𝜃 = 𝑠𝑖𝑛 𝜃, 𝑣𝜃 = 1 − 𝑐𝑜𝑠 𝜃 and 𝐴𝐾 = 𝑘𝑥 , 𝑘𝑦 , 𝑘𝑧
Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 Equivalent Angle-Axis

𝑘𝑥 𝑘𝑥 𝑣𝜃 + 𝑐𝜃 𝑘𝑥 𝑘𝑦 𝑣𝜃 − 𝑘𝑧 𝑠𝜃 𝑘𝑥 𝑘𝑧 𝑣𝜃 + 𝑘𝑦 𝑠𝜃
𝑅𝐾 𝜃 = 𝑘𝑥 𝑘𝑦 𝑣𝜃 + 𝑘𝑧 𝑠𝜃 𝑘𝑦 𝑘𝑦 𝑣𝜃 + 𝑐𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 − 𝑘𝑥 𝑠𝜃
𝑘𝑥 𝑘𝑧 𝑣𝜃 − 𝑘𝑦 𝑠𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 + 𝑘𝑥 𝑠𝜃 𝑘𝑧 𝑘𝑧 𝑣𝜃 + 𝑐𝜃

 Example:
 For 𝐾 as principal axes (e.g. 𝐾 = 𝑋 = 1 0 0 𝑇
or 𝑌 or 𝑍 )

1 0 0
𝑅𝑋 𝜃 = 0 𝑐𝜃 − 𝑠𝜃
0 𝑠𝜃 𝑐𝜃

𝑐𝜃 0 𝑠𝜃
𝑅𝑌 𝜃 = 0 1 0
− 𝑠𝜃 0 𝑐𝜃

𝑐𝜃 −𝑠𝜃 0
𝑅𝑍 𝜃 = 𝑠𝜃 𝑐𝜃 0 44
0 0 1
Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 Equivalent Angle-Axis
 The Inverse Problem
 Computing 𝐾 and 𝜃 from a given rotation matrix.

𝑘𝑥 𝑘𝑥 𝑣𝜃 + 𝑐𝜃 𝑘𝑥 𝑘𝑦 𝑣𝜃 − 𝑘𝑧 𝑠𝜃 𝑘𝑥 𝑘𝑧 𝑣𝜃 + 𝑘𝑦 𝑠𝜃 𝑟11 𝑟12 𝑟13


𝑘𝑥 𝑘𝑦 𝑣𝜃 + 𝑘𝑧 𝑠𝜃 𝑘𝑦 𝑘𝑦 𝑣𝜃 + 𝑐𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 − 𝑘𝑥 𝑠𝜃 = 𝑟21 𝑟22 𝑟23
𝑘𝑥 𝑘𝑧 𝑣𝜃 − 𝑘𝑦 𝑠𝜃 𝑘𝑦 𝑘𝑧 𝑣𝜃 + 𝑘𝑥 𝑠𝜃 𝑘𝑧 𝑘𝑧 𝑣𝜃 + 𝑐𝜃 𝑟31 𝑟32 𝑟33

𝑟32 − 𝑟23
𝑟11 +𝑟22 +𝑟33 −1 1
𝜃 = 𝐴𝑐𝑜𝑠 , 𝐾= 𝑟13 − 𝑟31
2 2 sin𝜃
𝑟21 − 𝑟12

 This solution always computes a value of 𝜃 between [0-180°].

 For any 𝐴𝐾 , 𝜃 , − 𝐴𝐾 , −𝜃 results in the same orientation in space.

 For small angular rotations, the axis becomes ill-defined. 45

 If 𝜃 → 0°, the axis becomes completely undefined. (𝜃 = 0° or 𝜃 = 180°)


Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 Euler Parameters
 Another representation is by means of four numbers called the Euler
parameters.

𝑇
 In terms of the equivalent axis 𝐾 = 𝑘𝑥 , 𝑘𝑦 , 𝑘𝑧 and the equivalent
angle 𝜃, the Euler parameters are given by

𝜖1 𝑘𝑥
𝜃 𝜃
𝜖 𝑘
𝜖 = 2 = 𝑦 𝑠𝑖𝑛 = 𝐾 𝑠𝑖𝑛
𝜖3 2 2
𝑘𝑧
𝜃
𝜖4 = 𝑐𝑜𝑠
2

 These four quantities are not independent (Unit Quaternion)


𝜖12 + 𝜖22 + 𝜖32 + 𝜖42 =1
46
 An orientation might be visualized as a point on a unit hypersphere in
four-dimensional space.
Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 Euler Parameters
 The rotation matrix

1 − 2𝜖22 − 2𝜖32 2 𝜖1 𝜖2 − 𝜖3 𝜖4 2 𝜖1 𝜖3 + 𝜖2 𝜖4
𝑅𝜖 = 2 𝜖1 𝜖2 + 𝜖3 𝜖4 1 − 2𝜖12 − 2𝜖32 2 𝜖2 𝜖3 − 𝜖1 𝜖4
2 𝜖1 𝜖3 − 𝜖2 𝜖4 2 𝜖2 𝜖3 + 𝜖1 𝜖4 1 − 2𝜖12 − 2𝜖22

 The Inverse Problem:


 Given a rotation matrix (𝐴), the equivalent Euler parameters are
1 − 2𝜖22 − 2𝜖32 2 𝜖1 𝜖2 − 𝜖3 𝜖4 2 𝜖1 𝜖3 + 𝜖2 𝜖4 𝑟11 𝑟12 𝑟13
2 𝜖1 𝜖2 + 𝜖3 𝜖4 1 − 2𝜖12 − 2𝜖32 2 𝜖2 𝜖3 − 𝜖1 𝜖4 = 𝑟21 𝑟22 𝑟23 = 𝐴
2 𝜖1 𝜖3 − 𝜖2 𝜖4 2 𝜖2 𝜖3 + 𝜖1 𝜖4 1 − 2𝜖12 − 2𝜖22 𝑟31 𝑟32 𝑟33

1
𝜖4 = 1 + 𝑟11 + 𝑟22 + 𝑟33
2
𝑟 − 𝑟23
1 32
𝜖= 𝑟13 − 𝑟31
4𝜖4 𝑟 − 𝑟 47
21 12
 For a rotation of 180 degrees about some axis, 𝜖4 → 0 (ill defined).
Amirkabir University of Technology / H. Ghafarirad ← Outline
More on Representation of Orientation
 Euler Parameters
 The Inverse Problem:
 Remember:
𝜃
𝜖 = 𝐾 𝑠𝑖𝑛
2
𝜃
𝜖4 = 𝑐𝑜𝑠
2
 By definition, if 𝜖4 = 0, then 𝜃 = 180° and 𝜖 is equal to rotation axis,
i.e. 𝜖 = 𝐾
1 + 2𝑟11 − 𝑡𝑟 𝐴
𝜖12 =
4
1 + 2𝑟22 − 𝑡𝑟 𝐴
𝜖22 =
4
2
1 + 2𝑟33 − 𝑡𝑟 𝐴
𝜖3 =
4

 Note: There is No Singularity associated with these parameters.


 As long as the direction cosines are known, we can find the 48
corresponding Euler parameters [1].
Amirkabir University of Technology / H. Ghafarirad ← Outline
Transformation of Free Vectors
 Line vector: a vector that is dependent on its line of action, along with
direction and magnitude. (Position & Force)

 Free vector: a vector that may be positioned anywhere in space,


provided that magnitude and direction are preserved (Velocity &
Moments)

 For free vectors, only the rotation matrix relating the two systems is used
in transforming.

 Position Transformation
𝐴𝑃 = 𝐴𝑇𝐵 𝐵𝑃
 Velocity Transformation
𝐴𝑉 = 𝐴𝑅𝐵 𝐵𝑉

𝐴
 𝑃𝐵𝑂𝑅𝐺 which would appear in
a position-vector transformation, 49
does not appear in a velocity transform.
Amirkabir University of Technology / H. Ghafarirad ← Outline
The END

• References:
[1] www.u.arizona.edu/~pen/ame553/Notes/Lesson%2009.pdf

50

Amirkabir University of Technology / H. Ghafarirad

You might also like