-
Notifications
You must be signed in to change notification settings - Fork 523
Courseplay Autodrive kurse rückwärts erkennung #7026
Comments
@Stephan-S we call GetPath() which returns a list of waypoints, how do we know if a waypoint is reverse? CP currently recognizes .rev or .reverse being true. |
Ich kann dir hier raten den Kurs einmal aus Autodrive zu erstellen, abzuspeichern und dann mit dem CP Editor die Wegpunkte zu ändern. Damit kann man z.B. auch einen Ballen Sammel Kurs erstellen und ihn irgendwo auf der Strecke abladen lassen. |
@Tom20214 hast du AD Kurse mit rückwärtsfahren? |
Hello Peter @pvaiko, @Tensuko,
To get the start and end of a reverse part of the waypoints table the following snippet might help: function ADDrivePathModule:checkForReverseSection()
local reverseStart = false
local reverseEnd = false
if self.wayPoints ~= nil and #self.wayPoints > self:getCurrentWayPointIndex() + 1 and self:getCurrentWayPointIndex() > 1 then
local wp_ahead = self.wayPoints[self:getCurrentWayPointIndex() + 1]
local wp_current = self.wayPoints[self:getCurrentWayPointIndex() - 0]
local wp_ref = self.wayPoints[self:getCurrentWayPointIndex() - 1]
local isReverseStart = wp_ahead.incoming ~= nil and (not table.contains(wp_ahead.incoming, wp_current.id))
local isReverseEnd = wp_ahead.incoming ~= nil and wp_current.incoming ~= nil and table.contains(wp_ahead.incoming, wp_current.id) and not table.contains(wp_current.incoming, wp_ref.id)
local angle = AutoDrive.angleBetween({x = wp_ahead.x - wp_current.x, z = wp_ahead.z - wp_current.z}, {x = wp_current.x - wp_ref.x, z = wp_current.z - wp_ref.z})
angle = math.abs(angle)
if angle > 100 and isReverseStart then
reverseStart = true
end
if angle > 100 and isReverseEnd then
reverseEnd = true
end
end
return reverseStart, reverseEnd
end |
@Axel32019 thanks, not sure I understand what exactly the meaning of the incoming and out parts is, are these tables (and not a single reference to the next/previous point) because the course is forking/merging? I could just look at the angle (which we have in our course anyway) and that could probably work fine, as long as an AD course never starts in reverse. |
@pvaiko Hallo Peter, You got it - incoming and out are tables. They keep the point(s) to the previous/next point, but for reverse "coding" the incoming will not have the previous point, the previous will have this point in out. Special way to store the points without the need for additional information if it is reverse direction. |
Trying to figure out where should the course be driven in reverse, based on the angle difference between two subsequent waypoints, similar to what AD does internally. Quite a fragile process, not really happy with it.
@Tom20214 da du keine AD Kurse zum testen gepostet hast musst jetzt selber auf dem issue-7026 Branch testen :) |
@pvaiko https://youtu.be/QUCMvf2lr_I besser könnte es garnicht funktionieren, danke das du es eingebaut hast. |
Was soll uns das 2te Video sagen ? |
@Tensuko Das soll zeigen das auch mit Anhänger funktioniert. |
Ah okay :) |
Trying to figure out where should the course be driven in reverse, based on the angle difference between two subsequent waypoints, similar to what AD does internally. Quite a fragile process, not really happy with it.
@Tensuko Da es nun einwandfrei funktioniert mach ich die issue jetzt zu. |
* Mode 6 re-enabled for Kuhn Discolander, fixes #7023 The fix for #6912 screwed this up. Instead of enabling all foldables for mode 6 and disabling sprayers/sowing machines, just enable tension belts, that should cover auto bale loader trailers. * Working width setting by 0.1 increments fixes #5997 Working width can be set by 0.1 increments over 10 m when holding down the left Alt key. * MapHotspot improvements - moved setting to global settings - simplified setting - improved start/stop CP multiplayer code * Fixes a click to switch bug. Where the player farm ID after entering a vehicle was not set correctly in SP. * Check for exact fill nodes before using them (#7060) Fixes #7006 * Reverse for AD courses #7026 (#7061) Trying to figure out where should the course be driven in reverse, based on the angle difference between two subsequent waypoints, similar to what AD does internally. Quite a fragile process, not really happy with it. * Fix AD compatibility (#7066) - Added explicit interface functions to stop/start the CP driver - When stopping/starting just check if CP is driving, don't worry about getIsAIActive() as that can be anything, especially when other mods setting it. * Salford Plow: Removed 'noReverse' as it tourned out it can be pushed backwards in 90 and 180 degree turns very easy. * Making the cotton harvesters work (#7077) - Some of them won't lower the cutter, for those, just lower manually before starting the CP driver. * Mode 2 fix for trucks #7074 (#7078) - check truck's own fill level, not just trailer * Action event rework - created new ActionEventConfig.xml file. * small pr improvements * fixes MP bug, when autodrive starts a CP driver. Co-authored-by: Tensuko <theta-darkphoenix@gmx.net>
Ist es möglich das Courseplay auch die Rückwärtskurse von Autodrive erkennt? momentan erkennt er die Rückwärtskurse als Vorwärtskurse und fährt z.b vorwärts in das Keilsilo rein
The text was updated successfully, but these errors were encountered: