Robot Transformations

advertisement
Introduction to ROBOTICS
Kinematics
Pose (position and orientation)
of a Rigid Body
University of Bridgeport
1
Representing Position (2D)
y
5 
p 
2
p
(“column” vector)
2
p  5xˆ  2 yˆ
xˆ
yˆ
5
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
yˆb
• The prefix superscript denotes the
reference frame in which the vector
should be understood
yˆa
p
2
2
3
b
5
b
5 3 8
p    
2 2 4
a
xˆa
xˆb
3
p 
2
Same point, two different
reference frames
3
Representing Position: vectors (3D)
y
y
p
x
2
p  5
2
z
p  2 xˆ  5 yˆ  2 zˆ
x
z
right-handed
coordinate frame
xˆ
yˆ
zˆ
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
A vector of length one pointing in the
direction of the base frame z axis
4
The rotation matrix
A
 cos   sin 

RB  
 sin  cos  
A
A
RB
B
yˆ B
p RB p
A
B
:To specify the coordinate vectors
for the fame B with respect to
frame A
RA  RB
A
B
1
 cos  sin   

 
  sin   cos 
pBRA A p
yˆ A
p
xˆB


xˆ A
θ: The angle between xˆ A and xˆB
in anti clockwise direction
5
The rotation matrix
A
RB 
A
x
A
B 2 x1
A
yB 2 x1

yˆ B
xB2 x1  cos xˆA  sin  . yˆ A
yˆ A
xˆB


A
xˆ A
yB2x1   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
B
10
p 
10
Example 1
B
A
yˆ
yˆ
A
find p
 cos30  sin 30

RB  
 sin 30 cos30 
 3 1 


A
2 
RB   2
 1
3




2 
 2
A
P



B
xˆ
30
A
30
A
3
2
1
2
A
p RB p
A
B
1 
 10
2     3.6603
3 10 13.6603

2 
8
xˆ
A
10
p 
10
Example 1
B
yˆ
A
yˆ
B
find p
 cos 30  sin  30 30

RA  
 sin  30 cos 30 
30
 3 1 


B
B
A
B
2
2


p RA p
RA 
 1
3
 3 1 

 10


  13.6603
2 
 2
B
2
2


   

P
 1
3 10  3.6603


2 
 2
B
xˆ
B
A
9
xˆ
Example 1
Another Solution
A
 cos30  sin 30

RB  
 sin 30 cos30 
B
RA  RB
B
A
1
OR
B
RA  RB
A
T
 cos30  sin 30

RA  
 sin 30 cos30 
10
Basic Rotation Matrix
– Rotation about x-axis with
0 
1 0
Rot( x, )  0 C  S 
0 S C 
 pu 
 px 
 p   R ( x,  )  p 
 v
 y
 pw 
 p z 
z
w
P
v

u
y
x
p x  pu
p y  pv cos  pw sin 
p z  pv sin   pw cos
11
Basic Rotation Matrices
– Rotation about x-axis with 
Rx ,
1 0
 Rot( x,  )  0 C
0 S
0 
 S 
C 
 C
 Rot( y,  )   0
 S
S 
1 0 
0 C 
– Rotation about y-axis with 
R y ,
– Rotation about z-axis with 
Pxyz  RPuvw
Rz ,
C
 Rot( z ,  )   S
 0
0
 S
C
0
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 axyz  (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.866 0   4   4.598 
 0.5
  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
15
current frame]
Rotation with respect to Current
Frame
A
B
A
P RB P
B
PBRC PC
C
C
D
P RD P
A
P ARD P D  ARB B RC C RD P D
RD  RB RD
A
RD  ARB B RC C RD
A
A
B
16
Example 4
• Find the rotation matrix for the following
operations:
R  Rot( y,  ) Rot( z, ) Rot( x,  )
Rotation  about Y axis
Rotation  about current Z axis
Rotation  about current X axis
0 
 C 0 S  C  S 0 1 0
  0 1 0   S C 0 0 C  S 
- S 0 C   0
0
1 0 S C 
 CC SS  CSC CSS  SC 

  S
CC
 CS

 SC SSC  CS CC  SSS 
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

Rotation about fixed Z axis 
- S
Rotation about fixed Y axis
0 S  C
1 0   S
0 C   0
 CC
  S
 SC
0 1 0
0 
C 0 0 C  S 
0
1 0 S C 
SS  CSC CSS  SC 

CC
 CS

SSC  CS CC  SSS 
Pre-multiply if rotate about the fixed frame
Post-multiply if rotate about the current
frame
18
 S
Example 6
• Find the rotation matrix for the following
operations:
Rotation about X axis
Rotation about current Zaxis
Rotation about fixed Z axis
Rotation about current Y axis
Rotation about fixed X axis
19
Pre-multiply if rotate about the fixed frame
Post-multiply if rotate about the current
frame
Example 6
• Find the rotation matrix for the following
operations:
Rotation about X axis
Rotation about current Zaxis
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{PIT CH}
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
R  Rot( z,  ) Rot( y, ) Rot( x, )


Y

X
0 
C  S 0  C 0 S  1 0
  S C 0  0 1 0  0 C  S 
 0
0
1 - S 0 C  0 S C 
CC  SS  CSS CSC  SS 
  SC CSS  CS  CS  SSC 
  S

CS
CC
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
P H B P
A
B
Rotation
matrix
(3*3)
 RB
HB  
 013
A
A
p 

1
A
B
Position
vector
(3*1)
24
Homogeneous Representation
A
P AH B B P
Rotation
matrix
(3*3)
 A xp 
A 
yp 
A

P A
 zp 


 1 
 RB
HB  
 013
A
A
 B xp 
B 
yp 
B

P B
 zp 


 1 
p 

1
A
B
Position vector
of the origin of
frame B wrt
frame A (3*1) 25
Homogeneous Transformation
• Special cases
1. Translation
 I 33
A
HB  
013
p 

1
A
B
2. Rotation
A

RB
A
HB  
 013
031 

1 
26
Example 7
• Translation along Z-axis with h:
1
0
Trans( z , h)  
0

0
0
1
0
0
0
0
1
0
 x  1
 y  0
 
 z  0
  
 1  0
0
0
h

1
z
0
1
0
0
0
0
1
0
0  p x1   p x1 
0  p y1   p y1 

h  p z1   p z1  h
  

1  1   1 
z
P
P
B
y
w
y
z
B
y
v
O
u
x
B
h
O
x
x
27
Example 7
• Translation along Z-axis with h:
0
P H B P
 x  1
 y  0
 
 z  0
  
 1  0
0
0
1
0
0
B
0
0
1
0
0  p xB   p xB 
0  p yB   p yB 

h  p yB   p z B  h
  

1  1   1 
28
Example 8
• Rotation about the X-axis by 
1 0
0 C
Rot( x, )  
0 S

0 0
0
 S
C
0
0
0
0

1
 x  1 0
 y  0 C
 
 z  0 S
  
 1  0 0
0
 S
C
0
0  p x1 
0  p y1 
0  p z1 
 
1  1 
z
z1
P

y1

x
x1
y
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
T ranslation of a alongOX axis
T ranslation of d alongOZ axis
Rotationof  about OZ axis
H  Rotz , Transz ,dTransx,a Rotx,
Answer :
C
 S

 0

 0
 S
C
0
0
0
0
1
0
0 1
0 0
0  0

1  0
0
1
0
0
0
0
1
0
0  1
0  0
d  0

1  0
0
1
0
0
0
0
1
0
a  1 0
0  0 C
0  0 S

1  0 0
0
 S
C
0
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
A  a21
 a31
a12
a22
a32
a13 
a23 
a33 
 a11
AT  a12
a13
 a11
a
 21
 a31
5 
p 
2
p  5 2
T
a12
a22
a32
a21
a22
a23
a31 
a32 
a33 
a13 
a23 
a33 
Important property:
AT BT  BA
T
33
and matrix multiplication…
 a11
A
a21
 a11
AB  
a21
a12 
a22 
b11 b12 
B

b
b
 21 22 
a12  b11 b12   a11b11  a12b21




a22  b21 b22  a21b11  a22b21
a11b12  a12b22 
a21b12  a22b22 
Can represent dot product as a matrix multiply:

a  b  axbx  a y by  ax
bx 
T
ay    a b
b
 y

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
Download