1 Introduction

Development of an agricultural robot involves making the operator’s work easier in the agricultural industry. The concept of a robot is required owing to the decreasing agricultural population and their increasing age. In general, a human operator is unable to operate a farm vehicle over a long period of time in the field, whereas a robot vehicle can work frequently for long periods in adverse conditions.

When a robot vehicle is designed, four issues must be taken into account: what work has to be done, what way does the work need to be completed, which information is necessary, and which positions must be measured [10]. In agricultural farming, the first answer is usually provided by the human operator, and the last two are more or less solved by the measurement of field environments and positions based on environmental and positioning sensors. However, the most difficult issue for the robot vehicle is proper field operation, that is, how to drive the robot in the field with more precision. Reid [13] stated that proper path planning is one of the key tasks in the planning process. Field efficiency and operational costs with the use of high-end technology are driven by the proper planning of field operation. Proper field operation reduces the production costs and increases the adoption of agricultural robots by farmers [15]. In general, a robot exploits a path planning algorithm (called the AB point method) that can find a path from point A to B so that no collisions with obstacles occur and that the path will be optimal with respect to a certain measure [10]. For agricultural robots, this kind of path planning algorithm can be used, but it will not cover the entire field.

Researchers are continually working to develop a route planning for agricultural robots that may cover the entire field. For instances, Taïx et al. [19] derived a field coverage algorithm for convex polygonal fields with one vertex of concavity. The field is divided into a working area and a turning area. In addition, non-convex fields with large obstacles are subdivided along boundary segments defined by concave vertices. A tool in Hofstee et al. [7] was developed to determine the optimum path for field operations in single convex fields. By contrast, a field can be split into subfields based on the longest side of the field or the longest segment of a field polygon [18]. A higher-level algorithm introduced in Oksanen and Visala [11] was based on the trapezoidal split of a complex-shaped field plot into smaller parts. Acar et al. [1] described the cellular decompositions of a field in various patterns for path planning between two points and to cover the free space. Plessen [12] used three patterns for path planning with partial field coverage for smaller field operating machines (such as spraying machines) collaborating with out-field support units (such as mobile depots). Willigenburg et al. [20] proposed online kinematic minimum time path planning and control in the presence of obstacles for an industrial fruit-picking robot. Bochtis et al. [2] developed a route planning method for a deterministic behavior robot that generates route plans for intra- and inter-row orchard operations based on the adoption of an optimal area coverage method developed for arable farming operations. Hameed et al. [6] developed a novel side-to-side 3D coverage path planning method that ensures zero skips/overlaps regardless of the topographical nature of the field terrain, and saves a significant percentage of uncovered area if an appropriate driving angle is chosen. Driscoll [3] derived an algorithm for solving the optimal complete coverage problem on a field boundary with n sides. Jin and Tang [8] reported on a path planning algorithm based on a developed geometric model for generating an optimized full-coverage pattern for a given 2D field by using Boustrophedon paths. A prototype optimized infield route planner used for mowing operations was used to evaluate the working distance and traffic intensity [4]. Seyyedhasani and Dvorak [16] proposed a vehicle routing problem (VRP) and optimization routing techniques for multiple vehicles in order to complete field work quickly.

From the above research studies, it can be summarized that most of the research describes an algorithm and tools/techniques for optimal field coverage considering soil compaction, obstacles, turning radii, energy savings [14], working area, and time. However, no specific research has been conducted on a robot combine harvester that reduces crop losses and operational processing time using path planning based on the optimum harvesting area of a crop, especially if the crop pattern is not in a row (as with wheat). Therefore, a need arises for developing a convenient optimum harvesting area method for determining the work path of the robot combine harvester so that it may cover all parts of the wheat and paddy crop periphery. After harvesting, no crop will be left in the field.

This paper’s research objective is to develop an algorithm that can estimate the optimum harvesting area for a convex or concave polygon field and determine the corner vertex to calculate the working path of a robot combine harvester. This research is conducted on a robot combine harvester developed by Zhang el al. [21]. The automatic path planning for the robot combine harvester is required to choose the crop field optimum harvesting area. Otherwise, crop losses may occur during harvesting in the field. In general, a boundary zone in the field includes water inlets and outlets or objects that are very dangerous for an operating robot. In order to make the turning margin safe for the robot combine harvester, the surrounding crop near a boundary zone is cut twice or thrice by manual operation. However, this surrounding cut crop is not exactly straight; sometimes it is curved or meandering, as shown in Fig. 1. This curved or meandering portion occurs mostly if the crop pattern is not in a row. Path planning is conducted using the corner position AB, and the parallel path is calculated based on the path AB in Fig. 1. Developing path planning with a conventional AB point method in order to take a corner position from the global positioning system by visual observation is a time-consuming operation. The curved or meandering crop is not cut, and the harvesting area is not optimum. During harvesting, this curved or meandering crop may be left in the field. In order to consider the crop losses in the field and the operational processing time, an optimum harvesting area with a convex or concave polygon form in the field is very important. Therefore, the main contribution of this paper is to develop an optimum harvesting area method for convex and concave polygons for the path planning of robot combine harvester. This reduces crop losses and minimizes the operational processing time for path planning.

Fig. 1
figure 1

Schematic of the corner vertices determined conventionally and the curved or meandering portion

The remainder of this paper is organized as follows. Section 2 presents the research platform and overall system algorithm, which will provide an idea of how to determine the optimum harvesting area for the estimated working path of a robot combine harvester for a convex or concave polygon. In Sect. 3, results are described for the convex and concave polygon field. Finally, brief concluding remarks are presented in Sect. 4.

2 Materials and methods

2.1 Research platform and sensors

This research was conducted for a robot combine harvester (model-YANMAR AG1100) developed by Zhang et al. [21] that was designed to harvest cereal crops such as paddy, wheat, and soybean. This robot combine harvester was equipped with an on-board computer to log data from the positioning and inertial sensors by using RS-232C serial and USB ports. This robot combine harvester is fully controlled by a control area network (CAN). The travel speed of the robot combine harvester ranges from 1 to 2 m/s during the harvesting of crops. Figure 2 shows the robot combine harvester with a general-purpose 2.5 m header. A Topcon GB-3 GPS receiver with a PG-S1 antenna was used in this research for measuring the Real-Time Global Positioning System (RTK-GPS) position. This RTK-GPS can provide the position, direction of travel, and speed of the robot combine harvester, and also a provides position accuracy of ± 2 cm. The maximum update and output rates of the RTK-GPS are up to 20 Hz. The low-latency configuration (update rate: 5 Hz, latency: 0.02 s, data link: 115200 Bd) was selected for the RTK mode in this research. An Inertial Measurement Unit (IMU) (model VECTORNAV, VN-100) was used as a posture sensor to measure the heading angle of the robot combine harvester, as shown in Fig. 2. The heading angle from the IMU was stored in the on-board computer at a frequency of 200 Hz through a USB serial port.

Fig. 2
figure 2

Robot combine harvester with RTK-GPS position and IMU direction sensors

2.2 Optimum harvesting area and path planning algorithm

The overall optimum harvesting area and path planning algorithm for the robot combine harvester is shown in Fig. 3. First, the measured RTK-GPS position P(Xi, Yi) and heading angle φ were used to calculate the header end position P(XH, YH), which is called the crop perimeter or the exact outline of a crop. Second, the convex hull CH (p0, p1, …, pi) was calculated from the crop perimeter position P(XH, YH) by using the incremental convex hull method [9]. Third, the actual field shape was selected based on the estimated convex hull. If the field shape was a rectangular polygon, a rotating caliper method was used to find the optimum harvesting area of rectangular field that provided the corner vertices V(Xi, Yi) for path planning. However, when the field shape was a pentagon or L-shaped polygon other than a rectangular polygon, an N-polygon algorithm and the split of convex hull and cross-point method were developed to estimate the optimum harvesting area and the corner vertices V(Xi, Yi) of that polygon. Fourth, the edges of the polygon were obtained by using the estimated corner vertices V(Xi, Yi) and selecting the path direction, which is called the first path. Using this first path, other paths were calculated by considering the header length. Finally, as every path gives start and end points, the waypoints of every path were estimated and stored in a file of the control pc. This file is the input file of the robot combine harvester for the completely automatic harvesting of a crop. The procedures are described in detail in the following sections.

Fig. 3
figure 3

Optimum harvesting area and path planning algorithm of the robot combine harvester

2.2.1 Header end position

To obtain a safe turning area for the robot combine harvester, the surrounding crop near to the headland was cut twice or thrice in manual operation so that the water inlets and outlets in the field were not damaged. The RTK-GPS and IMU sensors were equipped on the robot combine harvester to receive the position P(Xi, Yi) and heading angle φ of that robot harvester. The header end position P(XH, YH) or the exact outline of a crop was determined from this measured RTK-GPS position P(Xi, Yi) and IMU heading angle φ. Let us consider a relative coordinate system with origin O(0, 0) that coincides with the RTK-GPS position, and the x axis aligned with the vehicle forward direction, as shown in Fig. 4. The header’s end position A is identified by the relative coordinates (a, b). Parameters a and b indicate the distance between the header center to the GPS antenna and the header’s center to the header’s end.

Fig. 4
figure 4

Heading angle of the robot combine harvester for estimating the header’s end position

Hence, the header’s end position (XH, YH) was obtained by using Eq. (1) in the ground coordinate system rotating along vector OA by \( \left( {\frac{\pi }{2} - \varphi } \right) \).

$$ \left[ {\begin{array}{*{20}c} {X_{H} } \\ {Y_{H} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {\cos \left( {\frac{\pi }{2} - \varphi } \right)} & { - \sin \left( {\frac{\pi }{2} - \varphi } \right)} \\ {\sin \left( {\frac{\pi }{2} - \varphi } \right)} & {\cos \left( {\frac{\pi }{2} - \varphi } \right)} \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} a \\ b \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {X_{i} } \\ {Y_{i} } \\ \end{array} } \right] $$
(1)

2.2.2 Incremental convex hull algorithm

The convex hull of a set of points Q is defined as the smallest convex polygon P that contains all of its points. The convex hull of Q is expressed as CH(Q). An incremental convex hull algorithm developed by Kallay [9] was used to make a convex hull CH(Q) from a finite set of convex polygon points which are the header end position \( P\left( {p_{0} ,p_{i} \ldots p_{i} } \right) \) points from the RTK-GPS position P(Xi, Yi) points. This algorithm reduces the header end position \( P\left( {p_{0} ,p_{i} \ldots p_{i} } \right) \) points by consecutively selecting the outer most positions or points that cover all points inside the convex hull, as shown in Fig. 5. The point set Q is sorted clockwise to create a sort sequence of the convex hull CH\( (p_{0} ,p_{1} \ldots .,p_{i} ) \).

Fig. 5
figure 5

Convex hull from a finite set of RTK-GPS position of convex polygon

2.2.3 Optimum harvesting area of rectangle by rotating caliper method

The optimum harvesting area enclosing rectangle was determined from the estimated convex hull CH(Q) of a rectangle by using the rotating caliper method [5] shown in Fig. 6. In this method, consider \( L_{s} \left( {p_{i} ,p_{j} ,p_{k} ,p_{l} } \right) \) which indicates a straight line passing through pi, pj, pk and pl, as shown in Fig. 6. First, the vertices pi, pj, pk and pl are selected based on the minimum or maximum x and y coordinates. These vertices are rotated to build a set of calipers with an angle θ. After the rotation, the corner vertices of the rectangle can be computed from the coordinates pi, pi+1, pj, pk and pl when the optimum harvesting area of the rectangle is determined. Details about the rotating caliper method are described in [5, 17].

Fig. 6
figure 6

Optimum harvesting area of rectangle obtained by the rotating caliper method

2.2.4 Optimum harvesting area of convex polygon by N-polygon algorithm

The optimum harvesting area for a convex polygon was determined from the vertices of convex hull CH\( \left( {p_{1} ,p_{2} ,p_{3} , \ldots \ldots p_{i} } \right) \) by using the developed N-polygon algorithm, which is described in counter clockwise order in Fig. 7. The vertices pi of convex hull CH indicate the header end position (Xi, Yi). By using the vertices pipi+1 of convex hull CH, the equation of the ith straight line was obtained. Let us consider the two straight ith and jth lines, described by Eq. (2). The cross-point CP(Xi, Yi) was calculated by using Eq. (2), which is indicated by Eq. (3).

$$ \left( {\begin{array}{*{20}c} {a_{i} } & {b_{i} } \\ {a_{j} } & {b_{j} } \\ \end{array} } \right)\left( {\begin{array}{*{20}c} {X_{i} } \\ {Y_{i} } \\ \end{array} } \right) + \left( {\begin{array}{*{20}c} {c_{i} } \\ {c_{j} } \\ \end{array} } \right) = 0 $$
(2)
$$ \left( {X_{i} ,Y_{i} } \right) = \left( {\frac{{b_{i} c_{j} - b_{j} c_{i} }}{{a_{i} b_{j} - a_{j} b_{i} }}, \frac{{a_{j} c_{i} - a_{i} c_{j} }}{{a_{i} b_{j} - a_{j} b_{i} }}} \right) $$
(3)

where a, b and c are the constant parameters that were calculated from the vertices of convex hull CH\( \left( {p_{1} ,p_{2} ,p_{3} , \ldots \ldots p_{i} } \right) \) by the following Eqs. (4), (5) and (6). Here, j is equal to i + 1.

$$ a_{i} = Y_{i + 1} - Y_{i} $$
(4)
$$ b_{i} = X_{i + 1} - X_{i} $$
(5)
$$ c_{i} = X_{i + 1} Y_{i} - X_{i} Y_{i + 1} $$
(6)

By using the cross-points CP(Xi, Yi) of a convex polygon and the vertices of convex hull CH\( \left( {p_{1} ,p_{2} ,p_{3} , \ldots \ldots p_{i} } \right) \), the contour of the polygon and the contour of the convex hull were determined. The center of gravity point (Gx, Gy) was determined by Eq. (7). This center of gravity point (Gx, Gy) is used for checking whether this point is inside or outside the convex polygon and convex hull.

$$ \left. {\begin{array}{*{20}c} {G_{x} = \frac{{C_{x} }}{A}} \\ {G_{y} = \frac{{C_{y} }}{A}} \\ \end{array} } \right\} $$
(7)

where Cx and Cy indicate the centroid of a polygon that is measured by Eqs. (8) and (9).

$$ C_{x} = \frac{1}{6A}\mathop \sum \limits_{i = 0}^{n - 1} \left( {X_{i} + X_{i + 1} } \right)\left( {X_{i} Y_{i + 1} - X_{i + 1} Y_{i} } \right) $$
(8)
$$ C_{y} = \frac{1}{6A}\mathop \sum \limits_{i = 0}^{n - 1} \left( {Y_{i} + Y_{i + 1} } \right)\left( {X_{i} Y_{i + 1} - X_{i + 1} Y_{i} } \right) $$
(9)

Finally, when the center of gravity was inside the polygon or convex hull, the cross-point CP(Xi, Yi) was selected, and the area was determined by using Eq. (10). This procedure was continued until the optimum harvesting area was obtained. Afterward, the corner vertices V(Xi, Yi) of convex polygon were selected based on the optimum harvesting area.

$$ A = \frac{1}{2}\mathop \sum \limits_{i = 0}^{n - 1} \left( {X_{i} Y_{i + 1} - X_{i + 1} Y_{i} } \right) $$
(10)
Fig. 7
figure 7

Optimum harvesting area of an N-angular shape polygon

2.2.5 Optimum harvesting area of concave polygon by split of convex hull and cross-point method

A method was developed called split of convex hull CH(Q) and cross-point method to estimate the optimum harvesting area of the concave polygon, as shown in Fig. 8. To compute the optimum harvesting area of the concave polygon or concave hull, this method is described by the following steps.

Fig. 8
figure 8

Schematic of a concave hull by the split of convex hull and cross-point method

Step 1: Convex hull CH(Q) was determined from a concave polygon whose outline represents the header end position \( P\left( {p_{0} ,p_{1} \ldots .p_{i} } \right) \) points. The incremental convex hull algorithm was used to create the convex hull from the concave polygon. The optimum area of that convex hull was computed, which provided the corner vertices (Xi, Yi). These corner vertices were stored.

Step 2: When the optimum area of the convex hull was determined, the L-shape data were added into this optimum area of the convex hull, which represents the concave hull \( P\left( {p_{0} ,p_{1} \ldots .p_{1} } \right) \). Afterward, this concave hull was divided into two convex polygons. Again, the convex hull CH(Q) was estimated for each convex polygon. These estimated convex hulls were used to calculate the optimum area of both convex hulls CH(Q). The corner vertices of each optimum area of the convex hull were stored.

Step 3: The cross-point CP(Xi, Yi) was obtained by using Eq. (3) from the optimum area of each convex hull CH(Q). This cross-point CP(Xi, Yi) was stored with the corner vertices V(Xi, Yi) of convex hull CH(Q).

Step 4: Using this cross-point CP(Xi, Yi) and corner vertices V(Xi, Yi) of the concave hull, the optimum area of the concave hull was determined. This estimated optimum area was stored in a memory stack. This procedure was continued until the optimum area of the concave hull was calculated.

Step 5: Finally, the corner vertices V(Xi, Yi) of the concave hull CCH(Q) were obtained when the optimum harvesting area of the concave polygon or concave hull was determined.

2.2.6 Working path and waypoint algorithm

The working path of a robot combine harvester was calculated from the estimated corner vertices (xi, yi) of an optimum harvesting area of a convex or concave polygon field. First, each edge was calculated by using Eq. (11), which is the modified form of the general line equation \( Ax_{i} + By_{i} + C = 0 \), as described in Fig. 9. By using these edges, the operator determines the working direction of the robot combine harvester. The operator can choose any direction, but in general, the longest direction is better than the shortest one owing to the number of turns. In Fig. 9, the longest edge was selected as the working direction of the robot combine harvester. Second, based on header length d and the turning direction, the next path was estimated by using Eq. (12).

$$ y_{i} = ax_{i} + b $$
(11)

where, \( a = \frac{{y_{i} - y_{i + 1} }}{{x_{i} - x_{i + 1} }} \), and \( b = y_{i} - \frac{{y_{i} - y_{i + 1} }}{{x_{i} - x_{i + 1} }}x_{i} \)

$$ y_{i} = ax_{i} + bm $$
(12)

where

$$ bm = \left\{ {\begin{array}{*{20}c} {b + d\sin \left[ {\tan^{ - 1} \left( { - \frac{1}{a}} \right)} \right] - ad\cos \left[ {\tan^{ - 1} \left( { - \frac{1}{a}} \right)} \right] \left( {{\text{for}}\,{\text{right}}\,{\text{turn}}} \right)} \\ {b - d\sin \left[ {\tan^{ - 1} \left( { - \frac{1}{a}} \right)} \right] + ad\cos \left[ {\tan^{ - 1} \left( { - \frac{1}{a}} \right)} \right]\left( {{\text{for}}\,{\text{left}}\,{\text{turn}}} \right)} \\ \end{array} } \right. $$

Third, the cross-point (xc, yc) was determined by using Eq. (13) from the above two lines Eqs. (11) and (12).

$$ \left( {x_{c} ,y_{c} } \right) = \left( {\frac{{b_{i} - bm}}{{a_{i} - a_{i + 1} }}, a_{i} x_{c} + b_{i} } \right) $$
(13)

Finally, the waypoint (x′, y′) for every path was calculated by using the following Eq. (14) where D indicates the distance between the start and end cross-points (xc, yc).

$$ \left( {x^{\prime } ,y^{\prime } } \right) = \left( {x_{i} + \frac{{x_{i + 1} - x_{i} }}{D}, y_{i} + \frac{{y_{i + 1} - y_{i} }}{D}} \right) $$
(14)
Fig. 9
figure 9

Schematic representation of the estimated path for the robot combine harvester

2.2.7 Experiment design

The algorithms were verified by a field experiment of wheat harvesting in the field of Hokkaido University, Japan. The robot combine harvester computer was configured with RTK-GPS and IMU sensors that measured the positions and heading angles during the cutting of surrounding crops for the convex and concave polygon fields. This computer was also installed with Microsoft Visual studio for supporting computer languages. The C/C++ language and Windows API were used to implement the algorithms after obtaining the crop perimeter data or header end positions for generating the optimum area of the convex and concave polygon fields in this research.

3 Results and discussion

3.1 Estimated header end position

The red points in Fig. 10 indicate the location of the RTK-GPS antenna as a result of harvesting the wheat field periphery in manual operation by the robot combine harvester. Afterward, the header’s end position P(XH, YH) was determined using Eq. (1) by using the measured RTK-GPS position points P(Xi, Yi) and IMU heading angle φ, as depicted in Fig. 10. The values a and b can be changed considering the size of the header mounted on the robot combine harvester. The distances a and b taken in Eq. (1) were 2.5 m and 1.6 m, respectively. This estimated header end position P(XH, YH) indicates the actual perimeter or exact outline of wheat in the field that must be harvested by the robot combine harvester.

Fig. 10
figure 10

Estimated header end position from the measured RTK-GPS position P(Xi, Yi) and heading angle φ of the robot combine harvester

3.2 Estimated convex and concave hull

Figure 11a, b shows the vertices of the convex hull CH(Q) that were estimated from the header’s end position P(XH, YH) of the convex polygon field using the incremental convex hull method. For a concave polygon field, the vertices of concave hull CCH(Q) were estimated by using the split of convex hull and cross-point method shown in Fig. 11c. The result revealed that the header’s end position is the finite set of points for both the convex and concave polygon fields, whereas the convex and concave hull give a small set of points of that polygon field, as shown in Fig. 11. The result indicates that the convex and concave hull method reduced the number of point clouds of the crop perimeter and determined the vertices of the convex hull that belong to the crop perimeter position on the boundary or inside the convex and concave polygon fields.

Fig. 11
figure 11

Estimated vertices of convex and concave hull from the crop perimeter of convex and concave polygon fields

3.3 Estimating optimum harvesting area of polygon field

The optimum harvesting area of the convex polygon field was determined from the convex hull of a convex polygon field. When the operator judges that the shape of the crop periphery is a rectangular polygon, the rotating caliper method is used to create an optimum harvesting area of the rectangular field. Figure 12a shows the corner vertices V(Xi, Yi) of an optimum harvesting area of a rectangular polygon field by the rotating caliper method. When the shape of the crop periphery is an arbitrary polygon, the optimum N-polygonal algorithm is used to calculate the corner vertices V(Xi, Yi) of an optimum harvesting area of the convex polygon field by using Eq. (10) with the selected n sides of that polygon, as shown in Fig. 12b. Similarly, the corner vertices V(Xi, Yi) of the concave polygon field are determined by using the split of convex hull and cross-point method, as shown in Fig. 12c. The results revealed that the optimum harvesting area of the convex and concave polygon field considers the curved or meandering parts of the convex and concave polygon field. As a consequence, the robot combine harvester will completely harvest the wheat or paddy crop without leaving any mowing residual in the field.

Fig. 12
figure 12

Estimated optimum harvesting area and corner vertices of convex and concave polygon field

3.4 Comparison of optimum harvesting area of convex polygon field

The optimum harvesting area of a rectangular polygon during a wheat experiment was also calculated by using the optimum N-polygon algorithm, which can be compared with the optimum harvesting area from the rotating caliper method shown in Fig. 13. The estimated optimum harvesting area (green line) of the rectangular polygon from the optimum N-polygon algorithm was 4586.79 m2, whereas the optimum harvesting area (red line) from the rotating caliper method was 4631.63 m2. During harvesting, the area of the wheat field periphery (blue line) from the conventional AB point method was also calculated as 4333.97 m2, which is smaller than the optimum harvesting area of the rectangular polygon field shown in Fig. 13. The area of the rectangular field from the conventional method can sometimes be smaller or larger than the optimum harvesting area because the corner points are taken from an operator’s observations. If the operator is an expert and can take the corner points perfectly, then the harvesting map will be accurate, and the robot combine harvester will harvest the wheat of the entire field. Otherwise, some mowing residual will remain in the field.

Fig. 13
figure 13

Comparison of the optimum harvesting area with the conventional harvesting area of convex polygon field

3.5 Estimated working path of convex and concave polygon field

Figure 14 shows the simulated working path of the robot combine harvester based on the optimum harvesting area of the convex and concave polygon field. This working path was generated from the estimated corner vertices V(Xi, Yi) of the optimum harvesting area of the convex and concave polygon field by using Eqs. (11) and (12) when the header length was 2.5 m, which is the working width of the robot combine harvester. The total working distances for the convex and concave polygon field in Fig. 14 were obtained as 504.06 m and 381.08 m, respectively, while the number of working paths in both fields was 9. Based on these working distances and an average working speed of 1 m/s, the working time was calculated as 8.4 min for the convex polygon field and 6.4 min for the concave polygon field. Afterward, during the experiment in the rectangular wheat field, the working path was estimated based on the corner vertices V(Xi, Yi) from the optimum area method and conventional AB point method, as shown in Fig. 15. In both methods, the total number of working paths for the robot combine harvester was 16. In the AB point method shown in Fig. 15a, the total working distance was counted as 1890.12 m, while the working time was 31.5 min. The total working distance from the optimum area method was counted as 1941.45 m, as shown in Fig. 15b, while the working time was 32.4 min. The results indicated that unlike the optimum area method for a working path, if we provide the working path to the robot combine harvester by using the conventional AB point method, the robot will leave 51.33 m of mowing residual or meandering of wheat in the field. In addition, if we take the corner points based on the conventional AB point method to estimate the working path, the system needs almost 20–25 min to perform calculations. This time can be increased or decreased based on the size of the crop field. On the other hand, the estimated working path based on our proposed optimum area method needs up to 5 min to calculate. Considering these working times and the system estimated time of the working path, the total time was obtained as 56.5 min for the AB point method, whereas the total time for the proposed optimum area method was 37.4 min.

Fig. 14
figure 14

Estimated working path of the convex and concave polygon field

Fig. 15
figure 15

Estimated working path of the robot combine harvester during experiment in a rectangular wheat field

4 Conclusions

Automatic path planning is an important topic for robotic agricultural vehicles. This paper described an automatic path planning algorithm for a robot combine harvester to harvest wheat or paddy that is not in a row. The exact crop outline measured from the RTK-GPS position and IMU heading provides thousands of points, whose number is reduced by using the incremental convex hull method. Using an estimated convex hull, the optimum harvesting area of a polygon is determined by the rotating caliper and the developed optimum N-polygon algorithm, which is a better optimization of an area than when using the conventional AB point method. Unlike the conventional AB point method, the developed algorithm calculates an optimum harvesting area of the polygon that covers the entirely of the remaining crop and provides appropriate corner vertices. These corner vertices are used to calculate a working path for the robot combine harvester, which is more effective than the working path obtained from the conventional AB point method. The harvesting of a crop based on the working path from the conventional method is not sufficient and depends highly on the operator’s visual accuracy. This problem is completely solved by using the developed algorithm in this research. In addition, the work path estimated based on the conventional AB point method needs more times to process all of the information, whereas the developed algorithm requires only a few minutes. Finally, we conclude that the developed algorithm reduces the operational processing time and completely removes the crop losses during a harvesting operation performed in the field by the robot combine harvester in real time.