Kinematics Primer

doutfanaticalΜηχανική

14 Νοε 2013 (πριν από 3 χρόνια και 6 μήνες)

55 εμφανίσεις

Kinematics Primer

Jyun
-
Ming Chen

Contents

General Properties of Transform

2D and 3D Rigid Body Transforms


Representation


Computation


Conversion




Transforms for Hierarchical Objects



Math Primer

Kinematic Modeling

Two interpretations of

transform



Global

:


An operator that

displaces


a point
(or set of points) to
desired location



Local

:


specify where
objects are placed
in WCS
by moving
the local frame

Next, explain these
concepts via 2D
translation

Verify that the same
holds for rotation,
3D,


Ex: 2D translation

x

y

p

The transform, as an operator, takes

p to p

, thus changing the coordinate

of p:



Tr(t) p = p


p














































1
4
4
1
2
2
3
1
1
2
1
1
0
0
2
1
0
3
0
1
Tr(t)

Ex: 2D translation (cont)

p


x

y

x


y


p

The transform moves the xy
-
frame to

x

y

-
frame and the point is placed

with the same local coordinate.


To determine the corresponding
position of p


in xy
-
frame:

frame

y'
x'
to
frame
-
xy
s
that take
transform
the
:

y'-frame
in x'


of

coordinate

the
:

frame
-
in xy


of

coordinate

the
:


'
'
'
'
'
'
'
'
T
p
p
p
p
p
p
T
xy
y
x
y
x
xy
xy
y
x
xy
y
x








1
4
4
1
2
2
3
1
1
2
1
1
0
0
2
1
0
3
0
1












































Tr(t)

Properties of Transform

Transforms are
usually not
commutable


T
a
T
b

p


T
b
T
a

p (in
general)

Rigid body
transform:


the ones preserving
the shape


Two types:


rotation
rot(n,
q
)


translation

tr(t)


Rotation axis
n

passes thru origin

Rigid Body Transform

transforming a point/object


rot
(n,
q
) p;
tr
(t) p

not commutable


rot
(n,
q
)
tr
(t) p


tr
(t)
rot
(n,
q
) p

two interpretations (local vs. global
axes)

2
D Kinematics

Rigid body
transform only
consists of


Tr(x,y)


Rot(z,
q
)

Computation:


3x3 matrix is
sufficient

)
Rot(z,

)
,
Tr(
1
0
0
cos
sin
sin
cos
T
general,
In
1
0
0
0
cos
sin
0
sin
cos
)
Rot(z,
1
0
0
1
0
0
1
)
,
Tr(
q
q
q
q
q
q
q
q
q
q
y
x
y
x
y
x
y
x
t
t
t
t
t
t
t
t




































3
D Kinematics

Consists of two
parts


3D rotation


3D translation


The same as 2D


3
D rotation is more
complicated than 2D
rotation (restricted to z
-
axis)

Next, we will discuss
the treatment for spatial
(3D) rotation

3D Rotation Representations

Axis
-
angle

3X3 rotation matrix

Unit quaternion

Learning Objectives


Representation


Perform rotation


Composition


Interpolation


Conversion among
representations




Axis
-
Angle Representation

Rot(n,
q
)


n: rotation axis (global)


q
: rotation angle (rad. or deg.)


follow right
-
handed rule

Perform rotation


Rodrigues formula

Interpolation/Composition: poor


Rot(n
2
,
q
2
)Rot(n
1
,
q
1
) =?= Rot(n
3
,
q
3
)

Rodrigues Formula

v

=
R
v

a

r

v

v


Rodrigues (cont)

http://mesh.caltech.edu/ee148/notes/ro
tations.pdf

http://www.cs.berkeley.edu/~ug/slide/
pipeline/assignments/as5/rotation.html


Rotation Matrix

Meaning of three
columns

Perform rotation:
linear algebra

Composition: trivial


orthogonalization
might be required
due to FP errors

Interpolation: ?



Ax
u
A
x
u
A
x
u
A
x
u
x
u
x
u
x
x
u
u
u
a
A
ij



























ˆ
ˆ
ˆ

ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
3
3
2
2
1
1
3
3
2
2
1
1
3
2
1


x
R
R
x
R
R
x
R
x
x
R
x
1
2
1
2
2
1








Gram
-
Schmidt Orthogonalization

If 3x3 rotation matrix no longer
orthonormal, metric properties might
change!






















3
2
1
3
2
1
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
v
v
v
u
u
u
2
2
2
2
3
1
1
1
1
3
3
3
1
1
1
1
2
2
2
1
1
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
ˆ
v
v
v
v
u
v
v
v
v
u
u
v
v
v
v
v
u
u
v
u
v












Verify!

Quaternion

A mathematical entity invented by
Hamilton

Definition

j
ik
ki
i
kj
jk
k
ji
ij
k
j
i
q
q
k
q
j
q
i
q
q
q



















1
2
2
2
0
3
2
1
0

i

j

k

Quaternion (cont)

Operators


Addition




Multiplication



Conjugate



Length










k
q
p
j
q
p
i
q
p
q
p
q
p
k
q
j
q
i
q
q
q
k
p
j
p
i
p
p
p
3
3
2
2
1
1
0
0
3
2
1
0
3
2
1
0

















q
p
q
p
p
q
q
p
q
p
pq













0
0
0
0
q
q
q



0
*


*
*
*
p
q
pq

2
3
2
2
2
1
2
0
*
q
q
q
q
q
q
q





Unit Quaternion

Define unit quaternion as follows to
represent rotation


Example


Rot(z,90
°
)


n
q
n
ˆ
sin
cos
)
,
ˆ
(
Rot
2
2
q
q
q



1

q


2
2
2
2
0
0

q
Why

unit

?

DOF point
of view!

Unit Quaternion (cont)

Perform Rotation


Composition


Interpolation

)
(
2
2
)
(

...
0
2
0
*
x
q
q
x
q
q
x
q
q
q
qxq
x

















*
*
*
*
*
)
(
)
(
qp
x
qp
q
pxp
q
q
x
q
x
pxp
x








)
(
)
(
)
1
(
)
(
2
1
t
p
t
p
p
tp
p
t
t
p




Example

x

y,x


z,z


y


















































1
2
1
1
1
2
1
0
0
0
0
1
0
1
0
1
0
0
0
0
1
0
1
0
Rp
p
R
Rot(z,90
°
)

p(2,1,1)

Example (cont)














































































1
2
1
1
0
0
0
2
1

)
(
0
0
2
1
1
2
0
0
2
1
1
2
)
(

)
(
2
2
)
(
2
2
2
2
2
2
2
2
2
1
2
1
0
2
0
k
j
i
p
q
q
p
q
q
p
q
q
q
p









2
2
2
2
0
0
1
1
2
0


q
p
Example

x

y,x


z,z


y


)
0
0
(
)
0
0
1
(
sin
cos
)
0
0
(
)
1
0
0
(
sin
cos
2
2
2
2
2
90
2
90
2
2
2
2
2
2
90
2
90
1






q
q
x,x


y

z,y


z


:
angle
-
axis

ing
Correspond
)
(
:
normalize
)
0
(

:
middle
:
ion
Interpolat
)
(

)
0
0
(
)
0
0
(
0
0
0
0


)
0
0
(
)
0
0
(


)
0
0
)(
0
0
(
:
n
Compositio
5
.
1
5
.
1
4
2
4
2
2
2
2
2
1
1
2
1
5
.
1
2
1
2
1
2
1
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
























q
q
q
q
q
q
k
j
i
q
q
3
2
2
2
1
2
1
6
1
6
1
3
2
2
3
4
2
4
2
2
2
5
.
1
5
.
1
4
2
4
2
2
2
2
2
1
1
2
1
5
.
1
cos
),
0
(
ˆ
:
angle
-
axis

ing
Correspond
)
0
(
)
0
(
:
normalize
)
0
(

:
middle
:
ion
Interpolat








q
n
q
q
q
q
q
q
Spatial Displacement

Any displacement can be decomposed
into a rotation followed by a translation

Matrix




Quaternion

Tx
x
d
R
T
z
y
x
x
d
Rx
x


































1
0
,
1
d
qxq
x



*
Hierarchical Objects

For modeling articulated objects


Robots, mechanism,


Goals:


Draw it


Given the configuration, able to compute
the (global) coordinate of every point on
body

Ex: Two
-
Link Arm (2D)

Configuration


Link 1: Box (6,1);
bend 45 deg


Link 2: Box (8,1);
bend 30 deg

Goals:


Draw it


find tip position

x

y

x

y

Ex: Two
-
Link Arm

Tr(0,6)

Rot(z,45)

Rot(z,30)

Tip pos:(0,8)









8
0
Rot(z,30)
Tr(0,6)
Rot(z,45)
Tip Position:

T for link1:


Rot(z,45) Tr(0,6) Rot(z,30)


T for link2:


Rot(z,45)

Ex: Two
-
Link Arm

Rot(z,45)

Tr(0,6

)

Rot(z

,30)

Tip pos:(0
’”
,8
’”
)









8
0
Rot(z,45)
)
Tr(0,6'
,30)
Rot(z"
)
,
T(
)
,
T(
)
,
T(
)
,
T(
)
'
,
'
T(
)
"
,
"
T(
shown that

be
can
It
1
1
2
2
3
3
3
3
2
2
1
1
p
p
p
p
p
p
q
q
q
q
q
q





Thus, two views are equivalent


The latter might be easier to

visualize.

Ex: Two
-
Link Arm (VRML syntax)

Transform {


rotation 0 0 1 45


children


Link1


Transform {


translation 0 0 6


children


Transform {


rotation 0 0 1 30


children


Link2


}


}

}

Classes in Javax.vecmath



Conversion Methods:

Exercises

Study the references of Rodrigues
formula

Verify equivalence of these 2 ref

s

Compute inverse Rodrigues formula