# Basic Kinematics

Document Sample

```					 Basic Kinematics

•Spatial Descriptions and
Transformations
•Introduction to Motion
Objectives of the Lecture
• Learn to represent position and orientation
• Be able to transform between coordinate
systems.
• Use frames and homogeneous coordinates

Reference: Craig, “Introduction to Robotics,” Chapter 2.
Handout: Chapter 1
Almost any introductory book to robotics
Introduction
• Robot manipulation implies movement in
space
• Coordinate systems are required for
describing position/movement
• Objective: describe rigid body motion
• Starting point: there is a universe/ inertial/
stationary coordinate system, to which any
other coordinate system can be referred
The Descartes Connection
• Descartes invented what we now call Cartesian
coordinates, or the system by which we can graph
mathematical functions in two-or three-dimensional
space.
• So, all of those problems you have been working in
algebra are his fault.
• Descartes was lying on his bed watching a fly. Slowly,
it came to him that he could describe the fly's position
at any instant by just three numbers. Those three
numbers were along the planes of the floor and two
adjacent walls, what we now call the x,y,z coordinate
system.
• So, all of those problems you have been working in
algebra are really the fly‟s fault (kill that fly)
m
e

t
o
Coordinate System in Robotics
h
i
m

t
h
a
t

h
e

c
o
u
l
d

d
e
s
c
Three Problems with CS
• Given 2 CS‟s, how do we express one as a
function of the other?
• Given a point in one CS, what are the
point‟s coordinates on a second CS?
• Apply an operation on a vector
Description of a Position
a coordinate system
• point = position vector
{A}
ZA
AP                      px 
A   p 
P y
YA                 
 pz 
 
XA
Description of an Orientation
Often a point is not enough:
need orientation
z0   {A}                • In the example, a
y0             description of {B} with
y1
respect to {A} suffices to
give orientation
                  • Orientation = System of
x1
Coordinates
x0                           • Directions of {B}: XB, YB
z1   {B}       and ZB
• In {A} coord. system:
AX , AY and AZ
B     B       B
From {A} to {B}
cos Z   Z A  X B
{A}

XB

cos X   X A  X B           aZ

aX           aY        cosY   YA  X B

X A  X B 
X B   YA  X B 
We conclude:            A
          
ZA  XB 
          
Rotation Matrix
• Stack three unit vectors to form Rotation Matrix
A
• B R describes {B} with respect to {A}

A
B   R   
A
A   ˆ
XB   Aˆ
YB     A   ˆ
ZB   
• Each vector in R can be written as dot product
B
of pair of unit vectors: cosine matrix
A
• Rows of B R : unit vectors of {A} with respect to
{B}
A 1
• What is B R ? What is det( BA R )?
• Position + orientation = Frame
Description of a Frame
• Frame: set of four
vectors giving position +
z0                           orientation
{A}
• Description of a frame:
y0                position + rotation matrix
y1
• Ex.:


{B}    
A
B   R, APBORG   
x1
• position: frame with
x0                                identity as rotation
z1   {B}
• orientation: frame with
zero position
Mapping: from frame 2 frame
{B}
Translated Frames                    ZB
AP
{A}
ZA                           BP

YB
AP
BORG        XB
YA
XA
• If {A} has same orientation as {B}, then {B}
differs from {A} in a translation: APBORG
AP = BP + AP
BORG
• Mapping: change of description from one frame to
another. The vector APBORG defines the mapping.
Rotated Frames
ZA    BP            B
P  px X B  p yYB  pz Z B
A
P  px A X B  p y AYB  pz AZ B

 px 
A
P      A
XB      A
YB      A

ZB  py 
 
YA
 pz 
 
A
P  B R BP
A

XA              Description of Rotation = Rotation Matrix
Rotated Frame (cont.)
• The previous expression can be written as
A
P  B R BP
A

• The rotation mapping changes the
description of a point from one coordinate
system to another
• The point does not change! only its
description
Example (2D rotation)
YA

y0


x0       XA

x1  x0 cos  y0 sin 
y1   x0 sin   y0 cos
General Frame Mapping
A
P  B R BP  APBORG
A

BP
AP
XB
ZA                   ZB
Replace by the more appealing
AP                 equation:
BORG
YB
YA
 P 
A
R       A       A
PBORG   P
B

 
B
{A}                                                 
XA                     1  0 0 0                  1  1 

Homogeneous Coords
• Homogeneous coordinates: embed 3D
vectors into 4D by adding a “1”
• More generally, the transformation matrix T
has the form:
 Rot. Matrix     Trans. Vector 
T                                
 Perspect.Trans. Scaling Factor
Operators: Translation, Rotation
and General Transformation
• Translation Operator:

P1      Q
P2

A
P2  P  Q
A
1
A

 
ˆ , | Q |) A P
 TRANS( Q  A
1
Translation Operator
•   Translation Operator:
•   Only one coordinate frame, point moves
•   Equivalent to mapping point to a 2nd frame
•   Point Forward = Frame Backwards

• How does TRANS look in homogeneous
coordinates?
Operators (cont.)
• Rotational Operator

Rotation around axis:   K       AP
1


AP
2
Rotation Operator

• Rotational Operator
The rotation matrix can be seen as rotational
operator
• Takes AP1 and rotates it to AP2=R AP1

• AP2=ROT(K, q)(AP2)
• Write ROT for a rotation around K
Operators (Cont.)
• Transformation Operators
* A transformation mapping can be viewed as
a transformation operator: map a point to
any other in the same frame
* Transform that rotates by R and translates
by Q is the same a transforming the frame
by R & Q
Compound Transformation
If {C} is known relative to {B}, and {B} is
known relative to {A}. We want to
transform P from {C} to {A}:
B
P  CT P
B C

 P T P
A   A
C
C

A
P  AT BP
B

From here define
A
CT  AT CT
B
B

Write down the compound in homog. coords
Inverse Transform
Write down the inverse transform in HC’s
More on Rotations
• We saw that a rotation can be represented
by a rotation matrix
• Matrix has 9 variables and 6+ constraints
(which?)
• Rotations are far from intuitive: they do not
commute!
• Rotation matrix can be parameterized in
different manners:
—Roll, pitch and yaw angles
—Euler Angles
—Others
Euler‟s Theorem
• Euler‟s Theorem: Any two independent
orthonormal coordinate frames can be related by a
sequence of rotations (not more than three) about
coordinate axes, where no two successive
rotations may be about the same axis.
• Not to be confused with Euler angles, Euler
integration, Newton-Euler dynamics, inviscid
Euler equations, Euler characteristic…
• Leonard Euler (1707-1783)
XYZ Fixed
Euler Angles
• This means that we can represent an orientation with 3
numbers
• A sequence of rotations around principle axes is called an
Euler Angle Sequence
• Assuming we limit ourselves to 3 rotations without
successive rotations about the same axis, we could use any
of the following 12 sequences:

XYZ         XZY            XYX           XZX
YXZ         YZX            YXY           YZY
ZXY         ZYX            ZXZ           ZYZ
Euler Angles
• This gives us 12 redundant ways to store an
orientation using Euler angles
• Different industries use different
conventions for handling Euler angles (or
no conventions)
ZYX Euler
Euler Angles to Matrix
Conversion
• To build a matrix from a set of Euler angles, we
just multiply a sequence of rotation matrices
together:
1 0            0  c y        0  s y   cz        sz   0
R x  R y  R z  0 c x              0
sx  
 
1 0    s z        cz   0
                                                           
0  s x
               cx   s y
           0 cy   0          0    1

        c y cz                 c y sz         sy 
                                                   
  sx s y cz  cx sz      sx s y sz  cx cz sx c y 
c x s y c z  s x s z   cx s y s z  s x cz cx c y 
                                                   
Euler Angle Order
• As matrix multiplication is not commutative, the
order of operations is important
• Rotations are assumed to be relative to fixed world
axes, rather than local to the object
• One can think of them as being local to the object
if the sequence order is reversed
Using Euler Angles
• To use Euler angles, one must choose which
of the 12 representations they want
• There may be some practical differences
between them and the best sequence may
depend on what exactly you are trying to
accomplish
Euler Angle I, Animated

w'= z

w'"= w"
f       v'"
v"

v'
y

u'"

u' =u"
x
Orientation Representation
• Euler Angle I
 cosf  sin f          0           1    0        0    
                                                      
Rzf   sin f cosf            0 , Ru '   0 cos     sin  ,
                     1            0 sin     cos 
    0        0                                      
 cos     sin    0
                    
Rw''     sin     cos     0
 0                 1
            0       
Euler Angle I
Resultant eulerian rotation matrix:

R  Rzf Ru ' Rw''
 cosf cos               cosf sin                      
                                             sin  sin  
  sin f sin  cos      sin f cos cos                
                                                         
                                                         
 sin f cos             sin f sin          cosf sin  
  cosf sin  cos      cosf cos cos                  
                                                         
                                                         
     sin  sin            cos sin            cos     
                                                         
Euler Angle II, Animated

w'= z

w"'= w"      f

             v"'
 v' =v"
y
u"'
u"
Note the opposite                    u'
(clockwise) sense of the         x
third rotation, f.
Orientation Representation
• Matrix with Euler Angle II
  sin f sin           sin f cos                     
                                            cosf sin  
  cosf cos cos       sin f cos cos                
                                                        
                                                        
 cosf sin             cosf cos            sin  sin  
  sin f cos cos      sin f cos cos                
                                                        
                                               cos 
  cos sin                  sin  sin                
                                                        

Quiz: How to get this matrix ?
Orientation Representation
• Description of Roll Pitch Yaw
Z

f

                         Y

X

Quiz: How to get rotation matrix ?
Vehicle Orientation
• Generally, for vehicles, it is most convenient to
rotate in roll (z), pitch (x), and then yaw (y)
• In situations where there
y
is a definite ground plane,
Euler angles can actually               front of vehicle

be an intuitive
representation                              x

z
Euler Angles - Summary
• Euler angles are used in a lot of applications, but
they tend to require some rather arbitrary
decisions
• They also do not interpolate in a consistent way
• There is no simple way to concatenate rotations
• Conversion to/from a matrix requires several
trigonometry operations
• They are compact (requiring only 3 numbers)
Quaternions
Quaternions
• Quaternions are an interesting mathematical
concept with a deep relationship with the
foundations of algebra and number theory
• Invented by W.R.Hamilton in 1843
• In practice, they are most useful to us as a means
of representing orientations
• A quaternion has 4 components

q  q0   q1 q2     q3 
Quaternions (Imaginary Space)
• Quaternions are actually an extension to complex numbers
• Of the 4 components, one is a „real‟ scalar number, and the
other 3 form a vector in imaginary ijk space!

q  q0  iq1  jq2  kq3

i  j  k  ijk  1
2     2     2

i  jk  kj
j  ki  ik
k  ij   ji
Quaternions (Scalar/Vector)
• Sometimes, they are written as the combination of
a scalar value s and a vector value v

q  s, v
where
s  q0
v  q1 q2    q3 
Unit Quaternions
• For convenience, we will use only unit length quaternions,
as they will be sufficient for our purposes and make things
a little easier

q  q0  q12  q2  q3  1
2          2    2

• These correspond to the set of vectors that form the
„surface‟ of a 4D hypersphere of radius 1
• The „surface‟ is actually a 3D volume in 4D space, but it
can sometimes be visualized as an extension to the concept
of a 2D surface on a 3D sphere
Quaternions as Rotations
• A quaternion can represent a rotation by an angle
θ around a unit axis a:
                                             
q  cos       a x sin       a y sin       a z sin
    2               2             2             2

or
        
q  cos , a sin
2        2
• If a is unit length, then q will be also
Quaternions as Rotations
q  q q q q
2
0
2
1
2
2
2
3

                                                                 
 cos   2
 a sin
2
x
2
 a sin
2
y
2
 a sin
2
z
2

2                        2                     2                    2
                
 cos   2

2
 sin    2

2
a        2
x    a y  a z2
2

                                                             
 cos            sin                a  cos                     sin
2                2               2             2                2

2                2                              2               2
 1 1

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 24 posted: 9/15/2010 language: English pages: 48
How are you planning on using Docstoc?