Courseplay / Courseplay_FS22

Courseplay for Farming Simulator 2022
GNU General Public License v3.0
840 stars 179 forks source link

Automatic Headland setting #17

Closed Tensuko closed 5 months ago

Tensuko commented 2 years ago

Beside the Number of Headlands (0-X) add the option to generate an automatic number of headlands. Automatic - 0 - X

It should be calculated like this: Total length of the Vehicle + Tool * 1.5 (maybe 1.2 is enough) / workingwidth. Rounded up and this should be the number of headlands to provide enough space for a nice turn.

pops64 commented 2 years ago

I know in FS17 CP the turn calculation was used to determine if it could turn on the field at the end of the lane. Always had a thought of using this to determine the number of headlands needed. Cause turn radius should be taken into account

rohne83 commented 2 years ago

Quick&dirty paint job for strong geometric approach: in best case the working width is larger than the turn radius and the turn has a strong U shape (thin red line). In this case the required headland size would be total length + turn radius + (workingwidth/2). If turn radius is larger than the working width a so-called omega-curve (thick red line) is needed for turning without reversing. In that case we would even need two times the turn radius. Plus a small extra for transition the steering. headland turn

Result divided by working width gives the number of lanes then.

pvaiko commented 2 years ago

It is unfortunately a bit more complicated than this.

So the width of the headland really depends on a number of factors, and you may end up with a lot more headland than you actually need, using that geometric approach for a combine you'll have 3turning radius + half work width (as an omega turn in fact needs 3 r), but by making a 3 point turn, you can get away with 1 * radius + half work width.

@rohne83 we stopped using a geometric approach, instead, we use what is called Dubins path (or Reeds-Shepp when reversing is allowed) to generate the path between two poses (position+direction).

jobyrns72 commented 2 years ago

Or possibly a full circle pattern?? Im still hoping lol

rohne83 commented 2 years ago

To make it a bit more complicated, to minimize soil compaction in RL more and more farms start to use only existing tracks - keyword: controlled traffic farming. Of course work widths of all tools have to match each other (either 1 by 1 or at least integer multiples of each other). But at least for the same vehicle on the same field it will only use tracks where it has to drive anyway. Fertilizer sprayer/spreaders are doing this for ages now (just look on the field tracks you can see on google earth/maps/whatever). Also combines turning at row end would always drive into one of the headland lanes and use exactly this one to reach the next row (CP was already doing kind of this approach in FS19 when pathfinder was switched on für turns). Even unloaders try to stay on those tracks as long as possible. In the end, yes there's quite a number of factors, but it's still geometry which defines the pure number of headland lanes required for the turns. Now that you say it, yes, steering postion mitght be better suited than just vehicle length. To be on the safe side I think it would be the worst case of turning without reversing which is to be considered. Most often you don't know during course generation whether reversing (i.e. 3 point turns) is an option at all.

coatsy35 commented 1 year ago

Would be good to just have a display that tells us what the total length of vehicle and implement is (on the course generator page) so we can at least approximate first time what number of headlands are required

Tensuko commented 5 months ago

https://github.com/Courseplay/CourseGenerator/issues/12