Skip to content

Add potential-field local-minimum escape (navigation/40)#16

Merged
rsasaki0109 merged 1 commit into
mainfrom
add-potential-field-escape
Jun 5, 2026
Merged

Add potential-field local-minimum escape (navigation/40)#16
rsasaki0109 merged 1 commit into
mainfrom
add-potential-field-escape

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

What

A new example, examples/navigation/40_potential_field_escape.py: an artificial potential field local planner (Khatib, 1986) that hits its one famous failure — the local minimum — and recovers with the classic boundary-following escape. The repo had reactive avoidance, MPC, and a CBF safety filter, but not the textbook potential-field trap.

The lesson

Pull the robot down the gradient of an attractive potential toward the goal plus a repulsive potential away from obstacles, and step along the net force. An obstacle sits squarely on the straight line from start to goal, so plain descent walks into the stagnation point in front of it and stalls. The world detects the lack of net progress (the robot oscillates in place around the minimum) and reports a local_minimum failure; the agent reacts the way real planners do — it slides tangent to the repulsive gradient around the obstacle until the goal-ward path reopens, then resumes descent.

The contrast is built into the same file via --no-escape:

escape:     local_minimum ×1  → 14 tangential steps → goal (51 steps)
no escape:  local_minimum ×18 + timeout, stuck 6.0 from the goal

Contents

  • A self-contained PotentialFieldWorld (Khatib attractive/repulsive forces within an influence radius; net-progress stall detection so oscillation-in-place counts as the trap) and a PotentialFieldAgent whose local_minimum reaction is a fixed-length tangential boundary-follow committed to the goal-ward side.
  • Two smoke tests: the escape detects the minimum, boundary-follows, and reaches the goal with no collision; plain descent stalls, fires local_minimum repeatedly, and times out while the escape reaches the goal on the same scene.
  • examples/README.md row + a full examples/navigation/README.md section; example count 42→43 and test count 118→120 in README.md / docs/status.md.

Verification

  • Headless: escape reaches the goal in 51 steps; plain descent stalls at distance 6.0.
  • Full suite green (133 passed); matplotlib render path confirmed under Agg.

References

  • O. Khatib, "Real-Time Obstacle Avoidance for Manipulators and Mobile Robots," ICRA 1985 / IJRR 1986.
  • Y. Koren & J. Borenstein, "Potential Field Methods and Their Inherent Limitations for Mobile Robot Navigation," ICRA 1991 (the local-minimum trap).

🤖 Generated with Claude Code

Artificial potential fields (Khatib, 1986) are the one-line local planner and the
repo had no example of their one famous failure: the local minimum. This adds it
together with the classic recovery.

An obstacle sits on the straight line from start to goal, so plain gradient
descent walks the robot into the stagnation point in front of it and stalls. The
world detects the lack of *net* progress (the robot oscillates in place around
the minimum) and reports a `local_minimum` failure; the agent reacts the way real
potential-field planners do — it switches to boundary following, sliding tangent
to the repulsive gradient around the obstacle until the goal-ward path reopens,
then resumes descent and reaches the goal. `--no-escape` keeps plain descent and
it stalls until timeout.

  escape:     local_minimum x1 -> 14 tangential steps -> goal (51 steps)
  no escape:  local_minimum x18 + timeout, stuck 6.0 from the goal

- self-contained PotentialFieldWorld (Khatib attractive/repulsive forces within
  an influence radius, net-progress stall detection) + a PotentialFieldAgent with
  boundary-following escape, and a References section
- two smoke tests: escape detects the minimum, boundary-follows, and reaches the
  goal with no collision; plain descent stalls, fires local_minimum repeatedly,
  and times out while the escape reaches the goal on the same scene
- examples index + navigation README section; example 42->43, tests 118->120

Verified headless (escape reaches in 51 steps, plain stalls at distance 6.0) and
the matplotlib render path under Agg.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rsasaki0109 rsasaki0109 merged commit b79c289 into main Jun 5, 2026
3 checks passed
@rsasaki0109 rsasaki0109 deleted the add-potential-field-escape branch June 5, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant