fix(navigation): score frontiers by info-gain per A* path cost (#1255)#2830
Open
samuelokpor wants to merge 3 commits into
Open
fix(navigation): score frontiers by info-gain per A* path cost (#1255)#2830samuelokpor wants to merge 3 commits into
samuelokpor wants to merge 3 commits into
Conversation
Contributor
Greptile SummaryThis PR changes frontier selection to prefer useful nearby exploration by real travel cost.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (3): Last reviewed commit: "fix(navigation): exclude only unreachabl..." | Re-trigger Greptile |
…reachable frontiers
…p revisit/no-gain path)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The frontier explorer jumps across the map — it explores ~1 m in one spot, then walks to the opposite side of the building for another ~1 m, then back, wasting a lot of travel.
Root cause is in
_compute_comprehensive_frontier_score. The weighted sum gave 30% to a "distance from explored goals" term that rewards frontiers far from anywhere already visited (i.e. it incentivizes teleporting across the map), and its distance term peaked at 5 m so it penalized nearby frontiers. Distance was also straight-line, so a frontier just past a wall looked cheap even when it was a long detour to reach.Closes #1255
Solution
Replace the weighted sum with a single objective — information gained per unit of real travel — plus heading continuity and an anti-revisit term:
score = info_gain / (1 + path_cost), wherepath_costis the A* route length over the (inflated) costmap via the existingmin_cost_astar(which already supports traversing unknown cells) — so "near" means near to actually reach, not as the crow flies.*= 1 + 0.5 * heading_alignmentfor smooth sweeps instead of zig-zags.safe_distanceof an already-explored goal.Iteration for context: v1 (reward far-from-explored) → ping-pong; v2 (pure nearest-first) → stalls at the first wall; v3 (info-gain / A* path cost) → smooth full-map sweep.
How to Test
Run the Go2 office sim and trigger exploration:
The robot sweeps the space in a continuous loop instead of ping-ponging, and self-terminates on no-information-gain. Existing
test_wavefront_frontier_goal_selector.pypasses.Measured travel distance to reach a given map coverage (same office sim, old scorer vs new):
Contributor License Agreement