Skip to content

Fix potential field planning without obstacles - #1479

Draft
huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/potential-field-empty-obstacles
Draft

huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/potential-field-empty-obstacles

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown

Summary

Potential-field planning crashes on an obstacle-free map because the field bounds call min(ox) / max(ox) on empty lists and the repulsive potential tries to index the nearest obstacle even when none exists.

This change:

  • Builds potential-field bounds from the start, goal, and any obstacles, so an empty map remains valid.
  • Returns zero repulsive potential when there are no obstacles.

The behavior for maps with obstacles is unchanged.

Regression tests

  • A map without obstacles has zero repulsion and a finite, purely attractive potential field.
  • An obstacle-free end-to-end planning call progresses from (0, 0) toward (5, 5) and reaches within one grid resolution of the goal.
  • The original obstacle-based example remains in the existing tests.

Scope: 2 files (the planner and its tests), no API changes or new dependencies.

CI validation: fork PR #3 (Linux/macOS/Windows jobs launched).

AI assistance: ChatGPT (OpenAI GPT-6) helped inspect the edge case, implement the fix, and prepare regression tests.

huxiaoyi-ovo and others added 2 commits October 27, 2026 05:58
Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>
Co-Authored-By: ChatGPT (OpenAI GPT-6) <noreply@openai.com>

This branch has not been deployed

No deployments
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