Does anyone know of a program that will take a polygon defined by way-points at the corners and generate a pattern of way-points which covers the interior of the polygon in an outside-to-in pattern. The goal is to generate way-points for a lawn mower or similar rover. I found an open source library named clipper which can basically draw polygons inside polygons with a specified spacing. I have written a small test routine using clipper but I don’t want to reinvent the wheel if a program already exists.
I have created a program that will perform my desired function. It is not perfect and I welcome any improvements. It is located at https://github.com/ktrussell/MowPlan. Please read the README.md file for instructions. The program will take as its input a waypoint file from Mission Planner that contains the outline of an area to mow. Note that you should not “close” the polygon by placing the last waypoint on top of the first. See the examples below of input files and their resulting outputs. The command line used in each example was of the form:
mowplan in.waypoints out.waypoints 54 ccw
Note with more complex polygons, there may be slight anomalies, but still OK, IMHO:
If you wish to generate a clockwise pattern, first create the perimeter polygon in Mission Planner in the clockwise direction and then run MowPlan with the final argument being “CW”.
Let me know what you think!