Skip to main content

Module grid_based_sweep_cpp

Module grid_based_sweep_cpp 

Source
Expand description

Grid-based sweep coverage path planner (boustrophedon / lawn-mower pattern).

Ported from PythonRobotics GridBasedSweepCPP.

The algorithm:

  1. Find the longest edge of the input polygon to determine the sweep direction.
  2. Rotate the polygon so that the longest edge is axis-aligned.
  3. Build a grid map from the rotated polygon boundary, marking cells outside the polygon as occupied.
  4. Expand obstacles by one cell to avoid boundary collisions.
  5. Perform a boustrophedon (back-and-forth) sweep search on the grid.
  6. Convert the resulting grid path back to global coordinates.

Structs§

GridBasedSweepConfig
Configuration for the grid-based sweep coverage path planner.
SweepCoveragePath
Result of the grid-based sweep coverage path planner.

Enums§

MovingDirection
Horizontal moving direction.
SweepDirection
Sweep (vertical) direction.

Functions§

plan_sweep_coverage
Plan a boustrophedon (lawn-mower) coverage path over the area enclosed by the given polygon.