How to get rover/drone run parallel 8m from original track.

I am a little lost and in need of an outside opinion, I have been building, using and changing codes to get this to work, i currently have code for a Mega with a gps module a hm5883l compass and 2 drive motors (that also steer) that i can set way points and vehicle and will travel to.

What i now want to achieve is to be able to set up a Geo-Fence that triggers the turn sequence in the vehicle to turn 180Deg a set distance(8m) from the track it just came up on and run back down parallel to the track until it hits the Geo-fence again and turns and continues to do this, moving further and further away from start location. I'm not sure which part of my code to post as it is not really relative to anything i am chasing yet as i do not know where to start??
Summery (i think);

not after:
geo fence building or trigger (can do this)
Autopilot control (done)

After:
How to get rover/vehicle to turn and run parallel 8m from original track. (maybe not even code just a push in the right direction?)

Im thinking something to do with automatically moving way points in relation to Fence when triggered to create new heading? or maybe use the first heading to create a grid map of parallel lines and run off that (is that possible?).. maybe i'm over thinking it... maybe i'm way off!

example

Void set up{
pinMode(TrigPin, INPUT);// pin pulled high when in range of Geo fence.
}

Void loop{
if(TrigPin, High){

//move to next grid line? 

//next way point? /*which it will already do if the way point next is set, but the problem is i would need too many way points and would take a long time to set up manually and not be uniform or accurate. unless i can do this automatically after each trig and stay 4 way pionts in front or so?*/
}
else{
AutoPilot code;
}

}

Can you get the device to run along the original track with sufficient accuracy?

How is the track defined?

If the track is defined as movement from one GPS waypoint to another waypoint then it seems to me you just need some maths to add 8m to the waypoint positions.

...R

I think you have three or more problems. The first is knowing when to turn. The second is knowing how far you have turned, so that you can complete a 90 degree turn (NOT a 180 degree turn). Then, you need to travel 8 meters, and make another 90 degree turn. Obviously, the 8 meter distance will need to be adjusted based on the radii of the two 90 degree turns.

How will the rover know what track to take, having completed the two turns so that it is now facing the opposite direction and is 8 meters (+/- some number of furlongs) away from the original track?

Is the original track a straight line (or as straight as is reasonable, given the terrain)?

First of all thank you both for your replies.

R.
Yes it will re run any "track" accurately (way point to way point)

yes it currently navigates from one GPS way point to another.

Yes i believe this could be a solution but how do i get it to create its own way points on the fly? something i am attempting. I think i just needed a outside opinion to reinforce the idea as not sure if its the best solution.

PaulS
knowing when to turn; i am using a geo fence trigger.

90 + 90 turn: it turns and navigates to way points well currently so not quite sure on this one yet, but i think it will resolve its self if i could answer you third query.

How will it know what track to take: this is my only real concern at this point, Im not sure how to create a parallel track a precise distance from the previous.

90deg just gave me an idea...using Some math with haversine again, i can get my distance i believe but in my head i just cant quite work out how to get it to place in the correct direction. Maybe use my on board compass in a formula that will give the direction to place my way point?... that sounds doable. Thanks again for the spit-balling, i think i will give that a crack. sometimes you just have to say it out aloud. Thanks for the input i have been Head-Desking for 4days now.

What, exactly, are you trying to accomplish? How accurately do you need to parallel the original track?

It sounds like you are driving a tractor, and want to minimize gaps and overlaps between passes in opposite directions, covering a given area with the least number of passes.

KofK03:
Yes i believe this could be a solution but how do i get it to create its own way points on the fly?

I had been assuming that it would already have been given the waypoints for the original track - am I wrong?

...R

PaulS;
Sorry, didn't out line what the vehicle was as a bit caught up in my own head. As accurate as can be.

Yes, you are correct, exactly what i'm trying to do. As the tractor comes to the end of the paddock, than turns and drives in the opposite direction 8m away from where it came up. and continues to do so.

R
Yes but only the original 2 way points are set manually, so will i not need to create new ones every time I commence a turn? or do you think there is another way to achieve this?maybe run the other lines off the original 8m apart somehow?

so will i not need to create new ones every time I commence a turn?

No, you'll need to create two new ones BEFORE you begin the turn. Suppose that the track you are on is not perpendicular to the geo-fence. In that case, two turns add up to 180 degrees, but neither is 90 degrees.

Unless you plan to overrun the geo-fence, you'll need to offset the track to the left (or right) before you get to the original track/geo-fence intersection and then intersect the new track (infinite line) with the geo-fence, to get the start and end way-points.

Draw it out on paper. It's not that difficult if you ignore the fact that the ground isn't planar.

Unless you are mowing/tilling Kansas, you can reasonably assume that the geo-fence defines a planar area, in which case the math is pretty simple.

KofK03:
Yes but only the original 2 way points are set manually, so will i not need to create new ones every time I commence a turn? or do you think there is another way to achieve this?maybe run the other lines off the original 8m apart somehow?

Isn't that mathematically equivalent to starting with two numbers (say 24 and 2024) and incrementing each of them by 8 on every iteration. For example you will get to 128 and 2128 after 13 steps.

...R