3 AutoDrive modes: - Stephan-S/FS19_AutoDrive GitHub Wiki

The drive modes

AutoDrive offers different modes to do different actions:

3.1 Only Drive:

In this mode the current vehicle will take the most suited point (by it's current direction and distance) or simply the nearest one. If you start AutoDrive then it will automatically calculate the shortest path from there to the selected destination, start driving and stop at the destination. It is the most simple mode and best suited to test your new routes.

3.2 Deliver:

In this mode AutoDrive will drive the vehicle just like in the ‚Only Drive‘ mode but it will additionally unload the current trailer at the destination, if an unload trigger is detected. The destination point should be created behind the unload trigger, so that vehicles with long trailers will reach the unload trigger before reaching the destination. The driver will stop at the destination regardless of it beeing empty or not. If you notice that your destination point isn’t far enough back, you can easily move the destination or create it at the following point without having to remove the point it self.

3.3 Pickup & Deliver:

In this mode, you must select 2 target destinations: the 1st is for the loading and the 2nd one for the unload. Also you must select the fruit/product to be loaded. If AutoDrive is activated, it will look at the current fill level of the connected trailers/implements. If this value is higher than the set ‚Unload at‘ level (see settings), the driver will directly head for the unload destination. Otherwise it will head for the load destination first. Depending on the selected setting (‚On emtpy silo‘), the driver will either wait at the load destination to be filled past the ‚Unload at‘ level or it will continue to the unload destination. Either way, the driver will first try to load the selected fill type on any available trigger in the provided range (see settings) before the load destination. Additionally you can select a repetition counter before starting the driver. If you set this counter to 2, the driver will stop after having reached the unload destination 2 times. If this setting (see HUD) is left at default, the driver will always start the next cycle.

3.4 Load mode

This mode is very similar to the previously described ‘Pickup and Deliver’ mode with only a few minor exceptions. It will not respect the ‘repetition counter’. There is only a load destination and a target destination at which the driver will stop and disable AutoDrive. This mode is intended to be used as refill mode for field work. This way seeders or sprayers can be started at the field location, sent to a refill point and will return to the set field destination afterwards. This mode can also be used in conjunction with Courseplay. You will have to select ‘Use AutoDrive for refill/unload’ in the Courseplay HUD (not part of this documentation).

3.5 Combine Unloader

In this mode, you can again set two destinations. The first one should be a field location from where an active harvester can be reached. The second one is again an unload destination. This is the first mode in which AutoDrive drivers are allowed to leave the recorded path and drive on the field. This mode is quiet complicated and involves many settings from the settings menu. So this documentation will first describe the basic behaviour and then add how the settings affect the behaviour.

3.5.1 Basics

The driver will decide on startup whether to head to the field or unload first (see ‘Pickup & Deliver). If it reaches the field location it registers itself as available driver. If a combine harvester is at 100% fill level and has an extended pipe, it will automatically go through the registered unloaders and choose the one that is nearest to him. Depending on the setting ‘Find unloader’ either all drivers in a range of 300 meters are accepted (yes) or only drivers with the same target destination as the harvester in the AutoDrive Hud (no).

Important: you do not have to activate AutoDrive on the harvester. Only the selected target is required.

Alternatively, the player can also call the unloader manually by assigning the keybinding ‘Call Unloader’ in the game options and using this while sitting in the harvester. If the harvester is controlled by Courseplay, AutoDrive will also call an unloader if it detects that the Courseplay driver wants to be unloaded.

If an unloader is called to a harvester, it will start planning a path to the extended pipe of the harvester. The path planner is a completely unique implementation and an explanation might be included as appendix to this documentation later on. The core concepts are a division of the simulated world into grid cells. These grid cells are sized according the vehicles turn radius and are checked to be fruit free (see settings), collision free, are on the field (see settings) and have a maximum slope acceptable to AI drivers. After a free path has been found, some smoothing to get rid of most sharp turns is also applied and then the driver is sent along this path to the harvester.

Note: As soon as the unload driver receives the command to drive to the harvester, the status message in the info bar of the HUD changes from ‘Waiting for combine’ to ‘Drive to combine’, which means the path planner is now actively searching for a path. Depending on your CPU performance and your settings (‘Pathfinder time (max)’), this process may take some time and in extreme cases decreases your fps. This is usually the case if the unloader is unable to find an acceptable path to the combine. Always make sure that the space in front of the driver is obstacle free (and fruit free) and the path leading to the pipe of the harvester is also collision free (e.g. no trees or fruit just behind the harvester).

When it reaches the harvester it will check whether the unloading process is finished or if the current trailer is filled. In case of multiple trailers, the driver will drive forwards until a filling process on the next trailer is detected. After the unloading process, the driver will start driving backwards for a few meters to provide the harvester enough space to continue work. Then the driver will wait a few seconds for the harvester to clear the area and start path planning back to the starting point or drive to a park position on the field. Upon reaching that point it will again register itself as available unloader and will wait to be called again. If the trailer is already full it will directly head for the unload destination before returning back to the field location.

3.5.2 Park in field

If this option is set to true in the AutoDrive settings, the driver will stay on the field after the unload of the harvester has done. It will then drive to a park position and upon reaching that point it will again register itself as available unloader ToDo: Use virtual sensors to detect fruit at current vehicle position instead of relying on stored path finder values.

3.5.3 Restrict to field

If this option is set to true, the path finder algorithm will only accept grid cells which are on the field. This setting only takes effect if the vehicle is already on the field (started on the field or parked in the field). This option should help to keep the driver on the field, especially during turn manoeuvres. Important: If no fruit free path can be calculated in the provided time (see settings), the path finder will go into a fallback mode which ignores fruit and field borders! ToDo: Actually test for field location so that start locations that are on the field behave correctly

3.5.4 Fruit avoidance

This options ensures that the path finder will only accept grid cells that don’t contain any fruit or only have a marginal amount of fruit. Important: If no fruit free path can be calculated in the provided time (see settings), the path finder will go into a fallback mode which ignores fruit and field borders!

3.5.5 Pre call driver / Chase combine

These options can be used to either simply follow the harvester with some distance (Pre call driver on / chase combine off) or to have the unloader actively unload while the harvester is still driving. When the harvester reaches the set fill level (Pre call level), it will already call the driver to it’s current location. Once the driver reaches this point it will re-evaluate. If he is close to the harvester (<60 meters) and the ‘chase combine’ setting is on, he will start following him by line of sight. Otherwise he will retrigger a path finding process to the new harvester location. While chasing, he will sense if the pipe is currently in the fruit or not. If it isnt’t in the fruit, he will start targeting the pipe location, otherwise he will follow the harvester with some distance. When the driver reaches it’s ‘Unload at’ level he will immediately start planning a path to the selected field exit (see settings). Thus it makes sense to set the level to 100% in this mode. This way he won’t accidentally try to cut in front of the harvester or leave before being completely filled.

3.6 Unload Bunker silo

In the latest release this mode was removed. There will maybe a sub project for it.

This mode can only be used with vehicles that have a shovel attached. The basic idea is a one-click solution to empty drive-through bunker silos. 
On startup, the vehicle will check for the required conditions. It needs a filled bunker silo in the vicinity (~100m?) and an attached shovel. If both conditions are met, the vehicle will initialize it’s front loader axis to aquire the correct values for up/down, load/unload and extend/retract motions.
Then he will divide the bunker silo width into chunks as wide as his shovel + shovel addition (see settings) and start at the first line.
If the first or the last line ends up hitting the silo wall, you should increase the shovel addition value in the settings and restart the driver. This can occur if either the shovel pickup width is not matched properly to the physical dimensions or the bunker silo definition lies inside the wall, which is not unusual since it makes it easier to develop a good looking bunker silo.
After the shovel is flled and the vehicle reversed from the bunker, it will scan for a vehicle with an attached trailer (with left fill space) and start heading there.

_Caution: There is currently no collision detection included in this mode!_

Since the vehicle tries to find the ideal loading position for the shovel automatically, it can happen that he lifts it’s front wheels up. There is a detection included for this scenario, which checks if all wheels are on the ground and starts lifting the shovel if this check returns false for a few hundred milliseconds.