68
Robotics and Autonomous Systems Lecture 12: Navigation Terry Payne Department of Computer Science University of Liverpool 1/1

Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Robotics and Autonomous SystemsLecture 12: Navigation

Terry Payne

Department of Computer ScienceUniversity of Liverpool

1 / 1

Page 2: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Today

• Navigation — how the robots gets around the world.

2 / 1

Page 3: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Navigation

• We started this course with three questions:

?

• Where am I ?• Where am I going ?• How do I get there ?

• We are now at a point where we can answer the last two.

3 / 1

Page 4: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

What counts as navigation

• Navigation is concerned with how a robot gets around the world.• So what is new?

• Assume that the robot:• Knows where it is.• Knows where it wants to go.

• Concerned with getting from one place to another.

4 / 1

Page 5: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

What counts as navigation

• Distinguish two kinds of navigation• Global navigation• Local navigation

5 / 1

Page 6: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

What counts as navigation

• Global navigation is about deciding how to get from some start pointto a goal point.

• The robot plans in some sense.

• We will look at methods for path planning.• In short, the robot comes up with a “plan”.

• A sequence of way points• We’ll look at a couple of different methods that are appropriate for

different map representations.• Remember them?

6 / 1

Page 7: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

What counts as navigation

• Local navigation is about obstacle avoidance.• If there are objects in the way, make sure you don’t hit them.

• Range of different approaches depending on what kind of informationwe have about the world.• Depends on sensors

7 / 1

Page 8: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

What counts as navigation

• One way to think about the difference between the two is in terms ofthe relationship between the robot’s start point and the goal point.

• If there is a clear line of sight between the start point and the goalthen we are into obstacle avoidance.• Just avoiding some debris that isn’t on the map

8 / 1

Page 9: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

What counts as navigation

• However, if there is no line of sight from start to goal:

then we have to find a path.• Typically path segments will be between two points between which

there is a line of sight.• We call these waypoints

9 / 1

Page 10: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Visibility graph

• Direct implementation of line-of-sight.

• Connect up all the vertices in the map.

10 / 1

Page 11: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Visibility graph

• Given the line segments, we can find the shortest path from start togoal.• We’ll talk about this later.

• Can then translate the path into a series of waypoints.• Waypoints are the end points of the line segments.

• Given the visibility graph above, there is an obvious problem withusing the lines as a guide for where the robot should go.

• Problem.

11 / 1

Page 12: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Visibility graph

• Given the line segments, we can find the shortest path from start togoal.• We’ll talk about this later.

• Can then translate the path into a series of waypoints.• Waypoints are the end points of the line segments.

• Given the visibility graph above, there is an obvious problem withusing the lines as a guide for where the robot should go.

• No room for the robot.

12 / 1

Page 13: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Visibility graph

• Routes at the moment run arbitrarily close to the vertices of objects.• Problems with collisions

• Fix this by expanding objects by enough that the robot will still clearthem.• More than half the diameter of the robot.

• Still not a good solution.

13 / 1

Page 14: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Voronoi diagram

• A Voronoi diagram is a way to divide up a plane (a map).

• Given a set of points P, a Voronoi diagram is a set of polygons suchthat the points inside each polygon are closer to one member of Pthan any other.

14 / 1

Page 15: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Voronoi diagram

• Here the points in P are big red dots.

• The polygons then contain all points closer to one red dot thananother.

15 / 1

Page 16: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Voronoi diagram

• Can extend this to cases where P is a set of objects.

• Treat the line segments exactly like the edges in the visibility graph.

16 / 1

Page 17: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Voronoi diagram

• The lines are not necessarily lines of sight• As above they may bend.

• However, they are object free, and so can be followed just like lines ofsight can.

17 / 1

Page 18: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Voronoi diagram

• Voronoi diagrams also have a nice property in terms of path-following• That is when you get the robot to follow the “plan”.

• A robot that is maximising its distance from objects will follow the linesin the Voronoi diagram.The standard kind of thing to do to follow corridors etc.

• Means that we can again reduce the path to a set of waypoints.• Head to the next waypoint while maximising distance from objects.

18 / 1

Page 19: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Asides

• Voronoi diagrams work in 3D also:

19 / 1

Page 20: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Asides

• They were also famously used by John Snow to identify the source ofthe 1854 cholera epidemic in London

20 / 1

Page 21: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

• They were also famously used by John Snow to identify the source ofthe 1854 cholera epidemic in London

21 / 1

Page 22: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Cell-based maps

• Last time we saw a variety of different cell-based maps.

• Exact cell decomposition

22 / 1

Page 23: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Cell-based maps

• Fixed cell decomposition

23 / 1

Page 24: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Cell-based maps

• Adaptive cell decomposition.

24 / 1

Page 25: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Cell-based maps

• Given the maps, we still want to figure out a sequence of linesegments.

• Not quite so straightforward for cell-based maps.• We will look at two general approaches to do path-finding:

• Explicit search of a connectivity graph.• Wavefront planning

• These are really the same thing in different guises.

25 / 1

Page 26: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Connectivity graph

• Identify which cells are next to which other cells.

26 / 1

Page 27: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Connectivity graph

• The question is how to figure out a path from the graph.

• When the graph is complex, we need to use search techniques.

• This is also the case for the connectivity graphs we get automaticallyfrom the visibility graph or Voronoi diagram approaches.

• Standard approaches to search:• Depth first• Breadth first• A*

• Plus there are robotics-specific approaches like D*.

27 / 1

Page 28: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Search

• A general algorithm for search is:

agenda = initial node;

while agenda not empty do{

state <- node from agenda;

new nodes = nodes connected to state;

if goal in new nodes

then {

return solution;

}

add new nodes to agenda;

}

• Note that this doesn’t generate a set of waypoints, it just looks for thegoal state.

28 / 1

Page 29: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Search

• Let’s think about how this would work on the connectivity graph:

29 / 1

Page 30: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Search

• To use the algorithm we need to decide how to do the selection in

state <- node from agenda;

and how to do the addition in:

add new nodes to agenda;

• Depth-first search:• Takes the first node on the agenda;• Adds new nodes to the front of the agenda.

• Leads to a search that explores “vertically”.

30 / 1

Page 31: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Depth-first search

1

31 / 1

Page 32: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Depth-first search

1

2

7

32 / 1

Page 33: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Depth-first search

1

2

7 8

33 / 1

Page 34: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Depth-first search

1

2

7 8 9

34 / 1

Page 35: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Depth-first search

1

2

7 8 9

6

10

35 / 1

Page 36: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

• Breadth-first search• Takes the first node on the agenda;• Adds new nodes to the back of the agenda.

• Explores all the nodes at one “level” before looking at the next level.

36 / 1

Page 37: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

1

37 / 1

Page 38: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

1

2

7

38 / 1

Page 39: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

7

2

1

3

39 / 1

Page 40: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

7 8

2

1

3

40 / 1

Page 41: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

7 8

2

1

3 4

41 / 1

Page 42: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

7 8 9

2

1

3 4

42 / 1

Page 43: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

7 8 9

2

1

3 4

5

6

43 / 1

Page 44: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Breadth-first search

7 8 9

6

10

2

1

3 4

5

6

44 / 1

Page 45: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

A* search

• A* search focuses the search by giving each node a pair of weights:• How far it is from the start; and• How close it is to the goal.

• The cost of the node is then the sum of the weights.

• We pick from the agenda by choosing the node with the lowest cost.(Choosing like this means we don’t have to worry about what orderwe put nodes onto the agenda).

• Generalization of Dijkstra’s algorithm.

45 / 1

Page 46: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

A* search

• In some domains we have to design clever functions to determinewhat “far” is.

• In robotics we can just use Euclidean or Manhattan distance betweenpoints:• Euclidean distance

des,g “

b

pxg ´ xsq2 ` pyg ´ ysq

2

• Manhattan distance

dms,g “ |pxg ´ xsq| ` |pyg ´ ysq|

• Of course the distance to the goal may be an underestimate• may be no route through (common in Manhattan)

but it turns out that this is a good thing for A*.

46 / 1

Page 47: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

A* search

47 / 1

Page 48: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

A* search

48 / 1

Page 49: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

D* search

• Often in robotics we need to replan• D* is a version of A* that keeps track of the search that led to a plan

and just fixes the bits that need to be fixed.• Dynamic A*

• Quicker than replanning from scratch.• Usually have to replan from the robot to the goal and the only change

is near the robot.• That is where the robot senses failure.

49 / 1

Page 50: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Waypoints

• In all these approaches we have to extract the waypoints after we findthe goal.

• First we identify the sequence of cells.• As we search we can build a plan for each node we visit.• The plan for each node is the route to its parent plus the step to the

node.• When we get to the goal we have the plan.

• Then we build a waypoint from each grid cell.• Typically the center of gravity of the cell.

50 / 1

Page 51: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Also known as Grassfire, Wildfire or NF1.

• Essentially breadth-first search in a convenient form for application togrid-based maps.

• Works like this:1 Start at the cell containing the goal and label it 0.2 Take every unlabelled cell that is next to a cell labelled n and label it

n ` 1.3 Repeat until the cell containing the start is labelled.

• Then read the sequence of cells to traverse by following the labelsdown from the start.

51 / 1

Page 52: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

free cell

52 / 1

Page 53: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

53 / 1

Page 54: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

54 / 1

Page 55: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

2

2

55 / 1

Page 56: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

2

2 3

56 / 1

Page 57: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

2

2 3

4

4

57 / 1

Page 58: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

2

2 3

4

4

5

5

58 / 1

Page 59: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

2

2 3

4

4

5

5

6

6

59 / 1

Page 60: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

2

2 3

4

4

5

5

6

6

7

7

60 / 1

Page 61: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Here’s an example:

obstacle

G

S

0

0 cell with

distance

1

1

2

2 3

4

4

5

5

6

6

7

7

88

61 / 1

Page 62: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Wavefront planning

• Works especially well with occupancy grids, where the obstacles arealready factored into the map.

62 / 1

Page 63: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Vector field histogram

• Approach that uses sensor readings to tell the robot how to avoidobstacles.

• Representing the area around the robot as a grid, compute theprobability that any square has an obstacle.• Robot-centric grid.

• Provides a local map to decide how the robot should move.

63 / 1

Page 64: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Vector field histogram

• The local map is reduced to a 1 DOF histogram.• Probability of occupancy:

• Then compute the steering angle for the best gap.• “Best” selected using function G which combines:

G = a. target-direction + b. wheel-orientation+ c. previous-direction

64 / 1

Page 65: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

VFH+

• An issue with VFH is that it doesn’t take account of how the robot canreally move.

• The best gap could be one that the robot has to stop and do somecomplex maneuver to go through.

65 / 1

Page 66: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

VFH+

• VFH+ considers motion on trajectories.

• Any turn that has a trajectory that intersects anobstacle is blocked

66 / 1

Page 67: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

VFH+

• VFH+ in action.

• http://www.youtube.com/watch?v=84tPPOUjvSA

67 / 1

Page 68: Robotics and Autonomous Systemstrp/COMP329_files/COMP329_Lecture12.pdf · What counts as navigation Navigation is concerned with how a robot gets around the world. So what is new?

Summary

• In this lecture we looked at issues to do with navigation.• Global navigation is about finding a path.• Local navigation is about avoiding obstacles.

• We looked at several examples of both.

68 / 1