Skip to main content

wavefront_cpp

Function wavefront_cpp 

Source
pub fn wavefront_cpp(
    grid: &WavefrontGrid,
    start: (usize, usize),
    goal: (usize, usize),
    config: &WavefrontCppConfig,
) -> Vec<(usize, usize)>
Expand description

Run the wavefront coverage path planner.

Returns a path (list of (row, col) cells) that attempts to visit every reachable free cell, starting from start and ending at goal.

The algorithm:

  1. Build a wavefront transform matrix via BFS from goal.
  2. From start, greedily move to the unvisited neighbour with the highest transform value (farthest from goal).
  3. When stuck, backtrace along the existing path to find a cell with an unvisited neighbour and resume from there.