Skip to content

fix(mobile): rebuild D* plans and report traversed costs - #1000

Merged
petercorke merged 3 commits into
mainfrom
fix/dstar-replanning
Nov 28, 2026
Merged

petercorke merged 3 commits into
mainfrom
fix/dstar-replanning

Conversation

@petercorke

Copy link
Copy Markdown
Owner

What

Four fixes to DstarPlanner, by @Afloat16: PR #996 (D* plans), rebased onto main. That PR sits on a fork and cannot be updated from main, so its commit is kept here with their authorship; one commit of ours changes the versionchanged notes from 1.6.0 to 1.5.1.

  1. plan() builds a fresh search tree from the current goal and costmap, so a second call follows the new goal and edited costs. It kept the old goal's zero-cost root and ignored costmap edits.
  2. The heap invariant is restored after removing an open state whose priority decreases, so expansion order stays valid.
  3. The status cost from query() sums the steps actually followed, including a sensor detour. It reported the initial plan's cost (3 for a route that became a 1 + 2*sqrt(2) detour).
  4. An unreachable goal raises NoPathError, and the animation is finished when a query fails. It returned a path through infinite-cost cells.

Supersedes #996; I will close that one with a thank-you.

Behaviour

This changes results in the four cases above, as the versionchanged notes say. For a plan followed without a sensor, nothing changes: on 40 random cost grids the path, cost and expansion count are identical to main. The expansion count restarts with an explicit new plan().

What I ran, and what I could not

  • The new tests/test_dstar_replanning.py (12 cases): 8 fail on main and all pass here, on the pure-Python path.
  • With the existing mobile planner tests: 304 passed.
  • The 40-grid comparison with main above, with no sensor.
  • Could not run: other operating systems and Python versions (CI is the check), and the docs build locally.

AI assistance

@Afloat16's PR says it was prepared with OpenAI Codex. The rebase, the version change and the checks above were done with Claude Code (Claude Sonnet 5.5), reviewed by the maintainer.

🤖 Generated with Claude Code

Afloat16 and others added 2 commits November 27, 2026 17:16
Reset the search tree for each explicit plan, repair the frontier after a
priority decrease, and report the cost of the route actually followed.
Raise NoPathError for unreachable goals and finish animations on failure.

Co-Authored-By: OpenAI Codex (GPT-6 Astra Pro) <noreply@openai.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 26 complexity · 0 duplication

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

@petercorke
petercorke merged commit 95aa0ae into main Nov 28, 2026
24 checks passed
@petercorke
petercorke deleted the fix/dstar-replanning branch November 28, 2026 01:19
@github-actions github-actions Bot mentioned this pull request Nov 27, 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