# Towards the Development and Verification of a 3D-Based Advanced Optimized Farm Machinery Trajectory Algorithm

^{1}

^{2}

^{3}

^{4}

^{5}

^{*}

## Abstract

**:**

## 1. Introduction

- Plot segmentation;
- As a variable, among others, according to a given time;
- With respect to a desired number of machine sequences;
- With respect to elevation (slope);
- ○
- Optimization of the entry and exit points of a plot segment;
- ○
- The modeling of trajectories based on real obstacles;
- ○
- The return from a (finished) plot segment to a place that in reality allows the machine to truly leave the plot;

- A formalized workflow that addresses the optimization of farm machinery trajectories in a complex manner.

- What are the input requirements for designing a CTF-based algorithm for optimizing farm machinery trajectories?
- What are the ways of formalizing the identified requirements as a basis for their automatization?
- How does the (theoretically) optimized trajectory of a farm machine differ from the reference (real) trajectory of such a machine?

- Section 2 analyzes state-of-the-art approaches related to the optimization of farm machinery trajectories.
- Section 3 describes the methodology developed within this paper when building on existing approaches; accordingly, it:
- ○
- Introduces data from the fully operational reference farm at Rostěnice, the Czech Republic (Section 3.1);
- ○
- Deals with the pre-processing of data from the reference farm in order to homogenize them (Section 3.2);
- ○
- Summarizes the functional requirements for optimal trajectories (Section 3.3);
- ○
- Presents an open, scalable, and modular proof-of-concept algorithm for optimizing farm machinery trajectories (Section 3.4);
- ○
- Evaluates statistical differences between reference (real) trajectories and optimized (modeled) farm machinery trajectories (Section 3.5).

- Section 4 presents results comprising:
- ○
- The formalization of the developed algorithm through unified modeling language (UML) activity diagrams (Section 4.1);
- ○
- The formalization of the developed algorithm through pseudo-code notation (Section 4.2 and Supplementary Materials);
- ○
- Comparison of the (theoretically) optimized and reference (real) trajectories within the study area (Section 4.3).

- Section 5 presents the discussion of the achieved results, including their confrontation with existing approaches in the following respects:
- ○
- Fulfilment of the defined requirements for designing a CTF-based algorithm (Section 5.1);
- ○
- Ways of formalizing the developed algorithm (Section 5.2);
- ○
- In-depth differences between the (theoretically) optimized and the reference (real) trajectories (Section 5.3).

## 2. Related Work

## 3. Materials and Methods

#### 3.1. Reference (Real) Farm Machinery Trajectories

^{−1}, recommended as optimal at the Rostěnice Farm for cereal harvesting by the CASE IH AXIAL FLOW 9120 field harvester (for more details, see Řezník et al. [29]). Reference data also contained vertical information; however, such vertical information was not used during the conducted experiment due to the following:

- First, the main motivation was to homogenize input elevation information to both reference (real) as well as optimized (modeled) farm machinery trajectories. Elevation was computed from the Digital Terrain Model (DTM) 5th Generation (hereinafter DTM 5G) provided by the Czech national mapping organization, the Czech Office for Survey, Mapping and Cadastre. DTM 5G has positional accuracy equal to 0.14 m and vertical accuracy equal to 0.18 m.
- Second, elevation was not available for all the (real) reference farm machinery trajectories. Typically, headlands (turns) have gaps in the measured data [29].

#### 3.2. Pre-Processing of Reference (Real) Farm Machinery Trajectories

#### 3.3. Functional Specification and Its Verification

- Efficient divisions of plots:
- Avoidance of long-term obstacles: long-term obstacles in the field needed to be addressed automatically [21]. Long term in this context means the existence of an obstacle for more than one agronomic season. Note, short-term obstacles were not taken into account.
- Selection of appropriate U-turn shape: in line with research developed by Jin and Tang [18].
- Analysis of terrain impacts: as the minimization of elevation gain is an expected a priori impact of trajectory optimization, with further impacts as follows:

#### 3.4. Development of Optimized (Modeled) Farm Machinery Trajectory Algorithm

- Data import: the following kinds of data are required as a prerequisite for running the presented algorithm optimizing a farm machinery trajectory:
- DTM with its spatial accuracy (SA) in line with Equation (1):$$Mi{n}_{SA}\ge \frac{S{L}_{SPAN}}{2}$$
- ○
- Min
_{SA}corresponds to the minimal spatial accuracy of an imported DTM; - ○
- SL
_{SPAN}corresponds to the (desired) machine operating on a plot (for details, see module B).

- Geometry of plots with spatial accuracy consistent with the DTM, i.e., in line with Equation (1).
- Obstacles in terms of objects that have a size greater than the maneuvering capabilities of a machine performing the desired field operation. Typical examples are trees, bushes, and ponds, separately or in a form of green and blue infrastructures [35], or human-made objects such as power poles.

- Parameter settings:
- Span length of a (desired) machine operating on a plot. For example, the span length equals the width of the cutting bar of a harvester. Span length may, therefore, vary for the identical machine conducting various field operations such as sowing or harvesting. Experiments described within this paper narrowed the focus only to the field-harvesting operation. Only cereals (winter wheat, spring barley, corn) were harvested in the proof-of-concept fields. The span length within the proof-of-concept conducted in this study was 9.15 m for the Pivovárka plot and 10.4 m for Lány and Přední Prostřední plots. Such values originated from the existing machinery at Rostěnice Farm and were kept to allow the comparability of results between the computed optimized (modeled) route of a farm machine and the reference (real) farm machinery trajectory.
- Machine length of a (desired) machine operating on a plot. Additionally, in this case, machine length varied between various field operations. The machine length within the proof-of-concept conducted in this study was 7 m for all the plots. Such a value originated from the existing machinery at Rostěnice Farm and was used for the same reason indicated in point B. a.

- Plot fragmentation: such a module aims at simplifying the plots by splitting them into smaller fragments [5]. In these sections, it is easier to calculate a trajectory that will be less costly. Fragmentation into plot segments is designed to allow the employment of more machines.
- Division_Based_On_Vertices—calculates the angle for every three consecutive vertices. The function is supposed to split the corresponding plot into segments when an angle is found to be greater than 180°. Such an output is achieved by driving a perpendicular from the apex of an angle to the opposite field boundary. The rationale follows the goal of preventing the existence of inaccessible segments that would otherwise have to be managed separately.
- Division_Based_On_Aspect—a plot is split with respect to the aspect function, calculated from the input DTM. In such a case, crossing the slope is prevented. The natural structure of the terrain can be observed thanks to this division.
- Division_Based_On_Slope—detects uncultivable segments of the plots. If the slope in any part of the plot reaches 10° or more, it will be considered an obstacle. Such a sub-module prevents running over clods and possibly damaging the machine.

- Trajectory calculation: for each plot, subdivision is a core functionality of the whole algorithm. It consists of three sub-modules, each representing a different phase of the presented process.
- Initiation—identifies the plot division starting point along with the optimized (modeled) route. It comprises the following:
- Create_headlands creates a buffer area around the plot segment boundary with a width of one machine length, a constraint determining the minimum space required for successful rotation.
- Get_starting_point—the computation goes as follows in the case of there being no predefined entry point. The position of a starting point is determined by finding a boundary vertex which is in the closest proximity to the spot of highest elevation.
- Calculate_Ideal_Move_Vector determines the initial movement direction of the machine based on the position of the starting point. In general, two resulting directions are possible: (1) parallel with the plot segment boundary or (2) following a contour line. The first case is the preferred one when deviation from a contour line is no more than 5°.

- Movement prolongs a trajectory by adding new vertices in the direction determined by the previous phase. Such a sub-module also performs an assessment of the turn necessity as follows:
- Follow_direction_or_boundary (until the buffer as defined in the D. a. i. point is crossed).

- Rotation—once the previous sub-module “Movement” evaluates that the machinery is supposed to make a turn, this sub-module evaluates possibilities and picks the most suitable rotation type to perform [18]. In the case when a rotation is not feasible, the current position is considered as the end vertex. After a successful rotation, another iteration of the “Movement” sub-module is initiated.

- Bypass the obstacles: such a module performs a modification of the first iteration of the created trajectory, which has not yet taken any obstacle objects into consideration [18]. The presented proof-of-concept approach comprises reviews of the suggested trajectory vertex’s position with obstacles buffered by one half of the width of the cutting bar. An alternative route along the obstacle is then calculated for a route segment in between so-called touch vertices (vertices representing the first and last valid vertex according to the corresponding obstacle). The approach of Jin and Tang [18] was adopted as there are two route types available at each time: “left” and “right”. A smaller underlying area results from the division of the obstacle made by the original trajectory (Figure 5).
- Return to an exit point: a module through which it is possible to leave the plot in reality. In our study, the entry/exit points were identified in line with reference data, reference (real) trajectories, DTM 5G and orthophotos. The entry/exit points were then confirmed by agronomists at Rostěnice Farm.
- Export: Exporting capabilities were defined to obtain the resulting optimized (modeled) routes for farm machinery in an exchange format. The exported results were then used in statistical analyses as well as in proof-of-concept visualizations. The “Export” module comprises the following sub-modules:
- Export trajectory as geographical file format (e.g., Shapefile or GeoJSON).
- Export ENTER and END points as geographical file format (e.g., Shapefile or GeoJSON).

#### 3.5. Statistical Evaluation

- (a)
- Trajectory length in meters with computations based on the coordinate reference system UTM zone 33N for both (real) reference farm machinery trajectories and optimized (modeled) trajectories.
- (b)
- The number of turns needed for machinery to harvest a whole field including its subdivisions. In the case of (real) reference trajectories, the changes in a path’s direction caused by movement along the plot border were not considered as turns.
- (c)
- Elevation gain calculation was based on values derived from DTM 5G reference data resampled to a one meter step generated along the trajectory. The final value of elevation gain for the given trajectory represents the sum of the positive differences for the “next_value-current_value” variable.

## 4. Results

- UML activity diagrams documenting the developed algorithm (see the overall level of detail in Figure 6 as an example, and six remaining UML diagrams in Supplementary Materials);
- Pseudo-code of the developed algorithm (in Supplementary Materials);
- Trajectories created according to the developed algorithm (since the used procedure is designed as parameterizable and scalable, there are several trajectory variants, as depicted in Supplementary Materials);
- Comparison of measures calculated from both types (real and theoretical) of trajectories (trajectory lengths, number of turns, and elevation gain; see Table 2 and Supplementary Materials);
- 2D and 3D cartographic outputs (throughout the remaining four kinds of results).

#### 4.1. Documentation of the Developed Algorithm in Unified Modeling Language (UML)

#### 4.2. Expression of the Developed Algorithm Through Pseudocode

Alghoritm 1. A portion of pseudo-code for an optimized (modeled) farm machinery route algorithm (a function of the splitting of a field of complex shape into segments). |

function splitVertex { boundaries.vertex identify.vertex for i, i = 0, i++ calculate angle between vertex i, i + 1 and i + 2 if angle > 180 { perpendicular.cut create new boundaries splitVertex } else i++ } |

#### 4.3. Comparison of Reference (Real) and Optimized (Modeled) Trajectories

- Manually created trajectories (similarly to reference—real—trajectories, as described in Section 3.2) according to the developed pseudo-code, and;
- Pre-processed real farm machinery trajectories for three fields at Rostěnice Farm.

- The size of the plot: the larger the plot, the longer the trajectory;
- The shape of the plot: the more irregular the shape is, the longer the trajectory;
- The number of harvesting (or, in general, machine) sequences: the higher the number of plot segments is, the longer the trajectory.

## 5. Discussion

#### 5.1. Input Requirements for Designing a CTF-Based Algorithm

- The majority of related work addresses the development of an algorithm for optimizing (modeled) farm machinery trajectories in only two dimensions. Three-dimensional-based approaches are rare and were only described by Hameed [7] and Jin and Tang [10]. Indeed, 3D-based plot segmentation and the optimization of entry/exit points were not identified at all in the state-of-the-art analysis.
- A constant radius of turn was employed in the current study. This constant radius was equal to the parameters of the harvesters used at Rostěnice Farm. In contrast, none of the analyzed papers addressed the challenge of a variable machine radius. As such, it remains open for further research.
- Obstacles are mainly modeled theoretically, as described, for example, in Yan, Wang and Chen [16]. The research presented in this paper deals with real long-term obstacles (e.g., power poles). These were a part of the data adopted from Rostěnice Farm and identified as permanent barriers.
- Related work mostly presents one machine operating on one plot. The harvesting time for a whole plot within the conducted study varied in reality from 8.5 to 17.5 h. More harvesters were assumed in the presented research; we can therefore talk about “harvester-days”.
- Entry and exit points were defined a priori in all the analyzed papers. In contrast, the presented research aimed at the optimization of entry and exit points. The procedure is described in Section 3.4., item D.a.ii. Agronomic practices during the conducted experiment did not follow this approach, as demonstrated in the reference (real) trajectories. As a consequence, the resulting real trajectory had to be extended for a significant part of the plot boundary at the beginning or at the end of the conducted operation.
- The analyzed papers did not address the return from a (finished) plot segment to a place that—in reality—allowed the given machine to truly leave the plot. Trajectory length, number of turns, as well as elevation between the start and end of a plot segment on the one hand and the entry/exit points of a given plot on the other were added to statistical evaluations. Such an approach enhances the work of Kroulík et al. [24].

#### 5.2. Ways to Formalize the Identified Requirements

- The use of mathematical expressions that are most commonly used to describe a particular issue in detail. A typical example can be found in Jin and Tang [18], who defined various kinds of turns.

#### 5.3. Differences Between Reference (Real) and Optimized (Modeled) Trajectories

- The definition of (1) turns and (2) connections between the start and end of a plot segment on the one hand and the entry/exit point of a given plot on the other are the key drivers that influence the evaluation of an optimized (modeled) trajectory. Both aspects defined here significantly influence the length of a trajectory and the number of turns.
- Three-dimensional-based modeling does not have a significant influence on the length of trajectories in contrast to the previous point. However, a 3D-based approach was followed in the conducted experiment primarily to address soil erosion. Proper evaluation of erosion-related consequences would require an erosion model. The complexity of such research was beyond the scope of this paper; for details, see, e.g., Chyba et al. [9].
- Input requirements are, in reality, usually set in accordance with the ad hoc decisions of agronomists, who take into account, e.g., crop type. Such a fact emphasizes the need for a parametric and scalable model, as noted in Section 5.1.
- Different configurations of farm machinery were only partly verified in the conducted study, using two span widths in accordance with two vehicles that operate in reality at Rostěnice Farm.

## 6. Conclusions

## Supplementary Materials

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Feiden, K.; Kruse, F.; Řezník, T.; Kubíček, P.; Schentz, H.; Eberhardt, E.; Baritz, R. Best Practice Network GS SOIL Promoting Access to European, Interoperable and INSPIRE Compliant Soil Information. In Environmental Software Systems. Frameworks of eEnvironment; Hřebíček, J., Schimak, G., Denzer, R., Eds.; IFIP Advances in Information and Communication Technology; Springer: Berlin/Heidelberg, Germany, 2011; Volume 359, pp. 226–234. ISBN 978-3-642-22284-9. [Google Scholar]
- Michálek, V. Stabilní motory pro zemědělství. In Z Historie Zemědělství II.; Prameny a studie č. 49; Národní Zemědělské Muzeum: Praha, Czech Republic, 2012; pp. 163–172. ISBN 978-80-86874-44-9. [Google Scholar]
- Biglarbegian, M.; Al-Turjman, F. Path planning for data collectors in precision agriculture WSNs. In Proceedings of the 2014 International Wireless Communications and Mobile Computing Conference (IWCMC), Nicosia, Cyprus, 4–8 August 2014; pp. 483–487. [Google Scholar]
- Lampridi, M.G.; Kateris, D.; Vasileiadis, G.; Marinoudi, V.; Pearson, S.; Sørensen, C.G.; Balafoutis, A.; Bochtis, D. A Case-Based Economic Assessment of Robotics Employment in Precision Arable Farming. Agronomy
**2019**, 9, 175. [Google Scholar] [CrossRef] [Green Version] - Oksanen, T.; Visala, A. Coverage Path Planning Algorithms for Agricultural Field Machines: Oksanen & Visala: Coverage Path Planning Algorithms for Agricultural Field Machines. J. Field Robot.
**2009**, 26, 651–668. [Google Scholar] [CrossRef] - Driscoll, T. Complete Coverage Path Planning in an Agricultural Environment. Master’s Thesis, Iowa State University, Ames, IA, USA, 2011. [Google Scholar] [CrossRef]
- Hameed, I.A. Intelligent Coverage Path Planning for Agricultural Robots and Autonomous Machines on Three-Dimensional Terrain. J. Intell. Robot. Syst.
**2014**, 74, 965–983. [Google Scholar] [CrossRef] [Green Version] - Rodias, E.; Remigio, B.; Busato, P.; Bochtis, D.; Sørensen, C.; Kun, Z. Energy Savings from Optimised In-Field Route Planning for Agricultural Machinery. Sustainability
**2017**, 9, 1956. [Google Scholar] [CrossRef] [Green Version] - Chyba, J.; Kroulik, M.; Krištof, K.; Misiewicz, P.A. The Influence of Agricultural Traffic on Soil Infiltration Rates. Agron. Res.
**2017**, 15, 664–673. [Google Scholar] - Jin, J.; Tang, L. Coverage Path Planning on Three-Dimensional Terrain for Arable Farming: Coverage Path Planning on 3D Terrain for Arable Farming. J. Field Robot.
**2011**, 28, 424–440. [Google Scholar] [CrossRef] - Řezník, T.; Chytrý, J.; Trojanová, K. Machine Learning-Based Processing Proof-of-Concept Pipeline for Semi-Automatic Sentinel-2 Imagery Download, Cloudiness Filtering, Classifications, and Updates of Open Land Use/Land Cover Datasets. IJGI
**2021**, 10, 102. [Google Scholar] [CrossRef] - Řezník, T.; Lukas, V.; Charvát, K.; Charvát, K., Jr.; Horakova, S.; Křivánek, Z.; Herman, L. Monitoring of In-Field Variability for Site Specific Crop Management through Open Geospatial Information. ISPRS Int. Arch. Photogramm. Remote Sens. Spat. Inf. Sci.
**2016**, 41, 1023–1028. [Google Scholar] [CrossRef] - Charvát, K.; Řezník, T.; Lukas, V.; Jedlička, K.; Charvát, K., Jr.; Palma, R.; Berzins, R. Advanced visualisation of big data for agriculture as part of databio development. In Proceedings of the IGARSS 2018—2018 IEEE International Geoscience and Remote Sensing Symposium, Valencia, Spain, 22–27 July 2018; p. 418. [Google Scholar]
- Hamza, M.A.; Anderson, W.K. Soil Compaction in Cropping Systems. Soil Tillage Res.
**2005**, 82, 121–145. [Google Scholar] [CrossRef] - Noguchi, N.; Terao, H. Path Planning of an Agricultural Mobile Robot by Neural Network and Genetic Algorithm. Comput. Electron. Agric.
**1997**, 18, 187–204. [Google Scholar] [CrossRef] - Yan, H.; Wang, H.; Chen, Y.; Dai, G. Path planning based on constrained delaunay triangulation. In Proceedings of the 2008 7th World Congress on Intelligent Control and Automation, Chongqing, China, 25–27 June 2008. [Google Scholar] [CrossRef]
- Meuth, R.J.; Wunsch, D.C. Divide and conquer evolutionary TSP solution for vehicle path planning. In Proceedings of the 2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence), Hong Kong, China, 1–6 June 2008; pp. 676–681. [Google Scholar]
- Jin, J.; Tang, L. Optimal Coverage Path Planning for Arable Farming on 2D Surfaces. Trans. ASABE
**2010**, 53, 283–295. [Google Scholar] [CrossRef] - Gao, Y.; Gray, A.; Lin, T.; Hedrick, J.K.; Tseng, H.E.; Borrelli, F. Predictive control for agile semi-autonomous ground vehicles using motion primitives. In Proceedings of the 2012 American Control Conference (ACC), Montreal, QC, Canada, 27–29 June 2012; pp. 4239–4244. [Google Scholar]
- Gutman, P.-O.; Ioslovich, I. Inter-field routes scheduling and rescheduling for an autonomous tractor fleet at the farm. In Proceedings of the 2013 18th International Conference on Methods & Models in Automation & Robotics (MMAR), Miedzyzdroje, Poland, 26–29 August 2013; pp. 812–817. [Google Scholar]
- Hameed, I.A.; Bochtis, D.; Sørensen, C.A. An Optimized Field Coverage Planning Approach for Navigation of Agricultural Robots in Fields Involving Obstacle Areas. Int. J. Adv. Robot. Syst.
**2013**, 10, 231. [Google Scholar] [CrossRef] [Green Version] - Plessen, M.G.; Bemporad, A. Shortest path computations under trajectory constraints for ground vehicles within agricultural fields. In Proceedings of the 2016 IEEE 19th International Conference on Intelligent Transportation Systems (ITSC), Rio de Janeiro, Brazil, 1–4 November 2016. [Google Scholar] [CrossRef]
- Plessen, M.G.; Bemporad, A. Reference Trajectory Planning under Constraints and Path Tracking Using Linear Time-Varying Model Predictive Control for Agricultural Machines. Biosyst. Eng.
**2017**, 153, 28–41. [Google Scholar] [CrossRef] - Kroulik, M.; Hula, J.; Brant, V. Field Trajectories Proposals as a Tool for Increasing Work Efficiency and Sustainable Land Management. Agron. Res.
**2018**, 16, 1752–1761. [Google Scholar] [CrossRef] - Tu, X.; Tang, L. Headland Turning Optimisation for Agricultural Vehicles and Those with Towed Implements. J. Agric. Food Res.
**2019**, 1, 100009. [Google Scholar] [CrossRef] - Proj4js. JavaScript Library. Available online: https://proj4js.org (accessed on 9 March 2021).
- EPSG. EPSG:4326. Available online: https://epsg.io/4326 (accessed on 9 March 2021).
- Jedlička, K.; Luňák, T.; Šloufová, A. Stability and other information about networked GNSS reference station plzeň. In Proceedings of the 2nd International Conference on Cartography and GIS, Borovets, Bulgaria, 21–24 January 2008; Volume 2008, pp. 329–336. [Google Scholar]
- Řezník, T.; Pavelka, T.; Herman, L.; Leitgeb, Š.; Lukas, V.; Širůček, P. Deployment and Verifications of the Spatial Filtering of Data Measured by Field Harvesters and Methods of Their Interpolation: Czech Cereal Fields between 2014 and 2018. Sensors
**2019**, 19, 4879. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Řezník, T.; Herman, L.; Trojanová, K.; Pavelka, T.; Leitgeb, Š. Interpolation of data measured by field harvesters: Deployment, comparison and verification. In Environmental Software Systems. Data Science in Action, Proceedings of the ISESS 2020 International Symposium on Environmental Software Systems, Wageningen, The Netherlands, 5–7 February 2020; Springer: Cham, Switzerland, 2020; pp. 258–270. ISBN 978-3-030-39814-9. [Google Scholar]
- Arslan, S.; Colvin, T.S. Grain Yield Mapping: Yield Sensing, Yield Reconstruction, and Errors. Precis. Agric.
**2002**, 3, 135–154. [Google Scholar] [CrossRef] - Dimitrov, V.P.; Borisova, L.V.; Nurutdinova, I.N.; Pakhomov, V.I.; Maksimov, V.P. The Problem of Choice of Optimal Technological Decisions on Harvester Control. MATEC Web Conf.
**2018**, 226, 04023. [Google Scholar] [CrossRef] [Green Version] - Sotnar, M.; Pospíšil, J.; Mareček, J.; Dokukilová, T.; Novotný, V. Influence of the Combine Harvester Parameter Settings on Harvest Losses. Acta Technol. Agric.
**2018**, 21, 105–108. [Google Scholar] [CrossRef] [Green Version] - Royce, W.W. Managing the development of large software systems. Technical Papers of Western Electronic Show and Convention. In Proceedings of the IEEE WESCON, Los Angeles, CA, USA, 25–28 August 1970; pp. 1–9. [Google Scholar]
- Skokanová, H.; Netopil, P.; Havlíček, M.; Šarapatka, B. The Role of Traditional Agricultural Landscape Structures in Changes to Green Infrastructure Connectivity. Agric. Ecosyst. Environ.
**2020**, 302, 107071. [Google Scholar] [CrossRef] - EPSG. EPSG:32633. Available online: https://epsg.io/32633 (accessed on 9 March 2021).

**Figure 1.**Decision tree for selecting the most suitable type of rotation. Meanings of variables are as follows: r—radius of rotation of the vehicle, w—working width, W

_{h}—headland width, θ—swath direction, α is the angle of arch, which is a function of r, θ, and w. Adopted from: Jin and Tang [18].

**Figure 5.**Examples of obstacle avoidance in reference (real) trajectories (

**a**) and optimal trajectories (

**b**). Note that the left obstacle in the left image lies on the border of trajectories in the right image.

**Figure 6.**Overall unified modeling language (UML) activity diagram for an optimized (modeled) farm machinery route algorithm.

**Figure 7.**Map-based presentation of reference (real) trajectories measured at Rostěnice Farm (

**a**,

**c**,

**e**) and optimized (modeled) trajectories with an identical number of harvesting sequences (

**b**,

**d**,

**f**).

**Figure 8.**Three-dimensional visualization of reference (real) trajectories and optimized (modeled) trajectories with an identical number of harvesting sequences—from Pivovárka field (

**a**) and Lány field (

**b**) at Rostěnice Farm, Czech Republic.

Name | Date of Harvest | Number of Harvest Sequences | Number of Harvesters | Number of Measurements | Area (ha) | Number of Turns |
---|---|---|---|---|---|---|

Pivovárka | 19.9.2018 | 2 | 1 | 26,655 | 46.0 | 93 |

Lány | 14.7.2017 | 4 | 3 | 37,115 | 70.4 | 136 |

Přední Prostřední | 14.7.2017 | 4 | 4 | 25,580 | 64.3 | 98 |

**Table 2.**Descriptive statistics: comparison of trajectory length, elevation gain, number of turns (headlands) for reference (real) trajectories and optimized (modeled) trajectories. Note, full statistical details are provided in Supplementary Materials.

Plot | Trajectory | Length | Turns | Elevation | |||
---|---|---|---|---|---|---|---|

Length [m] | Difference [%] | Number | Difference [%] | Gain [m] | Difference [%] | ||

Pivovárka | Real | 59762 | N/A | 93 | N/A | 2075 | N/A |

Optimized-2 sequences | 51012 | −14.6 | 121 | 30.1 | 1784 | −14.0 | |

Přední Prostřední | Real | 73430 | N/A | 98 | N/A | 2862 | N/A |

Optimized- 4 sequences Option 1 | 66051 | −10.1 | 177 | 80.6 | 1352 | −52.8 | |

Lány | Real | 87614 | N/A | 136 | N/A | 1865 | N/A |

Optimized- 4 sequences Option 1 | 72300 | −17.5 | 151 | 11.0 | 1510 | −19.1 |

**Table 3.**Descriptive statistics: range of differences in trajectory length, elevation gain, and number of turns (headlands) between all optimized (modeled) trajectories and reference (real) trajectories.

Length Difference [%] | Turns Difference [%] | Elevation Difference [%] | |
---|---|---|---|

Max | −20.3 | 103.1 | −54.1 |

Min | −10.1 | 11.0 | −12.3 |

Mean | −15.6 | 50.2 | −25.6 |

Std deviation | 3.5 | 34.4 | 17.9 |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Řezník, T.; Herman, L.; Klocová, M.; Leitner, F.; Pavelka, T.; Leitgeb, Š.; Trojanová, K.; Štampach, R.; Moshou, D.; Mouazen, A.M.;
et al. Towards the Development and Verification of a 3D-Based Advanced Optimized Farm Machinery Trajectory Algorithm. *Sensors* **2021**, *21*, 2980.
https://doi.org/10.3390/s21092980

**AMA Style**

Řezník T, Herman L, Klocová M, Leitner F, Pavelka T, Leitgeb Š, Trojanová K, Štampach R, Moshou D, Mouazen AM,
et al. Towards the Development and Verification of a 3D-Based Advanced Optimized Farm Machinery Trajectory Algorithm. *Sensors*. 2021; 21(9):2980.
https://doi.org/10.3390/s21092980

**Chicago/Turabian Style**

Řezník, Tomáš, Lukáš Herman, Martina Klocová, Filip Leitner, Tomáš Pavelka, Šimon Leitgeb, Kateřina Trojanová, Radim Štampach, Dimitrios Moshou, Abdul M. Mouazen,
and et al. 2021. "Towards the Development and Verification of a 3D-Based Advanced Optimized Farm Machinery Trajectory Algorithm" *Sensors* 21, no. 9: 2980.
https://doi.org/10.3390/s21092980