1 of 72

TECHIN 517 - ROBOTICS LAB II

ROBOT NAVIGATION

WEEK 3 | WEDNESDAY | APR 13, 2022

2 of 72

ASSINGMENT #3

  • Post #1: Labs 11-15, visualizations with Markers and InteractiveMarkers in RViz
  • Post #2: Labs 16-17, mapping, localization, navigation
  • Post #3: Lab 18, interactive navigation

3 of 72

ROBOT NAVIGATION

Getting from point A to point B

How do I get to point B?

Where am I?

LOCALICATION

NAVIGATION

4 of 72

ROBOT NAVIGATION

  • Move towards B
  • Check where you are

How do I get to point B?

Where am I?

5 of 72

ROBOT NAVIGATION

Relative to:

  • A perceived entity
  • Where I started
  • A map

How do I get to point B?

Where am I?

6 of 72

ROBOT: WHERE AM I?

  • Relative to sensed entity using external sensors:
    • Servoing: Continuously try to change/maintain sensor reading

7 of 72

ROBOT: WHERE AM I?

  • Relative to where I started:
    • Based on commands sent to the wheels -> Dead reckoning
    • Based on movement sensors -> Odometry
      • Wheel encoders + wheel contact switches
      • IMU (Inertial Measurement Unit) / Gyro
    • Example method: Combine the two: Extended Kalman filtering

8 of 72

ROBOT: WHERE AM I?

  • Relative to a map:
    • Match sensor readings to a map
    • Map can be formed from readings from previously visited known locations on a map
    • Example method: Adaptive Monte Carlo Localization (AMCL): sample candidates, imagine what the sensors should read given the map + sensor model, see if it matches.

9 of 72

ROBOT NAVIGATION

  • Move towards B
  • Check where you are

How do I get to point B?

Where am I?

10 of 72

COORDINATE TRANSFORMS

11 of 72

DIFFERENTIAL DRIVE ROBOTS

two independent drive wheels mounted on a common axis

12 of 72

STEERING

Differential drive steering is controlled by setting the relative speeds of the wheels

simple cases

complex cases

dL=dR

-dL =-dR

dL=-dR

-dL=dR

dL<dR

dL>dR

-dL<-dR

-dL>-dR

13 of 72

DIFFERENTIAL DRIVE

b

r2

x1-x0

y1-y0

d

Ļ•

x= t (x1-x0)

Ė™

Ė™

y= t (y1-y0)

šœ‘L = tšœ‘L

Ė™

šœ‘R = tšœ‘R

Ė™

14 of 72

EXTRA SLIDES

15 of 72

COORDINATE TRANSFORMS

16 of 72

COORDINATE FRAMES

y

x’

(0,0)

š›©0

(x0, y0)

x

y’

17 of 72

COORDINATE FRAMES

(0,0)

š›©0

(x0, y0)

x

y’

y

{A}

{B}

x’

18 of 72

COORDINATE FRAMES

(0,0)

š›©0

(x0, y0)

x

y’

y

{A}

{B}

BP

x’

AP

19 of 72

COORDINATE FRAMES

(0,0)

y

{A}

x

{B}

BP =

x1

y1

x1

y1

20 of 72

COORDINATE TRANSFORMS

(0,0)

š›©0

(x0, y0)

x

y’

y

{A}

{B}

BP

x’

What is AP ?

21 of 72

COORDINATE TRANSFORMS

y

{A}

{B}

x’

BP =

x1

y1

Start with BP

Translate to (x0, y0)

Rotate by š›©0

What is AP ?

AP

22 of 72

TRANSLATIONS

x

y

{A}

BP =

x1

y1

AP =

x0 + x1

y0 + y1

(x0, y0)

x0

x1

{B}

23 of 72

ROTATIONS

x

y

{A}

š›©0

x

{B}

24 of 72

ROTATIONS

x

y

AP =

x2

y2

x

š›©0

x1

y1

y2

x2

BP =

x1

y1

{B}

cos(š›©0)

sin(š›©0)

-sin(š›©0) cos(š›©0)

{A}

25 of 72

ROTATIONS

x

y

AP =

x2

y2

x

š›©0

x1

y1

y2

x2

BP =

x1

y1

{B}

cos(š›©0)

sin(š›©0)

-sin(š›©0) cos(š›©0)

{A}

x1 = AP. AuBx

y1 = AP. AuBy

26 of 72

ROTATIONS

x

y

AP =

x2

y2

x

š›©0

x1

y1

y2

x2

BP =

x1

y1

{B}

cos(š›©0)

sin(š›©0)

-sin(š›©0) cos(š›©0)

{A}

x1 = x2 cos(š›©0) + y2 sin(š›©0)

y1 = -x2 sin(š›©0) + y2 cos(š›©0)

27 of 72

ROTATIONS

x

y

AP =

x2

y2

x

š›©0

x1

y1

y2

x2

BP =

x1

y1

{B}

{A}

x2 = x1 cos(š›©0) - y1 sin(š›©0)

y2 = x1 sin(š›©0) + y1 cos(š›©0)

x1 = x2 cos(š›©0) + y2 sin(š›©0)

y1 = -x2 sin(š›©0) + y2 cos(š›©0)

revert

28 of 72

ROTATIONS

x

y

x

š›©0

x1

y1

y2

x2

BP =

x1

y1

{B}

{A}

29 of 72

ROTATIONS AS MATRIX MULTIPLICATIONS

x

y

cos(š›©0), -sin(š›©0)

sin(š›©0), cos(š›©0)

x

š›©0

x1

y1

y2

x2

BP =

x1

y1

{B}

{A}

BP

ARB

30 of 72

TRANSLATIONS AS MATRIX MULTIPLICATIONS?

x

y

{A}

BP =

x1

y1

AP =

x0 + x1

y0 + y1

(x0, y0)

x0

x1

{B}

a, b

c, d

BP

31 of 72

TRANSLATIONS AS MATRIX MULTIPLICATIONS?

x

y

{A}

BP =

x1

y1

AP =

x0 + x1

y0 + y1

(x0, y0)

x0

x1

{B}

a, b

c, d

BP

Does not

work!

32 of 72

TRANSLATIONS AS MATRIX MULTIPLICATIONS?

x

y

{A}

BP =

x1

y1

AP’ =

x0 + x1

y0 + y1

1

(x0, y0)

x0

x1

{B}

1, 0, x0

0, 1, y0

0, 0, 1

Instead

x1

y1

1

homogeneous coordinates

33 of 72

COMBINING ROTATIONS AND TRANSLATIONS

y

{A}

{B}

x’

BP =

x1

y1

AP

AP’ =

1, 0, x0

0, 1, y0

0, 0, 1

x1

y1

1

ARB

replace with

homogeneous transformation

ATB

34 of 72

HOMOGENOUS TRANSFORMS

Ā 

35 of 72

COMPOSING TRANSFORMS

š›©0

(x0, y0)

x

y’

y

{A}

{B}

x’

CP =

x2

y2

AP’ =

x2

y2

1

ATB

y’’

x’’

š›©1

{C}

BTC

36 of 72

COMPOSING TRANSFORMS

š›©0

(x0, y0)

x

y’

y

{world}

{robot}

x’

y’’

x’’

š›©2

{cube}

š›©1

(x1, y1)

37 of 72

DIFFERENTIAL DRIVE

KINEMATICS

38 of 72

DIFFERENTIAL DRIVE ROBOTS

two independent drive wheels mounted on a common axis

39 of 72

STEERING

Differential drive steering is controlled by setting the relative speeds of the wheels

simple cases

complex cases

dL=dR

-dL =-dR

dL=-dR

-dL=dR

dL<dR

dL>dR

-dL<-dR

-dL>-dR

40 of 72

Steering

  • Differential drive steering is controlled by setting the relative speeds of the wheels

R

-R

-R

-R

-R

R

R

R

R

R

R

R

R

R

R

R

41 of 72

DIFFERENTIAL DRIVE

y

x’

(0,0)

š›©0

(x0, y0)

x

y’

robot pose

target pose

42 of 72

DIFFERENTIAL DRIVE

  1. Rotate in place until we face the target
  2. Drive to the target
  3. Rotate in place to the desired heading

x’

robot pose

target pose

APPROACH 1

u=

u=

u=

Issues?

Might overshoot

Not most efficient

Will not work for moving target

43 of 72

DIFFERENTIAL DRIVE

  1. Rotate in place until we face the target
  2. Drive to the target
  3. Rotate in place to the desired heading

x’

robot pose

target pose

APPROACH 1

u=

u=

u=

Take into account

distance to go?

44 of 72

DIFFERENTIAL DRIVE

Rotate and translate at the same time to make the robot go towards target pose

x’

robot pose

target pose

APPROACH 2

How does

change as a function of

?

45 of 72

DIFFERENTIAL DRIVE

x’

robot pose

f(

Ė™

Ė™

Ė™

Ė™

=

, b, r)

b

2r

46 of 72

DIFFERENTIAL DRIVE

f(

Ė™

Ė™

Ė™

Ė™

=

, b, r)

b

2r

dL

dR

Ļ•

instant center of turning

47 of 72

DIFFERENTIAL DRIVE

b

2r

dL=ršœ‘L

šœ‘L

dL

r

robot wheel

dR=ršœ‘R

Ļ•

48 of 72

DIFFERENTIAL DRIVE

b

r2

r1

dL=r1Ļ•

dR=r2Ļ•

r1=b+r2

dL=ršœ‘L

dR=ršœ‘R

Ļ•

49 of 72

DIFFERENTIAL DRIVE

b

2r

Ļ•

š›©0

š›©1

Ļ•

2

Ļ•

2

š›©1=š›©0-Ļ•

50 of 72

DIFFERENTIAL DRIVE

b

r2

x1-x0

y1-y0

d

Ļ•

d

0.5b+r2

0.5b+r2

d=(b+2r2)sin

Ļ•

2

š›©0-

Ļ•

2

y1-y0 =d sin( )

š›©0-

Ļ•

2

Ļ•

51 of 72

DIFFERENTIAL DRIVE

b

r2

x1-x0

y1-y0

d

cos( )

š›©0-

Ļ•

2

Ļ•

šœ‘L-šœ‘R

sin( )

š›©0-

Ļ•

2

šœ‘L-šœ‘R

Assume small

Ļ•

52 of 72

DIFFERENTIAL DRIVE

b

r2

x1-x0

y1-y0

d

cos( )

Ļ•

šœ‘L-šœ‘R

53 of 72

DIFFERENTIAL DRIVE

b

r2

x1-x0

y1-y0

d

Ļ•

x= t (x1-x0)

Ė™

Ė™

y= t (y1-y0)

šœ‘L = tšœ‘L

Ė™

šœ‘R = tšœ‘R

Ė™

54 of 72

DIFFERENTIAL DRIVE ROBOT KINEMATICS

b

55 of 72

Odometry Calculations

56 of 72

Odometry Calculations

57 of 72

DIFFERENTIAL DRIVE

b

dL=ršœ‘L

dR=ršœ‘R

r2

r1

dL=r1Ļ•

dR=r2Ļ•

r1=b+r2

Ļ•

58 of 72

Odometry Calculations

59 of 72

Odometry Calculations

60 of 72

Differential Drive Robot Kinematics

61 of 72

Differential Drive Robot Kinematics

62 of 72

Odometry Calculations

63 of 72

Differential Drive

  • Ā 

64 of 72

Differential Drive

  • Ā 

Ā 

65 of 72

Coordinate Transformation

  • Ā 

Ā 

66 of 72

How can we steer to a desired relative location?

  • Ā 

Problems with this approach?

  • Using max velocities is likely to make the robot overshoot
  • Will not work well if the target is moving

67 of 72

Differential Drive Robot Kinematics

68 of 72

How can we steer to a desired relative location?

  • Ā 

Note that this example assumes the velocity is bounded somewhere else in the software, such that you can send very high velocity values and they will always be bounded by maxVel. If this is not the case, an extra check can be added.

Time can also be incorporated into the formula if the target must be reached within some set period.

69 of 72

How can we steer to a desired relative location?

  • Ā 

70 of 72

DIFFERENTIAL DRIVE

y

x’

(0,0)

š›©

(x, y)

x

y’

robot pose

b

2r

71 of 72

COMPARISON OF DRIVING STRATEGIES

  • Approach 1 will result in the shortest path, but do not perform well in practice if the target location moves
    • mostly because rotating in place requires the robot to stop and reverse one of its motors, and doing this over and over adds time and slip error
  • Using Approach 2 the robot travels along an arc, and is more robust to changes in the target location
  • It is also possible to blend these techniques by turning in place when the angle offset is very large (e.g., the target is behind the robot), and then switching to the continuous mode

72 of 72

ASSUMPTIONS FOR ALL OF THE ABOVE

    • Movement is only in the horizontal plane
    • Single point of contact with ground
    • No deformation of wheels
    • Motion is purely by rolling (no slippage)
    • Steering axis is normal to ground
    • No rolling friction