Introduction to
ROBOTICS
Kinematics
Pose (position and orientation)
of a Rigid Body
University of Bridgeport
1
Representing Position (2D)
y
5
p (“column” vector) p
2 2
p 5 xˆ 2 yˆ 5 x
x̂ A vector of length one pointing
in the direction of the base
frame x axis
ŷ A vector of length one pointing
in the direction of the base
frame y axis
2
Representing Position: vectors
ŷb
• The prefix superscript denotes the
reference frame in which the vector
yˆ a
should be understood p
2
2 xˆa
3
b x̂b
5
b 5 3 8 3
p a
p
2 2 4 2
Same point, two different
reference frames
3
Representing Position: vectors (3D)
y y
p
x x
z
2 z
p 5
right-handed
coordinate frame
2
x̂ A vector of length one pointing in the
direction of the base frame x axis
p 2 xˆ 5 yˆ 2 zˆ
ŷ A vector of length one pointing in the
direction of the base frame y axis
ẑ A vector of length one pointing in the
4
direction of the base frame z axis
The rotation matrix
yˆ B yˆ A
A cos sin
RB p
sin cos
A
p ARB B p xˆB
A
RB :To specify the coordinate vectors xˆ A
for the fame B with respect to
frame A
θ: The angle between xˆ A and xˆB
B A 1 cos sin
RA RB in anti clockwise direction
sin cos
B
p BR A A p 5
The rotation matrix
yˆ B yˆ A
A
RB A xB 2 x1 A
y B 2 x1
A
xB 2 x1 cos xˆ A sin . yˆ A xˆB
A
xˆ A
yB 2 x1 sin xˆ A cos yˆ A
6
Useful formulas
B
A R ( BAR ) 1 ( BAR)T
R R 1 I
B
A R.BA R I
Det ( R ) 1
7
Example 1
B 10
p A
10 B
yˆ yˆ
A
find p
B
xˆ
A cos 30 sin 30 30
RB
sin 30 cos 30 30 A
3 1 xˆ
A A B
A
RB 2 2 p RB p
1 3 3 1
2 2 A
P 2 2 10 3.6603
1 3 10 13.6603
8
2 2
Example 1
A 10
p A
10 B
yˆ yˆ
B
find p
B
xˆ
B cos 30 sin 30 30
R A
sin 30 cos 30 30 A
3 1
xˆ
B B A
B
RA 2 2 p RA p
1 3 3 1
2 2 B 2 2 10 13.6603
P
1 3 10 3.6603
9
2 2
Example 1
Another Solution
A cos 30 sin 30
RB
sin 30 cos 30
B A 1 B A T
R A RB OR RA RB
B cos 30 sin 30
RA
sin 30 cos 30
10
Basic Rotation Matrix
– Rotation about x-axis with
1 0 0 z
w
Rot ( x, ) 0 C S P v
0 S C
px pu
p R ( x, ) p y
u
y v x
p z pw
p x pu
p y pv cos pw sin
p z pv sin pw cos 11
Basic Rotation Matrices
– Rotation about x-axis with
1 0 0
Rx , Rot ( x, ) 0 C S
0 S C
– Rotation about y-axis with
C 0 S
R y , Rot ( y, ) 0 1 0
S 0 C
– Rotation about z-axis with
C S 0
Rz , Rot ( z , ) S C 0
Pxyz RPuvw 0 0 1
12
Example 2
• A point puvw (4,3,2) is attached to a rotating frame,
the frame rotates 60 degree about the OZ axis of
the reference frame. Find the coordinates of the
point relative to the reference frame after the
rotation.
p xyz Rot ( z ,60) puvw
0.5 0.866 0 4 0.598
0.866 0.5 0 3 4.964
0 0 1 2 2
13
Example 3
• A point a xyz (4,3,2) is the coordinate w.r.t. the
reference coordinate system, find the
corresponding point auvw w.r.t. the rotated
OUVW coordinate system if it has been
rotated 60 degree about OZ axis.
puvw Rot ( z , 60)T pxyz
OR : puvw Rot ( z , 60) 1 pxyz
OR : puvw Rot ( z , 60) pxyz
0.5 0.866 0 4 4.598
0.866 0.5 0 3 1.964
0 0 1 2 2 14
Composite Rotation Matrix
• A sequence of finite rotations
– matrix multiplications do not commute
– rules:
• if rotating coordinate OUVW is rotating about
principal axis of OXYZ frame, then Pre-multiply the
previous (resultant) rotation matrix with an
appropriate basic rotation matrix [rotation about
fixed frame]
• if rotating coordinate OUVW is rotating about its
own principal axes, then post-multiply the previous
(resultant) rotation matrix with an appropriate basic
rotation matrix [rotation about current frame]
15
Rotation with respect to Current
Frame
A A B
P RB P
B
PBRC P C
C C D
P RD P
A
P ARD P D ARB B RC C RD P D
A A B
RD RB RD
A
RD ARB B RC C RD 16
Example 4
• Find the rotation matrix for the following
operations:
R Rot ( y, ) Rot ( z , ) Rot ( x, )
C 0 S C S 0 1 0 0
Rotation about Y axis 0 1 0 S C 0 0 C S
Rotation about current Z axis - S 0 C 0 0 1 0 S C
Rotation about current X axis CC SS CSC CSS SC
S CC CS
SC SSC CS CC SSS
Pre-multiply if rotate about the fixed frame
Post-multiply if rotate about the current
17
frame
Example 5
• Find the rotation matrix for the following
operations:
R Rot ( y, ) Rot ( z , ) Rot ( x, )
Rotation about X axis C 0 S C S
0 1 0 0
0 1 0 S C 0 0 C S
Rotation about fixed Z axis
- S 0 C 0 0 1 0 S C
Rotation about fixed Y axis
CC SS CSC CSS SC
S CC CS
SC SSC CS CC SSS
Pre-multiply if rotate about the fixed frame
Post-multiply if rotate about the current
frame
18
Example 6
• Find the rotation matrix for the following
operations:
Rotation about X axis
Rotation about current Z axis
Rotation about fixed Z axis
Rotation about current Y axis
Rotation about fixed X axis
Pre-multiply if rotate about the fixed frame
Post-multiply if rotate about the current
19
frame
Example 6
• Find the rotation matrix for the following
operations:
Rotation about X axis
Rotation about current Z axis
Rotation about fixed Z axis
Rotation about current Y axis
Rotation about fixed X axis
R Rot ( x, ) Rot ( z , ) Rot ( x, ) Rot ( z , ) Rot ( y, )
20
Quiz
• Description of Roll Pitch Yaw
• Find the rotation matrix for the following
operations: Z
Rotation about X axis{ROLL}
Rotation about fixed Y axis{PITCH}
Rotation about fixed Z axis{YAW}
Y
X
21
Z
Answer
Rotation about X axis
Rotation about fixed Y axis
Rotation about fixed Z axis Y
R Rot ( z , ) Rot ( y, ) Rot ( x, )
X
C S 0 C 0 S 1 0 0
S C 0 0 1 0 0 C S
0 0 1 - S 0 C 0 S C
CC SS CSS CSC SS
SC CSS CS CS SSC
S CS CC
22
Coordinate Transformations
• position vector of P
in {B} is transformed
to position vector of P
in {A}
• description of
frame{B} as seen
from an observer in
{A}
Rotation of {B} with respect to {A}
Translation of the origin of {B} with respect to origin of {A} 23
Homogeneous Representation
• Coordinate transformation from {B} to {A}
A A B A
rP RB rp ro '
Can be written as A A
P H B PB
Rotation
matrix
(3*3)
A
A RB pBA
H B
013 1 Position
vector
(3*1)
24
Homogeneous Representation
A
P AH B B P A xp B xp
A B
A yp yp
P A B
P B
zp zp
Rotation
1 1
matrix
(3*3)
A
A RB pBA
H B Position vector
013 1 of the origin of
frame B wrt
frame A (3*1) 25
Homogeneous Transformation
• Special cases
1. Translation
A
A I 33 p
B
H B
013 1
2. Rotation
A
A RB 031
H B
013 1
26
Example 7
• Translation along Z-axis with h:
1 0 0 0 x 1 0 0 0 p x1 p x1
0 1 0 0 y 0 1 0 0 p y1 p y1
Trans ( z , h)
0 0 1 h z 0 0 1 h p z1
p z1 h
0 0 0 1 1 0 0 0 1 1 1
z z P
P
B
z y
y
w B
y
v
B
x h
x x
O
u 27
O
Example 7
• Translation along Z-axis with h:
0 0 B
P H B P
x 1 0 0 0 p xB p xB
y 0 1 0 0 p y B p y B
z 0 0 1 h p yB p zB h
1 0 0 0 1 1 1
28
Example 8
• Rotation about the X-axis by
1 0 0 0 x 1 0 0 0 p x1
0 C S 0 y 0 C S 0 p y1
Rot ( x, )
0 S C 0 z 0 S C 0 p z1
0 0 0 1 1 0 0 0 1 1
z
z1
P
y1
y
x1
x 29
Homogeneous Transformation
• Composite Homogeneous Transformation
Matrix
• Rules:
– Transformation (rotation/translation) w.r.t fixed
frame, using pre-multiplication
– Transformation (rotation/translation) w.r.t
current frame, using post-multiplication
30
Example 9
• Find the homogeneous transformation matrix
(H) for the following operations:
Rotation about OX axis
Translation of a along OX axis
Translation of d along OZ axis
Rotation of about OZ axis
H Rot z , Trans z ,d Trans x ,a Rot x ,
Answer : C S 0 0 1 0 0 0 1 0 0 a 1 0 0 0
S C 0 0 0 1 0 0 0 1 0 0 0 C S 0
0 0 1 0 0 0 1 d 0 0 1 0 0 S C 0
0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1
31
Remember those double-angle formulas…
sin sin cos cos sin
cos cos cos sin sin
32
Review of matrix transpose
a11 a12 a13 a11 a21 a31
A a21 a22 a23 AT a12 a22 a32
a31 a32 a33 a13 a23 a33
a11 a12 a13
a a22 a23
21
a31 a32 a33
5 T
p T
p 5 2 Important property: A T BT BA
2
33
and matrix multiplication…
a11 a12 b11 b12
A B
a21 a22 b b
21 22
a11 a12 b11 b12 a11b11 a12b21 a11b12 a12b22
AB
a21 a22 b21 b22 a21b11 a22b21 a21b12 a22b22
Can represent dot product as a matrix multiply:
bx
a b a x bx a y by a x T
a y a b
by
34
HW
• Problems 2.10, 2.11, 2.12, 2.13,
2.14 ,2.15, 2.22, 2.24, 2.37, and 2.39
• Quiz next class
35