67
d Coverage and Search Algorithms Chapter 10 Algorithms

Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

dCoverage and Search Algorithms

Chapter 10Algorithms

Page 2: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

ObjectivesTo investigate some simple algorithms for coveringthe area in an environment

To understand how to break down an environment into simple convex pieces

To understand how to consider searchingenvironments with a limited range and limited di ecti se sdirection sensor.

10-2Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 3: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

What’s in Here ?Complete Coverage Algorithms– Difficulties and Issues– Boustrophedon Coverage B s p C v g– Other Coverage Ideas

Search Algorithmsg– Searching and Visibility– Guard Placement– Traveling Salesman ProblemTraveling Salesman Problem– Visibility Search Paths– Searching With Limited Range Visibility

10-3Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 4: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

lComplete Coverage AlgorithmsCoverage Algorithms

Page 5: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage AlgorithmsA complete coverage algorithm produces a path that a robot must travel on in order to “cover” or travel over the entire surface of its environment.over the entire surface of its environment.

Applications include:d i– vacuum and sweeping

– painting– searching– searching– security patrolling– map verificationp– etc…

10-5Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 6: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage AlgorithmsHow can we determine a valid path that the robot can take to cover the whole environment ?

10-6Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 7: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage AlgorithmsOne approach is to simply travel in some fixed direction (e.g., North) until an obstacle is encountered, then turn around…cover in strips:encountered, then turn around…cover in strips:

Can get tricky due to obstacle and border angles.

10-7Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 8: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage AlgorithmsEven in rectilinear environments, many problems may arise:

Painted into a corner :(Painted into a corner :(.

Unreachable areas.

Gaps left due to motion inaccuracy.

This area was missed.

Crooked coverage due to wheel discrepancy.

10-8Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 9: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage AlgorithmsIs there any hope ?– there will always be some error in terms of coverage.

ill i l d d i- may still miss close to edges and in corners– allowing overlapping coverage will help– dividing environment into smaller “chunks” will helpdividing environment into smaller chunks will help

For most applications (not painting the floor) being “close enough” to the obstacles is sufficientclose enough to the obstacles is sufficient.

– sensors can “pick-up”/detect from a certain dista ce awadistance away.

– sometimes, a rough coverage is enough.

10-9Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 10: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Boustrophedon CoverageRecall the Boustrophedon cell decomposition of a polygonal environment:

Critical pointsCritical points

10-10Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 11: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Boustrophedon CoverageNow connect adjacent cells to form a graph and consider an arbitrary ordering of the cells:

(e g from left to right)– (e.g., from left to right)

2 197

23

2218

14

13

12

95

3

20

24

15

13

6

8

1110

1

4

16

17

21

10-11Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 12: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Finding a PathPerform a depth-first-search (DFS) on the graph todetermine an exhaustive walk through the cells:

dfs(G) { list L = emptytree T = empty choose a starting vertex x

12

3

45

6

7

9a

bk

d

c

fj

gi

e

12

3

45

6

7

9a

bk

d

c

fj

gi

e

12

3

45

6

7

9a

bk

d

c

fj

gi

echoose a starting vertex xsearch(x) WHILE (L nonempty) DOremove edge (v,w) from end of LIF (w not yet visited) THEN

58

aL

d hi

bT

58

a c e f gL

d hi

bT

58

a c e f iL

d hi

b gT

j

add (v,w) to T search(w)

}

search(vertex v) {

12

3

45

6

7

8

9a

bk

d

c

fj

g

hi

e

12

3

45

6

7

8

9a

bk

d

c

fj

g

hi

e

12

3

45

6

7

8

9a

bk

d

c

fj

g

hi

e

( ) {visit(v)FOR (each edge (v,w)) DOadd edge (v,w) to end of L

}

8

a c e f iL

b g jT

k

8

a c e f iL

b g j kT

8

a c e f hL

b g j k iT

10-12Winter 2012Chapter 10 – Coverage and Search Algorithms

etc…

Page 13: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Finding a PathHere is what the DFS ordering may have produced in our example:

23

2 197

124 6 7

Cells visited in the following order (blue numbers indicate

139

24

23

22

3

12

5 18

14

2

27 3 5

148

13 11

1220

2226

21backtracking):

1-3-5-7-12-14-19-23-24-21-20-22-23-22-20 18 14 18 20 17

1

15

21

243

8

11106

201

199

10

13 11

1517

2425

23

20-18-14-18-20-17-16-15-16-4-3-4-16-17-20-21-24-23-19-14-13-14-12-9-6-8-11-10-11-8-6-5-6-9-1

4

21

17

16

15

16

17

18

12-7-5-3-2

10-13Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 14: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage Along a PathOnce a path is found, the robot visits all of these cells in that order:

Visitation order may not be the most efficient. There are other ways to traverse besides the DFS.

10-14Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 15: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage Along a PathWhen coming back to cells already visited, it is not necessary to re-cover the cell again:

Need to compute path back to previous cells.

10-15Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 16: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage Along a PathWhen entering a cell, the robot performs some simple maneuvers to cover the cell’s entire area:

Usually, vertical motions up and down separated by a robot width. Such motions are joined by travel along the obstacle boundaryobstacle boundary.

It may still be necessary to make path adjustments due to obstacles.

10-16Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 17: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage Along a PathMust take care when crossing one cell to another:

Follow a fixed rule: e.g., always cross at top of

Sometimes, backtracking along same path is necessary to ensure thatcell, even if extra

coverage is necessary.

necessary to ensure that nothing is missed.

Robot must go down then up along this portion in order to cover entire cell.

10-17Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 18: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Coverage Along a PathWhen backtracking, follow along cell boundaries:

Follow fixed rule when backtracking (e.g., travel along top of cell boundaries)(e.g., travel along top of cell boundaries)

Cover other cells, then come back again (i.e., backtrackingbacktracking in red).

Continue coverage maneuvers whenever an uncovered cell is encountered during the walk through the cells.

10-18Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 19: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Other Coverage IdeasThere are other ways to decompose the environment into cells and compute a coverage path. For example:example:

– circular or diamond-shaped spiral cellsspike cells We will look very briefly at these twoWe will look very briefly at these two– spike cells

– brushfire decomposition cells (like GVD)

E h f th h i diff t

We will look very briefly at these twoWe will look very briefly at these two

Each of these, however, may require different traversal techniques.

Their choice should depend on the robot’s sensor characteristics.

10-19Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 20: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Circular Coverage PatternsWe can alternatively create circular cells defined by circles extending outwards from the start location:

Cell boundaries formed by circles.

C i i l i d fi dCritical point defined when circle is tangent to obstacle.

10-20Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 21: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Circular Coverage PatternsOnce again, interconnect cells and do DFS to find path in graph:

49

1015

21

Critical point defined when i l i t t

1

2

8

12

17

19

circle is tangent to obstacle.

1

3 6

7

14

18

5

7

1113

16

20

10-21Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 22: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Circular Coverage PatternsTraverse each cell by making “laps” around the cell where each lap is separated by the robot width:

Alternatively can spiral here.

1

When obstacle is encounteredfollow alongfollow along edge.

10-22Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 23: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Brushfire DecompositionCan even break down into regions based on GVD and then traverse cells around obstacles:

When tracing cell around obstacle

This technique is best for robots that have dead-reckoning errors. By maintainingobstacle,

robot maintains fixed distance away from

b t l t ll

errors. By maintaining fixed distance from obstacle, robot can re-adjust its measurements and

fi it itiobstacle at all times (unless when adjusting for cell boundary)

re-confirm its position.

Robot needs long distance range sensor though.y) g

10-23Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 24: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Search AlgorithmsSearch Algorithms

Page 25: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

SearchingConsider covering an environment for thepurpose of searching for other robots, fire, intruders, any identifiable object etc…

Robot is equipped with one or more search sensors Robot is equipped with one or more search sensors of some kind which have either:

– unlimited or limited detection range

– omni-directional (i.e, 360°) or limited direction detection capabilities

10-25Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 26: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

SearchingAs the robot moves around in the environment, it is able to search based on its current visibility:

Unlimited range,Limited direction

Unlimited range,Omni-directional(Most common for theoretical models)

Limited range,Omni directional

Limited range,Limited direction.(Most common forOmni-directional (Most common for real robots)

10-26Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 27: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

VisibilityConsider a simple environment with no obstacles and a robot with omni-directional sensing with unlimited range capabilities.range capabilities.

Which environments can it search (i.e., see) completely without moving ?completely without moving ?

star-shaped polygons

With limited direction capabilities, p ,robot would have to rotate to view entire environment

10-27Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 28: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

VisibilityThe kernel of a star-shaped polygon is the area of the polygon from which the robot

“ ” th ti b d f can “see” the entire boundary of the environment:

Extend lines from each reflex vertex parallel to edges containing that vertex. A reflex vertex is one which forms an inside angle > 180°forms an inside angle > 180 .

> 180°

Kernel formed as intersection of the resulting half planes.

10-28Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 29: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

VisibilityWhat if environment is not star-shaped or has obstacles ?

– kernel is empty (i.e., can’t see whole environment from one location)

– need to determine a set of locations (i.e., view points) that cover the entire environment

10-29Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 30: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

VisibilityPlacing robot at each reflex vertex will ensure complete visibility coverage. Do you know why ?

10-30Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 31: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Guard PlacementCan we cover with less locations ?

This problem is called the Guard Placement problem p G por Art Gallery problem.

For a simple polygon environment with n vertices:For a simple polygon environment with n vertices:

– n/3 locations are occasionally necessary and always sufficient to have every point in the polygon visible from at sufficient to have every point in the polygon visible from at least one of the locations:

– e.g., n = 12 and 12 // 3 = 4 locations gare necessary and sufficient

10-31Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 32: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Guard PlacementWhen the environment contains h obstacles and has n edges (including obstacle edges), it can be shown that (n+h)/3 locations are sometimes necessary that (n+h)/3 locations are sometimes necessary and always sufficient to cover the entire environment:

– e.g., n = 19, h = 1 then (19+1)//3 = 20//3 = 6locations are necessaryand sufficient.

There are many possible placements, here are two …

10-32Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 33: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Guard PlacementHow do we compute these locations ?Can do a 3-coloring of the triangulation:– color each vertex of the triangulation with one of 3 colors– no two vertices sharing a triangulation edge should have the

same colorsame colorColoring is done through a DFS, but in some cases the straight forward approach does not

Each color here indicates

approach does not always work…it can be tricky.

Each color here indicates a possible set of robot locations.

10-33Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 34: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Search PathsTo perform an exhaustive search, the robot must move around in the environment

– shortest watchman route – the shortest possible path in the environment such that the robot covers (i.e., sees) all areas in the environment.

– difficult to find exact solution, approximations are usually simpler and acceptabley p p

Can solve this problem by finding guard placement locations and then connect them with an efficient path (i.e., travel between multiple goal locations).

10-34Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 35: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

l lTraveling Salesman ProblemProblem

Page 36: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemGiven a number of locations that the robot must travel to, what is the cheapest round-trip route that visits each location once and then returns to the visits each location once and then returns to the starting location ?– (e.g., visiting stations in a building for security checks).

10-36Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 37: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemMost direct solution:– try all permutations (ordered combinations) and see which

one is cheapest one is cheapest – number of permutations is n! for n locations … impractical !!

There are ma y approaches to this problemThere are many approaches to this problem– many use heuristics and approximations

v

w

If we don’t need the “optimal” path, we can compromise for some simpler algorithms. u

Assume triangle inequality holds: |uw| ≤ |uv| + |vw|

10-37Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 38: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemConsider the locations that robot must travel to.

start

Approximate tour is based on minimum spanning tree from the start location:tree from the start location:

start Use well-known Prim’s algorithm

th f itor other favorite.

10-38Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 39: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemConsider a complete graph of the locations– i.e., each location connects to every other location

The minimum spanning tree is a subset of the complete graph’s edges that forms a tree that i cl des every locatio where the total le gth of includes every location, where the total length of all the edges in the tree is minimized.

1. Create a tree containing a single arbitrarily chosen location

2. Create a set S containing all the edges in the graph

3. WHILE (any edge in S does not connect two locations in the tree) DO

4 Remove the shortest edge from S that connects a4. Remove the shortest edge from S that connects a

location in the tree with a location not in the tree

5. Add that edge to the tree Use simple heap data structure.

10-39Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 40: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemFrom the root of the minimum spanning tree perform a pre-order traversal of the tree.

Connect nodes in order visited.Solution can be at most twice the best path but is usuallypath … but is usually not so bad.

10-40Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 41: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemRunning time is O(n2) for n locations.

There are other variations of this problem p… we could spend a whole course discussing these types of problems.these types of problems.

Can we use this algorithm practically ?

– the triangle inequality may not hold since obstacles are often in the way.

– can still do a minimum spanning tree, but must replace straight line paths with weighted shortest path links.

10-41Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 42: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemSolution to TSP may yield invalid paths.– would have to replace point-to-point costs with shortest path

costscosts

10-42Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 43: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemCan replace invalid segments with shortest path segments:

Thick line replaces dotted one. These can be time consuming to compute !!

10-43Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 44: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Traveling Salesman ProblemThe solution to the traveling salesman problem does not directly apply to our problem since paths may be invalid.invalid.

A simpler, more practical approach is often betteri+ easier to compute

+ can ensure complete coverage- may end up with longer path- may end up with longer path

Simplest, most practical approach is to use the dual graph of the triangulationgraph of the triangulation.

10-44Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 45: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Visibility Search PathsVisibility Search Paths

Page 46: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Dual PathsConsider a robot with an unlimited range, omni-directional sensor.

First tria gulate the polygo with holes– First, triangulate the polygon with holes:

Use aUse a constrained Delauney Triangulation for best results.

10-46Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 47: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Dual PathsWe can traverse the dual graph (using a Depth First Search) as a rough path around all obstacles:

Robot visits the center location of each triangle.

From center location, the robot can “see” the entire triangle … and more.

10-47Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 48: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Visibility PathAs the robot travels along the dual graph, it can actually “see” (i.e., search) a much larger area than the triangles it passes through:the triangles it passes through:

Many triangles can be “seen” (hence searched) without having to enter them.

However, it is difficult to keep track of which “ t ” f th“parts” of the triangles are seen from other triangles.

10-48Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 49: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Visibility PathWhen robot travels between triangles it can:- search along the way - search only when arriving

hil li h i lwhile traveling at the triangle centers

Some areas are “ ” t i

Most areas are “seen” multiple times from multiple l ti

Some areas are never “seen” during travel

Some areas are never “seen” during travel

Some additional areas are never “ ”

“seen” twice.

Some areas are “seen” only once.

+ more coverage + less computation- more computation - less coverage

locations. during travel. during travel. “seen”.

10-49Winter 2012

more computation less coverage

Chapter 10 – Coverage and Search Algorithms

Page 50: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Refining PathsRecall that dual graph paths can be refined by computing a shortest sleeve path:

lt i li htl difi d – results in a slightly modified area coverage

This area is no longer visible from the new / shorter sleeve path.

10-50Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 51: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Refining PathsCombining all such refined paths leads to an efficient path that will guarantee visibility of the entire environment:environment:

10-51Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 52: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Refining PathsCan even trim (i.e., remove edges from) the path:– walk through the path, keeping track of which triangles are

completely covered along the way Eliminate edges/vertices completely covered along the way. Eliminate edges/vertices that do not add to the path’s coverage.

Do you know why we need yto keep this vertex ?

10-52Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 53: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Safer PathsFor safety, we can first grow obstacles according to robot model to allow valid paths that do not collide:

Points now away from obstacles to allow for safe

New points may be added due to grown obstacle restrictions.

Some points may be gone due to grown obstacle restrictions.

allow for safe robot traversal.

10-53Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 54: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Safer PathsA safer/simpler approach:– place view locations at midpoints of triang. diagonal edges

i i f d h i l– connect viewpoints from edges on the same triangle

Provides a safer clearance between obstacles.obstacles.

10-54Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 55: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Safer PathsOnce again, trim edges by removing ones that do not add to the coverage:

May also put constraint that edge must have certain clearance from

b t lobstacles.

Merge triangles that form convex polygons since entire convex polygon is visible from any point inside it.

10-55Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 56: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Convex PiecesOf course, we can always merge triangles to form convex areas before we search the graph

reduces eed to trim off ma y edges later– reduces need to trim off many edges later

The dashed edges are not necessary since they cross polygons that are already reached by other path portions.

10-56Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 57: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Convex PiecesHow do we merge triangles into convex pieces ?– traverse dual graph using DFS.

b ild l b ddi i l– build up convex polygon by adding new triangles one at a time … if a new triangle “ruins” convexity, start a new polygon

This triangle cannot be added since it would destroy the convexity property.

10-57Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 58: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Convex PiecesHow do we determine if a polygon is convex ?

There are a variety of ways:y y

– check that the line segment betweeneach pair of non-adjacent vertices doeseach pair of non-adjacent vertices doesnot intersect any polygon edge.

check that each pair of consecutive – check that each pair of consecutive edges forms an interior angle ≤180°.

t th l CW d k – traverse the polygon CW and make sure that each consecutive edge makes a right turn.

10-58Winter 2012

makes a right turn.

Chapter 10 – Coverage and Search Algorithms

Page 59: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Limited Direction VisibilityWhat if the robot cannot sense omni-directionally ?

Recall that robot can turn at each search point:

b ti i– can be time consuming

– try to minimize search locations

Alternatively, some robots are equipped with head turretsq ppthat can turn 360°.

10-59Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 60: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

dSearching With Limited VisibilityVisibility

Page 61: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Limited Range VisibilityThe problem changes when the robot has limited sensing range:

Traveling inside triangle no longer ensures complete visibility of that triangle’s area.

10-61Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 62: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Recursively DecomposeOne option is to ensure that each triangle is small enough to be covered by the robot’s range:

f (For each triangle that is not covered from its center (based on robot’s viewing range d), split triangle into smaller ones, recursively, adding any necessary edges.

d

10-62Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 63: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Limited Range PathsAgain, form path from dual graph:– more loops now

i i l d– cannot trim vertices now, only edges.

10-63Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 64: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Refining Limited Range PathsMay trim as many edges as possible, provided that the removal of the edge does not disconnect the graph.graph.

10-64Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 65: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Convex PiecesAgain, we can merge into convex polygons first, provided that the convex polygons are fully visible from each edge:from each edge:

This edge is not needed since whole polygon is visible from the red vertex.

10-65Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 66: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

Limited Range Visibility CoverageResult is that entire area is covered:

10-66Winter 2012Chapter 10 – Coverage and Search Algorithms

Page 67: Coverage and Search Algorithms - Carleton Universitypeople.scs.carleton.ca/~lanthier/teaching/COMP4807/Notes...Coverage Algorithms A complete coverage algorithmproduces a path that

SummaryYou should now understand:

– How to compute paths that cover an environmentp p

– Different ways of covering an environment

H t t t f b t l ti th t th ti – How to compute a set of robot locations that see the entire environment

– A simple way to search an environment with robots that have – A simple way to search an environment with robots that have sensors with unlimited or limited range as well as omni-directional or limited direction.

10-67Winter 2012Chapter 10 – Coverage and Search Algorithms