CSCE 452/752 Robotics and Spatial Intelligence, Fall 2025

7. Navigation: Bug algorithms

Overview

Definition
Navigation is the process of moving a robot through its environment to a goal state while avoiding obstacles.
This is one of the fundamental problems for mobile robots.
We'll see several types of algorithms for this problem.
Key Question 1
How do each of these algorithms work?
Key Question 2
What are the differences in when each of these algorithms can be applied?

Bug algorithms

Introduction

Definition
Bug algorithms are a general class of navigation algorithms that do not require the robot to know the obstacles ahead of time.
Defining characteristic: Only local information about the obstacles is available.
Vladimir J. Lumelsky, the inventor of the classic Bug algorithms, described the idea this way:
In general terms, the problem of sensor-based motion planning can be seen as one of reaching a global goal using local means.
(Lumelsky, 56)
Details about Bug algorithms are in Chapter 2 of the Choset textbook.

Motivating problem: Finding the Eiffel Tower

the Eiffel Tower in the center of Paris

Sensor model

Bug algorithms assume that the robot has some combination of sensors that allow it to perform two basic actions:
  1. Sense the direction and distance to the goal.
  2. Follow nearby obstacle boundaries and measure the distance traveled.
a navigation problem with two obstacles

An optimistic but incorrect algorithm

Here's a first crack at solving the problem:
When does this fail?
What about an algorithm that can guarantee reaching the goal?

Online vs. Offline

Bug algorithms are online planning algorithms.

Bug1

The simplest correct Bug algorithm is called Bug1.

Analysis of Bug1

How long a path does Bug1 generate?
  • $D$: distance from start to goal
  • $M$: number of obstacles
  • $p_i$: perimeter of obstacle $i$
The path length is bounded by: \[D + \frac{3}{2} \sum_{i=1}^M p_i\]
When does this worst case occur? That is, what conditions on the start and goal positions and the obstacle shapes lead to this worst case?

Hit points and leave points

As the robot follows an obstacle boundary, define:

Bug2

Another, similar algorithm is called Bug2:

Analysis of Bug2

How long a path does Bug2 generate?
  • $D$: distance from start to goal
  • $M$: number of obstacles
  • $p_i$: perimeter of obstacle $i$
  • $n_i$: number of intersection points between obstacle $i$ and the start-to-goal line.
The path length is bounded by: \[D + \frac{1}{2} \sum_{i=1}^M n_i p_i\]

A bad case for Bug 2

a navigation problem with a single nasty obstacle

Comparison between Bug1 and Bug2

Which algorithm is more “aggressive”? Which one is “conservative”?
Which algorithm provides better worst-case performance?

What if the goal cannot be reached?

What happens if there is no path to reach the goal?
Both algorithms can detect this.