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

Commit

Permalink
6.01.00227 Fix wide turns
Browse files Browse the repository at this point in the history
Reverted "Fix for lane transition maneuvers #3421 (#3459)"

This reverts commit 4de84e9.

Fixed it properly, that commit worked by accident but the real problem
was that the original code assumed that we never skip a row and used
to work width instead of the delta X.
  • Loading branch information
pvaiko committed May 27, 2019
1 parent 7b81e1e commit d6b39f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
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.00226</version>
<version>6.01.00227</version>
<author><![CDATA[Courseplay.devTeam]]></author>
<title>
<br>CoursePlay SIX</br>
Expand Down
20 changes: 10 additions & 10 deletions turn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -933,17 +933,17 @@ function courseplay:generateTurnTypeWideTurnWithAvoidance(vehicle, turnInfo)

--- Generate line between first and second turn circles
fromPoint.x, _, fromPoint.z = localToWorld(turnInfo.directionNode, turnInfo.turnRadius * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnRadius);
toPoint.x, _, toPoint.z = localToWorld(turnInfo.directionNode, (vehicle.cp.courseWorkWidth - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnRadius);
toPoint.x, _, toPoint.z = localToWorld(turnInfo.directionNode, (turnInfo.targetDeltaX - turnInfo.turnRadius - turnInfo.turnDiameter) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnRadius);
courseplay:generateTurnStraightPoints(vehicle, fromPoint, toPoint);

--- Generate the second turn circles
center.x,_,center.z = localToWorld(turnInfo.directionNode, (vehicle.cp.courseWorkWidth - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnDiameter);
startDir.x,_,startDir.z = localToWorld(turnInfo.directionNode, (vehicle.cp.courseWorkWidth - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnRadius);
stopDir.x,_,stopDir.z = localToWorld(turnInfo.directionNode, vehicle.cp.courseWorkWidth * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnDiameter);
center.x,_,center.z = localToWorld(turnInfo.directionNode, (turnInfo.targetDeltaX - turnInfo.turnRadius - turnInfo.turnDiameter) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnDiameter);
startDir.x,_,startDir.z = localToWorld(turnInfo.directionNode, (turnInfo.targetDeltaX - turnInfo.turnRadius - turnInfo.turnDiameter) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnRadius);
stopDir.x,_,stopDir.z = localToWorld(turnInfo.directionNode, (turnInfo.targetDeltaX - turnInfo.turnDiameter) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnDiameter);
courseplay:generateTurnCircle(vehicle, center, startDir, stopDir, turnInfo.turnRadius, turnInfo.direction * -1);

--- Generate line between second and third turn circles
fromPoint.x, _, fromPoint.z = localToWorld(turnInfo.directionNode, vehicle.cp.courseWorkWidth * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnDiameter);
fromPoint.x, _, fromPoint.z = localToWorld(turnInfo.directionNode, (turnInfo.targetDeltaX - turnInfo.turnDiameter) * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset + turnInfo.turnDiameter);
toPoint.x, _, toPoint.z = localToWorld(turnInfo.targetNode, turnInfo.turnDiameter * turnInfo.direction, 0, turnInfo.reverseOffset);
courseplay:generateTurnStraightPoints(vehicle, fromPoint, toPoint);

Expand All @@ -965,17 +965,17 @@ function courseplay:generateTurnTypeWideTurnWithAvoidance(vehicle, turnInfo)

--- Generate line between first and second turn circles
fromPoint.x, _, fromPoint.z = localToWorld(turnInfo.directionNode, turnInfo.turnDiameter * turnInfo.direction, 0, turnInfo.zOffset - turnInfo.reverseOffset);
toPoint.x, _, toPoint.z = localToWorld(turnInfo.targetNode, vehicle.cp.courseWorkWidth * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnDiameter);
toPoint.x, _, toPoint.z = localToWorld(turnInfo.targetNode, (turnInfo.targetDeltaX - turnInfo.turnDiameter) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnDiameter);
courseplay:generateTurnStraightPoints(vehicle, fromPoint, toPoint);

--- Generate the second turn circles
center.x,_,center.z = localToWorld(turnInfo.targetNode, (vehicle.cp.courseWorkWidth - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnDiameter);
startDir.x,_,startDir.z = localToWorld(turnInfo.targetNode, vehicle.cp.courseWorkWidth * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnDiameter);
stopDir.x,_,stopDir.z = localToWorld(turnInfo.targetNode, (vehicle.cp.courseWorkWidth - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnRadius);
center.x,_,center.z = localToWorld(turnInfo.targetNode, (turnInfo.targetDeltaX - turnInfo.turnDiameter - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnDiameter);
startDir.x,_,startDir.z = localToWorld(turnInfo.targetNode, (turnInfo.targetDeltaX - turnInfo.turnDiameter) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnDiameter);
stopDir.x,_,stopDir.z = localToWorld(turnInfo.targetNode, (turnInfo.targetDeltaX- turnInfo.turnDiameter - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnRadius);
courseplay:generateTurnCircle(vehicle, center, startDir, stopDir, turnInfo.turnRadius, turnInfo.direction * -1);

--- Generate line between second and third turn circles
fromPoint.x, _, fromPoint.z = localToWorld(turnInfo.targetNode, (vehicle.cp.courseWorkWidth - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnRadius);
fromPoint.x, _, fromPoint.z = localToWorld(turnInfo.targetNode, (turnInfo.targetDeltaX - turnInfo.turnDiameter - turnInfo.turnRadius) * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnRadius);
toPoint.x, _, toPoint.z = localToWorld(turnInfo.targetNode, turnInfo.turnRadius * turnInfo.direction, 0, turnInfo.reverseOffset - turnInfo.turnRadius);
courseplay:generateTurnStraightPoints(vehicle, fromPoint, toPoint);

Expand Down

6 comments on commit d6b39f9

@GeorgeEarslight
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good news, on which fix did you implement the targetDeltaX?

@pvaiko
Copy link
Contributor Author

@pvaiko pvaiko commented on d6b39f9 May 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the question?

@GeorgeEarslight
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was asking when member targetDeltaX was implemented.
Was it there from the first v6 release or added at a later commit?

@pvaiko
Copy link
Contributor Author

@pvaiko pvaiko commented on d6b39f9 May 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there in v5 already.

@Icke09
Copy link

@Icke09 Icke09 commented on d6b39f9 May 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, can i subscribe my problem in german?
Ich hab das Problem, dass der Courspalyhelfer wenn er die Standard Drillmaschine (Horsch Pronto 9DC) an einem Standard-Trecker angebaut ist beim Einsetzen viel zufrüh einsetzt und beim Ausheben auch zu früh aushebt. Das Gleiche Broblem habe ich auch beim Samson-Fass mit 12m Schlitzgerät.
Meine Vermutung ist, dass er gar nicht registriert das er eine Maschine hinten dran hat.
Das ändern des Versatzes in längs- Richtung löst auch nicht das Problem.

Darüberhinaus kann ich bei angebauter Drillmaschine nicht den Modus Düngen und Sähen wählen, da er nicht freigeschaltet wird.

Gibt es noch andere die das selbe Problem haben?

Wie kann ich hier Bilder zur Veranschaulichung posten?

@pvaiko
Copy link
Contributor Author

@pvaiko pvaiko commented on d6b39f9 May 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.