Robotics-Fall-2023-Week--5-20102023-120029pm-08102024-113028pm
Robotics-Fall-2023-Week--5-20102023-120029pm-08102024-113028pm
Robotics
Week # 5: Rotation Matrices and Euler Angles
Maryam Iqbal
Assistant Professor, EE Dept
Chapter 2
Spatial Descriptions
2 07/05/2025
Points and Vectors
point : a location in space
vector : magnitude (length) and direction between two points
v
q
3 07/05/2025
Coordinate Frames
choosing a frame (a point and two perpendicular vectors of unit
length) allows us to assign coordinates
0
p
0 4
p
ŷ0 q0 2.5
0 2
q
x̂0 1.5
0 o0 0 0 2
0
v p q
1
4 07/05/2025
Coordinate Frames
the coordinates change depending on the choice of frame
1
p
1 o1
ŷ1 0.5
1
p
q1 4
x̂1 1 0.5
q
2
1 1 1 1
v p q
2
5 07/05/2025
Dot Product
the dot product of two vectors
u1 v1
u v
u 2 v 2 u v u1v1 u2v2 un vn u T v
u v u v cos
un vn
v
u cos
6 07/05/2025
Translation
ŷ0 ŷ1
x̂0 x̂1
o0 o1
0 1
suppose we are given o1 expressed in {0}
0 3
o
1
0
7 07/05/2025
Translation 1
ŷ0 ŷ1
x̂0 x̂1
o0 o1
0 1
the location of {1} expressed in {0}
0 0 3 0 0 3
d o o
1 1 0 0 0
0
8 07/05/2025
Translation 2
0 0 3 1 4
1
p d p
1
0 1 1
9 07/05/2025
Translation 3
1 ŷ0 2
0 0
p q
1 1
x̂0
o0
0
q0 expressed in {0}
0 3 1 2
0
q d p
0 1 1
10 07/05/2025
Rotation
suppose that frame {1} is rotated relative to frame {0}
ŷ0
ŷ1
x̂1
sin
x̂0
o0 o1
cos
11 07/05/2025
Rotation 1
the orientation of frame {1} expressed in {0}
ŷ0
ŷ1
x̂1
x̂0
o0 o1
0 x1 x0 y1 x0
R
y1 y0
1
x1 y0
12 07/05/2025
Rotation 2
p1 expressed in {0}
1 1
p
ŷ0
1
ŷ1
x̂1
x̂0
o0 o1
0 0 cos
1 sin 1
p R p
cos 1
1
sin
13 07/05/2025
Rotation 3
q0 expressed in {0}
q0
ŷ0
0
p
o0 x̂0
14 07/05/2025
Properties of Rotation Matrices
RT = R-1
the columns of R are mutually orthogonal
each column of R is a unit vector
det R = 1 (the determinant is equal to 1)
15 07/05/2025
Rotation and Translation
ŷ1
ŷ0 x̂1
o1
x̂0 1
o0
0
16 07/05/2025
Rotations in 3D
17 07/05/2025
Chapter 2
Rotations
18 07/05/2025
Properties of Rotation Matrices
RT = R-1
the columns of R are mutually orthogonal
each column of R is a unit vector
det R = 1 (the determinant is equal to 1)
19 07/05/2025
Rotations in 3D
ẑ0
ŷ1
ẑ1
x̂1
ŷ0
o0 o1
20 07/05/2025
Rotation About z-axis
zˆ0 zˆ1
+'ve rotation
ŷ1
ŷ0
x̂0 x̂1
21 07/05/2025
Rotation About x-axis
ẑ0
ẑ1
ŷ1
ŷ0
+'ve rotation
x̂0 x̂1
22 07/05/2025
Rotation About y-axis
ẑ0
ẑ1
yˆ 0 yˆ1
+'ve rotation
x̂0 x̂1
23 07/05/2025
Relative Orientation Example
ẑ0
x̂1
45
x̂0
ŷ1
yˆ 0 zˆ1
24 07/05/2025
Successive Rotations in Moving Frames
1. Suppose you perform a rotation in frame {0} to obtain {1}.
2. Then you perform a rotation in frame {1} to obtain {2}.
R R 12 and R 02 R 10 R 12
R 02 RR 10
27 07/05/2025
Rotation About a Unit Axis
ẑ0
kz
k̂
ky c cos
ŷ0
kx s sin
v 1 cos
x̂0
k x2 v c k x k y v k z s k x k z v k y s
Rk , k x k y v k z s k y2 v c k y k z v k x s
k x k z v k y s k y k z v k x s k z2 v c
28 07/05/2025
Summa
ry
• Rotation Matrix can be interpreted in three different ways:
• It represents a coordinate transformation relating the coordinates of a point
in two different frames.
• It gives the orientation of a transformed coordinate frame w.r.t a fixed
coordinate frame.
• It is an operator taking a vector and rotating it to a new vector in the same
coordinate system.
Composition of
Rotations
•Suppose we have 3 coordinate frames namely o0x0y0, o1x1y1, o2x2y2
• Any point p can then be represented in all three frames and
relationship between these representations can be described as
• Another way to look is to start with all coincident frames, and rotate
Frame 1 & 2 using R 0 and then rotate Frame 2 using R 1
1
2
• In both steps new frame is generated by applying rotation about the
current frame.
Composition of
Example: Suppose a rotation matrix R represents the rotation of ∅
Rotations
•
deg. about y-axis followed by rotation of Θdeg. about z-axis.
Composition of
Example: Suppose a rotation matrix R represents the rotation of ∅
Rotations
•
deg. about y-axis followed by rotation of Θdeg. about z-axis.
Composition of
Rotations
• Example: Formulate rotation matrix R’ if rotations of the previous
example are carried out in reverse order.
Composition of
Rotations
• Rotation w.r.t Fixed Frame
• Many times it is desired to perform rotations w.r.t to some fixed
frame and not about the current frame.
•Consider Frame 0, which when rotated by R1 gives Frame 1.
0
• Hence
Euler
Angles
• How to calculate involved angles?
• Case 1:
• Two possibilities of ϑ are as:
Euler
Angles
• How to calculate involved angles?
• Case 2:
• If r13 and r23 are zero, following can be directly implied
• Hence
Euler
Angles
• How to calculate involved angles?
• Case 2:
• r33 = 1: and hence
ϑ=0
• For other angles consider
Euler
Angles
• How to calculate involved angles?
• Case 2:
It Atan(-r22, -r21)
Roll-Pitch-
Yaw
• Rotation matrix can also be defined as rotations on coordinate axes of
fixed reference frame in the order x-y-z through angles (ψ,ϑ,∅)
respectively.
MATLAB EXERCISE 1
• Familiarity with MATLAB and linear algebra (matrix theory). Also, the student must become familiar
with the MATLAB Robotics Toolbox.
• Advanced MATLAB users should become familiar with Simulink, the graphical interface of MATLAB, and
with the MATLAB Symbolic Toolbox.
b) Familiarize yourself with the IVIATLAB Robotics Toolbox, a third-party toolbox
developed by Peter I. Corke of CSIRO, Pinjarra Hills, Australia. This product
can be downloaded for free from www.cat.csiro.au/cmst/stafflpic/robot. The source
code is readable and changeable, and there is an international community of
users, at [email protected]. Download the MATLAB Robotics
Toolbox, and install it on your computer by using the .zip ifie and following the
instructions. Read the README ifie, and familiarize yourself with the various
functions available to the user. Find the robot.pdf ifie—this is the user manual
giving background information and detailed usage of all of the Toolbox functions.
Don't worry if you can't understand the purpose of these functions yet; they deal
with robotics mathematics concepts covered in Chapters 2 through 7 of this book.