Servers by jDrones

Auto Way-point Generation for Polygon Coverage from Outside to Center for autonomous mower

(Kenny Trussell) #1

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.

1 Like
Skid Steer Mower Overshooting pivot turns
Another waypoint generation scheme for vehicles with limited turn radius
(Kenny Trussell) #2

I have created a program that will perform my desired function. It is not perfect and I welcome any improvements. It is located at Please read the 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!

(Kai Justice) #3

I am really interested in trying out the program that you wrote! I downloaded the file to the desktop. Extracted… double clicked ( I also tried running as administrator), a quick cmd box pops up and then disappears… but that is it.

I am not familiar with github, am I missing something simple? Do I need a compiler to take a look this ? Is the desktop the wrong directory to be trying to execute from?

Thank you for guidance in advance!

(Kenny Trussell) #4

The program runs from the command line. You need to put it in a directory that you can easily get to from the command prompt (type “CMD”) in the windows search box. If you are not used to the command line, it may take you a little bit to learn. I will be glad to help you. I would be interested in your thoughts. It is not perfect but works for me. I use it for every mowing job I do. The first thing would be to watch these 2 videos on my YouTube channel:


Let me know if that helps.

(Kai Justice) #5

Got it working! Thank you! This is really slick. Doing an engine swap on the mower, will be trying this out once that is complete.

I assume driving in a lined pattern wasn’t effective with the current pixhawk tuning ?

(Kenny Trussell) #6

No, I did some mowing in a back and forth lined pattern. I just prefer all the clippings not be thrown into the grass I have not cut.
I’m so glad you got it to work. I have only had a few people indicate they were interested in it. It was very important to me. I guess there are different philosophies on mowing! :slight_smile:

1 Like
(Christopher Milner) #7

Kenny, Thank you!! Really helpful.

(Kenny Trussell) #8

Be sure to look over the final pattern, though. It will throw a stray point in there every now and then! Sometimes, it is harmless and just causes your machine to mow an extra bit, but I have had it put a point way outside the desired polygon, which can be BAD! I can tell stories!

(Michael Oborne) #9

just a fyi,

ive added something like this to MP beta, you can find it in survey grid, under spiral.

(Kenny Trussell) #10

Great! I will check it out!

(Kenny Trussell) #11

@Michael_Oborne, I finally tested the spiral survey grid you added to MP. That is awesome. I will like use this rather than my command line program. I do see that you have some of the same issues that I have (in my case using the Clipper library) in that it isn’t always perfect, but adjustments to the polygon and/or breaking the area to be covered into more regular polygons and then merging the waypoints after is a good workaround. As an example of what I am talking about, though, I took the polygon in the attached zip file and generated the survey waypoints in the zip file with 1 meter spacing. You see it has a gap around the inner most part of the survey. Again, thank you so much for adding this to MP. It is very nice.MP (4.8 KB)

(Kenny Trussell) #12

@Michael_Oborne, I used your built-in MP function to generate a mowing pattern for a real area I am about to mow. I also generated a pattern with my external program “mowplan”. I bow to the expert! Yours did a better job toward the middle of the pattern. I didn’t experiment with where my starting point was, which might make a slight difference. But, the convenience of having this capability built into MP is so great!

Anyone interested, see attached MP and MowPlan versions. MP is so much easier to use and gave the best result!

(Christopher Milner) #13

I’m stumped… How do I get the MP Beta version? Clicking on “Check for BETA Updates” in the “Help” screen didn’t work.

(Kenny Trussell) #14

I think that’s what I did. Maybe there is no beta version right now. The feature described above is in the released version: 1.3.68 build 1.3.7117.15819, at least.

(Kenny Trussell) #15

Well, I just did a “Check for BETA Updates” and it did install one for me. I am now on 1.3.68 build 1.3.7122.16568.

(Christopher Milner) #16

I was on the same version, and dug around in the menu to discover the “Advanced Options” checkbox, so found it now. Thanks.

1 Like