![Page 1: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/1.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Robotic Motion Planning:Bug Algorithms
Robotics Institute 16-735http://voronoi.sbp.ri.cmu.edu/~motion
Howie Chosethttp://voronoi.sbp.ri.cmu.edu/~choset
![Page 2: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/2.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
What’s Special About Bugs
• Many planning algorithms assume global knowledge
• Bug algorithms assume only local knowledge of the environment and a global goal
• Bug behaviors are simple:– 1) Follow a wall (right or left)– 2) Move in a straight line toward goal
• Bug 1 and Bug 2 assume essentially tactile sensing (bump wall)
• Tangent Bug deals with finite distance sensing
![Page 3: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/3.jpg)
Bug algorithms *
• Simple and intuitive• Straightforward to implement• Success guaranteed (when possible)• Assumes perfect positioning and sensing • Sensor based planning – has to be incremental and
reactive*Reference: Principles of Robot Motion. MIT Press. Howie Choset, Kevin Lynch, Seth Hutchinson, George
Kantor, Wolfram Burgard, Lydia Kavraki and Sebastian Thrun. Thanks to Howie Choset, CMU, for these slides
![Page 4: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/4.jpg)
Bug algorithms• Assumptions:
– Point robot– Contact sensor (Bug1,Bug2) or finite range sensor
(Tangent Bug)– Bounded environment– Robot position is perfectly known– Robot can measure the distance between two points
![Page 5: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/5.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
A Few General Concepts
• Workspace W– ℜ(2) or ℜ(3) depending on the robot– could be infinite (open) or bounded (closed/compact)
• Obstacle WOi
• Free workspace Wfree = W \ ∪iWOi
![Page 6: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/6.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Insect-inspired • known direction to goal
•robot can measure distance d(x,y) between pts x and y
• otherwise local sensingwalls/obstacles & encoders
• reasonable world
1) finitely many obstacles in any finite area
2) a line will intersect an obstacle finitely many times
3) Workspace is bounded
W ⊂ Br(x), r < ∞
Br(x) = { y∈ℜ(2) | d(x,y) < r }
The Bug Algorithms
Goal
Start
provable results...
![Page 7: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/7.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Buginner Strategy
“Bug 0” algorithm
how ?
• known direction to goal
• otherwise local sensingwalls/obstacles & encoders
Some notation:
qstart and qgoal
“hit point” qHi
“leave point qLi
A path is a sequence of hit/leavepairs bounded by qstart and qgoal
![Page 8: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/8.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Buginner Strategy
1) head toward goal
2) follow obstacles until you can head toward the goal again
3) continue
path ?
“Bug 0” algorithm • known direction to goal
• otherwise local sensingwalls/obstacles & encoders
![Page 9: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/9.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Buginner Strategy
1) head toward goal
2) follow obstacles until you can head toward the goal again
3) continue
assume a left-turning robot
OK ?
The turning direction might be decided beforehand…
“Bug 0” algorithm
![Page 10: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/10.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Bug Zapper
1) head toward goal
2) follow obstacles until you can head toward the goal again
3) continue
What map will foil Bug 0 ? “Bug 0” algorithm
![Page 11: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/11.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Bug Zapper
1) head toward goal
2) follow obstacles until you can head toward the goal again
3) continue
What map will foil Bug 0 ? “Bug 0” algorithm
start
goal
![Page 12: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/12.jpg)
Bug 0 bugs out – endless loop!
![Page 13: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/13.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
A better bug?
But add some memory!• known direction to goal
• otherwise local sensingwalls/obstacles & encoders
improvement ideas?
![Page 14: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/14.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
1) head toward goal
2) if an obstacle is encountered, circumnavigate it and remember how close you get to the goal
3) return to that closest point (by wall-following) and continue
Bug 1
“Bug 1” algorithm
Vladimir Lumelsky & Alexander Stepanov: Algorithmica 1987
• known direction to goal
• otherwise local sensingwalls/obstacles & encoders
But some computing power!
![Page 15: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/15.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
1) head toward goal
2) if an obstacle is encountered, circumnavigate it and remember how close you get to the goal
3) return to that closest point (by wall-following) and continue
Bug 1
“Bug 1” algorithm
Vladimir Lumelsky & Alexander Stepanov: Algorithmica 1987
But some computing power!• known direction to goal
• otherwise local sensingwalls/obstacles & encoders
![Page 16: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/16.jpg)
1. Bug 1 circumnavigates obstacle2. Remembers closest point3. Returns to that point and heads to goal
Bug 1 works where Bug 0 fails!
![Page 17: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/17.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
BUG 1 More formally
• Let qL0
= qstart; i = 1• repeat
– repeat• from qL
i-1 move toward qgoal
– until goal is reached or obstacle encountered at qHi
– if goal is reached, exit– repeat
• follow boundary recording pt qLi with shortest distance to goal
– until qgoal is reached or qHi is re-encountered
– if goal is reached, exit– Go to qL
i– if move toward qgoal moves into obstacle
• exit with failure– else
• i=i+1• continue
![Page 18: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/18.jpg)
Bug1 - example
qstart
qgoal
q1H
q1L
q2L
q2H
Motion to goalBoundary following
Shortest path to goal
![Page 19: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/19.jpg)
![Page 20: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/20.jpg)
![Page 21: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/21.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Bug 1 analysis
Bug 1: Path Bounds What are upper/lower bounds on the path length that the robot takes?
D = straight-line distance from start to goal
Pi = perimeter of the i th obstacle
Lower bound:
Upper bound:D
P1
P2
What’s the shortest distance it might travel?
What’s the longest distance it might travel?
What is an environment where your upper bound is required?
“Quiz”
![Page 22: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/22.jpg)
![Page 23: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/23.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Bug 1 analysis
Bug 1: Path Bounds What are upper/lower bounds on the path length that the robot takes?
D = straight-line distance from start to goal
Pi = perimeter of the i th obstacle
Lower bound:
Upper bound:D
P1
P2
What’s the shortest distance it might travel?
What’s the longest distance it might travel?
What is an environment where your upper bound is required?
“Quiz”
D + 1.5 Σ Pii
D
![Page 24: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/24.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
How Can We Show Completeness?
• An algorithm is complete if, in finite time, it finds a path if such a path exists or terminates with failure if it does not.
• Suppose BUG1 were incomplete– Therefore, there is a path from start to goal
• By assumption, it is finite length, and intersects obstacles a finite number of times.– BUG1 does not find it
• Either it terminates incorrectly, or, it spends an infinite amount of time• Suppose it never terminates
– but each leave point is closer to the obstacle than corresponding hit point– Each hit point is closer than the last leave point– Thus, there are a finite number of hit/leave pairs; after exhausting them, the robot will
proceed to the goal and terminate• Suppose it terminates (incorrectly)• Then, the closest point after a hit must be a leave where it would have to move into
the obstacle– But, then line from robot to goal must intersect object even number of times (Jordan curve
theorem)– But then there is another intersection point on the boundary closer to object. Since we
assumed there is a path, we must have crossed this pt on boundary which contradicts the definition of a leave point.
![Page 25: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/25.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Another step forward?
Call the line segment from the starting point to the goal the m-line
“Bug 2” Algorithm
![Page 26: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/26.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
A better bug?
Call the line segment from the starting point to the goal the m-line
1) head toward goal on the m-line
“Bug 2” Algorithm
![Page 27: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/27.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
A better bug?
Call the line segment from the starting point to the goal the m-line
1) head toward goal on the m-line
2) if an obstacle is in the way, follow it until you encounter the m-line again.
“Bug 2” Algorithm
![Page 28: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/28.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
A better bug?
1) head toward goal on the m-line
2) if an obstacle is in the way, follow it until you encounter the m-line again.
3) Leave the obstacle and continue toward the goal
OK ?
m-line segment “Bug 2” Algorithm
![Page 29: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/29.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
A better bug?
1) head toward goal on the m-line
2) if an obstacle is in the way, follow it until you encounter the m-line again closer to the goal.
3) Leave the obstacle and continue toward the goal
Goal
Start
“Bug 2” Algorithm
Better or worse than Bug1?
![Page 30: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/30.jpg)
Bug2 - example
qstart
qgoal
q1H Motion to goal
Boundary following
Line connecting start and goal
q1L
q2H
q2L
![Page 31: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/31.jpg)
2.1. BUG1 AND BUG2 7
Algorithm 2 Bug2 Algorithm
Input: A point robot with a tactile sensorOutput: A path to qgoal or a conclusion no such path exists
1: while True do
2: repeat
3: From qLi−1, move toward qgoal along m-line.4: until
qgoal is reached or
an obstacle is encountered at hit point qHi .5: Turn left (or right).6: repeat
7: Follow boundary8: until
9: qgoal is reached or
10: qHi is re-encountered or
11: m-line is re-encountered at a point m such that12: m 6= qHi (robot did not reach the hit point),13: d(m, qgoal) < d(m, qHi ) (robot is closer), and14: if robot moves toward goal, it would not hit the obstacle15: if Goal is reached then
16: Exit.17: end if
18: if qHi is re-encountered then
19: Conclude goal is unreachable20: end if
21: Let qLi+1 = m22: Increment i23: end while
obstacles as opposed to over the set of obstacles that are encountered by therobot.
A casual examination of (2.1) and (2.2) shows that LBug2 can be arbi-trarily longer than LBug1. This can be achieved by constructing an obstaclewhose boundary has many intersections with the m-line. Thus, as the “com-plexity” of the obstacle increases, it becomes increasingly likely that Bug1could outperform Bug2 (figure 2.4).
In fact, Bug1 and Bug2 illustrate two basic approaches to search prob-lems. For each obstacle that it encounters, Bug1 performs an exhaustivesearch to find the optimal leave point. This requires that Bug1 traverse
![Page 32: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/32.jpg)
![Page 33: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/33.jpg)
![Page 34: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/34.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
head-to-head comparison
Draw worlds in which Bug 2 does better than Bug 1 (and vice versa).
Bug 2 beats Bug 1
or thorax-to-thorax, perhaps
Bug 1 beats Bug 2
![Page 35: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/35.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
head-to-head comparison
Draw worlds in which Bug 2 does better than Bug 1 (and vice versa).
Bug 2 beats Bug 1
or thorax-to-thorax, perhaps
Bug 1 beats Bug 2
?
![Page 36: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/36.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
head-to-head comparison
Draw worlds in which Bug 2 does better than Bug 1 (and vice versa).
Bug 2 beats Bug 1
or thorax-to-thorax, perhaps
Bug 1 beats Bug 2
![Page 37: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/37.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
BUG 1 vs. BUG 2
• BUG 1 is an exhaustive search algorithm– it looks at all choices before commiting
• BUG 2 is a greedy algorithm– it takes the first thing that looks better
• In many cases, BUG 2 will outperform BUG 1, but
• BUG 1 has a more predictable performance overall
![Page 38: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/38.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Bug 2 analysis
Bug 2: Path Bounds What are upper/lower bounds on the path length that the robot takes?
D = straight-line distance from start to goal
Pi = perimeter of the i th obstacle
Lower bound:
Upper bound:
What’s the shortest distance it might travel?
What’s the longest distance it might travel?
“Quiz”
D
What is an environment where your upper bound is required?
![Page 39: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/39.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Bug 2 analysis
Bug 2: Path Bounds What are upper/lower bounds on the path length that the robot takes?
D = straight-line distance from start to goal
Pi = perimeter of the i th obstacle
Lower bound:
Upper bound:
What’s the shortest distance it might travel?
What’s the longest distance it might travel?
“Quiz”
D + Σ Pii
D
ni = # of m-line intersections of the i th obstacle
ni2
What is an environment where your upper bound is required?
![Page 40: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/40.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
A More Realistic Bug
• As presented: global beacons plus contact-based wall following
• The reality: we typically use some sort of range sensing device that lets us look ahead (but has finite resolution and is noisy).
• Let us assume we have a range sensor
![Page 41: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/41.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Raw Distance Function
Saturated raw distance function
![Page 42: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/42.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Tangent Bug
• Tangent Bug relies on finding endpoints of finite, conts segments of ρR
xqgoal O1
O2O3
O4
O5
O6
Problem: what if this distance starts to go up?Ans: start to act like a BUG and follow boundary
![Page 43: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/43.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Motion-to-Goal Transition from Moving Toward goal to “following obstacles”
Currently, the motion-to-goal behavior “thinks” the robot can get to the goal
Transition
![Page 44: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/44.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Motion-to-Goal Transition From Moving Toward goal to “following obstacles”
Currently, the motion-to-goal behavior “thinks” the robot can get to the goal
Transition
![Page 45: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/45.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Motion-to-Goal Transition Minimize Heuristic
Now, it starts to see something --- what to do?Ans: Choose the pt Oi that minimizes d(x,Oi) + d(Oi,qgoal)
![Page 46: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/46.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Minimize Heuristic Example
Choose the pt Oi that minimizes d(x,Oi) + d(Oi,qgoal)
so moves toward O2. Note the line connecting O2 and goal pass through obstacle
At x, robot knows only what it sees and where the goal is,
so moves toward O4. Note some “thinking” was involved and the line connecting O4 and goal pass through obstacle
![Page 47: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/47.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Motion To Goal Example
Choose the pt Oi that minimizes d(x,Oi) + d(Oi,qgoal)
![Page 48: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/48.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Transition from Motion-to-Goal
Problem: what if this distance starts to go up?
Ans: start to act like a BUG and follow boundary
Choose the pt Oi that minimizes d(x,Oi) + d(Oi,qgoal)
M is the point on the “sensed”obstacle which has the shorted
distance to the goal
Followed obstacle: the obstacle that we are currently sensing
Blocking obstacle: the obstacle that intersects the segment
They start as the same
![Page 49: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/49.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Boundary Following
M is the point on the “sensed”obstacle which has the shorted
distance to the goal
Followed obstacle: the obstacle that we are currently sensing
Blocking obstacle: the obstacle that intersects the segment
They start as the same
Move toward the Oi on the followed obstacle in the “chosen”direction
Maintain dfollowed and dreach
![Page 50: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/50.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
dfollowed and dreach
dfollowed is the shortest distance between the sensed boundary and the goal
• dreach is the shortest distance between blocking obstacle and goal (or my distance to goal if no blocking obstacle visible)
• Terminate boundary following behavior when dreach < dfollowed
![Page 51: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/51.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Example: Zero Senor Range
1. Robot moves toward goal until it hits obstacle 1 at H12. Pretend there is an infinitely small sensor range and the Oi which minimizes the
heuristic is to the right 3. Keep following obstacle until robot can go toward goal again4. Same situation with second obstacle5. At third obstacle, the robot turned left until it could not increase heuristic6. Dfollowed is distance between M3 and goal, dreach is distance between robot and goal
because sensing distance is zero
![Page 52: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/52.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Example: Finite Sensor Range
![Page 53: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/53.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Example: Infinite Sensor Range
![Page 54: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/54.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Tangent Bug
• Tangent Bug relies on finding endpoints of finite, conts segments of ρR
xqgoal O1
O2O3
O4
O5
O6
Now, it starts to see something --- what to do?Ans: Choose the pt Oi that minimizes d(x,Oi) + d(Oi,qgoal)
T
“Heuristic distance”
![Page 55: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/55.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Tangent Bug Algorithm
1) repeata) Compute continuous range segments in viewb) Move toward n ∈ {T,Oi} that minimizes h(x,n) = d(x,n) + d(n,qgoal)
untila) goal is encountered, orb) the value of h(x,n) begins to increase
2) follow boundary continuing in same direction as before repeatinga) update {Oi}, dreach and dfolloweduntil
a) goal is reachedb) a complete cycle is performed (goal is unreachable)c) dreach < dfollowed
Note the same general proof reasoning as before applies, although the definition of hit and leave points is a little trickier. In the text,
d_reach == d_leave and d_followed==d_min
![Page 56: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/56.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
The Basic Ideas
• A motion-to-goal behavior as long as way is clear or there is a visible obstacle boundary pt that decreases heuristic distance
• A boundary following behavior invoked when heuristic distance increases.
• A value dfollowed which is the shortest distance between the sensed boundary and the goal
• A value dreach which is the shortest distance between blockingobstacle and goal (or my distance to goal if no blocking obstacle visible)
• Terminate boundary following behavior when dreach < dfollowed
![Page 57: Robotic Motion Planning: Bug Algorithms › ~allen › F19 › NOTES › Chap2-Bug.pdf16-735, Howie Choset with slides from G.D. Hager and Z. Dodds What’s Special About Bugs •](https://reader033.vdocuments.us/reader033/viewer/2022052613/5f28773fe56ab609be3bf4a1/html5/thumbnails/57.jpg)
16-735, Howie Choset with slides from G.D. Hager and Z. Dodds
Summary
• Bug 1: safe and reliable
• Bug 2: better in some cases; worse in others
• Bug 2 is greedy algorithm
• Tangent Bug: supports range sensing
• Sensors and control– should understand basic concepts and know what different sensors
are - next lecture!