Skip to content

fix(mobile): reject PRM maps with no free cells - #931

Merged
petercorke merged 3 commits into
petercorke:mainfrom
Afloat16:fix/prm-fully-occupied-grid
Nov 19, 2026
Merged

petercorke merged 3 commits into
petercorke:mainfrom
Afloat16:fix/prm-fully-occupied-grid

Conversation

@Afloat16

@Afloat16 Afloat16 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem

PRM roadmap construction rejection-samples coordinates until it finds an unoccupied point. When the occupancy grid has no free cells, that loop never terminates. This can also occur after obstacle inflation removes the last free cell.

Change

Before sampling a nonempty roadmap, check whether the effective occupancy grid contains any free cells and raise NoPathError if it does not. Document the error on plan. Empty roadmap requests retain their existing behaviour.

The regression covers both an initially full grid and a grid made full by inflation, plus a free-space control that builds a real roadmap. The impossible cases use the project's timeout plugin to detect the former infinite loop.

Validation

  • Original source: both impossible-map cases time out after 2 seconds; the free-space control passes.
  • PYTHONPATH=src python -m pytest tests/test_prm_free_space.py tests/test_mobile_planners_a.py tests/test_mobile_performance.py -k 'PRM or prm or free_cells' -q: 14 passed, 22 deselected.
  • Ruff passes for the changed source and new test file; the new file passes formatting.
  • git diff --check passed.

Main-branch update

Updated with main at cee0023535988e4ae9490c81d639a46f2311b8fd in merge commit 73651a81d2d2916866be5fa333419a29a5337baf. The original PR patch is byte-for-byte unchanged relative to the updated base, and git diff --check passes.

Fresh CI for the updated head records the new build and test results. The local validation figures above describe the original submission.

CI note: mypy reports the same eight errors in blocks/mobile.py and blocks/arm.py as current main. Both files and the type-check configuration are unchanged by this PR. The current workflow runs this check as advisory with continue-on-error: true.

Primary contributor: Afloat16, who has reviewed the original submission.

AI assistance for this follow-up: ChatGPT (GPT-6 Astra Pro), used for main-branch synchronization and verification.

@Afloat16
Afloat16 marked this pull request as ready for review November 3, 2026 13:56
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Refresh the branch with main cee0023. The existing PR patch and all changed file blobs remain unchanged.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro)
@Afloat16

Copy link
Copy Markdown
Contributor Author

The updated head 73651a81d2d2916866be5fa333419a29a5337baf has passed all 15 OS/Python test combinations, test-core, the required All tests passed aggregate, and coverage. The original PRM fix and regression patch remain unchanged after the main-branch update.

The docs-build job builds Sphinx successfully, then fails in the real-Pyodide check: the SymPy wheel download from jsDelivr returns request failed, followed by ModuleNotFoundError: No module named 'sympy' and analytic inverse kinematics needs SymPy. This is the same download/missing-dependency sequence seen in #927. The separate advisory mypy result matches the existing main errors documented in the description.

Could a maintainer rerun this docs job and review the occupied-map fix for merge? I do not have access to rerun the upstream job.

@petercorke
petercorke merged commit bceb42c into petercorke:main Nov 19, 2026
22 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 19, 2026
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.

2 participants