Skip to content

fix(mobile): restore missing distance-transform diagonal - #644

Merged
petercorke merged 1 commit into
petercorke:mainfrom
tahazarif10:fix/distance-transform-missing-diagonal
Aug 26, 2026
Merged

fix(mobile): restore missing distance-transform diagonal#644
petercorke merged 1 commit into
petercorke:mainfrom
tahazarif10:fix/distance-transform-missing-diagonal

Conversation

@tahazarif10

Copy link
Copy Markdown
Contributor

Thanks for contributing to RTB!

Summary

DistanceTransformPlanner.next() currently has seven neighbour offsets plus [0, 0], leaving the dy=-1, dx=+1 diagonal unavailable during path extraction.

The Euclidean distance transform itself is 8-connected, so this makes path extraction asymmetric with the cost map.

This replaces the self-offset with the missing diagonal [-1, 1] and adds a regression test on an interior 5x5 grid where that move is the unique shortest next step.

Related issue

Fixes #503

Checklist

  • PR title follows Conventional Commits (type: description)
  • Tests pass locally (pytest)
  • Added/updated tests for this change, if applicable
  • New/changed code is type-hinted with modern syntax (X | Y, list[X], not Union/Optional/List)
  • Docstrings updated where applicable
  • PR is as small/focused as practical
  • No test files, data files, or notebooks specific to my own project

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (5b5a0fe) to head (835457e).

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #644   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files        143     143           
  Lines      14035   14035           
=====================================
  Misses     14035   14035           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@petercorke
petercorke merged commit 674c63b into petercorke:main Aug 26, 2026
23 checks passed
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.

DistanceTransformPlanner missing direction [-1,-1]

2 participants