Vectors, Matrices, Rotations Robert Platt Northeastern University - - PowerPoint PPT Presentation

vectors matrices rotations
SMART_READER_LITE
LIVE PREVIEW

Vectors, Matrices, Rotations Robert Platt Northeastern University - - PowerPoint PPT Presentation

Vectors, Matrices, Rotations Robert Platt Northeastern University 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)


slide-1
SLIDE 1

Vectors, Matrices, Rotations

Robert Platt Northeastern University

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

KIT Humanoid

Why are we studying this?

Joint encoders tell us head angle Visual perception tells us object position and

  • rientation (pose)

Need to know where hand is... Need to tell the hand where to move!

slide-4
SLIDE 4

Why are we studying this?

slide-5
SLIDE 5

Representing Position: Vectors

slide-6
SLIDE 6

Representing Position: vectors

x y p 5 2

(“column” vector) (“row” vector)

x y z p

slide-7
SLIDE 7

Representing Position: vectors

  • Vectors are a way to transform between

two different reference frames w/ the same orientation

  • The prefix superscript denotes the

reference frame in which the vector should be understood Same point, two different reference frames

p 5 2 b

p

x ˆ

b

x ˆ

b

y ˆ

p

y ˆ

slide-8
SLIDE 8

Representing Position: vectors

  • Note that I am denoting the axes as
  • rthogonal unit basis vectors

b

x ˆ

A vector of length one pointing in the direction of the base frame x axis y axis

b

y ˆ

p

y ˆ

p frame y axis This means “perpendicular”

p 5 2 b

p

x ˆ

b

x ˆ

b

y ˆ

p

y ˆ

slide-9
SLIDE 9

What is a unit vector?

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

5 2

b ^

x

How convert a non-zero vector a into a unit vector pointing in the same direction?

y

b ˆ

slide-10
SLIDE 10

y y x x

b a b a b a   

Orthogonal vectors

First, define the dot product:

a ˆ b

Under what conditions is the dot product zero?

slide-11
SLIDE 11

A couple of other random things

b b b

y x p ˆ 2 ˆ 5  

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

err b eff b

  • bject

b

x x x  

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

  • bject
  • bject

bx

err bx eff bx

slide-13
SLIDE 13

The importance of differencing two vectors

err b eff b

  • bject

b

x x x  

b

b

x ˆ

b

y ˆ

eff

eff

x ˆ

eff

y ˆ

  • bject
  • bject

x ˆ

  • bject

y ˆ

err

The eff 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

Before we go there – review of matrix transpose

Question:

slide-16
SLIDE 16

and matrix multiplication…

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

  • for the moment, assume that

there is no difference in position…

slide-18
SLIDE 18

a ˆ b ) cos( ) cos( ˆ ˆ   b b a b a l    

y y x x

b a b a b a    ) cos( b a 

Another important use of the dot product: projection

l

slide-19
SLIDE 19

p 5 2 8 . 3 8 . 3

B-frame’s y axis written in A frame

Think-pair-share

x

a

y

a b ax

ˆ

b a y

ˆ

Calculate given

slide-20
SLIDE 20

Same point - different reference frames

Where: Rotation matrix

slide-21
SLIDE 21

Rotation matrices

Rows and columns are unit length and

  • rthogonal

A rotation matrix is a 2x2 or 3x3 matrix R such that: 1. 2. Right handed coordinate frame Rotation matrix inverse equals transpose:

slide-22
SLIDE 22

Rotation matrices

Rows and columns are unit length and

  • rthogonal

A rotation matrix is a 2x2 or 3x3 matrix R such that: 1. 2. Right handed coordinate frame Unit vectors and orthogonal to each other

slide-23
SLIDE 23

Rotation matrices

Rows and columns are unit length and

  • rthogonal

A rotation matrix is a 2x2 or 3x3 matrix R such that: 1. 2. Right handed coordinate frame Unit vectors and orthogonal to each other

slide-24
SLIDE 24

Rotation matrices

By convention: where Similarly: Notice:

Because of properties

  • f rotation matrix
slide-25
SLIDE 25

Think-pair-share

Given: Calculate:

slide-26
SLIDE 26

Example 1: rotation matrix

x

a ˆ

y

a ˆ

x

b ˆ

y

b ˆ

 

a Rb=( a ^

xb

a ^

yb )=( cos(θ ) −sin (θ ) sin (θ ) cos(θ) )

a ^

xb=( cos (θ) sin (θ) )

a ^

yb=( −sin (θ ) cos(θ) )

b Ra=(

cos (θ) sin (θ ) −sin (θ) cos (θ ))

slide-27
SLIDE 27

Example 2: rotation matrix

y

A

z

A

x

A

45

z

B

x

B

y

B

  • 1. Calculate:
  • 2. What’s the magnitude of this rotation?
slide-28
SLIDE 28

Example 3: rotation matrix

a

x ˆ

a

y ˆ

 

a

z ˆ

b

z ˆ

b

x ˆ

b

y ˆ

a Rc=(

cθcφ −sθ cθcφ+ π

2

sθ cφ cθ sθ cφ+ π

2

sφ sφ+ π

2 )

=( cθ cφ −sθ −cθ sφ sθ cφ cθ −sθ sφ sφ cφ )

slide-29
SLIDE 29

Rotations about x, y, z

Rz (α )=( cos(α) −sin (α) sin (α ) cos (α ) 1) R y (β )=( cos(β ) sin (β ) 1 −sin (β ) cos (β)) Rx (γ )=( 1 cos(γ) −sin (γ ) sin (γ) cos(γ) )

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

slide-30
SLIDE 30

Remember those double-angle formulas…

         

      sin cos cos sin sin   

         

      sin sin cos cos cos   