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

Abtankrohr ausfahren bei Füllstand erreicht an/aus #3792

Closed
klauskleber14 opened this issue May 15, 2019 · 26 comments
Closed

Abtankrohr ausfahren bei Füllstand erreicht an/aus #3792

klauskleber14 opened this issue May 15, 2019 · 26 comments

Comments

@klauskleber14
Copy link

Hallo Zusammen,

ich habe eine Frage bezüglich des Dreschen mit Courseplay.

Ist es möglich den Courseplay Helfer so einzustellen, das er sobald er seinen Füllstand erreicht hat automatisch sein Abtankrohr ausfährt? Zur Zeit bleibt der Drescher, sobald er voll ist, stehen und fährt das Abtankrohr erst aus wenn ein Fahrzeug in der nähe ist.

In den .lua Daten habe ich den Eintrag gefunden ab wo er immer stehen bleibt (99.5%). Wenn man diesen Wert auf 100 abändert bleibt er zwar kurz stehen und fährt das Abtankrohr aus und wieder ein, fährt aber dann einfach weiter ohne irgendwas abzuernten.

Hintergrund ist es Courseplay zusammen mit Autodrive zu nutzen. Der Autodrive Helfer fährt aber den Drescher nur Abtanken wenn der Drescher das Abtankrohr ausgefahren hat.

Vielleicht kann mir eine weiter helfen.

Vielen Dank schonmal

@Tensuko
Copy link
Contributor

Tensuko commented May 15, 2019

Da wir selber einen Abfahrer (Mode2) haben, auch wenn der sich noch im Rework befindet, glaube ich nicht, das wir Anpassungen daran machen werden.

Eigene änderungen in der LUA werden nicht unterstützt.

Ich werde das mal als Suggestion einbauen, ob das Drescherrohr bei Füllstand X (Eventuell auffüllen bis) automatisch ausfahren soll, oder nur wenn ein Abfahrer kommt. Aber ob das umsetzbar ist und ob wir das machen werden müssen wir erst besprechen.

@Tensuko Tensuko changed the title Abtankrohr Drescher Abtankrohr ausfahren bei Füllstand erreicht an/aus May 15, 2019
@klauskleber14
Copy link
Author

Ok trotzdem schonmal vielen Dank für die schnelle Antwort.

Wäre super wenn das klappen würde

@pvaiko
Copy link
Contributor

pvaiko commented May 17, 2019

@klauskleber14 wir könnten auch mit dem Autodrive Entwickler zusammen eine Lösung ausarbeiten wo die zwei Mods direkt über eine definierte Schnittstelle kommunizieren.

Du kansst die evt. mal fragen ob die interresse daran haben.

@pvaiko pvaiko self-assigned this May 17, 2019
@klauskleber14
Copy link
Author

Das wäre aufjedenfall eine super sachen wovon beide mods profitieren würden.

ich werde mal bei den Autodrive entwicklern nachhören.

@Stephan-S
Copy link

Hallo pvaiko,

an was für eine Schnittstelle hast du hier denn gedacht? Prinzipiell bin ich da absolut offen für, falls CP mit AD kommunizieren möchte.
Da AD hier den deutlich kleineren Funktionsumfang hat, macht es wohl hauptsächlich Sinn, das CP bestimmte Aktionen in AD starten kann, nehme ich an.

Ihr arbeitet ja gerade daran den Mode2 zu erweitern/erneuern. Ich weiß nicht ob ihr schon mal dazu gekommen seid euch den Abfahrer-Modus von AD in Aktion anzusehen. Dieser ist sicherlich deutlich weniger umfangreich als euer Mode2 aber bringt wie @klauskleber14 bereits erwähnt hat den Vorteil mit das er sehr leicht zu aktivieren/starten ist, da er sich ja immer auf das komplette bereits eingefahrene Kursnetzwerk von AD beziehen kann um die Strecken Feld->Abladepunkt->Feld zu fahren.

Derzeit meldet sich jeder AD Fahrer in dieser Einstellung auf einer globalen Liste als Abfahrer an und wird aktiv von den Dreschern gerufen, je nach Einstellung entweder erkannt durch die Entfernung oder durch die selber Zieleinstellung im AD-Menü.

Einzige Vorraussetzung ist hier, das das Rohr des Dreschers ausgefahren ist, bevor der Abfahrer gerufen wird, da ich daraus den Zielpunkt für den Abfahrer ermitteln kann, ohne diesen vorher wie bei Courseplay vorher je nach Fahrzeug, bereits im eingeklappten Zustand (mit zig Sonderfällen etc.) zu errechnen.

Falls ihr eine Meldung von AD haben möchtet, das ein Fahrer bereit ist und nur auf ein ausgeklapptes Rohr wartet, kann ich das natürlich auch gerne an eine entsprechende Schnittstelle weitergeben.

Viele Grüße,
Stephan

@pvaiko
Copy link
Contributor

pvaiko commented May 19, 2019

Hallo Stephan,

für diesen speziellen Fall mit dem Rohr wäre uns vielleicht dein letzter Vorschlag am einfachsten, diese Kondition:

if self:isFillableTrailerUnderPipe() then

könnten wir mit .z.B. AutoDrive:isDriverWaitingForPipe() o. änlich erweitern, das solange mit true zurückkehrt bis der Trailer den Rohrtrigger erreicht.

Was für andere Schnittstellen noch Sinn machen? Für CP wäre es bestimmt interressant, Kurse zu kombinieren, z.B. Auffüll/Abladekurse für Feldarbeit Autodrive berechnen oder fahren lassen. Für AutoDrive könnte evt. unser Pathfinding für die Fruchtumfahrung interessant sein, aber so gut kenne ich mich mit AD nicht aus.

Am besten fragen wir in der Community nach, bin sicher dass es tausende von Ideen gibt.

Peter

@Tensuko
Copy link
Contributor

Tensuko commented May 19, 2019

Du meinst die Überführungs- und Auffüllkurse durch das AD Netzwerk ergänzen/ersetzen ?
CP dann die Feldarbeit machen lassen ?

Klingt jetzt erstmal nicht so schlecht, allerdings müsste man dann schauen, was man macht, wenn kein AD vorhanden ist. Eventuell eine Abfrage bei spielstart, ob mit AD oder CP die Überführung- und Auffüllkurse gefahren werden sollen und dann entsprechend die Funktionen in CP deaktiviert oder aktiviert werden.

Aber da wisst ihr bestimmt eh besser, was machbar ist :)

@Stephan-S
Copy link

Ich habe eine kleine Anpassung vorgenommen, damit AD erkennt, wann ein CP gefahrener Drescher abladen möchte.
Damit CP wiederum darauf reagiert, könnte die von @pvaiko referenzierte Zeile so aussehen:
if self:isFillableTrailerUnderPipe() or (self.vehicle.ad ~= nil and (self.vehicle.ad.tryingToCallDriver or self.vehicle.ad.driverOnTheWay)) then

Damit hat es in ersten Versuchen keine Probleme gegeben.
In der Version 1.0.2.0 von AD sind die entsprechenden Variablen enthalten.
Hierbei überprüft AD folgende CP Variablen, um den Abfahrer zu rufen:

if vehicle.cp.driver.states.WAITING_FOR_UNLOAD_OR_REFILL == vehicle.cp.driver.fieldWorkUnloadOrRefillState then
--print("Detected CP is calling driver");
cpIsCalling = true;
end;

pvaiko added a commit that referenced this issue May 20, 2019

Verified

This commit was signed with the committer’s verified signature.
mitchellh Mitchell Hashimoto
@pvaiko
Copy link
Contributor

pvaiko commented May 20, 2019

@51stHD
Copy link

51stHD commented May 20, 2019

Really pleased to see this as it also makes manually driving the tractor or truck easier than guessing where the pipe will be.

I tested it and unfortunately it only works when the pipe in not the fruit, as it stops at 95%

@pvaiko
Copy link
Contributor

pvaiko commented May 20, 2019

If you have the pathfinding turned on, the combine should make a pocket and then wait for the unload. The 5% is there to have enough capacity to make the pocket.

@51stHD
Copy link

51stHD commented May 20, 2019

Yes that's understood, however in the course I was running the combine had no fruit to cut a pocket in.

It was a simple square field with 4 headlands, then just up & down. It was on one of the up & down runs that the combine backed out to one side as it was almost full and the pipe would have been in the fruit, but there was no fruit on the other side to cut the pocket and therefore reach the 100% needed to trigger the pipe.

I will run it again and make a screenshot.

@Tensuko
Copy link
Contributor

Tensuko commented May 21, 2019

For a general Discussion, pls continue here #3820
I keep this open for the ongoing implemention of Combine unloading.

@51stHD
Copy link

51stHD commented May 22, 2019

fsScreen_2019_05_22_12_21_57

@pvaiko
Copy link
Contributor

pvaiko commented May 22, 2019

Not sure what version of CP and AD you are using but in that situation, CP is in the 'waiting for unload' state, maybe @Stephan-S knows, I think on the CP side we are doing what we are supposed to.

@51stHD
Copy link

51stHD commented May 22, 2019

Sorry...CP version was 6.01.00220 and I was not running it in conjunction with AD, even although I had AD version 1.0.2.0 installed, yet to update both and try again.

In this scenario I have been using CP for field work & AD for driving from place to place on the map, but drive to the combine and offload points manually myself, especially with over-loaders as mode 3 is yet to be initiated.

@Stephan-S
Copy link

Hey, sorry I just got around to checking it myself.
Apparently in this state, the interface function:
vehicle.cp.driver:isWaitingForUnload();
actually returns false

I haven't had time to check which state might be missing in CP to trigger this.
@pvaiko Can you verify that? I might not get to it until Friday

@pvaiko
Copy link
Contributor

pvaiko commented May 22, 2019

I'll check it. I think it's my fault...

pvaiko added a commit that referenced this issue May 23, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Hopefully got it right finally, combine now also calls AutoDrive when
waiting to unload after made a pocket or pull back
@pvaiko
Copy link
Contributor

pvaiko commented May 23, 2019

Yeah, I screwed it up. Try with 224.

@51stHD
Copy link

51stHD commented May 23, 2019

For me 224 has not changed anything from my screenshot above...

However I will state again but possibly more clearly that at no point am I using CP in conjunction with AD. That is something I intend to test shortly.

For now I was just happy to see CP instruct the combine to extend it's pipe when it requires unloading, as I mentioned above because it makes manual driving of the tractor/truck easier and more realistic. I had even intended to open this as a request at some point.

So if you are manually driving the tractor to unload the CP combine, the spout is extended automatically when the combine is ready to unload in all cases except for the one in the screen above.

PS. Sorry for not being able to express this in German, I really wish I could.

@pvaiko
Copy link
Contributor

pvaiko commented May 23, 2019

@51stHD looks like we had a little misunderstanding here, your scenario really did not work with AD, but it does work fine when you drive manually: the combine will open the pipe when you drive the tractor closer, it checks if there's a fillable trailer close enough.

@51stHD
Copy link

51stHD commented May 23, 2019

Yes that is understood. Thanks.

What I was looking for was for the combine to extend it's pipe when it requires emptying as the Giants helper does, regardless of AD or not.

I should really have opened a separate "request" for this where I could better explain what I have in mind.

@Tensuko
Copy link
Contributor

Tensuko commented May 25, 2019

Current state is, if you unload CP Combine manualy, Trailer is full and Combine still got fruit in it, it doesn't continue its work, I don't rly like that. There must be an other way to support AD (and not make the Pipe unfold all time).

@Stephan-S
Copy link

I think this is due to the current cyclic dependency.
As soon as CP tells AD it is ready to unload and is standing still, AD will always say that it is trying to call a driver (since CP is saying it needs to be unloaded).
And while AD is returning true on this call, CP will keep the pipe extended, right?

I added a check in the AD function to check if there is an active driver waiting, If not, AD will not say that it is calling a driver.

https://github.com/Stephan-S/FS19_AutoDrive/blob/33e89d53696c7db17e7efd7ca02aee3f6c3ce833/FS19_AutoDrive/scripts/AutoDriveCombineMode.lua#L88

I updated the lua file. A new zip will be packaged later today when I'm done with processing some more issues.

@Stephan-S
Copy link

I also noticed another issue:

https://github.com/Stephan-S/FS19_AutoDrive/issues/135

The AD unloader waits 15 seconds after the unload process before starting to drive back to the start position. The reasoning was to allow the combine to drive a 'safe' distance away before the tractor starts maneuvering.
As you can see in the referenced issue, it can happen that the driver wants to cut before the combine right at the start. This is the only time where it is allowed to go through some fruit (since default helper has him unload in fruit 50% of the time).
This is where these 15 seconds wait time prevent deadlocks or crashes.

CP seems to stop until the trailer is out of pipe range, independent of the fill level, right?
Would it be an option to check for the fill level of the trailer in pipe range and continue if it is full or would this conflict with your driving strategies?

I will also try to include more checks, if driving through the fruit is really required/allowed at this point, to further prevent 'deadlocks' from AD side.

@pvaiko
Copy link
Contributor

pvaiko commented May 26, 2019

I think the deadlock you see there is because @Mannie313 set the 'stop when unloading' in CP. If that's set then it looks it will not continue until the trailer leaves the pipe's range. Otherwise the combine would close the pipe and continue once the trailer is full.

When AutoDrive is driving it could use

function FieldworkAIDriver:holdForUnloadOrRefill()

to tell CP to hold, which, according to the description

-- Hold for unload (or refill) for example a combine can be asked by a an unloading tractor -- to stop and wait. Must be called in every loop to keep waiting because it will automatically be -- reset and the vehicle restarted. This way the users don't explicitly need to call resumeAfterUnloadOrRefill()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants