0% found this document useful (0 votes)
82 views20 pages

Position and Orientation of Rigid Bodies: Robotics 1

This document discusses representations of rigid body position and orientation using reference frames. It covers: - Representing position as a vector and orientation as a rotation matrix between reference frames - Properties and interpretations of rotation matrices, including representing rotations as sequences of elementary rotations and changes of coordinate systems - Representing orientation using axis-angle parameters, including the direct and inverse problems of relating a rotation matrix to an axis and angle of rotation - Properties and singular cases of the axis-angle representation - Representing orientation using unit quaternions to avoid singular cases

Uploaded by

Bharath Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views20 pages

Position and Orientation of Rigid Bodies: Robotics 1

This document discusses representations of rigid body position and orientation using reference frames. It covers: - Representing position as a vector and orientation as a rotation matrix between reference frames - Properties and interpretations of rotation matrices, including representing rotations as sequences of elementary rotations and changes of coordinate systems - Representing orientation using axis-angle parameters, including the direct and inverse problems of relating a rotation matrix to an axis and angle of rotation - Properties and singular cases of the axis-angle representation - Representing orientation using unit quaternions to avoid singular cases

Uploaded by

Bharath Kumar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Robotics 1

Position and orientation of rigid bodies


Prof. Alessandro De Luca

Robotics 1

Position and orientation


right-handed orthogonal Reference Frames

RFB rigid body B ! position: ApAB (vector ! R3),


expressed in RFA (use of coordinates I other than Cartesian is possible, e.g. cylindrical or spherical)

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

xAT yB yAT yB zAT yB

xAT zB yAT zB zAT zB

yAT xB zAT xB

direction cosine of zB w.r.t. xA

chain rule property


orientation of RFi w.r.t. RFk

kR i

! iRj = kRj

algebraic structure of a group SO(3) (neutral element = I; inverse element = RT) orientation of RFj w.r.t. RFk

orientation of RFj w.r.t. RFi

NOTE: in general, the product of rotation matrices does not commute!


Robotics 1 3

Change of coordinates
z0 z1
! P
0P

0p x 0p y 0p z

1p 0x x 1

+ 1py 0y1 + 1pz 0z1


1p x 1p y 1p z

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

Ex: Orientation of frames in a plane


(elementary rotation around z-axis) y v C # O x B
0OP

P # u RF0 x y z RFC

x = OB xB = u cos # - v sin #$ y = OC + Cy = u sin # + v cos #$ z=w or


0x C 0y C 0z C COP

cos # $-sin # $0 = sin # $ cos # 0 0 0 1 Rz(-#) = RzT(#)

u u v = Rz(#) v w w

similarly: Rx(#) =
Robotics 1

1 0 0

0 0 cos # - sin # sin # cos #$

Ry(#) =

cos # 0 - sin #

0 1 0

sin # 0 cos #$
5

Ex: Rotation of a vector around z


y y # %$ O x x

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

or x cos # y = sin # z 0 - sin # cos # 0 0 0 1 x y z = Rz(#) x y z as before!

Robotics 1

Equivalent interpretations of a rotation matrix


the same rotation matrix, e.g., Rz(#), may represent:
RFC P RFC # RF0
the orientation of a rigid body with respect to a reference frame RF0 ex: [0xc 0yc 0zc] = Rz(#)

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

brings RF1 on RF2

2R 3

brings RF2 on RF3

p23 = 0 p01 = 0 p12 = 0 RF1 RF0


0p

3p

RF2

RF3

a comment on computational complexity = (0R1 1R2 2R3) 3p = 0R3 3p


0p

63 products 42 summations 27 products 18 summations


8

= 0R1 (1R2 (2R33p))


2p 1p

Robotics 1

Axis/angle representation
z0 rz
P DATA ! unit vector r (!r! = 1)$ ! # (positive if counterclockwise, as

z1
RF1

v
#$

r y1

seen from an observer placed like r)

v
RF0

ry y0

DIRECT PROBLEM

rx x0

find R(#,r) = [0x1 0y1 0z1] such that


0P=

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

Axis/angle: Direct problem


z0
1

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

Axis/angle: Direct problem


solution

R(#,r) = C Rz(#) CT R(#,r) = n s r


c # - s# 0 s# c # 0 0 0 1 nT sT rT

= r rT + (n nT + s sT) c# + (s nT - n sT) s# taking into account that C CT = n nT + s sT + r rT = I , 0 s nT - n sT = depends only on r and # !!


Robotics 1

and that skew-symmetric(r): r


"

-rz 0

ry -rx = S(r) 0

v = S(r)v = - S(v)r

R(#,r) = r rT + (I - r rT) c# + S(r) s#

= RT(-#,r) = R(-#,-r)
11

Final expression of R(#,r)


developing computations

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

Axis/angle: a simple example


R(#,r) = r rT + (I - r rT) c# + S(r) s#
r= 0 0 = z0 1

#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

0& 0( = R z (" ) 1( '


13

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

Axis/angle: Inverse problem


GIVEN a rotation matrix R, FIND a unit vector r and an angle # such that:

R = r rT + (I - r rT) cos # + S(r) sin # = R(#,r)


Note first that

tr(R) = R11 + R22 + R33 = 1 + 2 cos #$ # = arcos R11 + R22 + R33 - 1 2

but: ! provides only values in [0,+] (thus, never negative angles #) ! loss of numerical accuracy for # , 0
Robotics 1 16

Axis/angle: Inverse problem


solution from R - RT = it follows 1 !r! = 1 " sin # = 2$ 0 R12-R21 R13-R31 0 R23-R32 0 = 2 sin # 0 -rz 0 ry -rx 0

) (R21 - R12)2 + (R13 - R31)2 + (R23 - R32)2

# = ATAN2 {) (R21 - R12)2 + (R13 - R31)2 + (R23 - R32)2, R11 + R22 + R33 - 1}
see next slide

r=

rx ry rz

R32 - R23 1 = R13 - R31 2 sin #$ R21 - R12

can be used only if

# # 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

multiple signs ambiguities (always two solutions, of opposite sign)


0 & ( 1 " 2( 1 ( 2 '
19

exercise: determine all the solutions (r, #) for R =


Robotics 1

#"1 0 % 1 %0 " 2 %0 " 1 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)

Q 1*Q 2 = {-1-2 - .1T.2, -1.2 + -2.1 + .1".2}


Robotics 1 20

You might also like