Position and Orientation of Rigid Bodies: Robotics 1
Position and Orientation of Rigid Bodies: Robotics 1
Robotics 1
RFA
pAB A
AR B
! orientation:
orthonormal 3x3 matrix (RT = R-1 " ARB BRA = I), with det = +1
[x
A
Ay
Az
]
2
! xA yA zA (xB yB zB) are unit vectors (with unitary norm) of frame RFA (RFB) ! components in ARB are the direction cosines of the axes of RFB with respect to (w.r.t.) RFA
Robotics 1
Rotation matrix
xAT xB
orthonormal, with det = +1
AR B
yAT xB zAT xB
kR i
! iRj = kRj
algebraic structure of a group SO(3) (neutral element = I; inverse element = RT) orientation of RFj w.r.t. RFk
Change of coordinates
z0 z1
! P
0P
0p x 0p y 0p z
1p 0x x 1
y1
RF1 RF0
0x
0y 0z 1 1
y0
= 0R1 1P
x0 x1
Robotics 1
the rotation matrix 0R1 (i.e., the orientation of RF1 w.r.t. RF0) represents also the change of coordinates of a vector from RF1 to RF0
4
P # u RF0 x y z RFC
u u v = Rz(#) v w w
similarly: Rx(#) =
Robotics 1
1 0 0
Ry(#) =
cos # 0 - sin #
0 1 0
sin # 0 cos #$
5
v v
x = |v| cos %$ y = |v| sin %$ x = |v| cos (% + #) = |v| (cos % cos # - sin % sin #) x = x cos # - y sin # y = |v| sin (% + #) = |v| (sin % cos # + cos % sin #) x = x sin # + y cos # z = z
Robotics 1
v v
# RF0
the change of coordinates from RFC to RF0 ex: 0P = Rz(#) CP the vector rotation operator ex: v = Rz(#) v
Robotics 1
the rotation matrix 0RC is an operator superposing frame RF0 to frame RFC
Composition of rotations
brings RF0 on RF1
0R 1 1R 2
2R 3
3p
RF2
RF3
Robotics 1
Axis/angle representation
z0 rz
P DATA ! unit vector r (!r! = 1)$ ! # (positive if counterclockwise, as
z1
RF1
v
#$
r y1
v
RF0
ry y0
DIRECT PROBLEM
rx x0
RF1 is the result of rotating RF0 by an angle # around the unit vector r
R(#,r) 1P
0v
= R(#,r) 0v
x1
Robotics 1 9
R(#,r) = C Rz(#) CT
C concatenation of three rotations
z1
RF1
C-1 = CT
2
r
Rz(#)
y1 y0
C= n s r
RF0
after the first rotation the z-axis coincides with r n and s are orthogonal unit vectors such that n " s = r, or nysz - synz = rx nzsx - sznx = ry nxsy - sxny = rz
x0 x1
Robotics 1
sequence of 3 rotations that bring frame RF0 to superpose with frame RF1
10
-rz 0
ry -rx = S(r) 0
v = S(r)v = - S(v)r
= RT(-#,r) = R(-#,-r)
11
R(#,r) =
rx2(1- cos#)+cos# rxry(1- cos#)+rzsin# rxrz(1- cos#)-rysin# rxry(1- cos#)-rzsin# ry2(1- cos#)+cos# ryrz(1- cos #)+rxsin# rxrz(1- cos #)+rysin# ryrz(1- cos #)-rxsin# rz2(1- cos#)+cos#
Robotics 1
12
#0 0 0 & #1 0 0 & #0 )1 0& R (" ,r ) = %0 0 0 ( + %0 1 0 ( c" + %1 0 0( s" % % $0 0 1 ( ' % $0 0 0 ( ' $0 0 0( ' #c" = %s" % $0
Robotics 1
-s" c" 0
Rodriguez formula
v = R(#,r) v v = v cos # + (r " v) sin # + (1 - cos #)(rTv) r
proof:
R(#,r) v = (r rT + (I - r rT) cos # + S(r) sin #)v = r rT v (1 - cos #) + v cos # + (r " v) sin #
q.e.d.
Robotics 1
14
Properties of R(#,r)
1.! R(#,r)r = r (r is the invariant axis in this rotation) 2.! when r is one of the coordinate axes, R boils down to one of the known elementary rotation matrices 3.! (#,r)R is not an injective map: R(#,r) = R(-#,-r) 4.! det R = +1 = & 'i (eigenvalues) 5.! tr(R) = tr(r rT) + tr(I - r rT)c# = 1 + 2 c# = ( 'i 1. " '1 = 1
1. 5. & 4. " '2 + '3 = 2 c# " '2 - 2 c# ' + 1 = 0 " '2,3 = c# )c2# - 1 = c# i s# = ei # $ all eigenvalues ' have unitary module (* R orthonormal)
Robotics 1
15
but: ! provides only values in [0,+] (thus, never negative angles #) ! loss of numerical accuracy for # , 0
Robotics 1 16
# = ATAN2 {) (R21 - R12)2 + (R13 - R31)2 + (R23 - R32)2, R11 + R22 + R33 - 1}
see next slide
r=
rx ry rz
# # 0 k+$
(this test is made in advance on the above expression of sin # in terms of the Rijs)
Robotics 1
17
ATAN2 function
!! arctangent with output values in the four quadrants !! two input arguments !! takes values in [-+ ,++ ] !! undefined only for (0,0) !! uses the sign of both arguments to define the output quadrant !! based on arctan function with output values in [-+ /2,++ /2] !! available in main languages (C++, Matlab, )
Robotics 1
18
Singular cases
"!
"!
for # = 0 2k+, there is no solution for r (rotation axis is undefined) for # = + 2k+, sin # = 0, cos # = -1 " R = 2r rT - I resolving
rx r= ry = rz )(R11 + 1)/2 )(R22 + 1)/2 )(R33 + 1)/2 rx ry = R12/2 with rx rz = R13/2 ry rz = R23/2
Unit quaternion
"!
to eliminate undetermined and singular cases arising in the axis/angle representation, one can use the unit quaternion representation Q = {-, .} = {cos(#/2), sin(#/2) r}
a scalar 3-dim vector
-2 + !.!2 = 1 (thus, unit ...) (#, r) and (-#, -r) gives the same quaternion Q the absence of rotation is associated to Q = {1, 0} unit quaternions can be composed with special rules (in a similar way as in the product of rotation matrices)