Problem Statement
Current target selection algorithm fails to properly filter out targets located at corners or edges of the mapped area. When a target is at the map boundary, only a portion of the target circle is accessible, leading to suboptimal loop closure attempts.
Current Behavior
Map boundary problem: Target at corner (only ~30% of circle is accessible) Robot cannot reach the area outside the map The current 60° sector check passes because nodes can fill +3 sectors even at corners:
Corner scenario (still passes filter):
4 sectors filled (1,2,4,6) → filter passes incorrectly!
Attempted Solutions
1. Sector-Based Distribution Check (Current - Not Working)
- Divides target area into 6 sectors (60° each)
- Requires minimum N sectors to have nodes
- Problem: Corners can still have 4+ sectors filled in the accessible portion
2. Opposite Sector Balance Check
# Check if opposite sectors both have nodes
opposite_pairs = [(1, 4), (2, 5), (3, 6)]
balanced_pairs = sum(1 for a, b in opposite_pairs
if sectors[a] > 0 and sectors[b] > 0)
- Problem: Still doesn't guarantee the target is not at boundary
3. echo /map
# Check FREE/UNKNOWN/OCCUPIED ratio in target circle
explored_ratio = (free_cells + occupied_cells) / total_cells
if explored_ratio < 0.7:
skip_target()
- Problem: UNKNOWN includes areas behind obstacles (not just unexplored)
- Obstacle interiors appear as UNKNOWN even though they're inaccessible
Problem Statement
Current target selection algorithm fails to properly filter out targets located at corners or edges of the mapped area. When a target is at the map boundary, only a portion of the target circle is accessible, leading to suboptimal loop closure attempts.
Current Behavior
Map boundary problem: Target at corner (only ~30% of circle is accessible) Robot cannot reach the area outside the map The current 60° sector check passes because nodes can fill +3 sectors even at corners:
Corner scenario (still passes filter):
4 sectors filled (1,2,4,6) → filter passes incorrectly!
Attempted Solutions
1. Sector-Based Distribution Check (Current - Not Working)
2. Opposite Sector Balance Check
3. echo /map