0% found this document useful (0 votes)
2 views56 pages

Robotics-Fall-2023-Week--5-20102023-120029pm-08102024-113028pm

Uploaded by

aqsaadnan12.2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views56 pages

Robotics-Fall-2023-Week--5-20102023-120029pm-08102024-113028pm

Uploaded by

aqsaadnan12.2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 56

Department of Electrical Engineering

BSEAS H-11 Campus

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 ŷ1 1


1
p  
1
x̂0 x̂1
o0 o1
0 1
 p1 expressed in {0}

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

0 0  cos   sin   1


q  R p 
 sin  cos   1

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

 x1 x0 y1 x0 z1 x0 


R10  x1 y0 y1 y0 z1 y0 
 x1 z0 y1 z0 z1 z0 

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

 x1 x0 y1 x0 z1 x0 


x̂0
R10  x1 y0 y1 y0 z1 y0 
 x1 z0 y1 z0 z1 z0 

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}.

What is the orientation of {2} relative to {0}?

ẑ1 ẑ0 zˆ1 zˆ2 ẑ2 ẑ0



x̂0 ŷ2 x̂0 ŷ2
 x̂1
x̂1
yˆ 0  yˆ1 x̂2 ŷ1 x̂2 ŷ0
R10 R y , R21 Rz , R20 ?
25 07/05/2025
Successive Rotations in a Fixed Frame
1. Suppose you perform a rotation in frame {0} to obtain {1}.
2. Then you rotate {1} in frame {0} to obtain {2}.

What is the orientation of {2} relative to {0}?



ẑ1 ẑ0 ẑ1 ẑ0 ẑ2 ẑ0
ŷ1 ŷ2
x̂0 x̂0 x̂0

x̂1
yˆ 0  yˆ1 x̂1 ŷ0 x̂2 ŷ0
R10 R y , R Rz , R20 ?
26 07/05/2025
Composition of Rotations
0
1. R1
Given a fixed frame {0} and a current frame {1} and
 if {2} is obtained by a rotation R in the current frame {1} then use
postmulitplication to obtain:

R R 12 and R 02 R 10 R 12

2. Given a fixed frame {0} and a frame {1} and


 if {2} is obtained by a rotation R in the fixed frame {0} then use
premultiplication to obtain:

R 02 RR 10

27 07/05/2025
Rotation About a Unit Axis

ẑ0
kz

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

• It can be concluded that


Composition of
Rotations
• Composition Law of Rotational Transformations

• In order to change the representation of point p from p2 to p0 we may


first go to p1 using R 21 and then to p0 using R 10
•R20 represents orientation of Frame 2 w.r.t Frame 0. If
multiplied with any point in Frame 2, it will transform that
point of Frame 2 to Frame 0.
Composition of
Rotations
• Composition Law of Rotational Transformations

• 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

• Now suppose a Frame 2 is obtained by rotating Frame 1 about some


axis of Frame 0 and not the current frame, i.e. Frame 1.
• Rotation matrix used for this rotation may be denoted as R.
Composition of
Rotations
• Rotation w.r.t Fixed Frame
• R20 will relate Frame 2 with Frame 0 and following can be concluded
very easily.

• If we consider rotation about current frame then following holds:


Composition of
Rotations
• Rotation w.r.t Fixed Frame
• Let us take the following route to get to Frame 2 from Frame 0.
Composition of
• Example: Suppose that a rotation matrix R represents a rotation of ∅
Rotations
deg. about y-axis followed by rotation of Θdeg. about the fixed z-axis.
Let p0, p1 and p2 be representations of point p in different frames.
• Initially current and fixed frames are same so we can write

• Now second rotation is about fixed axis so we cannot conclude that


Composition of
Rotations
• In order to get the second rotation correct we need to undo the first
rotation, apply the second rotation and then reinstate the first
rotation again.
Summa
ry
• POSTMULTIPLY: If successive rotations are applied on the current
frame then post-multiply the rotation matrix.
• PREMULTIPLY: If successive rotations are applied about the fixed
frame then pre-multiply the rotation matrix.
Parametrizations of
Rotations
• There are total 9 elements in a Rotation matrix
• All 9 are not independent
• A rigid body may have maximally 3 DOF for rotation, hence 3
independent quantities are sufficient to describe any rotation.
• Following constraints consolidate this claim
• Column vectors are unit vectors
• Column vectors are mutually orthogonal
Euler
Angles
•Consider fixed frame o0x0y0 and rotated frame o1x1y1
• We can express the orientation of Frame 1 w.r.t Frame 0 by specifying
three angles (∅,ϑ,ψ), called Euler Angles, and obtain the rotation by
following three successive rotations:
• Rotation of ∅deg. about z-axis
• Rotation of ϑ deg. about current y-axis
• Rotation of ψ deg. about current z-axis
Euler
Angles
Euler
Angles
Euler
Angles
• How to calculate involved angles?
• Case 1: Compare following matrices
Euler
Angles
• How to calculate involved angles?
• Case 1:
• If r13 and r23 both are not zero then following implies

• Additionally following can also be implied

• 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:

• Only sum can be determined hence there are infinite possibilities


Euler
Angles
• How to calculate involved angles?
• Case 2:
• r33 = -1: and hence
ϑ = pi

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.

Check out www.mathworks.com for more information and tutorials.


Any
Questions
Referenc
es
• Robot Dynamics and Control (2 ed.) by Mark W. Spong,
Seth Hutchinson, and M. Vidayasagar
• Chapter 2: Section 2.1, 2.4 and 2.5

You might also like