Skip to content

Fix Theta* grid bounds for non-divisible map extents - #1468

Draft
yunyv wants to merge 2 commits into
AtsushiSakai:masterfrom
yunyv:patch-1
Draft

yunyv wants to merge 2 commits into
AtsushiSakai:masterfrom
yunyv:patch-1

Conversation

@yunyv

@yunyv yunyv commented Oct 20, 2026

Copy link
Copy Markdown

Reference issue

No matching open or closed PR found for Theta* grid-size rounding and boundary indexing.

What does this implement/fix?

Theta* rounds the number of grid cells down for some map extents. On a map spanning 0 to 10 with resolution 3, the grid has only three entries per axis, but the world-coordinate bounds accept index 3 at coordinate 9. Planning from (6, 6) to (3, 3) then raises IndexError while checking a neighbor.

Use ceiling division for the grid dimensions so the final partial interval is represented. Also check allocated index bounds before accessing the obstacle grid: floating-point rounding can otherwise admit an out-of-array index just below the exclusive world-coordinate bound. Obstacle inflation and the existing world-bound checks are unchanged.

Additional information

Validated against cdd0cc888802b584c2d654ca85e3c5460973487d:

  • Focused native suite on upstream: 8 failed, 4 passed. With the fix: 12 passed.
  • Focused native Theta* tests plus unchanged A* smoke test: 13 passed with warnings as errors on Linux/Python 3.13.5, NumPy 2.2.4 and Matplotlib 3.10.1.
  • Tests cover non-divisible and exact extents, rectangular grids, shifted origins, fractional resolutions, both directions of last-cell planning, obstacle inflation and floating-point boundary indices.
  • Ruff passes both changed files. Two existing trailing spaces in the touched source file were removed for that check.
  • Only the relevant source and test files were materialized locally. The full bash runtests.sh suite, documentation build, animations and other platforms were not run. The available dependency versions differ from current CI pins.

CheckList

  • Added unit tests for the defect fix.
  • Documentation: no new algorithm or visual behavior; existing Theta* explanation is unchanged.
  • All CIs are green? Not run upstream yet; full local suite not run.

yunyv added 2 commits October 19, 2026 17:59
…llocation and bounds validation

Updated planning method and collision check logic. Changed width calculations to use math.ceil for better accuracy.
Cover non-divisible extents, shifted origins, obstacle inflation, and floating-point grid boundaries.

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