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!
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!
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.
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 ?
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!
Kenny, Thank you!! Really helpful.
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!
just a fyi,
ive added something like this to MP beta, you can find it in survey grid, under spiral.
Great! I will check it out!
@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 Survey.zip (4.8 KB)
@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!
I’m stumped… How do I get the MP Beta version? Clicking on “Check for BETA Updates” in the “Help” screen didn’t work.
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.
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.
I was on the same version, and dug around in the menu to discover the “Advanced Options” checkbox, so found it now. Thanks.
Are you still around as I’m still interested in your progress
Yes! I am. I have been way less active than I would like due to many other priorities. I am working on my mower to get it back running after a fire burned up some wiring early last fall. I hope to have it running this week. I will do my best to post my progress on YouTube.
OK. I have lost my mind I guess. Can someone tell me where the check box is to create a spiral survey in Mission Planner. I just can’t see it. I’ve used it many times, but it has been a while. I am running the latest version, but went back to 1.3.69 also and don’t see it there either.