Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust headland rounding #29

Closed
chrispahm opened this issue Mar 7, 2018 · 10 comments
Closed

Adjust headland rounding #29

chrispahm opened this issue Mar 7, 2018 · 10 comments

Comments

@chrispahm
Copy link

Thanks a lot for the amazing tool!
I wanted to know whether it was possible to adjust the turning radius of the vehicle for the headland creation. The background is, that currently the innermost headland path cannot be cultivated without turning. Here, the angle would be too "sharp" for most of the machinery (see attached picture). Another question I have is whether it would be possible to add an option to "split" the headlands in case the corner radius is above a certain treshold, e.g. if the corner can't be cultivated without turning.
Thanks a lot for your help!
capture

@pvaiko
Copy link
Owner

pvaiko commented Mar 7, 2018

Not sure what version you are using, is this one of the older releases? I did not know folks still using the standalone version. I did not create a standalone release for a long time now as this is integrated in the game. I still use the standalone for development and testing though.

The standalone release packages here are out of date, there's a lot more functionality available now.

If I understand you correctly, you are using the 'round corners' option and would like that the radius will not be smaller the vehicle turning radius. I started that work and made significant progress on it but then I added the headland turns feature and then this did not seem to be that important anymore (also, see my discussion of this topic in #13).

Not sure I understand your second question, if you mean the corner radius is below a certain threshold, then that functionality is partly covered by the headland turns.

@chrispahm
Copy link
Author

Thanks a lot for your reply! I downloaded the v.1.1 release from the release page and used lua/love executables from an earlier release.
To be honest, I don't own the game and got to your project through a different background: for a research project assessing ecological focus areas I would like to identify headlands from a given field, ideally as separate headlands for each "side" of the field.
For that purpose I started working on a little algorithm, however it is far from stable/usable.
As your project is really advanced and has some very nice features I would love to use it for the project instead. Especially having the ability to round the corners of a headland would make economic/ecologic comparisons of full coverage (i.e. with turning on the headlands) compared to rounded headlands with ecological focus areas in the edges possible.

The question now is, wether through your turn mechanism I could somehow export the single headlands, i.e. "split" the headland where are turn is necessary.

Thanks a lot for the help!

@pvaiko
Copy link
Owner

pvaiko commented Mar 7, 2018

Christoph, das klingt super interessant, was für ein Projekt ist das?

Ich glaube es ist machbar was du willst, ich kann dir auch gerne helfen. Die aktuelle Quellen sind in dem Courseplay Repo (https://github.com/Courseplay/courseplay) unter dem course-generator Ordner.

Als erstes solltest du vielleicht auf die aktuelle Version umstellen, du musst dieses Repo klonen und darin nochmal https://github.com/Courseplay/courseplay klonen. Danach kannst Du den Generator z.B. mit LOVE\love.exe . fromFile fields/Goldcrest.xml 12 starten, unter fields gibt es Felder zum Testzwecken aus dem Spiel exportiert.

@chrispahm
Copy link
Author

Das Projekt ist zur Zeit noch eher eine Idee, höchstwahrscheinlich für eine mögliche Abschlussarbeit. Im großen und ganzen geht es darum, dass Landwirte in Deutschland die Möglichkeit haben Blühstreifen/Blühflächen als Agrarumweltmaßnahme auf ihrem Acker anzulegen. Dafür gibt es, je nach Bundesland, auch eine relativ attraktive Prämie pro Hektar.

Einhergehend mit der Maßnahme gibt es allerdings einige Anforderungen die eingehalten werden müssen: Z.B. muss der Blühstreifen (in NRW) mindestens 6m, maximal 12m breit sein, darf zeitgleich jedoch nicht mehr als 0,25ha pro Schlag groß werden, für 5 Jahre nicht befahren werden etc. Die Analyse, inwiefern so ein Blühstreifen nun sowohl ökonomisch als auch ökologisch sinnig/wertvoll ist wird dadurch erschwert, insbesondere für den Entscheidungsträger (also den Landwirt). Es gibt in der Richtung bereits ein paar Studien (z.B. Karpenstein-Machan et al. (2013), jedoch wird dort meiner Auffassung nach nicht die tatsächliche Komplexität der Entscheidung (wie die oben genannten Vorgaben für den Blühstreifen, Einfluss auf die Arbeitszeit/eingesetzte Pflanzenschutzmittel etc.) berücksichtigt.

In der Praxis lässt sich beobachten, dass Blühstreifen i.d.R entlang der Vorgewende angelegt werden. Dank deines Algorithmus wäre es (höchstwahrscheinlich) möglich, die Vorgewende eines Feldes zu identifizieren und anschließend zu prüfen, ob die Anlage eines Blühstreifens auf dem Vorgewende möglich/sinnig wäre (z.B besonders bei Nähe zu angrenzendem Wald (-> Schatten)) und welche Auswirkungen dies für Landwirt und Umwelt hätte.

Eine alternative herangehensweise dazu wäre der Ansatz mit den abgerundeten Ecken: da die vielen Wendemanöver, die i.d.R für die Bewirtschaftung vom Vorgewende nötig sind, die Flächenproduktivität (ha/h) drastisch verringern, werden in vielen Gegenden mit geringen Landpreisen solche Ecken nicht mehr bewirtschaftet. Somit wird bei der Bewirtschaftung des Vorgewendes nicht mehr das Anbaugerät ausgehoben, sondern einfach die kleinstmögliche Kurve innerhalb des Wenderadius gefahren. Hier wäre es durchaus interessant gegenzurechnen inwiefern die eingesparte Arbeitszeit inklusive des erlöses aus einem Blühstreifen/Blühfläche in der jeweiligen Ecke die wirtschaftlichkeit beeinflusst.
Soviel zu der Idee an sich, ist doch einiges an Text geworden :)

Zurück zum course-generator, habe nun die repo geclont und wie oben von dir beschrieben die courseplay repo dort hinein geclont. Wenn ich nun z.B. LOVE\love.exe . fromFile fields/Goldcrest.xml 12 ausführe, öffnet sich zwar der course-generator, jedoch erhalte ich die Fehlermeldung "Could not generate course.". Gibt es zu dem Fehler einen ausführlicheren Log-Eintrag? Ich hab leider noch nicht herausgefunden wie ich den Fehler sonst beheben kann.

Vielen Dank nochmal für deine Hilfe!

@pvaiko
Copy link
Owner

pvaiko commented Mar 8, 2018

Interessant, endlich eine Anwendung im wirklichen Leben.

Der Fehler ist natürlich meine Schuld, du hast einen Zwischenstand erwischt, wenn du den headland branch von courseplay auscheckst muss alles funktionieren:
cd courseplay
git checkout headland
(Weiss nicht wie gut du dich mit git und Softwareentwicklung in generell auskennst, ich benutze IntelliJ Idea, dort kannst du das course-generator Verzeichnis als Projekt öffnen, ich habe auch run configs eingecheckt)

Im Generatorfenster kannst du mit den Tasten 1-6 verschiedene ebene ein/auschalten.

@chrispahm
Copy link
Author

Vielen Dank, läuft wie geschmiert! Jetzt muss ich mir nur noch überlegen, wie ich
a) meine GeoJSON Felder in course-generator kompatible XML-Dateien konvertiere (gibt es eine Spezifikation für das Format?) ,
b) das Skript ohne UI mit den gewünschten Parametern aufrufe (z.B headlandWidth: 3m etc.)
c) den äußersten Vorgewende-Pfad inkl. der Wendepunkte exportiere (entweder den Pfad als ganzes und zusätzlich einen Array mit den Wendepunkten oder bereits einen Array aus Pfadabschnitten). Wie werden aktuell die Pfade gespeichert?

@pvaiko
Copy link
Owner

pvaiko commented Mar 8, 2018

a) wäre evt. einfacher ein GeoJSON reader in Lua zu implementieren, es gibt JSON Lua Libraries aber das format ist auch nicht zu kompliziert zu lesen. Schau mal in file.lua rein, z.B. loadSavedFields().
b) Beispiele siehst du im Smoke Test fieldtester.lua, der lädt die Felder von Files und generiert Pfade ohne die GUI.
c) auch hier, siehe file.lua, die Funktionen mit write.

Wenn es nicht dringend ist kann ich auch bei der Implementation helfen.

@chrispahm
Copy link
Author

Super, tausend dank schonmal! Ist überhaupt nicht dringend, ich drücke mich mal wieder vorm Paper schreiben... Werde dann mal in den nächsten tagen einen Branch erstellen und ein wenig basteln, habe überhaupt keine Erfahrung mit Lua (arbeite sonst nur mit JS) und würde, falls möglich, später nochmal auf deine Hilfe zurückkommen!

@pvaiko
Copy link
Owner

pvaiko commented Mar 17, 2018

@chrispahm
Christoph, habe die alte Wenderadiusfunktion aktiviert und verbessert, ist unter dem radius Branch zu finden (git checkout radius in beiden Repos)

@chrispahm
Copy link
Author

Hi Peter,
sorry das ich mich jetzt erst melde, vielen Dank aber schonmal für das Update! Ich schaue später aber mal rein!

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

No branches or pull requests

2 participants