Skip to content

Carve route corridors only between adjacent decomposed cells (jazzy) - #142

Merged
SteveMacenski merged 1 commit into
open-navigation:jazzy-v2from
u33549:Feature/umutc/f2c-enhancements-jazzy-v2/decomp-route-corridors
Jul 27, 2026
Merged

SteveMacenski merged 1 commit into
open-navigation:jazzy-v2from
u33549:Feature/umutc/f2c-enhancements-jazzy-v2/decomp-route-corridors

Conversation

@u33549

@u33549 u33549 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Jazzy port of #135 (Rolling). Fixes a double-headland gap between decomposed
cells. Behavior-preserving unless the field is decomposed with a headland.

The bug: when a field is decomposed with a headland, the headland was being
applied twice. The field headland is already removed once before decomposing;
then applying generateHeadlands to every sub-cell insets a headland on all
of that cell's borders again — including the borders shared with a neighbor. Two
adjacent cells each carving a headland on the same shared edge leaves a
double-width gap between them, and outer edges get a redundant second headland
stacked on the one already removed at the field level.

The fix: generateHeadlandsBetweenCells carves a corridor only on the
borders two cells actually share. An edge is carved only when both its endpoints
and its midpoint lie on a neighbor cell's border, so shared borders get exactly
one corridor and edges facing the outer boundary or a void keep their single,
already-correct headland. route_headland_width (default 0.0 = operation
width) sets the corridor width.

generateHeadlands per sub-cell (before)      generateHeadlandsBetweenCells (after)
headland inset on EVERY border               corridor ONLY on the shared A│B border

 ┌─────────────┐ ┌─────────────┐              ┌─────────────┬───┬─────────────┐
 │▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒│              │             │░░░│             │
 │▒┌─────────┐▒│ │▒┌─────────┐▒│              │             │░░░│             │
 │▒│    A    │▒│ │▒│    B    │▒│              │      A      │░░░│      B      │
 │▒│         │▒│ │▒│         │▒│              │             │░░░│             │
 │▒└─────────┘▒│ │▒└─────────┘▒│              │             │░░░│             │
 │▒▒▒▒▒▒▒▒▒▒▒▒▒│ │▒▒▒▒▒▒▒▒▒▒▒▒▒│              │             │░░░│             │
 └─────────────┘ └─────────────┘              └─────────────┴───┴─────────────┘
   double headland on the shared edge           one corridor where cells meet;
   + redundant outer headland                   outer boundary left untouched

Port notes

Straight port of the Rolling change — the five touched files carry the exact
same hunks as #135, with no adaptation needed. The Jazzy base differs from
Rolling only outside the changed regions (nav2_util vs nav2_ros_common,
nav2_util::LifecycleNode/CallbackReturn, the pre-create_action_server
action server setup, tf2/utils.h), and those differences are preserved as-is.

Decomposition removes the field headland once before decomposing; the
per-sub-cell second headland is dropped so swaths reach the outer field
headland instead of leaving a double-wide gap. A new route_headland_width
goal field (0 = operation width) sets the corridor carved strictly on the
borders that two cells actually share: an edge is carved only when both
endpoints and its midpoint lie on a neighbor's border, so edges facing a
concave void or the outer boundary keep their single headland.

The corridor is built by buffering the shared edge as a line (numerically
robust) and differencing it out; sub-cells below a minimum area are dropped
so degenerate slivers never reach F2C's unchecked OGR casts.
Copilot AI review requested due to automatic review settings July 27, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@SteveMacenski
SteveMacenski merged commit 2ea9ff6 into open-navigation:jazzy-v2 Jul 27, 2026
7 checks passed
@u33549
u33549 deleted the Feature/umutc/f2c-enhancements-jazzy-v2/decomp-route-corridors branch August 1, 2026 11:54
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.

3 participants