Week 4_MCT-352 Robotics
Week 4_MCT-352 Robotics
ROBOTICS
Week 4
INSTRUCTOR: DR. HASHIM IQBAL
Week 4 Agenda
Rotation
◦ Properties of Rotation Matrix
◦ Interpretation of Rotation Matrix
◦ Composition of Rotation
◦ Parameterization of Rotation
Rigid Motions
◦ Homogeneous Transformations
^𝑨
𝒛
^𝑩
𝒛
{ 𝑩} { 𝑨} ^
𝒚𝑨
^
𝒚𝑩 ^
𝒙𝑩
^
𝒙𝑨
^𝑨
^𝑩 𝒛
𝒛
°
𝟗𝟎
^
𝒚𝑩 ^
𝒙𝑩
^
𝒚𝑨
^
𝒙𝑨
Rotation Matrix
• Example 1:
Given the following
frames {A} and {B} …
• Example 3: given the following rotation, plot frames {A} and {B}
^𝑧 𝐴
0 1 0
A
RB 0 0 1
1 0 0
Rotation Matrix
• Example:
There is a table, and on the table there is
a cube. There is a camera over the center
of the cube and its frame is {3}. Find the
rotation matrix that relates frame {2} to
the camera frame {3}
0 1 0
3
R2 1 0 0
0 0 1
𝜃
Rotation about the z axis
𝜃 cos sin 0
𝜃 Rz ( ) sin cos 0
0 0 1
Properties of a Rotation Matrix
1. Transpose of a rotation matrix (R)
R is an orthogonal matrix
Properties of a Rotation Matrix
1. Transpose of a rotation matrix (R)
• R is an orthogonal matrix:
→ It has orthogonal rows (and columns)
3 constraints
3 constraints
6 constraints
• R has 9 elements
• R has 6 constraints (due to the orthonormal columns)
• R has 9 – 6 = 3 degrees of freedom (only 3 dof for orientation)
RT R I det( RT R ) det( I )
det( RT ) det( R) 1 Property: det( RT ) det( R)
det( R)
2
1
det( R) 1
z Right-handed frame:
In a right-handed frame (normally used): x y z
y z x
y
det( R) 1 z x y
x
Rotation Group: SO(3)
The rotation group in is known as SO(3) and is defined as:
SO = Special Orthogonal
◦ Orthogonal matrices
◦ Special because the determinant is +1 (positive)
Solution
a) 1
det R1 It is not a rotation matrix
2
b)
det R2 1
It is a rotation matrix
R2 R2T I
Interpretations of the Rotation Matrix
a) Representation of the Orientation
:
• Interpretation : Represents frame {B} in terms of frame {A}
Interpretations of the Rotation Matrix
b) Mapping between frames
• It represents the same point in different frames
- We want: start with point in {B} and represent it in {A} (obtain the coordinates in {A})
Interpretations of the Rotation Matrix
b) Mapping between frames
- Objective: start with point in {B} and represent it in {A} (obtain the coordinates in {A})
- In matrix form:
P
0 1 0 d 2 d1
- Transformed point: A p A RB B p 1 0 0 d1 d 2
0 0 1 0 0
Interpretations of the Rotation Matrix
c) Rotation Operator
• It rotates a vector within the same reference frame
- In general: it rotates vector an angle θ about axis to obtain
- Example:
Find the resulting vector after rotating vector p = (0, , 1) an angle 30° about axis x
1
0
1 0 0 1 0
𝒑2
R(30 , x) 0 cos(30 ) sin(30 ) 0 3
2
1
2
𝒑1 0 sin(30 ) cos(30 ) 0 1 3
𝜃 2 2
0
p 2 R (30 , x)p1 1
3
Composition of Rotations
Composition of Rotations
Consider a point in 3 frames: {A}, {B}, {C}
◦ Point P in frame {A}: Ap
◦ Point P in frame {B}: Bp
◦ Point P in frame {C}: Cp
Relations:
◦ Point from frame {B} to frame {A}: A
p A RB B p
◦ Point from frame {C} to frame {B}: B
p B RC C p
◦ Point from frame {C} in frame {A}: A
p A RB B RC C p
Composition of rotations:
A
RC A RB B RC
Interpretations of AR :
C
1) It rotates point P from {C} to {B} and then from {B} to {A}
2) It starts with frame {A}, then makes it coincident with {B}, and then with {
Composition of Rotations
a) Rotation with Respect to the Current (mobile)
System
• A post-multiplication with a rotation matrix is needed
• Example 1
Initial frame: {0}
1º: Rotate θ1 about axis y0: Ry(θ1) → we obtain frame {1}
2º: Rotate θ2 about axis z1 (of the current system {1}): Rz(θ2) → we obtain
frame {2}
Resulting rotation: R = Ry(θ1) Rz(θ2)
z0 2° Final: z0
z1 z2 z1 y2 z2 y2
y1 𝜃2 y1
𝜃 1 y0 y0
x0 x2 x0 Ry (1 ) Rz ( 2 )
x1 Ry (1 ) x1 Rz ( 2 ) x2
Composition of Rotations
b) Rotation with Respect to the Fixed Frame
Then (2 cases):
First, apply a rotation of 90° about z.
a) Apply a rotation of 90° about the current (“new”) y axis
b) Apply a rotation of 90° about the fixed y axis Ry (90 ) R Rz (90 ) Ry (90 )
a) current y
Rz (90 )
Ry (90 )
b) fixed y
R Ry (90 ) Rz (90 )
Images from B. Siciliano et al, Robotics Modelling, Planning and Control, 2009
Composition of Rotations
Example 4
Consider the following rigid body
Then (2 cases):
First, apply a rotation of 90° about y.
a) Apply a rotation of 90° about the current (“new”) z axis
Rz (90 )
b) Apply a rotation of 90° about the fixed z axis a) current z
Ry (90 )
Images from B. Siciliano et al, Robotics Modelling, Planning and Control, 2009
Composition of Rotations
Example 5
We apply the following rotations to a reference frame in the following order:
1. Rotation of θ about the current x axis
2. Rotation of ϕ about the current z axis
3. Rotation of α about the fixed z axis
4. Rotation of β about the current y axis
5. Rotation of γ about the fixed x axis
Write the expression of the resulting rotation matrix
Rx ( )
Rx ( ) Rz ( )
Rz ( ) Rx ( ) Rz ( )
Rz ( ) Rx ( ) Rz ( ) Ry ( )
R Rx ( ) Rz ( ) Rx ( ) Rz ( ) Ry ( )
Parameterization of Rotations
Parameterizations of the Orientation
The orientation (rotation) in space has 3 degrees of freedom
The rotation matrix has 9 elements it is redundant
Parameterization
◦ Objective: be less redundant
◦ Represent orientation (rotation) using less than 9 elements
Usual parameterizations:
◦ Euler angles (3 angles)
◦ Roll, pitch, yaw angles (3 angles)
◦ Axis/angle representation (3 elements)
Euler Angles
They represent the orientation using 3 angles
The angles are originated from 3 successive rotations about the current (mobile)
axes
x x' x '' xf
x'
Rotation
matrix from
ZYZ Euler
angles
Euler Angles
Euler Angles ZYZ
ZYZ Euler angles from rotation matrix
sin ϕ2 ≠ 0
[ ]
− 0 . 5 −0 . 557 0 . 663
𝑅=𝑅 𝑧 ( 30 ° ) 𝑅 𝑦 ( 50 ° ) 𝑅 𝑧 ( 90 ° ) = 0 . 866 −0 . 321 0 . 383
0 0 . 766 0 . 643
b) Find the rotation matrix equivalent to the ZYZ Euler angles (-150°, -50°, -90°)
[ ]
− 0 .5 − 0 .557 0 .663
𝑅=𝑅 𝑧 (−150 °) 𝑅 𝑦 (−50 °) 𝑅 𝑧 (−90 °)= 0 . 866 − 0 . 321 0 .383
0 0 .766 0 .643
c) Given the previous matrix, find the possible ZYZ Euler angles
Roll, Pitch, Yaw Angles
Originated from the following sequence of rotations:
1. A rotation of ϕy about the fixed x axis (yaw)
2. A rotation of ϕp about the fixed y axis (pitch)
3. A rotation of ϕr about the fixed z axis (roll)
z
r
p
y y
x
Rotation
matrix from
roll, pitch,
yaw angles
Roll, Pitch, Yaw Angles
RPY angles from rotation matrix
cos ϕp ≠ 0
Solution
__ ^ ^ ^
k k x i k y j k z k
sin
k y
2 2
k x k y
cos k x
2 2
k x k y
2 2
sin k x k y
cos k z
𝑅 𝑘, 𝜃 =¿R z , R y , R z k , R y , R z ,
0 0 0 0 0
Axis/angle Representation
sin
k y
2 2
kx k y
cos k x
2 2
kx k y
2 2
sin k x k y
cos k z
𝑘=(𝑘𝑥 , 𝑘 𝑦 ,𝑘 𝑧 )
Angle: Axis:
Always use
atan2
Axis/angle Representation
Example
Compute the axis and angle equivalent to the following rotation matrix
0.926 0.304 0.226
R 0.363 0.881 0.304
0.107 0.363 0.926
Solution
(0.363 0.304) 2 ( 0.107 0.226) 2 (0.363 0.304) 2 0.926 0.881 0.926 1
atan2 ,
2 2
1 1.733
atan2 ,
2 2
30 30
0.363 0.304 0.667 0.363 0.304 0.667
1 0.226 0.107 0.333 1 0.226 0.107 0.333
ω ω
2sin 30 2sin 30
0.363 0.304 0.667 0.363 0.304 0.667
Rigid Motion
Homogeneous Transformations
Homogeneous Transformations
P zB
B
P p yB
zA
A
p
A
tB
xB
yA A
t B : Origin of frame B
with respect to
xA frame A
A
Point P of frame {B} in frame {A}: p At B A RB B p
In a more compact way:
A p A RB A
tB B p A
p
Homogeneo
1 0 1 1 B
p us
coordinates
A
p A
TB
B
p
Homogeneous
transformation
matrix
Homogeneous Transformations
They represent the position and orientation (pose) of a frame with respect to
another frame
Parts Rotation
(orientation)
r11 r12 r13 t x
r r22 r23 t y R t translation
T 21
(position)
r31 r32 r33 t z 0 1
0 0 0 1
R 0 I t
Pure transformations T T
0 1 0 1
Pure rotation Pure translation
Homogeneous Transformations
Pure Transformations
Pure rotations: Pure translations:
1 0 0 0 1 0 0 d
0 cos sin 0 0 1 0 0
Rot x ( ) Transx (d )
0 sin cos 0 0 0 1 0
0 0 0 1 0 0 0 1
cos 0 sin 0 1 0 0 0
0 1 0 0 0 1 0 d
Rot y ( ) Trans y (d )
sin 0 cos 0 0 0 1 0
0 0 0 1 0 0 0 1
cos sin 0 0 1 0 0 0
sin cos 0 0 0 1 0 0
Rot z ( ) Transz (d )
0 0 1 0 0 0 1 d
0 0 0 1 0 0 0 1
Homogeneous Transformations
Composition
1. When a transformation is applied with respect to the fixed frame:
- A pre-multiplication is used
1 0 0 6 1 0 0 0 1 0 0 6
0 1 0 2 0 cos 90 sin 90 0 0 0 1 2
0 0 1 10 0 sin 90 cos 90 0 0 1 0 10
0 0 0 1 0 0 0 1 0 0 0 1
Homogeneous Transformations
Composition
Example
Find the homogeneous transformation matrix that represents a rotation of an angle α
about the x axis, followed by a translation of b units along the new x axis, followed by
a translation of d units along the new z axis, followed by a rotation of an angle θ about
the new z axis
Solution
A
TB Rot x ( )Transx (b)Trans z (d ) Rot z ( )
cos sin 0 b
cos sin cos cos sin d sin
sin sin sin cos cos d cos
0 0 0 1
Homogeneous Transformations
Composition
Decomposition in pure transformations
◦ Any homogeneous transformation can be decomposed in 2 components:
R t I t R 0
T 0 1
0 1 0 1
translatio rotation
nt R
◦ Interpretation 2:
1. First, it applies a rotation R
2. Then, it applies a translation of t units with respect to the fixed (initial) frame
Homogeneous Transformations
Uses
1. They represent the pose (position+orientation) of a frame (rigid body) with
respect to another frame
A
p ATB B
p
◦ Note: the point must be represented using homogeneous coordinates (its notation
uses ~)
zA xB
4
yB
6
yA
xA
Solution
0 1 0 4 2 4
4
p RB
A A A
tB p
B
A p 1 0 0 6 0 4
A
p 4
1 0 1 1 1 0 0 1 0 1 1
1
0 0 0 1 1 1
Homogeneous Transformations
Uses
Example 2
A frame {A} is rotated 90° about x, and then it is translated a vector (6, -2, 10) with
respect to the fixed (initial) frame. Consider a point p = (-5, 2, -12) with respect to the
new frame {B}. Determine the coordinates of that point with respect to the initial
frame
Solution
- Homogeneous transformation
1 0 0 6 1 0 0 0 1 0 0 6
A
0 1 0 2 0 cos 90 sin 90 0 0 0 1 2
TB Trans (6, 2,10) Rot x (90 )
0 0 1 10 0 sin 90 cos 90 0 0 1 0 10
0 0 0 1 0 0 0 1 0 0 0 1
A frame {A} is translated a vector (6, -2, 10) and then it is rotated 90° about axis x of
the fixed (initial) frame. Consider a point with coordinates (-5, 2, -12) with respect to
the new frame ({B}). Find the coordinates of that point with respect to the initial
frame
Solution
- Homogeneous transformation
1 0 0 0 1 0 0 6 1 0 0 6
0 cos 90 sin 90 0 0 1 0 2 0 0 1 10
A
TB Rot x (90 )Trans (6, 2,10) 0 sin 90 cos 90 0 0 0
1 10 0 1 0 2
0 0 0 1 0 0 0 1 0 0 0 1
- Transformed point:
1 0 0 6 5 1
0 0 1 10 2 2
A
p TB p
A B
0 1 0 2 12 0
0 0 0 1 1 1
Homogeneous Transformations
Properties
Inverse of a homogeneous transformation:
R t R T
RT t
T T 1
0 1 0 1
◦ Why?
Solving for BP B
A A A
p t B RB pB
p A RBT A p A RBT At B
R1 t1 R2 t2 R1 R2 R1t 2 t1
T1 T2 T1T2
0 1 0 1 0 1
It is not commutative
Homogeneous Transformations
Example:
Consider that the transformations of the belt and of the robot base with respect to a
reference frame {W} are known. The transformation of the object with respect to the
belt, as well as the transformation of the end effector with respect to the robot base
are also known.
a) Find the pose of the object with respect to the base of the robot
b) Find the pose of the object with respect to the end effector
End
effector
{E}
object
{O}
{F}
belt
{B}
base
{W}
world
Homogeneous Transformations
Example:
Consider that the transformations of the belt and of the robot base with respect to a
reference frame {W} are known. The transformation of the object with respect to the
belt, as well as the transformation of the end effector with respect to the robot base
are also known.
a) Find the pose of the object with respect to the base of the robot
b) Find the pose of the object with respect to the end effector
Solution
W
- Known transformations: TF , W TB , FTO , BTE
a) Desired pose (in terms of the known transformations): BTO
B
TO BTW W TO W TB 1 T T
W
F
F
O
TE TB TF FTO
B 1 W 1 W
Homogeneous Transformations
Example:
The figure shows a robot whose base is 1m away
from the base of the table. The table is 1m height and
its surface is a square. Frame {1} is fixed on a corner
of the table. A 20 cm cube is located on the middle of
the table, and it has frame {2} attached to its center.
A camera is located 2m above the table, just over the
cube, and it has frame {3} attached to it.
0 1 0 1.5 1 0 0 0.5 0 1 0 0
1 0 0 0.5 0 1 0 1.5 1 0 0 0
0 0 1 3 0 0 1 1 0 0 1 2
0 0 0 1 0 0 0 1 0 0 0 1
Kinematics of Robot Manipulators
{n}
qi+1
Forward
Joint kinematics Operation
space al space
q (q1 , , qn ) x ( x, y, z, , , )
Inverse
kinematics
q f 1 ( x)
◦ Forward kinematics
Given a joint configuration, find the pose (position/orientation) of some part of the
robot (e.g. end effector)
◦ Inverse Kinematics
Find the joint configuration that achieves a certain pose (position/orientation) of
some part of the robot
Kinematics of Robot Manipulators
Forward and Inverse formulations
T=?
, q ,=?
, q5 6
, q , q 3, q 4
q1 2
Note: the reference frame of the end effector was arbitrarily assigned
Forward Kinematics
Example (robot R-R): given q1, q2 , where is the end effector?
q1
Joint vector: q x f (q)
q2
Forward Kinematics
For an Open Chain
1 {2}
{1}
T2
{n 1}
…
0
T1 n 1
Tn
{0}
Base Efector
final {n}
o
[y] n {e}: end effector frame
[x]
Fanuc M-10iA x0 y0
Denavit-Hartenberg Convention
Introduction
Procedure
1. Determine 1 frame per joint (based on some rules)
2. Determine 4 parameters (θi, di, ai, αi) that describe the pose between
every two reference frames (based on rules)
3. Using the 4 parameters (per joint) compute the homogeneous
transformation matrices
→ Determine the pose of the end effector with respect to the base (product of the
homogeneous transformation matrices)
Number joint axes: 1 to n (from the base to the end effector) showing the
axis of motion for each joint
Joint 2 Joint
(q2) Joint
Link i- i+1 (qi+1)
1 n (qn)
1 ki
il nk Lin
Joint 1
Lin
Joint
k
(q1)
n
i-1 (q
i )
-1
Joint
Link 0 i (qi) End
(base) effector
Denavit-Hartenberg Convention
(1) Assigning a Reference Frame
Number joint axes: 1 to n (from the base to the end effector) showing the
axis of motion for each joint
Base reference frame: assign frame {0} to the base, with axis z0 along
the axis of motion of joint 1 (arbitrary origin)
→ Axis x0 is arbitrary, and axis y0 completes the frame (right-hand rule)
q3
z0 q2
q1 y0
x0
Denavit-Hartenberg Convention
(1) Assigning a Reference Frame
x0
Denavit-Hartenberg Convention
(1) Assigning a Reference Frame
Axis xi: assign xi in the direction of zi-1 x zi. If (zi-1 & zi) are parallel, assign xi
along the common normal between zi-1 & zi
Axis yi: assign yi to complete the frame (following the right hand rule)
q3
z0 q2
q1 y0 y2
z1 y1
z2
x0 x1 x2
q3 z3
z0 q2 x3
q1 y0 y2
z1 y1
z2 y3
x0 x1 x2 n=3
Denavit-Hartenberg Convention
(2) Assigning the DH Parameters
Joint Parameters
Joint angle (θi): rotation angle from axis xi-1 to axis xi about axis zi-1
→ It is the joint variable if the i-th joint is revolute
Joint displacement (di): distance from the origin of frame {i-1} to the
intersection of axis zi-1 to axis xi along axis zi-1
→ It is the joint variable if the i-th joint is prismatic
Link length (ai): distance from the intersection of axis zi-1 and axis xi to
the origin of frame {i} along axis xi
Link rotation angle (αi): rotation angle from axis zi-1 to axis zi about
axis xi
Denavit-Hartenberg Convention
(2) Assigning the DH Parameters
joint joint
qi-1 qi joint
qi+1
zi
di zi-1
xi-1 xi
θi joint between
links
Joint parameters
• di: distance from the origin of {i-1} to the [intersection of zi-1 with xi] along zi-1
• θi: rotation angle from xi-1 to xi about zi-1
Note: di, θi have sign (they can be + or -)
Denavit-Hartenberg Convention
(2) Assigning the DH Parameters
joint joint
qi-1 qi joint
qi+1
Angle between
αi joint axis
zi
ai
zi-1
Displacement xi
xi-1 between
joint axis
Link parameters
• ai: distance from [the intersection of zi-1 with xi] to the origin of {i} along xi
• αi: angle from zi-1 to zi about xi
Note: ai, αi have sign (they can be + or -)
Denavit-Hartenberg Convention
(2) Assigning the DH Parameters
joint joint
qi-1 qi joint
qi+1
αi
zi
ai
di zi-1
xi-1 xi
θi
Summary
• di: distance from the origin of {i-1} to the [intersection of zi-1 with xi]
along zi-1
• θi: rotation angle from xi-1 to xi about zi-1
• ai: distance from [the intersection of zi-1 with xi] to the origin of {i}
along xi
Denavit-Hartenberg Convention
(2) Assigning the DH Parameters
Example
q3 z3
z0 q2 x3
q1 y0 y2
z1 y1
y3 l3
z2
x0 x1 x2
l1 l2
Joint i di θi ai αi
1 0 q1 l1 0
2 0 180+q2 -l2 90
3 l3 180+q3 0 0
di: distance from the origin of {i-1} to [the intersection of zi-1 to xi] along
zi-1
θi: rotation angle from xi-1 to xi about zi-1
ai: distance from [the intersection of zi-1 with xi] to the origin of {i} along
xi
Denavit-Hartenberg Convention
(2) Assigning the DH Parameters
Example
q3 z3
z0 q2 x3
q1 y0 y2
z1 y1
y3 l3
z2
x0 x1 x2
l1 l2
Note:
Joint i di θi ai αi Joint i di θi ai αi
Home
1 0 q1 l1 0 Sometimes 1 0 q1 l1 0 0
2 0 180+q2 -l2 90 written as
2 0 q2 -l2 90 180
3 l3 180+q3 0 0
3 l3 q3 0 0 180
Sometimes the “home” is omitted
Denavit-Hartenberg Convention
(3) Homogeneous Transformation
Objective: take frame {i-1} to frame {i}
1. First take {i-1} to {G} qi+1
qi
zg αi
{G} xg zi
ai
di zi-1
xi-1 xi
{i}
θi
{i-1}