Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
6.01.00226 Use wide turn maneuver in racetrack pattern #3760
Browse files Browse the repository at this point in the history
The only drawback of this is that it may drive off field during the turn
on non-convex shaped fields.
  • Loading branch information
pvaiko committed May 27, 2019
1 parent c81b594 commit 7b81e1e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Waypoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ function Course:getDistanceToFirstUpDownRowWaypoint(ix)
local isConnectingTrack = false
for i = ix, #self.waypoints - 1 do
isConnectingTrack = isConnectingTrack or self.waypoints[i].isConnectingTrack
d = d + courseplay:distance(self.waypoints[i].x, self.waypoints[i].z, self.waypoints[i + 1].x, self.waypoints[i + 1].z)
d = d + self.waypoints[i].dToNext
--courseplay.debugFormat(12, 'd = %.1f i = %d, lane = %s', d, i, tostring(self.waypoints[i].lane))
if self.waypoints[i].lane and not self.waypoints[i + 1].lane and isConnectingTrack then
return d, i + 1
Expand Down
2 changes: 1 addition & 1 deletion course-generator/center.lua
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ function linkParallelTracks(parallelTracks, bottomToTop, leftToRight, centerSett
if parallelTracks[ i ].waypoints then
-- use turn maneuver from one track to the other if they are close to each other
local useHeadlandFromPreviousRow = useHeadlandToNextRow
useHeadlandToNextRow = centerSettings.mode ~= courseGenerator.CENTER_MODE_UP_DOWN and
useHeadlandToNextRow = centerSettings.mode == courseGenerator.CENTER_MODE_SPIRAL and
(i ~= endTrack and math.abs(parallelTracks[i].originalTrackNumber - parallelTracks[i + 1].originalTrackNumber) > 2)
for j, point in ipairs( parallelTracks[ i ].waypoints) do
-- the first point of a track is the end of the turn (except for the first track)
Expand Down
2 changes: 0 additions & 2 deletions course-generator/track.lua
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,7 @@ function fixHeadlandToCenterTransition(course, headlandSettings, centerSettings,
getAllHeadlands(headlands, islands), width, true)
if pathToNextRow then
course:replaceElementsBetween(replaceFromHere, i, pathToNextRow)
print(i, replaceFromHere, #pathToNextRow)
i = replaceFromHere + #pathToNextRow
print(i, replaceFromHere, #pathToNextRow)
end
else
-- In other modes we add a turn maneuver if needed as we start at the row adjacent to the headland
Expand Down
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="40">
<version>6.01.00225</version>
<version>6.01.00226</version>
<author><![CDATA[Courseplay.devTeam]]></author>
<title>
<br>CoursePlay SIX</br>
Expand Down

0 comments on commit 7b81e1e

Please sign in to comment.