Agricultural machine operation path planning method, device and equipment
By using obstacle isolation and segmentation and region segmentation methods, the operation path of agricultural machinery is determined, which solves the path planning problem in the obstacle scenario of farmland and realizes efficient and safe path planning for agricultural machinery operations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI ALLYNAV TECH CO LTD
- Filing Date
- 2026-01-14
- Publication Date
- 2026-06-05
Smart Images

Figure CN122149433A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus and equipment for agricultural machinery operation path planning. Background Technology
[0002] With the development of agricultural mechanization and intelligence, automated agricultural machinery operations have placed higher demands on the accuracy, safety and efficiency of path planning.
[0003] When agricultural machinery operates on polygonal plots of farmland, the generally planned operation paths mostly focus on scenarios where there are no obstacles in the farmland, or the handling of obstacles is limited to simple avoidance. For example, if obstacles are encountered during operation, the agricultural machinery is manually operated to avoid the obstacles.
[0004] However, when dealing with scenarios where there are obstacles in farmland, the above technologies suffer from the problem that the planned agricultural machinery operation paths are not reasonable enough. Summary of the Invention
[0005] This invention provides a method, apparatus, and equipment for planning agricultural machinery operation paths, which addresses the shortcomings of existing technologies in planning agricultural machinery operation paths in scenarios with obstacles in farmland. The invention achieves the solution of the operation path planning problem for plots containing internal independent obstacles through the process of "obstacle isolation and segmentation - obstacle-free operation area screening - optimal operation direction path planning - path integration", making the agricultural machinery operation paths planned for farmland with obstacles more reasonable.
[0006] This invention provides a method for agricultural machinery operation path planning, comprising: Obtain the first boundary vertices and their first positions corresponding to the boundaries of the farmland plots, and obtain the second boundary vertices and their second positions corresponding to the boundaries of each obstacle in the farmland plots. Based on each first position and each second position, determine the valid starting point corresponding to each obstacle; The area division line is determined by connecting each valid starting point with the boundary of the farmland plot, and the farmland plot is divided into multiple work areas by the area division line; each work area does not include obstacles. Based on the range of the operation direction angle corresponding to the farmland plot and the third boundary vertex and its third position corresponding to the boundary of each operation area, determine the target operation direction angle corresponding to each operation area; Based on the target operating direction angle of each operating area, the operating path of agricultural machinery in each operating area is planned.
[0007] According to the agricultural machinery operation path planning method provided by the present invention, the above-mentioned determination of the effective starting point corresponding to each obstacle based on each first position and each second position includes: Based on each first position, determine the first boundary line segment corresponding to each boundary of the farmland plot; Based on the second position of each obstacle, determine the longest boundary in each obstacle, and based on the two second boundary vertices corresponding to the longest boundary, determine the first reference direction and the second reference direction; the first reference direction is opposite to the second reference direction. Calculate the first distance from each second position of each obstacle to each first boundary segment in the first reference direction of the corresponding obstacle, and the second distance from each second position to each first boundary segment in the second reference direction of the corresponding obstacle; The effective starting point for each obstacle is determined based on the first distance and the second distance for each obstacle.
[0008] According to the agricultural machinery operation path planning method provided by the present invention, the above-mentioned determination of the effective starting point corresponding to each obstacle based on each first distance and each second distance of each obstacle includes: For each obstacle, select the minimum distance from each first distance and each second distance, and take the second boundary vertex corresponding to the minimum distance as the initial starting point of the obstacle; Determine the midpoint corresponding to the longest boundary of each obstacle based on the two second boundary vertices of the longest boundary of each obstacle and the corresponding second position; Determine the valid starting point for each obstacle based on its initial starting point and midpoint.
[0009] According to the agricultural machinery operation path planning method provided by the present invention, the above-mentioned determination of the effective starting point corresponding to each obstacle based on the initial starting point and midpoint of each obstacle includes: Calculate the straight-line distance between any two points, including the initial starting point and midpoint, of each obstacle; Based on the straight-line distances and the working width of the agricultural machinery, the effective starting point corresponding to each obstacle is selected from the initial starting point and midpoint of each obstacle.
[0010] According to the agricultural machinery operation path planning method provided by the present invention, the above-mentioned method for determining the target operation direction angle corresponding to each operation area based on the operation direction angle range corresponding to the farmland plot and the third boundary vertices and their third positions corresponding to the boundary of each operation area includes: For each work area, the range of work direction angles corresponding to the farmland plots is obtained and the range of work direction angles is discretely sampled to obtain multiple candidate work direction angles; For each candidate operation direction angle, based on the third boundary vertices and their third positions corresponding to the boundary of the operation area, multiple line segments with the included angle of the candidate operation direction angle and parallel to each other are generated in the operation area. Based on the length of each line segment in the operation area, the total operation length of the operation area under the candidate operation direction angle is determined. Based on the total working length of the working area under each candidate working direction angle, determine the target working direction angle corresponding to the working area from among the candidate working direction angles.
[0011] According to a method for agricultural machinery operation path planning provided by the present invention, obtaining the range of operation direction angles corresponding to the farmland plot includes: Obtain visual images of farmland plots and the initial range of operational orientation angles; Visual images are identified to determine the planting direction of the crops corresponding to the farmland plots; Based on the planting direction, the operating direction angle range corresponding to the planting direction is determined within the initial operating direction angle range, and the operating direction angle range corresponding to the planting direction is taken as the operating direction angle range corresponding to the farmland plot; the operating direction angle range corresponding to the farmland plot is smaller than the initial operating direction angle range.
[0012] According to the agricultural machinery operation path planning method provided by the present invention, the above-mentioned generation of multiple line segments with the included angle being the candidate operation direction angle and parallel to each other within the operation area based on each third boundary vertex corresponding to the boundary of the operation area and its third position, includes: Based on any candidate point and candidate operation direction angle within the operation area, generate the first straight line that passes through the candidate point and has an angle equal to the candidate operation direction angle. Determine the normal direction angle perpendicular to the candidate operation direction angle based on the candidate operation direction angle, and generate a second straight line passing through the candidate point and with an angle equal to the normal direction angle of the candidate operation direction angle based on the candidate point and the normal direction angle of the candidate operation direction angle. The third position of each third boundary vertex of the working area is projected onto the second straight line, and the intercept range is determined according to the equations corresponding to each projection point and the first straight line. Based on the intercept range and the working width of the agricultural machinery, generate all straight lines parallel to the first straight line within the working area, and generate line segments corresponding to each straight line within the working area based on all straight lines parallel to the first straight line within the working area and the boundary of the working area.
[0013] According to the agricultural machinery operation path planning method provided by the present invention, the above-mentioned planning of the operation path of agricultural machinery in each operation area based on the target operation direction angle of each operation area includes: Based on the working width of the agricultural machinery and the target working direction angle of each working area, a working path corresponding to the working area is generated in each working area along the corresponding target working direction angle; Extract the starting point and ending point of the operation path in each operation area, and construct a node network based on each starting point and ending point. A path search algorithm is used to search for connecting paths between different work areas in the node network; Based on the operation paths and connection paths of each operation area, the total operation path for agricultural machinery to operate between each operation area is generated.
[0014] The present invention also provides an agricultural machinery operation path planning device, comprising the following modules: The location acquisition module is used to acquire each first boundary vertex and its first position corresponding to the boundary of the farmland plot, and to acquire each second boundary vertex and its second position corresponding to the boundary of each obstacle in the farmland plot. The starting point filtering module is used to determine the valid starting point corresponding to each obstacle based on each first position and each second position; The area segmentation module is used to determine the area segmentation line based on the line connecting each valid starting point to the boundary of the farmland plot, and to divide the farmland plot into multiple working areas through the area segmentation line; each working area does not contain obstacles; The orientation angle determination module is used to determine the target operation orientation angle for each operation area based on the operation orientation angle range corresponding to the farmland plot and the third boundary vertex and its third position corresponding to the boundary of each operation area. The operation path planning module is used to plan the operation path of agricultural machinery in each operation area based on the target operation direction angle of each operation area.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the agricultural machinery operation path planning method as described above.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the agricultural machinery operation path planning method as described above.
[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the agricultural machinery operation path planning method as described above.
[0018] The agricultural machinery operation path planning method, apparatus, and equipment provided by this invention obtains the first boundary vertices and their first positions corresponding to the boundaries of farmland plots, and the second boundary vertices and their second positions corresponding to the boundaries of each obstacle in the farmland plot. Based on the first and second positions, an effective starting point for each obstacle is determined. A region division line is determined based on the line connecting each effective starting point to the boundary of the farmland plot. The farmland plot is then divided into multiple operation areas, none of which contain obstacles, using the region division line. Based on the operation direction angle range corresponding to the farmland plot and the third boundary vertices and their third positions corresponding to the boundaries of each operation area, a target operation direction angle corresponding to each operation area is determined. The operation path of the agricultural machinery within each operation area is planned based on the target operation direction angle of each operation area. This method allows for agricultural machinery operation path planning on farmland plots containing obstacles through a fully automated process of "obstacle isolation and segmentation - obstacle-free operation area screening - optimal operation direction path planning - path integration." This results in more reasonable agricultural machinery operation paths for farmland with obstacles and improves the efficiency of operation path planning for complex plots with obstacles. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is one of the flowcharts of the agricultural machinery operation path planning method provided by the present invention.
[0021] Figure 2 This is a schematic diagram of the initial farmland plot boundary and the initial obstacle boundary before expansion provided by the present invention.
[0022] Figure 3 This is a schematic diagram of the expanded farmland plot boundary and obstacle boundary provided by the present invention.
[0023] Figure 4 This is a schematic diagram of dividing farmland into multiple work areas provided by the present invention.
[0024] Figure 5 This is the second flowchart of the agricultural machinery operation path planning method provided by the present invention.
[0025] Figure 6 This is a schematic diagram of the final generated agricultural machinery operation path provided by the present invention.
[0026] Figure 7This is a schematic diagram of the agricultural machinery operation path planning device provided by the present invention.
[0027] Figure 8 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0029] With the development of agricultural mechanization and intelligence, automated agricultural machinery operations place higher demands on the accuracy, safety, and efficiency of path planning. Current technologies for path planning on polygonal plots often focus on obstacle-free scenarios, or only handle obstacles at a simple avoidance level, failing to form a complete logical chain of "obstacle isolation - area segmentation - path generation." Specifically, current technologies have the following shortcomings: First, they do not clearly isolate internal obstacles into independent, impassable areas using precise dividing lines, making it difficult to generate continuous and safe operating paths. Second, the selection of dividing line starting points lacks systematic rules, often relying on random or heuristic selection, easily resulting in elongated, small-area, or topologically complex sub-regions, significantly increasing the difficulty of subsequent path planning. Third, the segmentation and planning processes are disconnected; a collaborative mechanism of "first segmenting into obstacle-free operating sub-regions, then independently optimizing the direction and generating paths for each sub-region" has not been established, resulting in high path repetition rates, numerous blind spots, frequent turning, and even the risk of collisions between agricultural machinery and obstacles. Therefore, there is an urgent need for a technical solution that can achieve the integration of "obstacle isolation and segmentation - obstacle-free sub-area screening - optimal operation direction path planning - path integration" to systematically solve the problem of full coverage, high efficiency and low risk operation path planning for plots containing internal independent obstacles, and fill the gap in existing technology.
[0030] This invention provides a method, apparatus, and equipment for agricultural machinery operation path planning, which is applied to the autonomous navigation and efficient operation of agricultural machinery (such as tractors, harvesters, plant protection machines, etc.) in complex field environments. By integrating geographic information modeling, geometric segmentation, coverage path optimization, and path integration strategies, it can solve the problem of full coverage, no omissions, and low repetition in farmland with independent obstacles (such as trees, utility poles, ponds, etc.), and is suitable for smart agriculture, precision agriculture, and unmanned farm scenarios.
[0031] It should be noted that the execution subject of the embodiments of the present invention may be an agricultural machinery operation path planning device, or an electronic device, or other devices or equipment. The following embodiments will use an electronic device as the execution subject as an example for illustration. The electronic device may be a terminal or a server.
[0032] Figure 1 This is one of the flowcharts illustrating the agricultural machinery operation path planning method provided by the present invention, such as... Figure 1 As shown, the method includes the following steps: Step 102: Obtain the first boundary vertices and their first positions corresponding to the boundaries of the farmland plots, and obtain the second boundary vertices and their second positions corresponding to the boundaries of each obstacle in the farmland plots.
[0033] Before planning a work path for a specific farmland plot, a GNSS (Global Navigation Satellite System) positioning module can be used to collect the planar coordinates of the boundary vertices of the farmland plot. This obtains the individual boundary vertices and their coordinates, ensuring that the boundary vertices are arranged in a clockwise or counterclockwise order to form the initial farmland plot boundary. Simultaneously, visual sensors (such as high-definition cameras) or LiDAR can be used to scan for obstacles within the farmland plot. These obstacles can be those that are "unconnected and do not intersect with the initial farmland plot boundary," obtaining the boundary vertices and their coordinates for each obstacle to form the initial obstacle boundary.
[0034] Then, a "plot-obstacle composite model" can be constructed. Specifically, the initial farmland plot boundary can be expanded inwards by a preset safety distance, and the initial obstacle boundary can be expanded outwards by a preset safety distance and integrated. The "operable area" (i.e., the area after the initial plot area has been expanded) and the "impeded area" (i.e., the area after the obstacle expansion) can be marked. After expanding the initial farmland plot boundary, a new farmland plot boundary is obtained, along with its vertices and coordinates. Each vertex of the new farmland plot boundary can be designated as the first boundary vertex, and its coordinates as the first position. Similarly, after expanding the initial obstacle boundary, a new obstacle boundary is obtained, along with its vertices and coordinates. Each vertex of the new obstacle boundary can be designated as the second boundary vertex, and its coordinates as the second position. For example, a schematic diagram of the initial farmland plot boundary and the initial obstacle boundary before expansion can be found here. Figure 2 As shown, a schematic diagram of the expanded farmland plot boundaries and obstacle boundaries can be found in [reference needed]. Figure 3As shown, P0-P3 are the first boundary vertices of the expanded farmland plots, and O a1 -O a3 For each of the second boundary vertices of the obstacle boundary of the first obstacle after expansion, O b1 -O b3 These are the second boundary vertices of the obstacle boundary after the expansion. By expanding the initial farmland plot boundary inward and the initial obstacle boundary outward, collisions with obstacles or exceeding the farmland plot boundaries during subsequent agricultural machinery operations can be avoided, making the planned operation path more reasonable and accurate.
[0035] Furthermore, the shape of the farmland plots requiring operational path planning can be set according to the actual situation; for example, it can be any polygon, such as a concave shape. The number of obstacles in the farmland plots can be one or more, and the shape of each obstacle is not specifically limited.
[0036] Step 104: Determine the valid starting point corresponding to each obstacle based on each first position and each second position.
[0037] In this step, after obtaining each first boundary vertex and its first position on the farmland plot boundary and each second boundary vertex and its second position on the obstacle boundary, for each obstacle, the distance between each second position and the boundary formed between each first position can be directly calculated based on each first position and each second position, or the distance between each second position and the boundary formed between each first position can be calculated based on the reference direction. Then, one or more second boundary vertices that are closer to the farmland plot boundary are selected from the second positions of the obstacle, and the selected second boundary vertices are used as the valid starting points of the corresponding obstacles.
[0038] Alternatively, based on each first position and each second position, the distance between the midpoint of the boundary formed by each second position and the boundary formed between each first position can be calculated, and one or more midpoints that are closer to the farmland boundary can be selected from the midpoints of the boundaries formed by each second position of the obstacle, and the selected midpoints can be used as the valid starting point of the corresponding obstacle.
[0039] Step 106: Determine the area division line based on the line connecting each valid starting point to the boundary of the farmland plot, and divide the farmland plot into multiple work areas using the area division line; each work area does not include obstacles.
[0040] In this step, after determining the effective starting points of each obstacle, these effective starting points are generally close to the boundaries of the farmland plots. Each effective starting point can be perpendicular to the boundary of the nearest farmland plot or perpendicular to the reference direction. The obtained perpendicular lines can be used as area dividing lines, and then the farmland plots can be divided into multiple working areas through each area dividing line.
[0041] Specifically, all area dividing lines can be used as new edges, together with the boundaries of farmland plots and obstacle boundaries, to form a plan view. All connected surfaces without obstacles in this plan view are extracted according to the set filtering conditions, which are used as working areas without obstacles, or can be recorded as "barrier-free independent sub-areas" to be planned. The set filtering conditions here include: (1) the area ≥ the working width of the agricultural machinery × the set value; (2) the minimum width of the area in any direction ≥ the working width of the agricultural machinery. Among them, the working width of the agricultural machinery in the area judgment condition can be the minimum working width of the agricultural machinery, such as 2 meters. The set value can represent the length of the agricultural machinery, which can be determined according to the actual length of the agricultural machinery, such as 5 meters. Then the area in the above area judgment condition is ≥ 2 × 5 = 10 square meters. Generally, the working areas to be screened need to meet the above two conditions at the same time.
[0042] For example, see Figure 4 The diagram shown divides farmland into multiple work areas, assuming that the land is divided into three work areas: S1, S2, and S3, and that none of the three work areas contain obstacles.
[0043] Step 108: Determine the target operating direction angle for each operating area based on the range of operating direction angles corresponding to the farmland plots and the third boundary vertices and their third positions corresponding to the boundaries of each operating area.
[0044] In this step, after obtaining each work area, the boundary vertices and their positions of each work area can be calculated using the first boundary vertices and their first positions of the farmland plot boundaries, and the second boundary vertices and their second positions of the obstacle boundaries. These are denoted as the third boundary vertices and their third positions.
[0045] Simultaneously, a range of operating directional angles can be pre-determined for each farmland plot. The optimal operating directional angle for each operating area within the farmland plot can be determined within this range. The operating directional angle range for each farmland plot can be pre-determined by the operating directional angle range of the agricultural machinery, for example, set to 0°-180°, or determined based on the planting direction of the crops to be planted in the farmland plot, or determined using other methods. This operating directional angle range can include multiple discrete operating directional angles. For each operating area, the third position of each third boundary vertex of the operating area can be used as the area boundary constraint condition to generate an operating path under each operating directional angle within the operating area. Then, using the operating paths under each operating directional angle, the operating directional angle with the highest operating coverage is selected from among the operating directional angles and taken as the optimal operating directional angle for the corresponding operating area, denoted as the target operating directional angle.
[0046] It is understandable that the optimal operating direction angle determined for each operating area can be different, meaning that the agricultural machinery can use the corresponding optimal operating direction angle to operate in each operating area, thus maximizing the operating coverage of the agricultural machinery.
[0047] Step 110: Based on the target operating direction angle of each operating area, plan the operating path of the agricultural machinery in each operating area.
[0048] In this step, after determining the target working direction angle for each working area, a reciprocating working path along the target working direction angle can be planned and generated for each working area. Then, the agricultural machinery can complete the work in each working area according to the planned working path, thus realizing the operation of the farmland.
[0049] In this embodiment, by acquiring the first boundary vertices and their first positions corresponding to the boundaries of the farmland plot, and the second boundary vertices and their second positions corresponding to the boundaries of each obstacle in the farmland plot, the effective starting point of each obstacle is determined based on the first and second positions. A region division line is determined based on the line connecting each effective starting point to the boundary of the farmland plot, and the farmland plot is divided into multiple work areas that do not contain obstacles using the region division line. The target work direction angle corresponding to each work area is determined based on the range of work direction angles corresponding to the farmland plot and the third boundary vertices and their third positions corresponding to the boundaries of each work area. The work path of the agricultural machinery in each work area is planned based on the target work direction angle of each work area. In this method, since agricultural machinery work path planning for farmland plots containing obstacles can be performed through a fully automated process of "obstacle isolation and segmentation - obstacle-free work area screening - optimal work direction path planning - path integration," the planned agricultural machinery work paths for farmland with obstacles are more reasonable and the efficiency of work path planning for complex plots with obstacles can be improved.
[0050] The above embodiments mention several implementation methods for determining the effective starting point corresponding to each obstacle based on the first position of each vertex of the farmland plot boundary and the second position of each vertex of the obstacle boundary. The following embodiments will describe one of the implementation methods in detail.
[0051] In one embodiment, step 104 above, which determines the effective starting point corresponding to each obstacle based on each first position and each second position, may include: Step A1: Based on each first position, determine the first boundary line segment corresponding to each boundary of the farmland plot.
[0052] Specifically, based on the first position of each first boundary vertex of the farmland plot boundary, the first positions of the two first boundary vertices of each boundary of the farmland plot can be obtained. Then, the straight line equation corresponding to the boundary can be calculated through the two first positions, and the straight line corresponding to the boundary can be obtained. All of these are denoted as the first boundary line segments.
[0053] Step A2: Based on the second position of each obstacle, determine the longest boundary in each obstacle, and based on the two second boundary vertices corresponding to the longest boundary, determine the first reference direction and the second reference direction; the first reference direction is opposite to the second reference direction.
[0054] Specifically, based on the second position of each second boundary vertex of the obstacle boundary, the second positions of the two second boundary vertices of each boundary of the obstacle can be obtained. Then, the length of the corresponding boundary can be calculated through the two second positions. In this way, the lengths of multiple boundaries of each obstacle can be obtained. Then, the lengths are compared to obtain the longest length from the multiple boundaries of each obstacle. The boundary corresponding to the longest length is the longest boundary of the obstacle.
[0055] Then, for each obstacle, the direction of the longest boundary of the obstacle is used as the dividing reference direction. This direction includes two reference directions with opposite directions, namely the first reference direction and the second reference direction. The first reference direction is the direction from the start point to the end point of the longest boundary, and the second reference direction is the direction from the end point to the start point of the longest boundary.
[0056] Step A3: Calculate the first distance from each second position of each obstacle to each first boundary segment in the first reference direction of the corresponding obstacle, and the second distance from each second position to each first boundary segment in the second reference direction of the corresponding obstacle.
[0057] For each obstacle, after determining the two reference directions of the obstacle, the distance from each second boundary vertex of the obstacle to the boundary of the farmland plot can be calculated in the two reference directions based on the second position of each second boundary vertex of the obstacle. The distance calculated in the first reference direction is recorded as the first distance, and the distance calculated in the second reference direction is recorded as the second distance. In this way, each second boundary vertex of the obstacle can obtain two distances, namely a first distance and a second distance.
[0058] To calculate the distance from the boundary vertex of an obstacle to the boundary of a farmland plot, one can first calculate the straight line equations corresponding to each boundary of the farmland plot using the boundary vertex of the farmland plot. Then, by calculating the straight line equations from the boundary vertex of the obstacle to the boundary of the farmland plot using the position of the boundary vertex of the obstacle, the distance from the boundary vertex of the obstacle to the boundary of the farmland plot can be obtained.
[0059] Step A4: Determine the valid starting point for each obstacle based on its first distance and second distance.
[0060] In this process, after obtaining the distances of each second boundary vertex of each obstacle to the obstacle in two reference directions, the first and second distances of the obstacle can be compared, and the second boundary vertex corresponding to the distance that meets the requirements can be selected as the valid starting point for that obstacle. The required distances can be, for example, the minimum distance, or a distance greater than the working width of the agricultural machinery.
[0061] Optionally, determining the valid starting point for each obstacle in this step, based on each first distance and each second distance, may include: For each obstacle, select the minimum distance from each first distance and each second distance, and take the second boundary vertex corresponding to the minimum distance as the initial starting point of the obstacle; Determine the midpoint corresponding to the longest boundary of each obstacle based on the two second boundary vertices of the longest boundary of each obstacle and the corresponding second position; Determine the valid starting point for each obstacle based on its initial starting point and midpoint.
[0062] This process involves comparing the first and second distances of each obstacle, selecting the minimum distance, and using the second boundary vertex corresponding to the minimum distance as the initial starting point of the obstacle. If multiple second boundary vertices have equal distances and all represent the minimum distance, all are retained. Then, the midpoint and its position of the longest boundary of the obstacle are calculated from the second positions corresponding to the two second boundary vertices, and this midpoint position is denoted as the midpoint position. The initial starting point and midpoint of the obstacle can then be used together as the valid starting point of the obstacle, or redundant points can be further eliminated from the initial starting point and midpoint, and the final point obtained is used as the valid starting point of the obstacle.
[0063] In cases where redundant points are further eliminated from the initial starting point and midpoint of the obstacle, and the final point is used as the valid starting point of the obstacle, optionally, the above determination of the valid starting point for each obstacle based on its initial starting point and midpoint may include: Calculate the straight-line distance between any two points, including the initial starting point and midpoint, of each obstacle; Based on the straight-line distances and the working width of the agricultural machinery, the effective starting point corresponding to each obstacle is selected from the initial starting point and midpoint of each obstacle.
[0064] After obtaining the initial starting point and midpoint of the obstacle, the straight-line distance between any two points can be calculated. This can be done by examining the positions of the two points. Then, the straight-line distance between any two points on the obstacle is compared to the working width of the agricultural machinery. If the straight-line distance between any two points is less than the working width, only the point closer to the working area is retained. Conversely, if any two straight-line distances are equal, only the two points corresponding to that straight-line distance are retained. The final selected points can be used as valid starting points for the obstacle.
[0065] In this embodiment, two reference directions are first determined by the longest boundary vertex of the obstacle. Then, the distance from each vertex of each obstacle along the two reference directions to the plot boundary is calculated. The effective starting point of the obstacle is determined by the two distances of each obstacle vertex. This allows for the rapid selection of suitable segmentation starting points to set the work area division lines. Furthermore, by using the vertex corresponding to the minimum distance in the two reference directions as the initial starting point, and combining this with the midpoint of the longest boundary of the obstacle to determine the effective starting point, the determined effective starting point is more reasonable and comprehensive. Further, by calculating the straight-line distance between each initial starting point and the midpoint, and using each straight-line distance and the agricultural machinery operating width to select the effective starting point of the obstacle, the determined effective starting point is more consistent with the actual situation of agricultural machinery operation, resulting in a more accurate division of the work area and improved agricultural machinery operation efficiency.
[0066] The above embodiments briefly illustrate the process of selecting the optimal working direction angle within the working direction angle range corresponding to the farmland plot. The following embodiments will explain the specific implementation process of selecting the optimal working direction angle within the working direction angle range corresponding to the farmland plot.
[0067] Figure 5 This is the second flowchart of the agricultural machinery operation path planning method provided by the present invention, as shown below. Figure 5 As shown, step 108 above, which determines the target operating direction angle for each operating area based on the range of operating direction angles corresponding to the farmland plots and the third boundary vertices and their third positions corresponding to the boundaries of each operating area, may include the following steps: Step 502: For each work area, obtain the range of work direction angles corresponding to the farmland plots and perform discrete sampling on the range of work direction angles to obtain multiple candidate work direction angles.
[0068] The method for determining the range of the working direction angle corresponding to the farmland plot can be as follows: Method 1: First, obtain the range of the working direction angles that can be filtered in the working area of the agricultural machinery, and use this range of working direction angles as the working direction angle range corresponding to the farmland plot. Its size can be set according to the actual situation.
[0069] Method 2: Alternatively, a visual image of the farmland plot and an initial operating direction angle range can be obtained; the visual image can be identified to determine the planting direction of the corresponding crop for the farmland plot; based on the planting direction, the operating direction angle range corresponding to the planting direction can be determined within the initial operating direction angle range, and the operating direction angle range corresponding to the planting direction can be used as the operating direction angle range corresponding to the farmland plot; the operating direction angle range corresponding to the farmland plot is smaller than the initial operating direction angle range.
[0070] This process involves using visual sensors (such as high-definition cameras) to capture visual images of farmland plots. Image recognition algorithms or neural networks are then used to identify the planting direction of the crops to be planted within these images, thus determining the corresponding planting direction. Simultaneously, an initial operating direction angle range can be obtained. This range can be, for example, a filterable range of operating direction angles for the agricultural machinery within the operating area, such as 0°-180°. The planting direction angle corresponding to the planting direction can then be determined based on the planting direction. For instance, for crops planted in a north-south direction, the planting direction angle could be 90°. This planting direction angle can then be expanded within the initial operating direction angle range using preset expansion ranges (such as ±10°, ±20°, ±30°, etc.) to obtain an expanded planting direction angle range. It is crucial that this expanded range remains within the initial operating direction angle range. The final obtained planting direction angle range can be used as the operating direction angle range corresponding to the farmland plot, and it is smaller than the initial operating direction angle range. By narrowing down the range of operational direction angles by the planting direction of farmland plots, the optimal operational direction angle for each subsequent operational area can be selected, thereby improving the efficiency and accuracy of the selection process.
[0071] Then, the range of operating direction angles can be discretely sampled to obtain multiple candidate operating direction angles. For example, theta∈[0,pi), where [0,pi) is the range of operating direction angles, pi represents 180°, and theta is a discrete candidate operating direction angle, such as 0°, 10°, 20°, ... , or theta∈[60°,120°], where theta is a discrete candidate operating direction angle, such as 60°, 70°, 80°, 90°, 100°, ... , and the candidate operating direction angle can be the angle between the main axis direction of agricultural machinery operation and the horizontal direction.
[0072] Step 504: For each candidate operation direction angle, based on the third boundary vertices and their third positions corresponding to the boundary of the operation area, generate multiple line segments in the operation area with the included angle of the candidate operation direction angle and parallel to each other, and determine the total operation length of the operation area under the candidate operation direction angle based on the length of each line segment in the operation area.
[0073] Specifically, for each work area, after obtaining multiple discrete candidate work direction angles, for each candidate work direction angle, multiple straight lines with the included angle of the candidate work direction angle and parallel to each other can be generated within the work area. Then, the third position of each third boundary vertex of the work area can be used as the area boundary constraint condition to cut off these multiple parallel straight lines, restricting these multiple straight lines within the work area to obtain multiple parallel line segments. The lengths of these multiple parallel line segments are added together to obtain the line segment sum value, which can be used as the total work length of the agricultural machinery under the candidate work direction angle in the work area.
[0074] Optionally, in the specific process of obtaining multiple parallel line segments, this step may include generating multiple line segments within the work area that have an included angle equal to the candidate work direction angle and are parallel to each other, based on the third boundary vertices corresponding to the boundary of the work area and their third positions. Based on any candidate point and candidate operation direction angle within the operation area, generate the first straight line that passes through the candidate point and has an angle equal to the candidate operation direction angle. Determine the normal direction angle perpendicular to the candidate operation direction angle based on the candidate operation direction angle, and generate a second straight line passing through the candidate point and with an angle equal to the normal direction angle of the candidate operation direction angle based on the candidate point and the normal direction angle of the candidate operation direction angle. The third position of each third boundary vertex of the working area is projected onto the second straight line, and the intercept range is determined according to the equations corresponding to each projection point and the first straight line. Based on the intercept range and the working width of the agricultural machinery, generate all straight lines parallel to the first straight line within the working area, and generate line segments corresponding to each straight line within the working area based on all straight lines parallel to the first straight line within the working area and the boundary of the working area.
[0075] For each candidate operation direction angle in each operation area, a point can be randomly selected as a candidate point within the operation area. A straight line passing through the candidate point and with the included angle equal to the candidate operation direction angle is generated using the position of the candidate point and the candidate operation direction angle. This straight line is denoted as the first straight line. The equation of the first straight line can be expressed as L: Ax + By + C = 0, where the parameters A, B, and C can all be calculated using the aforementioned candidate operation direction angle and the position of the candidate point.
[0076] Simultaneously, when determining the pre-set range of the working direction angle, the range of the normal direction angle can also be determined, which can also be set to [0, pi), and multiple normal direction angles can be discretized. In this embodiment, when determining a candidate working direction angle, the corresponding normal direction angle can also be determined, denoted as theta. TThe normal direction angle refers to the angle between the direction perpendicular to the first straight line corresponding to the candidate operation direction angle and the horizontal direction, which can be obtained by adding or subtracting 90° from the candidate operation direction angle. After obtaining the normal direction angle corresponding to the candidate operation direction angle, a straight line passing through the candidate point and with an angle equal to the normal direction angle can be generated using the position of the candidate point and the normal direction angle. This straight line is denoted as the second straight line, and its equation can be expressed as: L T A T x+B T y+C T =0, where parameter A T B T C T All of these can be calculated using the normal direction angle and the position of the candidate point as described above.
[0077] Then, each third boundary vertex of the working area is projected onto the second straight line. Using the third position of each third boundary vertex and the corresponding equation of the second straight line, the projection point of the third position of each third boundary vertex on the second straight line is calculated. These projection points are then substituted into the equation of the first straight line to obtain multiple C values. Then, the minimum value p_min and the maximum value p_max among the multiple C values are found and a range of intercepts is formed, denoted as [p_min, p_max].
[0078] Then, the operating width d of the agricultural machinery is obtained, and a series of offset constants c are generated based on the intercept range and the operating width of the agricultural machinery. k , where c k =p_min+k×d, k=0,1,2,...,K, where K is the expression that satisfies c k The largest integer ≤ p_max. Then, the first straight line can be translated according to the aforementioned offset constants, thus generating all straight lines parallel to the first straight line within the working area. Then, the third position of each third boundary vertex of the working area can be used as the region boundary constraint condition to truncate these parallel straight lines, restricting them to the working area. Specifically, for each parallel straight line, its intersection point with the boundary of the working area can be calculated, and after sorting, several or more parallel line segments can be formed.
[0079] Step 506: Based on the total working length of the working area under each candidate working direction angle, determine the target working direction angle corresponding to the working area among each candidate working direction angle.
[0080] In this step, following the method described above, the total working length L(theta) of each working area under each candidate working direction angle can be obtained. Then, the total working lengths of each candidate working direction angle can be compared to obtain the maximum total working length. The candidate working direction angle corresponding to the maximum total working length is taken as the optimal working direction angle for that working area, i.e., the target working direction angle theta. By following the above method, the optimal working direction angle can be determined for each working area. By selecting the working direction angle with the maximum working length for subsequent operations, the maximum working coverage within the working area can be achieved.
[0081] In this embodiment, for each candidate work direction angle within the work direction range, multiple parallel line segments with included angles equal to the candidate work direction angle are generated within the work area using the coordinates of each vertex of the work area. The total work length under each candidate work direction angle is calculated accordingly, and the optimal work direction angle is determined based on the total work length under each candidate work direction angle. This achieves maximum work coverage within the work area. Furthermore, for any point within the work area, a corresponding straight line is generated using the candidate work direction angle and its normal direction angle. The vertex coordinates of the work area are projected onto the line generated by the normal direction angle to generate an intercept range. Combined with the agricultural machinery work width, multiple parallel line segments are generated. This allows for the rapid generation of multiple parallel line segments within the work area, improving the efficiency of determining the optimal work direction angle within the work area.
[0082] The above embodiments mentioned the planning of work paths for each work area by determining the optimal work direction angle of the work area. The following embodiments will describe one implementation method for planning the work paths of each work area.
[0083] In one embodiment, the step 110 above, which plans the working path of the agricultural machinery in each working area based on the target working direction angle of each working area, may include: Based on the working width of the agricultural machinery and the target working direction angle of each working area, a working path corresponding to the working area is generated in each working area along the corresponding target working direction angle; Extract the starting point and ending point of the operation path in each operation area, and construct a node network based on each starting point and ending point. A path search algorithm is used to search for connecting paths between different work areas in the node network; Based on the operation paths and connection paths of each operation area, the total operation path for agricultural machinery to operate between each operation area is generated.
[0084] After obtaining the target operating direction angle for each work area, a set of work lines with the target operating direction angle as the travel direction can be generated at intervals of the agricultural machinery's working width d. For each work line, it is trimmed to the interior of the corresponding work area, and road segments less than 0.5d from the boundary of the work area (including farmland boundaries, obstacle safety restricted area boundaries, and area dividing lines) are removed to obtain the main work path segment. For each boundary (outer boundary and inner boundary) of each work area, it is offset inward by distances d and 2d respectively to generate the first and second rings of sealing paths to avoid missed cutting / work. Then, the main work path segment and the sealing path of each work area are spliced together according to the work sequence to form the complete work path within each work area.
[0085] Then, the entry point (start of the first segment) and exit point (end of the last segment) of the work path in each work area can be extracted as path nodes, and a node network can be constructed based on each path node. A path search algorithm, such as A... The algorithm searches the node network to find the optimal connection path between each work area, such as the shortest connection path between work areas. Then, it integrates the main work path segments, edge sealing paths, and connection paths between all work areas, inserting necessary turning or U-turn segments to form a complete, continuous, and executable overall work path for agricultural machinery operations. For example, a schematic diagram of the final generated overall work path for agricultural machinery operations can be found in [reference needed]. Figure 6 As shown, from left to right, the work areas are S3, S2, and S1. The lower left or upper left corner is the starting point of the agricultural machinery operation, and the lower right corner is the ending point of the agricultural machinery operation. The optimal working direction angle / target working direction angle of each work area is not the same. This makes it easier to maximize the work coverage in each work area. Furthermore, the optimal connection path between each work area can be found by using a node network search. This facilitates the rapid switching of agricultural machinery between work areas and improves the efficiency of inter-area operations.
[0086] In this embodiment, the operation path of each operation area is generated by the operation width of the agricultural machinery and the optimal operation direction angle of each operation area. A node network is constructed by the start and end points of the operation path of each operation area to search for the connection path between each operation area. The total operation path of all operation areas is generated by combining the operation paths of each operation area. This makes it easier for agricultural machinery to quickly switch between operation areas and improves the efficiency of operation between areas.
[0087] In summary, the embodiments of the present invention, through processes such as "obstacle-free sub-region screening - optimal direction path planning - path integration," can effectively solve the problem of generating automatic operation paths for agricultural machinery in complex farmland environments, and realize intelligent segmentation and operation path planning for polygonal plots containing internal independent obstacles, specifically including: Site and obstacle modeling: GNSS and visual / laser sensors are used to collect information on site boundaries and internal obstacles, and a "site-obstacle composite model" including a safety buffer zone is constructed to clearly define workable and impassable areas.
[0088] Obstacle isolation and segmentation: Based on rules such as the nearest vertex and the midpoint of the longest edge, valid starting points are selected, isolation dividing lines are generated, the original plot is divided into multiple connected sub-regions, and suitable "obstacle-free sub-regions to be planned" are selected based on area and minimum width threshold.
[0089] Optimal operation direction calculation: Within each unobstructed sub-region, the optimal operation direction that maximizes the total coverage length of parallel operation paths is automatically searched through orientation angle parameterization and coverage length maximization strategies. This is applicable to any (including concave) geometry.
[0090] Path planning and integration: Generate the main operation path and double-ring edge sealing path in each sub-region to avoid missed cuts; through A The algorithm plans the connecting paths between sub-regions and integrates all path segments to form a continuous, conflict-free, and executable complete agricultural machinery operation trajectory.
[0091] The method of this invention can significantly improve the path planning efficiency and operation coverage of complex plots containing obstacles, and has good engineering practicality and promotion value.
[0092] The agricultural machinery operation path planning device provided by the present invention is described below. The agricultural machinery operation path planning device described below and the agricultural machinery operation path planning method described above can be referred to in correspondence.
[0093] Figure 7 This is a schematic diagram of the agricultural machinery operation path planning device provided by the present invention. See also: Figure 7 As shown, the device may include: The location acquisition module 710 is used to acquire each first boundary vertex and its first position corresponding to the boundary of the farmland plot, and to acquire each second boundary vertex and its second position corresponding to the boundary of each obstacle in the farmland plot. The starting point filtering module 720 is used to determine the valid starting point corresponding to each obstacle based on each first position and each second position; The area segmentation module 730 is used to determine the area segmentation line based on the line connecting each valid starting point to the boundary of the farmland plot, and to divide the farmland plot into multiple working areas through the area segmentation line; each working area does not include obstacles; The orientation angle determination module 740 is used to determine the target operation orientation angle for each operation area based on the operation orientation angle range corresponding to the farmland plot and the third boundary vertex and its third position corresponding to the boundary of each operation area. The operation path planning module 750 is used to plan the operation path of agricultural machinery in each operation area based on the target operation direction angle of each operation area.
[0094] In one embodiment, the starting point filtering module 720 is specifically configured to: determine the first boundary segment corresponding to each boundary of the farmland plot based on each first position; determine the longest boundary in each obstacle based on each second position of each obstacle, and determine the first reference direction and the second reference direction based on the two second boundary vertices corresponding to the longest boundary; the first reference direction is opposite to the second reference direction; calculate the first distance from each second position of each obstacle to each first boundary segment in the first reference direction of the corresponding obstacle, and the second distance from each second position to each first boundary segment in the second reference direction of the corresponding obstacle; and determine the valid starting point corresponding to each obstacle based on each first distance and each second distance.
[0095] Optionally, the aforementioned starting point filtering module 720 is specifically used to select the minimum distance among the first distances and the second distances of each obstacle, and take the second boundary vertex corresponding to the minimum distance as the initial starting point of the obstacle; determine the midpoint corresponding to the longest boundary of each obstacle based on the two second boundary vertices of the longest boundary of each obstacle and the corresponding second position; and determine the valid starting point corresponding to each obstacle based on the initial starting point and the midpoint of each obstacle.
[0096] Optionally, the aforementioned starting point filtering module 720 is specifically used to calculate the straight-line distance between any two points among the initial starting point and midpoint of each obstacle; and to filter out the valid starting point corresponding to each obstacle from the initial starting point and midpoint of each obstacle based on the straight-line distance and the working width of the agricultural machinery.
[0097] In one embodiment, the aforementioned orientation angle determination module 740 is specifically used to: obtain the range of operation orientation angles corresponding to farmland plots for each operation area and perform discrete sampling on the range of operation orientation angles to obtain multiple candidate operation orientation angles; for each candidate operation orientation angle, generate multiple line segments with included angles equal to the candidate operation orientation angles and parallel to each other within the operation area based on the third boundary vertices and their third positions corresponding to the boundaries of the operation area; determine the total operation length of the operation area under the candidate operation orientation angles based on the length of each line segment within the operation area; and determine the target operation orientation angle corresponding to the operation area among the candidate operation orientation angles based on the total operation length of the operation area under each candidate operation orientation angle.
[0098] Optionally, the aforementioned orientation angle determination module 740 is specifically used to acquire a visual image corresponding to the farmland plot and an initial operating orientation angle range; to identify the visual image and determine the planting direction corresponding to the crop planted on the farmland plot; based on the planting direction, to determine the operating orientation angle range corresponding to the planting direction within the initial operating orientation angle range, and to use the operating orientation angle range corresponding to the planting direction as the operating orientation angle range corresponding to the farmland plot; the aforementioned operating orientation angle range corresponding to the farmland plot is smaller than the initial operating orientation angle range.
[0099] Optionally, the aforementioned direction angle determination module 740 is specifically used to generate a first straight line passing through a candidate point and having an included angle equal to the candidate operation direction angle, based on any candidate point and a candidate operation direction angle within the operation area; determine a normal direction angle perpendicular to the candidate operation direction angle based on the candidate operation direction angle; generate a second straight line passing through a candidate point and having an included angle equal to the normal direction angle of the candidate operation direction angle based on the candidate point and the normal direction angle of the candidate operation direction angle; project the third positions of each third boundary vertex of the operation area onto the second straight line, and determine the intercept range based on the equations corresponding to each projection point and the first straight line; generate all straight lines within the operation area parallel to the first straight line based on the intercept range and the operation width of the agricultural machinery; and generate line segments corresponding to each straight line within the operation area based on all straight lines within the operation area parallel to the first straight line and the boundary of the operation area.
[0100] In one embodiment, the above-mentioned operation path planning module 750 is specifically used to generate operation paths corresponding to the operation areas along the corresponding target operation direction angles in each operation area according to the operation width of the agricultural machinery and the target operation direction angles of each operation area; extract the starting point and ending point of the first segment of the operation path of each operation area, and construct a node network based on the starting point and ending point of each segment; use a path search algorithm to search for the connecting paths between each operation area in the node network; and generate the total operation path for the agricultural machinery to operate between each operation area based on the operation paths of each operation area and the connecting paths.
[0101] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0102] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communications bus 840. The processor 810 can call logical instructions in the memory 830 to execute an agricultural machinery operation path planning method. This method includes: obtaining the first boundary vertices and their first positions corresponding to the boundaries of the farmland plot, and obtaining the second boundary vertices and their second positions corresponding to the boundaries of each obstacle in the farmland plot; determining the effective starting point corresponding to each obstacle based on the first and second positions; determining a region dividing line based on the line connecting each effective starting point to the boundary of the farmland plot, and dividing the farmland plot into multiple operation areas using the region dividing line; each operation area does not contain obstacles; determining the target operation direction angle corresponding to each operation area based on the operation direction angle range corresponding to the farmland plot and the third boundary vertices and their third positions corresponding to the boundaries of each operation area; and planning the operation path of the agricultural machinery within each operation area based on the target operation direction angle of each operation area.
[0103] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0104] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the agricultural machinery operation path planning method provided by the above methods. The method includes: obtaining each first boundary vertex and its first position corresponding to the boundary of the farmland plot, and obtaining each second boundary vertex and its second position corresponding to the boundary of each obstacle in the farmland plot; determining the effective starting point corresponding to each obstacle based on each first position and each second position; determining the area division line based on the line connecting each effective starting point and the boundary of the farmland plot, and dividing the farmland plot into multiple operation areas through the area division line; each operation area does not include obstacles; determining the target operation direction angle corresponding to each operation area based on the operation direction angle range corresponding to the farmland plot and each third boundary vertex and its third position corresponding to the boundary of each operation area; and planning the operation path of the agricultural machinery in each operation area based on the target operation direction angle of each operation area.
[0105] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the agricultural machinery operation path planning method provided by the above methods. The method includes: obtaining each first boundary vertex and its first position corresponding to the boundary of a farmland plot, and obtaining each second boundary vertex and its second position corresponding to the boundary of each obstacle in the farmland plot; determining a valid starting point corresponding to each obstacle based on each first position and each second position; determining a region dividing line based on the line connecting each valid starting point and the boundary of the farmland plot, and dividing the farmland plot into multiple operation areas through the region dividing line; each operation area does not include obstacles; determining a target operation direction angle corresponding to each operation area based on the range of operation direction angles corresponding to the farmland plot and each third boundary vertex and its third position corresponding to the boundary of each operation area; and planning the operation path of the agricultural machinery in each operation area based on the target operation direction angle of each operation area.
[0106] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0107] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for planning agricultural machinery operation paths, characterized in that, include: Obtain the first boundary vertices and their first positions corresponding to the boundaries of the farmland plots, and obtain the second boundary vertices and their second positions corresponding to the boundaries of each obstacle in the farmland plots. Based on each of the first positions and each of the second positions, determine the effective starting point corresponding to each obstacle; The area division line is determined by connecting the effective starting point with the boundary of the farmland plot, and the farmland plot is divided into multiple work areas by the area division line. None of the aforementioned work areas include the obstacles; Based on the range of the operation direction angle corresponding to the farmland plot and the third boundary vertex and its third position corresponding to the boundary of each operation area, the target operation direction angle corresponding to each operation area is determined; Based on the target operating direction angle of each operating area, the operating path of the agricultural machinery in each operating area is planned.
2. The agricultural machinery operation path planning method according to claim 1, characterized in that, The step of determining the effective starting point corresponding to each obstacle based on each of the first positions and each of the second positions includes: Based on each of the first positions, determine the first boundary line segment corresponding to each boundary of the farmland plot; Based on each of the second positions of each obstacle, the longest boundary in each obstacle is determined, and based on the two second boundary vertices corresponding to the longest boundary, a first reference direction and a second reference direction are determined; the first reference direction is opposite to the second reference direction. Calculate the first distance from each of the second positions of each obstacle to each of the first boundary segments in the first reference direction of the corresponding obstacle, and the second distance from each of the second positions to each of the first boundary segments in the second reference direction of the corresponding obstacle; The effective starting point corresponding to each obstacle is determined based on the first distance and the second distance of each obstacle.
3. The agricultural machinery operation path planning method according to claim 2, characterized in that, The step of determining the effective starting point corresponding to each obstacle based on each of the first distances and each of the second distances of each obstacle includes: In each of the first distances and second distances of the obstacle, the minimum distance is selected, and the second boundary vertex corresponding to the minimum distance is taken as the initial starting point of the obstacle; Based on the two second boundary vertices of the longest boundary of each obstacle and their corresponding second positions, determine the midpoint corresponding to the longest boundary of each obstacle; Based on the initial starting point and midpoint of each obstacle, determine the valid starting point corresponding to each obstacle.
4. The agricultural machinery operation path planning method according to claim 3, characterized in that, The step of determining the effective starting point corresponding to each obstacle based on the initial starting point and midpoint of each obstacle includes: Calculate the straight-line distance between any two points, including the initial starting point and midpoint, of each obstacle; Based on the straight-line distances and the working width of the agricultural machinery, a valid starting point corresponding to each obstacle is selected from the initial starting point and midpoint of each obstacle.
5. The agricultural machinery operation path planning method according to any one of claims 1 to 4, characterized in that, The step of determining the target working direction angle for each working area based on the range of working direction angles corresponding to the farmland plots and the third boundary vertices and their third positions corresponding to the boundaries of each working area includes: For each of the work areas, the range of work direction angles corresponding to the farmland plots is obtained and the range of work direction angles is discretely sampled to obtain multiple candidate work direction angles; For each candidate operation direction angle, based on each third boundary vertex and its third position corresponding to the boundary of the operation area, multiple line segments with the included angle of the candidate operation direction angle and parallel to each other are generated in the operation area. Based on the length of each line segment in the operation area, the total operation length of the operation area under the candidate operation direction angle is determined. Based on the total working length of the working area under each of the candidate working direction angles, the target working direction angle corresponding to the working area is determined from among the candidate working direction angles.
6. The agricultural machinery operation path planning method according to claim 5, characterized in that, The process of obtaining the range of working direction angles corresponding to the farmland plot includes: Obtain the visual image of the farmland plot and the initial operating direction angle range; The visual image is identified to determine the planting direction of the crops planted on the farmland plot. Based on the planting direction, a working direction angle range corresponding to the planting direction is determined within the initial working direction angle range, and the working direction angle range corresponding to the planting direction is taken as the working direction angle range corresponding to the farmland plot; the working direction angle range corresponding to the farmland plot is smaller than the initial working direction angle range.
7. The agricultural machinery operation path planning method according to claim 5, characterized in that, The step of generating multiple line segments within the work area, whose included angle is the candidate work direction angle and which are parallel to each other, based on each third boundary vertex corresponding to the boundary of the work area and its third position, includes: Based on any candidate point within the work area and the candidate work direction angle, generate a first straight line passing through the candidate point and having an included angle equal to the candidate work direction angle; Based on the candidate operation direction angle, a normal direction angle perpendicular to the candidate operation direction angle is determined. Based on the candidate point and the normal direction angle of the candidate operation direction angle, a second straight line passing through the candidate point and having an angle equal to the normal direction angle of the candidate operation direction angle is generated. The third positions of each of the third boundary vertices of the work area are projected onto the second straight line, and the intercept range is determined according to the equations corresponding to each projection point and the first straight line. Based on the intercept range and the working width of the agricultural machinery, all straight lines parallel to the first straight line within the working area are generated, and based on all straight lines parallel to the first straight line within the working area and the boundary of the working area, line segments corresponding to each straight line within the working area are generated.
8. The agricultural machinery operation path planning method according to any one of claims 1 to 4, characterized in that, The step of planning the working path of agricultural machinery in each of the said working areas based on the target working direction angle includes: Based on the working width of the agricultural machinery and the target working direction angle of each working area, a working path corresponding to the working area is generated in each working area along the corresponding target working direction angle; Extract the starting point and ending point of the operation path for each of the operation areas, and construct a node network based on each starting point and ending point. A path search algorithm is used to search for the connecting paths between the various work areas in the node network; Based on the operation paths of each operation area and the connecting paths, a total operation path is generated for the agricultural machinery to operate between each operation area.
9. A device for planning agricultural machinery operation paths, characterized in that, include: The location acquisition module is used to acquire each first boundary vertex and its first position corresponding to the boundary of the farmland plot, and to acquire each second boundary vertex and its second position corresponding to the boundary of each obstacle in the farmland plot. The starting point filtering module is used to determine the valid starting point corresponding to each obstacle based on each of the first positions and each of the second positions; The area segmentation module is used to determine area segmentation lines based on the lines connecting each of the valid starting points and the boundaries of the farmland plots, and to divide the farmland plots into multiple work areas using the area segmentation lines; none of the work areas include the obstacles. The orientation angle determination module is used to determine the target operation orientation angle corresponding to each operation area based on the operation orientation angle range corresponding to the farmland plot and the third boundary vertex and its third position corresponding to the boundary of each operation area; The operation path planning module is used to plan the operation path of agricultural machinery in each of the operation areas based on the target operation direction angle of each operation area.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the agricultural machinery operation path planning method as described in any one of claims 1 to 8.