# Zigzag line entrance small tools

**URL:** <https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422>\
**Category:** Aog issues (no bugs)\
**Created:** [23 May 2021 15:05 UTC](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422 "2021-05-23T15:05:38Z")\
**Posts on this page:** 6\
**Page:** 4

<div class="post-metadata">

**Author:** ![KentStuff](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/k/f05b48/32.png) [@KentStuff](https://discourse.agopengps.com/u/KentStuff)\
**Post date:** [15 June 2021 03:42 UTC](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422/61 "2021-06-15T03:42:40Z")

</div>

I’ve broken the contour into max count of 36. That helps. Then you need not look at the closest two lines. And for some reason, if it runs across a line that is 90 degrees or so it drops the line. I got rid of the last second counter. That helps. Still not clean, randomly it will not record the contour line, randomly it will just drop the line it is following.

Edit:  
Some progress:  
The search for new line stays active all the time. But, it only looks for lines 3 behind and 3 ahead of the current line. Every 36 points on a contour line it is broken into a new line. If a line is not found, it starts a counter, after 10 times of no line, it assumes there is no recent line and scans all the lines. This has eliminated the 90 degree jump and picking up lines from a separate pass. Now, if the 90 degree pass is with the last three, it will pick it up. In the picture below, it is making circles based on an original circle. The green line is the current line it is using, the other purple lines are all the lines it could be using.

![image](https://discourse.agopengps.com/images/transparent.png)  
Started in a rough circle, Then cut across and made a few loops.  
then asked it to drive the perimeter. In this photo it has ran for an extened time at 61.6 km/h. Simulator only of course. But, I’ve worked much of the bugs out.

![image](https://discourse.agopengps.com/images/transparent.png)

Last Edit:  
I’m calling this a partial success. I drove the perimeter of the field and then hit auto steer after one round. Just some minor glitches when the tractor could not steer the increasingly tightening corners. But the contour works very well and will stick the line.

![image](https://discourse.agopengps.com/images/transparent.png)

Summary of changes:  
If autosteer is on, only look for the closest 6 lines.  
Remove the last second delay.  
Remove the start and end point for each line segment.  
Break contours into smaller (36) pieces.  
Draw the contours and turn the one that is reference to green. (This really helps to know when you have a fix on the correct line.)  
All pivot references are to the guidenceLookPoint.  
Get rid of the sharp angle break.  
Set how many paths away to 1 and -1 regardless of where you are in the field. You only need to be 1 path away from any line.

---

<div class="post-metadata">

**Author:** ![bricbric](https://discourse.agopengps.com/user_avatar/discourse.agopengps.com/bricbric/32/9918_2.png) [@bricbric](https://discourse.agopengps.com/u/bricbric)\
**Post date:** [16 June 2021 06:39 UTC](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422/62 "2021-06-16T06:39:18Z")

</div>

Thanks @KentStuff to investigate and improve the code !

---

<div class="post-metadata">

**Author:** ![KentStuff](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/k/f05b48/32.png) [@KentStuff](https://discourse.agopengps.com/u/KentStuff)\
**Post date:** [16 June 2021 13:31 UTC](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422/63 "2021-06-16T13:31:34Z")

</div>

Here is the program to try the contour. The (dirty) source code is also in the same github. This was based on the sticky branch of Brian’s a week ago. The two files that changed are the ccontour and the position designer. The changes to the position designer was to break the contour into smaller sections. Most of the changes are in the contour file.

Give it a try, if it works well for everyone, it may be worth adding into the code.

[AgOpenGPS\_v5.zip](https://github.com/KentStuff/AgOpenGPS-ContourMods/blob/master/AgOpenGPS_v5.zip)

---

<div class="post-metadata">

**Author:** ![bricbric](https://discourse.agopengps.com/user_avatar/discourse.agopengps.com/bricbric/32/9918_2.png) [@bricbric](https://discourse.agopengps.com/u/bricbric)\
**Post date:** [21 June 2021 05:16 UTC](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422/64 "2021-06-21T05:16:44Z")

</div>

Kent

thanks to do this proposal

Sorry i have no time and no task to really test this update ,  
I just use the simulator but i think it is out of reality and i cannot conclude

---

<div class="post-metadata">

**Author:** ![BrianTee\_Admin](https://discourse.agopengps.com/user_avatar/discourse.agopengps.com/briantee_admin/32/7_2.png) [@BrianTee\_Admin](https://discourse.agopengps.com/u/BrianTee_Admin)\
**Post date:** [21 June 2021 18:26 UTC](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422/65 "2021-06-21T18:26:45Z")

</div>

Do you have the source up to date on your github?

---

<div class="post-metadata">

**Author:** ![KentStuff](https://discourse.agopengps.com/letter_avatar_proxy/v4/letter/k/f05b48/32.png) [@KentStuff](https://discourse.agopengps.com/u/KentStuff)\
**Post date:** [21 June 2021 18:39 UTC](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422/66 "2021-06-21T18:39:57Z")

</div>

Here is the link.

# [KentStuff](https://github.com/KentStuff) / **[AgOpenGPS-ContourMods](https://github.com/KentStuff/AgOpenGPS-ContourMods)**

[Previous page](https://discourse.agopengps.com/t/zigzag-line-entrance-small-tools/5422.md?page=3)
