Vectors, Matrices, Rotations Why are we studying this? You want to - - PowerPoint PPT Presentation

vectors matrices rotations why are we studying this
SMART_READER_LITE
LIVE PREVIEW

Vectors, Matrices, Rotations Why are we studying this? You want to - - PowerPoint PPT Presentation

Vectors, Matrices, Rotations Why are we studying this? You want to put your hand on the cup Suppose your eyes tell you where the mug is and its orientation in the robot base frame (big assumption) In order to put your hand on the


slide-1
SLIDE 1

Vectors, Matrices, Rotations

slide-2
SLIDE 2

You want to put your hand on the cup…

  • Suppose your eyes tell you where the mug

is and its orientation in the robot base frame (big assumption)

  • In order to put your hand on the object, you

want to align the coordinate frame of your hand w/ that of the object

  • This kind of problem makes representation
  • f pose important...

Why are we studying this?

slide-3
SLIDE 3

Why are we studying this?

Puma 500/560

slide-4
SLIDE 4

Why are we studying this?

slide-5
SLIDE 5

Why are we studying this?

slide-6
SLIDE 6

Representing Position: Vectors

slide-7
SLIDE 7

Representing Position: vectors

x y p 5 2

p=[ 5 2]

(“column” vector)

[ ]

5 2 = p

(“row” vector)

x y z

          = 2 5 2 p

p

slide-8
SLIDE 8

Representing Position: vectors

p 5 2

The “a” reference frame Basis vectors – unit vectors (length of magnitude 1) – orthogonal (perpendicular to each other) Vector p in written in a reference frame

slide-9
SLIDE 9

What is this unit vector you speak of?

Vector length/magnitude: Definition of unit vector: These are the elements of p:

5 2

x

b ˆ

y

b ˆ

You can turn an arbitrary vector p into a unit vector of the same direction this way:

slide-10
SLIDE 10

y y x x

b a b a b a + = ⋅ ) cos(θ b a =

And what does orthogonal mean?

Unit vectors are orthogonal iff (if and

  • nly if) the dot product is zero:

is orthogonal to iff First, define the dot product:

= ⋅b a

when:

= a = b

( )

cos = θ

  • r,
  • r,

a ˆ b

θ

slide-11
SLIDE 11

A couple of other random things

5 2 b

x

b ˆ

y

b ˆ

x y z x y z

right-handed coordinate frame left-handed coordinate frame Vectors are elements of

n

R

slide-12
SLIDE 12

The importance of differencing two vectors

The hand needs to make a Cartesian displacement of this much to reach the object

slide-13
SLIDE 13

The importance of differencing two vectors

b

The hand needs to make a Cartesian displacement of this much to reach the object

slide-14
SLIDE 14

Representing Orientation: Rotation Matrices

  • The reference frame of the hand and the
  • bject have different orientations
  • We want to represent and difference
  • rientations just like we did for

positions…

slide-15
SLIDE 15

          =

33 32 31 23 22 21 13 12 11

a a a a a a a a a A

          =

33 23 13 32 22 12 31 21 11

a a a a a a a a a

T

A          

33 32 31 23 22 21 13 12 11

a a a a a a a a a

      = 2 5 p

[ ]

2 5 =

T

p

Before we go there – review of matrix transpose

( )

T T T

BA B A =

Important property:

slide-16
SLIDE 16

      =

22 21 12 11

a a a a A       =

22 21 12 11

b b b b B

and matrix multiplication…

      + + + + =             =

22 22 12 21 21 22 11 21 22 12 12 11 21 12 11 11 22 21 12 11 22 21 12 11

b a b a b a b a b a b a b a b a b b b b a a a a AB

[ ]

b a b b a a b a b a b a

T y x y x y y x x

=       = + = ⋅

Can represent dot product as a matrix multiply:

slide-17
SLIDE 17

Same point - different reference frames

x

a ˆ

p 5 2

y

a ˆ

y

b ˆ

x

b ˆ

8 . 3 8 . 3

      = 2 5 p

a

      = 8 . 3 8 . 3 p

b

slide-18
SLIDE 18

a ˆ b ) cos( ) cos( ˆ ˆ θ θ b b a b a l = = ⋅ =

θ

Another important use of the dot product: projection

l

slide-19
SLIDE 19

a ˆ b ) cos( ) cos( ˆ ˆ θ θ b b a b a l = = ⋅ =

θ

Another important use of the dot product: projection

l

Another way of writing the dot product

slide-20
SLIDE 20

p 5 2 8 . 3 8 . 3

B-frame’s x axis written in A frame B-frame’s y axis written in A frame

Same point - different reference frames

x

a

y

a b ax

ˆ

b a y

ˆ

slide-21
SLIDE 21

x

a

p

a

5 2

y

a

8 . 3 8 . 3

b ax

ˆ

b a y

ˆ

B-frame’s y axis written in A frame

Same point - different reference frames

θ

B-frame’s x axis written in A frame

slide-22
SLIDE 22

5 2 8 . 3 8 . 3

B-frame’s y axis written in A frame

Same point - different reference frames

x

a

p

a

y

a b ax

ˆ

b a y

ˆ

B-frame’s x axis written in A frame

slide-23
SLIDE 23

x

A

p 5 2

y

A

8 . 3 8 . 3

B Ax

ˆ

B A y

ˆ

Same point - different reference frames

where:

  • r
slide-24
SLIDE 24

The rotation matrix

To recap: where:

slide-25
SLIDE 25

The rotation matrix

To recap: where: We will write: so: Notice the way the notation “cancels out” But, can we do this: ???

slide-26
SLIDE 26

The rotation matrix

Multiply both sides by inverse: But, can we do this: ??? It turns out that: because the columns of are unit, orthogonal

slide-27
SLIDE 27

The rotation matrix

Multiply both sides by inverse: But, can we do this: ??? It turns out that: because the columns of are orthogonal This is important!

slide-28
SLIDE 28

The rotation matrix

So, if: Then:

slide-29
SLIDE 29

The rotation matrix

Both columns are orthogonal But: So, the rows are orthogonal too!

slide-30
SLIDE 30

The rotation matrix

Both columns are orthogonal But: So, the rows are orthogonal too!

The same matrix can be understood both ways!

slide-31
SLIDE 31

Example 1: rotation matrix

x

a ˆ

y

a ˆ

x

b ˆ

y

b ˆ

θ θ

( )

( ) ( ) ( ) ( ) 

       − = = θ θ θ θ cos sin sin cos ˆ ˆ

b a b a b a

y x R

( ) ( ) 

       = θ θ sin cos ˆb

ax

( ) ( ) 

      − = θ θ cos sin ˆb

a y

( ) ( ) ( ) ( )

       − = θ θ θ θ cos sin sin cos

a bR

slide-32
SLIDE 32

Example 2: rotation matrix

y

A

z

A

x

A

45

z

B

x

B

y

B

( )

B A B A B A B A

z y x R ˆ ˆ ˆ =                       −           −           =

2 1 2 1 2 1 2 1

1

B AR

          − − =

2 1 2 1 2 1 2 1

1

B AR

slide-33
SLIDE 33

Example 3: rotation matrix

a

x ˆ

a

y ˆ

θ φ

a

z ˆ

b

z ˆ

b

x ˆ

b

y ˆ

          − − − =             − =

+ + + φ φ φ θ θ φ θ φ θ θ φ θ φ φ φ θ θ φ θ φ θ θ φ θ

π π π

c s s s c c s s c s c c s s c s c c s c c s c c Rc

a

2 2 2

slide-34
SLIDE 34

Rotations about x, y, z

( ) ( ) ( ) ( ) ( )

          − = 1 cos sin sin cos α α α α α

z

R

( ) ( ) ( ) ( ) ( )

         − = β β β β β cos sin 1 sin cos

y

R

( ) ( ) ( ) ( ) ( ) 

         − = γ γ γ γ γ cos sin sin cos 1

x

R

These rotation matrices encode the basis vectors of the after- rotation reference frame in terms of the before-rotation reference frame

slide-35
SLIDE 35

Remember those double-angle formulas…

( ) ( ) ( ) ( ) ( )

φ θ φ θ φ θ sin cos cos sin sin ± = ±

( ) ( ) ( ) ( ) ( )

φ θ φ θ φ θ sin sin cos cos cos  = ±

slide-36
SLIDE 36

Example 1: composition of rotation matrices

C B B A C A

R R R =

p

y

a ˆ

x

b ˆ

y

b ˆ

x

a ˆ

y

c ˆ

x

c ˆ 1

θ

2

θ

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )

        − + − − − =         −         − =

2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 1 1 1 1

cos sin sin cos cos sin sin cos s s c c s c c s c s s c s s c c Rc

a

θ θ θ θ θ θ θ θ         − =

12 12 12 12

c s s c

slide-37
SLIDE 37

Example 2: composition of rotation matrices

a

x ˆ

a

y ˆ

θ φ

a

z ˆ

b

x ˆ

c

x ˆ

          − = 1

θ θ θ θ

c s s c Rb

a

          − =           − =

− − − − φ φ φ φ φ φ φ φ

c s s c c s s c Rc

b

1 1

slide-38
SLIDE 38

Example 2: composition of rotation matrices

a

x ˆ

a

y ˆ

θ φ

a

z ˆ

b

x ˆ

c

x ˆ

          − − − =           −           − = =

φ φ φ θ θ φ θ φ θ θ φ θ φ φ φ φ θ θ θ θ

c s s s c c s s c s c c c s s c c s s c R R R

c b b a c a

1 1