Skip to content

fix(mobile): preserve fractional obstacle inflation radii - #980

Closed
Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/fractional-obstacle-inflation
Closed

Afloat16 wants to merge 1 commit into
petercorke:mainfrom
Afloat16:fix/fractional-obstacle-inflation

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

Obstacle inflation rounds the requested radius to a whole number of cells before building its circular footprint. This changes the requested clearance in either direction: at 1.45 cells, diagonal neighbors only sqrt(2) cells away remain free; at 1.55 cells, axial neighbors two cells away are incorrectly blocked.

The error reaches real planning: a distance-transform path with inflation 1.45 can pass within 1.414 cells of an occupied center, while a corridor with two cells of clearance is rejected at inflation 1.55.

Change

Use the requested floating-point radius for footprint membership, with a ceiling only for the footprint's bounding box. Include exact cell boundaries despite floating-point division rounding, and reject negative or nonfinite radii before modifying the grid. The existing dilation operation is retained.

Behavior change: fractional-cell inflation now uses the documented world-space radius. Paths and corridor availability can consequently change. Invalid radii raise ValueError without changing the map.

Validation

  • 42 new regressions compare the inflated grid with an independent world-distance oracle across multiple radii, cell sizes, origins, border obstacles and rectangular grids; they also cover sqrt(2) boundaries, zero radius, empty/full grids and repeated inflation.
  • Real DistanceTransformPlanner tests check minimum obstacle clearance and a narrow corridor at two cell sizes.
  • Unchanged main: 24 failed, 18 passed.
  • New tests plus four existing map/planner test modules: 180 passed, 13 subtests passed.
  • mypy: all 166 source files passed. New tests pass Ruff lint/format; git diff --check passes.
  • The full repository/platform matrix was not run locally.

Prior work

Checked all 105 prior fork heads and the relevant upstream patches. The older occupancy-region fork retains the rounding implementation. #779 changes annotations, documentation and a spelling error around inflation; #928 clips regions and #790/#769 guard negative indices. None changes fractional-radius footprint membership.

Primary contributor: Afloat16.

Prepared with ChatGPT (GPT-6 Astra Pro) assistance.

Build the circular dilation footprint from the requested world radius
instead of rounding the radius to whole cells. Preserve inclusive cell
boundaries and reject invalid radii before modifying the map.

Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 16 complexity · 0 duplication

Metric Results
Complexity 16
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.

@Afloat16

Copy link
Copy Markdown
Contributor Author

Could a maintainer rerun the failed jobs in this workflow run?

At head 70b15fb8ac5f8514f1bf8fc1be6e74165e2edfb3, the Ubuntu Python 3.14 job hit the 50-second pytest timeout in the existing tests/test_analytic_ik.py::test_general. The stack is in the Jaco analytic solver's SymPy expansion; it contains no occupancy-grid or inflation code. Failed job log.

The inflation change and its local regression results are unchanged. I could not retry the workflow: the API returned 403 and the GitHub run page offered no re-run control.

@Afloat16 Afloat16 closed this 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.

1 participant