Position and Orientation of Rigid Bodies: Robotics 1
Position and Orientation of Rigid Bodies: Robotics 1
Robotics 1 1
Position and orientation
right-handed orthogonal RFB rigid body
Reference Frames
• position: ApAB (vector ! R3),
B expressed in RFA (use of coordinates
RFA I
other than Cartesian is possible, e.g.
pAB
cylindrical or spherical)
• orientation:
orthonormal 3x3 matrix
A (RT = R-1 " ARB BRA = I), with det = +1
AR
B = [x
A
B
Ay
B
Az
B ]
• 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 2
Rotation matrix
direction cosine of
xAT xB xAT yB xAT zB zB w.r.t. xA
AR = yAT xB yAT yB yAT zB
B
orthonormal,
with det = +1 zAT xB zAT yB zAT zB
algebraic structure
chain rule property of a group SO(3)
(neutral element = I;
kR inverse element = RT)
i ! iRj = kRj
orientation of RFi orientation of RFj
w.r.t. RFk w.r.t. RFk
orientation of RFj
w.r.t. RFi
Robotics 1 3
Change of coordinates
z0
0p
x
0p 1p 0x
z1 • P 0P = y = x 1 + 1py 0y1 + 1pz 0z1
0p
z 1p
x
y1 0x 0y 0z 1p
= 1 1 1 y
1p
RF1 z
y0
RF0 = 0R1 1P
x0
the rotation matrix 0R1 (i.e., the orientation of RF1
w.r.t. RF0) represents also the change of
x1 coordinates of a vector from RF1 to RF0
Robotics 1 4
Ex: Orientation of frames in a plane
(elementary rotation around z-axis)
x = OB – xB = u cos # - v sin #$
y •P y = OC + Cy = u sin # + v cos #$
RFC z=w
v #
C or…
u
COP
0x 0y 0z
# RF0 C C C
x B
O
x cos # $-sin # $0 u u
0OP y = sin # $ cos # 0 v = Rz(#) v
z 0 0 1 w w
Rz(-#) = RzT(#)
similarly:
1 0 0 cos # 0 sin #
Rx(#) = 0 cos # - sin # Ry(#) = 0 1 0
0 sin # cos #$ - sin # 0 cos #$
Robotics 1 5
Ex: Rotation of a vector around z
y’
v’ x = |v| cos %$
y = |v| sin %$
y v x’ = |v| cos (% + #) = |v| (cos % cos # - sin % sin #)
# x’ = x cos # - y sin #
%$
y’ = |v| sin (% + #) = |v| (sin % cos # + cos % sin #)
x’ x x’ = x sin # + y cos #
O
z’ = z
or…
Robotics 1 6
Equivalent interpretations
of a rotation matrix
the same rotation matrix, e.g., Rz(#), may represent:
v’
RFC
v
• P RFC #
# #
RF0 RF0
0R
1
p23 = 0 • 3p
0p 63 products
= (0R1 1R2 2R3) 3p = 0R3 3p
42 summations
0p = 0R1 (1R2 (2R33p)) 27 products
2p
18 summations
1p
Robotics 1 8
Axis/angle representation
z0
DATA
rz
• unit vector r (!r! = 1)$
•P
r • # (positive if counterclockwise, as
v seen from an “observer” placed like r)
z1 y1
#$ DIRECT PROBLEM
RF1 v’ ry
find
RF0 y0
rx R(#,r) = [0x1 0y1 0z1]
x0 RF1 is the result of rotating such that
RF0 by an angle # around
0P= R(#,r) 1P 0v’ = R(#,r) 0v
the unit vector r
x1
Robotics 1 9
Axis/angle: Direct problem
z0 R(#,r) = C Rz(#) CT
1
C concatenation of three rotations
C-1 = CT r
3 C= n s r
z1 2 y1
Rz(#)
R(#,r) = C Rz(#) CT
c# - s# 0 nT
R(#,r) = n s r s# c# 0 sT
0 0 1 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 , and that
0 -rz ry
skew-symmetric(r):
s nT - n sT = 0 -rx = S(r)
r " v = S(r)v = - S(v)r
0
depends only
R(#,r) = r rT + (I - r rT) c# + S(r) s# = RT(-#,r) = R(-#,-r)
on r and # !!
Robotics 1 11
Rodriguez formula
v’ = R(#,r) v
proof:
Robotics 1 14
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
Robotics 1
Minimal representations
of orientation
(Euler and roll-pitch-yaw angles)
Homogeneous transformations
Robotics 1 1
“Minimal” representations
= 3 independent variables
{(a1 α1), (a2 α2), (a3 α3)} ≡ { (a’3 α3) , (a’2 α2), (a’1 α1)}
Robotics 1 2
ZX’Z’’ Euler angles
1 z≡z’ z’ 2
z’’
y’’
φ y’ RF”
RF’
θ y’ Rx’(θ) =
RF
θ 1 0 0
y
0 cos θ -sin θ
x φ x’ x’≡x’’ 0 sin θ cos θ
cos φ
-
sin φ
0
Rz(φ) = sin φ
cos φ
0 3 z’’≡z’’’
y’’’
0 0 1 y’’
ψ
RF”’
cos ψ
-
sin ψ
0
Rz” (ψ) = sin ψ
cos ψ
0
x’’ x’’’
0 0 1 ψ
Robotics 1 3
ZX’Z’’ Euler angles
direct problem: given φ , θ , ψ ; find R
RZX’Z’’ (φ, θ, ψ) = RZ (φ) RX’ (θ) RZ’’ (ψ)
order of definition cφ cψ - sφ cθ sψ - cφ sψ - sφ cθ cψ sφ sθ
in concatenation = sφ cψ + cφ cθ sψ - sφ sψ + cφ cθ cψ - cφ sθ
sθ sψ sθ cψ cθ
given a vector v”’= (x”’,y”’,z”’) expressed in RF”’, its
expression in the coordinates of RF is
v = RZX’Z’’ (φ, θ, ψ) v”’
the orientation of RF”’ is the same that would be obtained with
the sequence of rotations:
ψ around z, θ around x (fixed), φ around z (fixed)
Robotics 1 4
Roll-Pitch-Yaw angles
PITCH
1 ROLL z’ 2
z z’’
z’ y’’
ψ y’ C1RY(θ)C1T
y’ θ with RY(θ) =
θ y cos θ 0 sin θ
y x’ 0 1 0
ψ x’’ - sin θ 0 cos θ
x≡x’
3 YAW z y’’’
1 0 0 z’’ φ
RX(ψ) = 0 cos ψ - sin ψ y’’
0 sin ψ cos ψ
C2RZ(φ)C2T z’’’
cos φ
-
sin φ 0
with RZ(φ) = sin φ
cos φ 0
0 0 1 x’’ φ x’’’
Robotics 1 6
Roll-Pitch-Yaw angles (fixed XYZ)
direct problem: given ψ , θ , φ ; find R
RRPY (ψ, θ, φ) = RZ (φ) RY (θ) RX (ψ) ⇐ note the order of products!
order of definition cφ cθ cφ sθ sψ - sφ cψ cφ sθ cψ + sφ sψ
= sφ cθ sφ sθ sψ + cφ cψ sφ sθ cψ - cφ sψ
- sθ cθ sψ cθ cψ
inverse problem: given R = {rij}; find ψ , θ , φ
r322 + r332 = c2θ, r31 = -sθ ⇒ θ = ATAN2{-r31, ± √ r322 + r332}
if r322 + r332 ≠ 0 (i.e., cθ ≠ 0) two symmetric values w.r.t. π/2
Ap RFB
Ap ‘affine’ relationship
AB OB
RFA
Ap = ApAB + ARB Bp
OA
Ap AR Ap Bp
B AB linear
Ap
hom = = = ATB Bphom relationship
1 0 0 0 1 1
AR Ap BR Bp AR T - ARBT ApAB
B AB A BA B
=
0 0 0 1 0 0 0 1 0 0 0 1
AT BT (ATB)-1
B A
Robotics 1 11
Defining a robot task
yE absolute definition
of task
RFE task definition relative
to the robot end-effector
zE
RFB WT
2 • T = WTB BTE ETT
RFT 1 •
• 3
known, once
the robot direct kinematics of the
is placed robot arm (function of q)
RFW
BT (q) = WT -1 WT ET -1 = cost
E B T T
Robotics 1 12
Final comments on T matrices
they are the main tool for computing the direct kinematics
of robot manipulators
they are used in many application areas (in robotics and
beyond)
b
in the positioning of a vision camera (matrix T with the extrinsic
c
parameters of the camera posture)
in computer graphics, for the real-time visualization of 3D solid
objects when changing the observation point
AR Ap
B AB
AT =
B
αx αy αz σ
Robotics 1
deformation 13
Robotics 1
Direct kinematics
Prof. Alessandro De Luca
Robotics 1 1
Kinematics of robot manipulators
! robot seen as
“(open) kinematic chain of rigid bodies
interconnected by (revolute or prismatic)
joints”
Robotics 1 2
Motivations
! functional aspects
! definition of robot workspace
! calibration
! operational aspects
task execution task definition and
(actuation by motors) performance
Robotics 1 3
Kinematics
formulation and parameterizations
r = f(q)
DIRECT TASK
JOINT
(Cartesian)
space INVERSE space
! choice of parameterization q
! unambiguous and minimal characterization of the robot configuration
! n = # degrees of freedom (dof) = # robot joints (rotational or
translational)
! choice of parameterization r
! compact description of positional and/or orientation (pose)
components of interest to the required task
! m ! 6, and usually m ! n (but this is not strictly needed)
Robotics 1 4
Open kinematic chains
q2 qn RFE
q4
q1 q3 r = (r1,…,rm)
e.g., the relative angle e.g., it describes the
between a link and the pose of frame RFE
following one
! m=2
! pointing in space
! positioning in the plane
! m=3
! orientation in space
! positioning and orientation in the plane
Robotics 1 5
Classification by kinematic type
(first 3 dofs)
SCARA
(RRP)
cylindric
cartesian or (RPP)
gantry
(PPP) articulated or
anthropomorphic
(RRR)
polar or
spherical
(RRP)
r = fr(q)
Robotics 1 7
Example: direct kinematics of 2R arm
y q1
P " q= n=2
py •
q2
l2
q2
l1 px
r = py m=3
q1
"
px x
px = l1 cos q1 + l2 cos(q1+q2)
py = l1 sin q1 + l2 sin(q1+q2)
" = q1+ q2
for more general cases we need a “method”!
Robotics 1 8
Numbering links and joints
revolute prismatic
Robotics 1 9
Relation between joint axes
A # i$
90°
common normal
B (axis of link i)
Robotics 1 10
Relation between link axes
axis of joint i
link i-1
link i
D
C
axis of link i-1 axis of link i
'$
&i
d i = distance CD (a variable if joint i is prismatic)
with sign
& i = angle (a variable if joint i is revolute) between link axes (pos/neg)!
[projected on a plane ' orthogonal to the joint axis]
Robotics 1 11
Frame assignment
by Denavit-Hartenberg (DH)
joint axis joint axis joint axis
i-1 i i+1
link i-1
link i
frame RFi is
attached to link i #i
zi
ai
di zi-1
xi-1 Oi xi
&i
Oi-1
common normal
to joint axes
axis around which the link rotates i and i+1
or along which the link slides
Robotics 1 12
Denavit-Hartenberg parameters
axis of joint axis of joint axis of joint
i-1 i i+1
link i
link i-1 #i
D zi
• ai
di zi-1
xi-1 Oi xi
&i
Oi-1
Robotics 1 16
Direct kinematics of manipulators
description “internal” yE slide s
to the robot
using:
zE approach a
• product 0A1(q1) 1A2(q2)…n-1An(qn)
• q=(q1,…,qn) xE normal n
z0
y0
RFB
“external” description using
x0 • r = (r1,…,rm)
R p = nsa p
BT = BT 0A (q ) 1A (q ) …n-1An(qn) nTE • BTE=
E 0 1 1 2 2
000 1 000 1
r = fr(q)
Robotics 1
alternative descriptions of robot direct kinematics 17
Example: SCARA robot
q3
q2
q1
q4
Robotics 1 18
Step 1: joint axes
all parallel
(or coincident)
twists # i = 0
or % J3 prismatic
≡
J1 shoulder J4 revolute
J2 elbow
Robotics 1 19
Step 2: link axes
Robotics 1 20
Step 3: frames
z1
x1 z2 = z3
yi axes for i > 0
are not shown
(and not needed; x2
they form
x3
right-handed frames) x4
z0 z4 = a axis
(approach)
y0
x0
Robotics 1 21
Step 4: DH parameters table
i # i$ ai di &i
z1
1 0 a1 d1 q1
x1 z2 = z3
2 0 a2 0 q2
x2
3 0 0 q3 0
x3
x4 4 % 0 d4 q4
z0 z4
Robotics 1 23
Step 6: direct kinematics
c12 -s12 0 a1c1+ a2c12
0A (q ,q ,q )= s12 c12 0 a1s1+ a2s12
3 1 2 3
0 0 1 d1+q3
0 0 0 1
c4 s4 0 0
3A (q )= s4 -c4 0 0
4 4
0 0 -1 d4
0 0 0 1
c124 s124 0
R(q1,q2,q4)=[ n s a ] a1c1+ a2c12
0A (q ,q ,q ,q )= s124 -c124 0 a1s1+ a2s12 p = p(q1,q2,q3)
4 1 2 3 4
0 0 -1 d1+q3+d4
0 0 0 1
Robotics 1 24
Robotics 1
Differential kinematics
Robotics 1 1
Differential kinematics
representation of orientation
Robotics 1 2
Linear and angular velocity
of the robot end-effector
. ω
.
ω2 = z1θ2 ωn = zn-1θn v
.
ω1 = z0θ1
.
v3 = z2 d3 .
ωi = zi-1θi r = (p,φ)
alternative definitions
of the e-e direct kinematics R p
T=
000 1
z Δy Δz
z
y = y
x
x
Δz Δy
same final
position
Robotics 1 5
Finite rotations do not commute
example
z z
initial φ X = 90°
orientation
y y
x x
mathematical fact: ω is
NOT an exact differential form φ Z = 90°
z (the integral of ω over time
z
depends on the integration path!)
φ Z = 90° y
z
y
x
x φ X = 90° different final
orientations
y
x note: finite rotations still commute when
Robotics 1 made around the same fixed axis 6
Infinitesimal rotations commute!
infinitesimal rotations dφX, dφY, dφZ around x,y,z axes
1 0 0 1 0 0
RX(φX) = 0 cos φX -sin φX RX(dφX) = 0 1 -dφX
0 sin φX cos φX 0 dφX 1
cos φY 0 sin φY 1 0 dφ Y
RY(φY) = 0 1 0 RY(dφY) = 0 1 0
-sin φY 0 cos φY -dφ Y 0 1
cos φZ -sin φZ
0 1 -dφ Z 0
RZ(φZ) = sin φZ cos φZ
0 RZ(dφZ) = dφ Z 1 0
0 0 1 0 0 1
neglecting
1 -dφz dφY second- and
R(dφ) = R(dφX, dφY, dφZ) = dφz 1 -dφX third-order
(infinitesimal)
-dφY dφX 1 terms
in any sequence
Robotics 1
= I + S(dφ) 7
Time derivative of a rotation matrix
let R = R(t) be a rotation matrix, given as a function of time
since I = R(t)RT(t), taking the time derivative of both sides yields
0 = d[R(t)RT(t)]/dt = dR(t)/dt RT(t) + R(t) dRT(t)/dt
= dR(t)/dt RT(t) + [dR(t)/dt RT(t)]T
thus dR(t)/dt RT(t) = S(t) is a skew-symmetric matrix
let p(t) = R(t)p’ a vector (with constant norm) rotated over time
comparing
ω
dp(t)/dt = dR(t)/dt p’ = S(t)R(t) p’ = S(t) p(t)
dp(t)/dt = ω(t) × p(t) = S(ω(t)) p(t) p
.
we get S = S(ω) p
. .
R = S(ω) R S(ω) = R RT
Robotics 1 8
Robot Jacobian matrices
p . p ∂fr(q) . .
r= = fr(q) r= . = q = Jr(q) q
φ φ ∂q
.
v p JL(q) . .
= = q = J(q) q
ω ω JA(q)
Robotics 1 11
Geometric Jacobian
always a 6 x n matrix
end-effector v .
JL(q) . JL1(q) … JLn(q) q1
instantaneous E = q=
…
velocity ωE JA(q) J (q) … J (q)
A1 An
.
qn
superposition of effects
. . . .
vE = JL1(q) q1 +…+ JLn(q) qn ωE = JA1(q) q1 +…+ JAn(q) qn
Robotics 1 14
Contribution of a prismatic joint
Note: joints beyond the i-th one are considered to be “frozen”, . .
so that the distal part of the robot is a single rigid body JLi(q) qi = zi-1 di
zi-1
E
prismatic
i-th joint
. .
JLi(q) qi zi-1 di
qi = di
.
JAi(q) qi 0
RF0
Robotics 1 15
Contribution of a revolute joint
.
JLi(q) qi . .
JAi(q) qi = zi-1 θi
zi-1
Oi-1 • pi-1,E
qi = θi revolute
i-th joint
. .
JLi(q) qi (zi-1 × pi-1,E) θi
RF0 .
.
JAi(q) qi zi-1 θi
Robotics 1 16
Expression of geometric Jacobian
. .
p0,E vE JL(q) . JL1(q) … JLn(q) q1
( =) = q=
…
ωE ωE JA(q) J (q) … J (q)
A1 An
.
qn
JAi(q) 0 zi-1
Robotics 1 17
Robot Jacobian
decomposition in linear subspaces and duality
space of space of
joint velocities J task (Cartesian)
velocities
0 0
ℵ(J) ℜ(J)
dual spaces
dual spaces
ℜ(JT) + ℵ(J) = Rn ℜ(J) + ℵ(JT) = Rm
ℜ(JT) ℵ(JT)
0 0
space of
space of
task (Cartesian)
joint torques JT forces
Robotics 1
(in a given configuration q) 26
Mobility analysis
ρ(J) = ρ(J(q)), ℜ(J) = ℜ(J(q)), ℵ(JT)= ℵ(JT(q)) are locally defined, i.e.,
they depend on the current configuration q
ℜ(J(q)) = subspace of all “generalized” velocities (with linear and/or
angular components) that can be instantaneously realized by the robot
end-effector when varying the joint velocities in the configuration q
if J(q) has max rank (typically = m) in the configuration q, the robot
end-effector can be moved in any direction of the task space Rm
if ρ(J(q)) < m, there exist directions in Rm along which the robot end-
effector cannot instantaneously move
these directions lie in ℵ(JT(q)), namely the complement of ℜ(J(q)) to the
task space Rm, which is of dimension m - ρ(J(q))
when ℵ(J(q)) ≠ {0} (this is always the case if m<n, i.e., in robots that
are redundant for the task), there exist non-zero joint velocities that
produce zero end-effector velocity (“self motions”)
Robotics 1 27
Kinematic singularities
configurations where the Jacobian loses rank
⇔ loss of instantaneous mobility of the robot end-effector
for m=n, they correspond in general to Cartesian poses that lead to a
number of inverse kinematic solutions that differs from the “generic” case
“in” a singular configuration, one cannot find a joint velocity that realizes
a desired end-effector velocity in an arbitrary direction of the task space
“close” to a singularity, large joint velocities may be needed to realize
some (even small) velocity of the end-effector
finding and analyzing in advance all singularities of a robot helps in
avoiding them during trajectory planning and motion control
when m = n: find the configurations q such that det J(q) = 0
when m < n: find the configurations q such that all m×m minors of J are
singular (or, equivalently, such that det [J(q) JT(q)] = 0)
finding all singular configurations of a robot with a large number of joints,
or the actual “distance” from a singularity, is a hard computational task
Robotics 1 28