A full coverage field path planning method and device based on improved genetic algorithm

CN116050682A8Active Publication Date: 2024-12-13SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211043439.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2021-12-24
Filing Date
2022-08-29
Publication Date
2024-12-13
Estimated Expiration
2042-08-29

AI Technical Summary

Technical Problem

When the traditional full-coverage path planning algorithm has irregular farmland shapes or obstacles in the fields, it results in large repetitive operations, high number of turns, and low efficiency.

Method used

An improved genetic algorithm is used to construct a field environment map through the raster method, chromosome coding and path adjustment, combined with the fitness function of the multi-objective equilibrium criterion, for iterative optimization to generate the shortest continuous full coverage path.

Benefits of technology

It effectively reduces the repetitive operation area and the number of turns, improves the field operation efficiency and operation quality of unmanned agricultural machinery, avoids a large number of invalid solutions, and enhances the optimization capability of the algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116050682A8_ABST
    Figure CN116050682A8_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of unmanned agricultural machinery, and specifically to a method and device for planning a full-coverage field path based on an improved genetic algorithm. The method comprises: S1, constructing a field environment map using a grid method. S2, performing chromosome encoding on the free grids in the field environment map, and randomly generating a number of initial chromosomes. S3, adjusting the initial chromosomes to obtain legal chromosomes. S4, constructing a fitness function based on a multi-objective equilibrium criterion, and determining the fitness of legal chromosomes. S5, evolving the initial chromosomes to generate the next generation population as the parent population for the next iteration. S6, determining whether to end this iteration. If so, decoding the chromosome output with the highest fitness in the contemporary population to obtain a full coverage path; if not, returning to execute step S3. The present invention can reduce the repeated operation area and the number of turns, and improve the field operation efficiency and operation quality of unmanned agricultural machinery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of unmanned agricultural machinery technology, specifically to a method and device for full-coverage field path planning for unmanned agricultural machinery based on an improved genetic algorithm. Background Technology

[0002] The Coverage-Planning (CCPP) algorithm is suitable for special scenarios where the work area is fully covered. Coverage-based field path planning is a key task in smart farms to improve field operation efficiency, and the success of automated navigation machinery depends on its ability to generate fully covered paths for the field work area. Traditional coverage-based path planning algorithms are designed for rectangular fields or indoor mobile robots, failing to consider complex field environments. When planning fully covered paths in the field, especially in irregularly shaped fields or with obstacles, traditional algorithms suffer from problems such as large areas of repetitive work and numerous turns, resulting in significantly lower efficiency compared to rectangular fields. Summary of the Invention

[0003] To address the issues of large repetitive work areas and numerous turns during full-coverage unmanned agricultural machinery operations, this invention proposes a full-coverage field path planning method and device based on an improved genetic algorithm. This method and device can reduce the repetitive work area and the number of turns, effectively improving the field operation efficiency and quality of unmanned agricultural machinery.

[0004] To achieve the above objectives, the present invention adopts the following technical solution:

[0005] A method for full-coverage field path planning based on an improved genetic algorithm, comprising the following steps:

[0006] S1. A field environment map is constructed using a grid method; the grids in the field environment map are divided into two types: free grids without obstacles and grids with obstacles.

[0007] S2. Chromosome encoding is performed on the free grid in the field environment map, and several initial chromosomes are randomly generated based on the chromosome-encoded field environment map.

[0008] S3. Adjust the initial chromosomes to make their paths the shortest continuous paths, obtaining valid chromosomes. Combine the initial chromosomes with their corresponding valid chromosomes to generate chromosome pairs. Each chromosome pair is considered part of the current population, and iteration is performed using this population. The initial chromosome refers to the most primitive chromosome in the parent population (current population). A valid chromosome is the chromosome obtained after adjusting the paths of the initial chromosomes to make their paths the shortest continuous paths.

[0009] S4. Construct a fitness function based on the multi-objective equilibrium criterion, and use the fitness function to obtain the fitness of each legitimate chromosome in the current population.

[0010] S5. Evolve the initial chromosomes in the current population to generate the next generation population, which will serve as the parent population for the next iteration.

[0011] S6. Determine whether to end the current iteration. If yes, output the chromosome with the highest fitness in the current population and decode it to obtain the full-coverage path; if no, increment the iteration count by 1 and return to step S3 for the next iteration. Preferably, the maximum number of iterations is 1000.

[0012] Furthermore, the construction of the field environment map using the raster method described in step S1 includes:

[0013] S11. Divide the farmland into several squares of equal area according to the shape of the farmland, and mark the obstacles in the field; the squares with obstacles are called obstacle grids, and the squares without obstacles are called free grids.

[0014] S12. When farmland boundaries are irregular or there are obstacles in the field, the farmland boundaries or obstacle boundaries are expanded to make them regular boundaries or obstacles with regular boundaries, resulting in an expanded and quantified field grid map.

[0015] S13. Mark the expanded and quantized field grid map to obtain a field environment map.

[0016] Furthermore, the adjustment of the initial chromosome to make the chromosome path the shortest continuous path to obtain a valid chromosome includes:

[0017] S31. If the initial chromosome path is continuous, no adjustment is needed.

[0018] S32. If the initial chromosome path is not continuous, insert the shortest continuous path between the intervening paths, and delete the path numbers that the initial chromosome has repeated after the intervening paths. Repeat the above process until all paths are continuous, thus generating a valid chromosome. The shortest continuous path is obtained using the Floyd algorithm.

[0019] Furthermore, the construction of the fitness function based on the multi-objective equilibrium criterion includes:

[0020] S41. The following formulas are used to calculate the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome in the current population:

[0021]

[0022]

[0023]

[0024]

[0025]

[0026] in, and Let Y represent the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome, respectively. i || Represents a legitimate chromosome Y i The length of ||set(Y) i )|| represents the legitimate Y chromosome i The length after removing duplicate genes, % represents the modulo operation, orien(Y i [g] indicates that the autonomous agricultural machinery is in grid number Y. i The direction of movement at [g], turn(g) and uturn(g) indicate the direction of movement at grid number Y. i Does [g] indicate a turning or U-turn behavior?

[0027] S42. Based on the repeated work area, number of turns, and number of U-turns of the i-th legal chromosome in the current population, the corresponding weight coefficients w1(i), w2(i), and w3(i) are obtained using the following formula:

[0028]

[0029]

[0030]

[0031]

[0032]

[0033]

[0034]

[0035]

[0036]

[0037] in, and This represents the weight coefficient of the i-th legitimate chromosome in the contemporary population. and This represents the weight coefficient of the i-th legal chromosome in the parent population. and Let represent the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome in the current population, respectively. and These represent the average area of ​​repeated operations, number of turns, and number of reversals for all chromosomes in the current population, respectively.

[0038] S43. Based on the weight coefficient of the i-th legal chromosome in the current population, the area of ​​repeated operations, the number of turns, and the number of U-turns, the fitness function is determined as follows:

[0039]

[0040] Where f(i) represents the fitness value of the i-th legal chromosome, and w1(i), w2(i), and w3(i) represent the weight coefficients of the repeated operation area, the number of turns, and the number of U-turns for the i-th legal chromosome, respectively. and These are functions that calculate the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome, respectively.

[0041] Furthermore, the evolution includes selection, crossover, and mutation operations.

[0042] Furthermore, the specific process of the selection operation is as follows:

[0043] Using roulette wheel selection as the selection operator, the probability of each chromosome being selected in the population is proportional to its fitness value. Therefore, the probability of each chromosome being selected is P(i):

[0044]

[0045] The offspring chromosomes generated after chromosome selection need to be adjusted according to the adjustment method in step S3 to make the chromosome path the shortest continuous path, so as to generate a legal and feasible full-coverage path.

[0046] Furthermore, the specific process of the crossover operation is as follows:

[0047] The crossover operation is performed using a single-point crossover method. Two chromosomes are randomly selected from the current population for crossover. First, a crossover point is randomly determined. Then, all genes before the crossover point are deleted from the other chromosome. Finally, the remaining genes are filled in order after the crossover point. The offspring chromosomes generated after chromosome crossover are adjusted according to the adjustment method in step S3 to make the chromosome path the shortest continuous path, so as to generate a legal and feasible full-coverage path.

[0048] Furthermore, the specific process of the mutation operation is as follows:

[0049] The mutation operation is performed using the basic position mutation method. A chromosome is randomly selected from the current population. First, two points are randomly determined as gene mutation points, and then the two gene positions are interchanged. The offspring chromosome generated after chromosome mutation needs to be adjusted according to the adjustment method in step S3 to make the chromosome path the shortest continuous path, so as to generate a legal and feasible full-coverage path.

[0050] Furthermore, the determination of whether to end the current iteration includes:

[0051] Determine whether the current iteration count has reached the set maximum iteration count or whether the fitness of all legitimate chromosomes in the current population is within the set threshold range.

[0052] The present invention also relates to a full-coverage field path planning device based on an improved genetic algorithm, the device comprising: a field environment map construction module and a path planning module based on an improved genetic algorithm.

[0053] The field environment map construction module is used to construct a field environment map using a grid method; the grids in the field environment map are divided into two types: free grids without obstacles and grids with obstacles.

[0054] The path planning module based on the improved genetic algorithm is used to encode chromosomes in the free grid in the field environment map, and randomly generate several initial chromosomes based on the chromosome-encoded field environment map. It is also used to adjust the initial chromosomes to make the chromosome paths the shortest continuous paths, obtaining legal chromosomes. The initial chromosomes and their corresponding legal chromosomes are combined to generate chromosome pairs, and each chromosome pair is used as the current population for iteration. Furthermore, it is used to construct a fitness function based on a multi-objective equilibrium criterion, and use the fitness function to calculate the fitness of each legal chromosome in the current population. It is also used to evolve the initial chromosomes in the current population to generate the next generation population, which serves as the parent population for the next iteration. Finally, it is used to determine whether the current iteration count has reached the set maximum iteration count or whether the fitness of all legal chromosomes in the current population is within a set threshold range. If so, the chromosome with the highest fitness in the current population is output and decoded to obtain a full-coverage path; otherwise, the iteration count is incremented by 1, and the next iteration begins.

[0055] Compared with the prior art, the advantages of the present invention are:

[0056] (1) This invention proposes a full-coverage field path planning method based on an improved genetic algorithm. It focuses on irregular farmland shapes and the presence of obstacles in the field. It can find a full-coverage field path that has a good balance between the area of ​​repeated operation and the number of turns, effectively reducing the area of ​​repeated operation and the number of turns, and improving the working efficiency and quality of agricultural machinery.

[0057] (2) This invention proposes a chromosome encoding method based on adjacent grids and its corresponding chromosome adjustment method, which can adjust any generated chromosome into a valid chromosome, corresponding to a feasible full-coverage path. Adjusting the chromosomes can avoid a large number of invalid solutions, effectively improving the algorithm's convergence speed. The chromosome encoding evolution method proposed in this invention can enhance the algorithm's optimization ability, effectively avoid premature convergence, and improve the effectiveness of full-coverage field path planning. Attached Figure Description

[0058] Figure 1 This is a flowchart of the method of the present invention;

[0059] Figure 2a These are field photos before quantification;

[0060] Figure 2b It is a quantified field environment map;

[0061] Figure 3 It is an expanded and quantified field environment map;

[0062] Figure 4 It is a marked field environment map;

[0063] Figure 5 This is a diagram illustrating field environment coding;

[0064] Figure 6 This is a schematic diagram of adjacent grid cells;

[0065] Figure 7 This is a schematic diagram of the field path fully covered by the ox-plowing algorithm when there are no obstacles.

[0066] Figure 8 This is a schematic diagram illustrating the full field path coverage of the ox-plowing algorithm when there are obstacles.

[0067] Figure 9 This is a schematic diagram of the initial chromosomes;

[0068] Figures 10a to 10d This is a schematic diagram of the initial chromosome adjustment;

[0069] Figure 11 This is a diagram of the adjusted chromosomes;

[0070] Figure 12 This is a schematic diagram of the initial population based on chromosome pairs;

[0071] Figure 13 This is a diagram illustrating chromosome crossing over.

[0072] Figure 14 This is a schematic diagram of chromosome variation operations;

[0073] Figure 15 This is a schematic diagram of the optimal chromosome.

[0074] Figure 16 This is a schematic diagram of the optimal full-coverage field path. Detailed Implementation

[0075] The present invention will be further described below with reference to the accompanying drawings:

[0076] like Figure 1 The method shown is a full-coverage field path planning method based on an improved genetic algorithm, which includes the following steps:

[0077] Step 1: Construction of field environment map based on raster method

[0078] S11. The present invention constructs a field path planning map covering the entire operation area of ​​unmanned agricultural machinery using the grid method. As shown in Figure 2, the farmland is first divided into squares of equal area according to the shape of the farmland, and obstacles in the field are marked. Figure 2a These are field photos before quantification; Figure 2b It is a quantified field environment map, in Figure 2b The system not only divides the grid into grids, but also marks inaccessible grids as obstacles.

[0079] S12. When farmland boundaries are irregular or obstacles exist in the field, they need to be expanded to create regular boundaries or regular obstacles. The expanded, quantified field environment map is as follows: Figure 3 As shown.

[0080] S13, such as Figure 4 As shown, the expanded and quantized field grid map is marked. The unmanned agricultural machinery can only travel in four directions: forward, backward, left, and right. The black area is the obstacle area, and the blank area is the free area. The unmanned agricultural machinery needs to traverse the entire free area and meet the following conditions: (1) The unmanned agricultural machinery must traverse the entire working area; (2) The unmanned agricultural machinery must avoid all static obstacles; (3) The unmanned agricultural machinery should pass through the already worked area as little as possible; (4) The number of turns during the operation of the unmanned agricultural machinery should be minimized.

[0081] For ease of explanation, the present invention adopts the following... Figure 5The 3x4 field grid map shown is an example, where blank areas are free areas, areas filled with diagonal lines are obstacle areas, and the grid numbered 1 is the starting point for agricultural machinery operations. The grids are numbered from left to right and from bottom to top.

[0082] like Figure 6 As shown, in the field grid map, there are four adjacent grids to grid number i: i-1, iC, i+1, and i+C, where C is the column number of the grid map. This means that when the agricultural machinery is at grid number i, it can only move in these four directions. Meanwhile, for boundary grids, the movement directions may be two or three; if there are obstacles around, the movement directions will be reduced; and unreachable grids, i.e., grids surrounded by obstacles, will be marked as obstacles.

[0083] The most commonly used method for full-coverage field path planning is the "ox-plowing" algorithm. Its basic idea is to use a bow-shaped search method for coverage, with the unmanned agricultural machinery (UAV) performing a back-and-forth covering operation in a certain direction. When encountering an obstacle, it moves upwards by one vehicle length to cross it; after crossing the obstacle, it returns to the original working direction to continue working; upon reaching the work boundary, it moves in the opposite direction along the current working direction, repeating this process to traverse the entire work area. Figure 7 The diagram shown is a schematic of the ox-plowing algorithm's full-coverage field path planning under barrier-free conditions.

[0084] When there are obstacles or irregular boundaries in the field operation area, the full-coverage field path planning of the Ox-plowing algorithm is as follows: Figure 8 As shown, at this point, the planned full-coverage road field operation path has a large area of ​​repetitive operation and too many turns. To solve this problem, this invention proposes another full-coverage path planning algorithm, namely, a full-coverage field path planning method based on an improved genetic algorithm, to adapt to situations where the operation area has obstacles or irregular boundaries.

[0085] Since genetic algorithms are easy to encode and implement, have global optimization capabilities and strong scalability, this invention will use an improved genetic algorithm as the basic model for solving the full-coverage field path planning problem.

[0086] Step 2: Chromosome encoding method based on adjacent grids

[0087] The purpose of this invention is to perform a full traversal of a free grid, and the order of traversal constitutes the final planned full-coverage path. A decimal encoding method is used, with each chromosome representing a feasible solution, corresponding to one full-coverage field path in this invention.

[0088] To ensure full traversal of the free grid, the corresponding free grid must appear at least once in the chromosome, while obstacle region grids cannot appear in the chromosome. Based on the above... Figure 4 The field environment shown depicts a randomly generated initial chromosome, such as... Figure 9 As shown.

[0089] However, the aforementioned chromosome is invalid because the unmanned agricultural machinery cannot move directly from chromosome 1 to chromosome 8. Therefore, the initial chromosome needs to be adjusted, as follows:

[0090] (1) If the path is continuous, no adjustment is needed.

[0091] (2) If the paths are discontinuous, continuous free grids need to be inserted into the interval paths to make them continuous. The insertion method is to find the shortest continuous path between the interval grids, while deleting path numbers that have already appeared after the initial chromosome. Finding the shortest path between interval paths is a multi-source path problem. Dijkstra's algorithm is suitable for solving single-source path problems. The path obtained by the A* algorithm may not be the shortest path, so the Floyd algorithm can be used to find the shortest continuous path. Repeat the above process until all paths are continuous, thus generating a valid chromosome.

[0092] Figure 9 The initial chromosome adjustment process shown is as follows: Figures 10a to 10d As shown, the adjusted chromosome′ is as follows Figure 11 As shown.

[0093] Step 3: Generate the initial population

[0094] Based on the chromosome encoding method based on adjacent grids in Step 2, Q chromosomes are randomly generated as the initial population. Each chromosome consists of two parts: an initial chromosome and an adjusted chromosome. The initial chromosomes are of uniform length and are used for evolutionary operations such as crossover and mutation. The adjusted chromosomes have varying lengths, and each gene locus is continuously adjacent to its neighboring gene loci in the field grid map, representing a feasible full-coverage path. The initial population based on chromosome pairs is as follows: Figure 12 As shown. In Figure 12 There are a total of Q chromosome pairs. Each chromosome pair consists of an initial chromosome X and a valid chromosome Y.

[0095] Step 4: Construct a fitness function based on a multi-objective equilibrium criterion

[0096] The fitness function is the basis for the iteration of the genetic algorithm, and it relates to the quality of the results and the convergence speed. The main goal of full-coverage path planning is to minimize the number of turns and U-turns while satisfying the requirement of full coverage of the free grid, because turns or U-turns involve a deceleration-re-acceleration process, which increases the energy consumption of agricultural machinery. However, in reality, the number of turns or U-turns is often increased to reduce the area of ​​repeated work, or vice versa. Therefore, in order to balance the three planning objectives of the number of U-turns, turns, and repeated work area, this invention proposes a fitness function based on a multi-objective equilibrium criterion, which is defined as follows:

[0097]

[0098] Where f(i) represents the fitness value of the i-th chromosome, and w1(i), w2(i), and w3(i) represent the weighting coefficients of the repeated work area, the number of turns, and the number of U-turns for the i-th chromosome, respectively. and These are functions that calculate the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th chromosome, respectively.

[0099] Since turning around in the field is the most costly, and we need to minimize the area of ​​repeated work, we set the initial weights of w1(i), w2(i), and w3(i) to 0.3, 0.2, and 0.5, respectively. Then, we adopted an adaptive weight coefficient mechanism to ensure the balance of the three objectives. The update and iteration formula is as follows:

[0100]

[0101]

[0102]

[0103]

[0104]

[0105]

[0106]

[0107]

[0108]

[0109] in, and This represents the weight coefficient of the i-th chromosome in the contemporary population. and This represents the weight coefficient of the i-th chromosome in the contemporary population. and Let represent the area of ​​repeated operations, the number of turns, and the number of U-turns of the i-th chromosome in the contemporary population, respectively. and These represent the average area of ​​repeated operations, number of turns, and number of reversals for all chromosomes in the current population, respectively.

[0110] The formulas for calculating the area of ​​repeated operations, the number of turns, and the number of U-turns are as follows, based on the Y chromosome in the chromosome pair:

[0111]

[0112]

[0113]

[0114]

[0115]

[0116] in, and Let Y represent the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th chromosome, respectively. i || represents chromosome Y i The length of ||set(Y) i )|| represents chromosome Y i The length after removing duplicate genes, % represents the modulo operation, orien(Y i [g] indicates that the autonomous agricultural machinery is in grid number Y. i The direction of movement at [g], turn(g) and uturn(g) indicate the direction of movement at grid number Y. i Does [g] indicate a turning or U-turn behavior?

[0117] Step 5: Select Operation

[0118] This invention employs a roulette wheel selection method as the selection operator. This operator selects individuals with both low and high fitness, ensuring population diversity and preventing the algorithm from getting trapped in local optima. The probability of each chromosome being selected in the population is proportional to its fitness value, so the probability of each chromosome being selected is P(i):

[0119]

[0120] The offspring chromosomes generated after chromosome selection need to be adjusted according to the adjustment method in Step 1 to generate a legal and feasible full-coverage path.

[0121] Step 6: Cross-operation

[0122] Crossover is one of the important steps in the evolution of genetic algorithms. The idea is to randomly select two chromosomes from the parent population with a relatively high probability to perform crossover, generating chromosomes that have both parental characteristics and new genetic properties, thereby enhancing the algorithm's optimization ability.

[0123] This invention employs a single-point crossover method: two chromosomes are randomly selected from the parent population for crossover. First, a crossover point is randomly determined. Then, all genes before the crossover point are deleted from the other chromosome. Finally, the remaining genes are sequentially added after the crossover point. The crossover probability is generally set between 0.5 and 1. A schematic diagram of the crossover operation is shown below. Figure 13 As shown.

[0124] The offspring chromosomes generated after chromosome crossover need to be adjusted according to the adjustment method in Step 1 to generate a legal, feasible, and fully covered path.

[0125] Step 7: Mutation Operation

[0126] Mutation is one of the important steps in the evolution of genetic algorithms. The idea is to randomly select a chromosome in the parent population with a small probability to perform a mutation operation, generating offspring chromosomes with new genetic information, effectively avoiding premature convergence of the algorithm.

[0127] This invention employs the basic locus mutation method for mutation operations: A chromosome is randomly selected from the parent population, and two points are randomly determined as gene mutation points. Then, the two gene loci are interchanged. The mutation probability is generally set between 0.001 and 0.1. A schematic diagram of the mutation operation is shown below. Figure 14 As shown.

[0128] The offspring chromosomes generated after chromosome mutation need to be adjusted according to the adjustment method in Step 1 to generate a legal and feasible full-coverage path.

[0129] Step 8: Termination Conditions

[0130] Genetic algorithms typically have two termination methods: generational iteration and result stabilization. Generational iteration involves setting a maximum number of iterations T, and terminating the algorithm and outputting the optimal solution when the maximum number of iterations T is reached. Result stabilization involves setting a stable integer M, and terminating the algorithm and outputting the optimal solution when the fitness value remains unchanged for M consecutive iterations or the difference from the optimal solution is less than δ. This paper combines the advantages of both termination algorithms. First, it sets a reasonable number of iterations T = 1000. Second, it terminates the algorithm early and outputs the optimal solution when the algorithm tends to stabilize at δ = 0.01 over a long period.

[0131] Step 9: Decode and output

[0132] This invention comprehensively considers the area of ​​repeated work and the number of turns, proposing a full-coverage field path planning method based on an improved genetic algorithm. This method balances both factors while minimizing the area of ​​repeated work and the number of turns. After the algorithm iterations, the output of the chromosome with the highest fitness in the last generation population is decoded, such as... Figure 15 The image shows the optimal chromosome.

[0133] Based on the chromosome adjustment method in Step 1, since the optimal chromosome satisfies the condition that every pair of genes is adjacent, no adjustment is needed. The corresponding full-coverage path planning after decoding is as follows: Figure 16 As shown.

[0134] Figure 8 and Figure 16 The diagrams show full-coverage field path planning based on the ox-plowing algorithm and the improved genetic algorithm, respectively. The comparison shows that when there are obstacles in the work area or the work boundary is irregular, the full-coverage operation efficiency of the ox-plowing algorithm is low. In this case, the full-coverage field path planning method based on the improved genetic algorithm should be selected to reduce the area and number of repeated operations.

[0135] The present invention also relates to a full-coverage field path planning device based on an improved genetic algorithm, the device comprising: a field environment map construction module and a path planning module based on an improved genetic algorithm.

[0136] The field environment map construction module is used to construct a field environment map using a grid method; the grids in the field environment map are divided into two types: free grids without obstacles and grids with obstacles.

[0137] The path planning module based on the improved genetic algorithm is used to encode chromosomes in the free grid in the field environment map, and randomly generate several initial chromosomes based on the chromosome-encoded field environment map. It is also used to adjust the initial chromosomes to make the chromosome paths the shortest continuous paths, obtaining legal chromosomes. The initial chromosomes and their corresponding legal chromosomes are combined to generate chromosome pairs, and each chromosome pair is used as the current population for iteration. Furthermore, it is used to construct a fitness function based on a multi-objective equilibrium criterion, and use the fitness function to calculate the fitness of each legal chromosome in the current population. It is also used to evolve the initial chromosomes in the current population to generate the next generation population, which serves as the parent population for the next iteration. Finally, it is used to determine whether the current iteration count has reached the set maximum iteration count or whether the fitness of all legal chromosomes in the current population is within a set threshold range. If so, the chromosome with the highest fitness in the current population is output and decoded to obtain a full-coverage path; otherwise, the iteration count is incremented by 1, and the next iteration begins.

[0138] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0139] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for full-coverage field path planning based on an improved genetic algorithm, characterized in that: The method includes the following steps: S1. A field environment map is constructed using a grid method; the grids in the field environment map are divided into two types: free grids without obstacles and grids with obstacles; S2. Chromosome encoding is performed on the free grid in the field environment map, and several initial chromosomes are randomly generated based on the chromosome-encoded field environment map; S3. Adjust the initial chromosomes to make the chromosome path the shortest continuous path to obtain legal chromosomes; combine the initial chromosomes with their corresponding legal chromosomes to generate chromosome pairs, and use each chromosome pair as the current population for iteration; S4. Construct a fitness function based on the multi-objective equilibrium criterion, and use the fitness function to obtain the fitness of each legal chromosome in the current population. S5. Evolve the initial chromosomes in the current population to generate the next generation population, which will serve as the parent population for the next iteration. S6. Determine whether to end the current iteration. If yes, output the chromosome with the highest fitness in the current population and decode it to obtain the full coverage path. If no, increment the iteration count by 1 and return to step S3 to perform the next iteration.

2. The method for full-coverage field path planning based on an improved genetic algorithm according to claim 1, characterized in that: The method of constructing field environment maps using a raster method includes: S11. Divide the farmland into several squares of equal area according to the shape of the farmland, and mark the obstacles in the field; the squares with obstacles are called obstacle grids, and the squares without obstacles are called free grids. S12. When the farmland boundary is irregular or there are obstacles in the field, the farmland boundary or obstacle boundary is expanded to make it a regular boundary or an obstacle with a regular boundary, and the expanded and quantified field grid map is obtained. S13. Mark the expanded and quantized field grid map to obtain a field environment map.

3. The method for full-coverage field path planning based on an improved genetic algorithm according to claim 2, characterized in that: The process of adjusting the initial chromosome to obtain a valid chromosome by making the chromosome path the shortest continuous path includes: S31. If the initial chromosome path is continuous, no adjustment is needed; S32. If the initial chromosome path is not continuous, insert the shortest continuous path between the intervening paths, and delete the path numbers that the initial chromosome has repeated after the intervening paths. Repeat the above process until all paths are continuous, thus generating a valid chromosome. The shortest continuous path is obtained using the Floyd algorithm.

4. The method for full-coverage field path planning based on an improved genetic algorithm according to claim 1, characterized in that: The construction of the fitness function based on the multi-objective equilibrium criterion includes: S41. The following formulas are used to calculate the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome in the current population: in, and Let Y represent the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome, respectively. i || Represents a legitimate chromosome Y i The length of ||set(Y) i )|| represents the legitimate Y chromosome i The length after removing duplicate genes, % represents the modulo operation, orien(Y i [g] indicates that the autonomous agricultural machinery is in grid number Y. i The direction of movement at [g], turn(g) and uturn(g) indicate the direction of movement at grid number Y. i Does [g] indicate a turning or U-turn? S42. Based on the repeated work area, number of turns, and number of U-turns of the i-th legal chromosome in the current population, the corresponding weight coefficients w1(i), w2(i), and w3(i) are obtained using the following formula: in, and This represents the weight coefficient of the i-th legitimate chromosome in the contemporary population. and This represents the weight coefficient of the i-th legal chromosome in the contemporary population. and Let represent the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome in the current population, respectively. and These represent the average of the area of ​​repeated work, the number of turns, and the number of U-turns for all chromosomes in the current population, respectively. S43. Based on the weight coefficient of the i-th legal chromosome in the current population, the area of ​​repeated operations, the number of turns, and the number of U-turns, the fitness function is determined as follows: Where f(i) represents the fitness value of the i-th legal chromosome, and w1(i), w2(i), and w3(i) represent the weight coefficients of the repeated operation area, the number of turns, and the number of U-turns for the i-th legal chromosome, respectively. and These are functions that calculate the area of ​​repeated operations, the number of turns, and the number of U-turns for the i-th legal chromosome, respectively.

5. A method for full-coverage field path planning based on an improved genetic algorithm according to claim 4, characterized in that: The evolution includes selection, crossover, and mutation operations.

6. The method for full-coverage field path planning based on an improved genetic algorithm according to claim 5, characterized in that, The specific process of the selection operation is as follows: Using roulette wheel selection as the selection operator, the probability of each chromosome being selected in the population is proportional to its fitness value, and the probability of each chromosome being selected is P(i): The offspring chromosomes generated after chromosome selection need to be adjusted according to the adjustment method in step S3 to make the chromosome path the shortest continuous path, so as to generate a legal and feasible full-coverage path.

7. A method for full-coverage field path planning based on an improved genetic algorithm according to claim 5, characterized in that, The specific process of the crossover operation is as follows: The crossover operation is performed using a single-point crossover method. Two chromosomes are randomly selected from the current population for crossover. First, a crossover point is randomly determined. Then, all genes before the crossover point are deleted from the other chromosome. Finally, the remaining genes are filled in order after the crossover point. The offspring chromosomes generated after chromosome crossover are adjusted according to the adjustment method in step S3 to make the chromosome path the shortest continuous path, so as to generate a legal and feasible full-coverage path.

8. A method for full-coverage field path planning based on an improved genetic algorithm according to claim 5, characterized in that, The specific process of the mutation operation is as follows: The mutation operation is performed using the basic position mutation method. A chromosome is randomly selected from the current population. First, two points are randomly determined as gene mutation points, and then the two gene positions are interchanged. The offspring chromosome generated after the chromosome mutation needs to be adjusted according to the adjustment method in step S3 to make the chromosome path the shortest continuous path, so as to generate a legal and feasible full-coverage path.

9. A method for full-coverage field path planning based on an improved genetic algorithm according to claim 1, characterized in that, The determination of whether to end the current iteration includes: Determine whether the current iteration count has reached the set maximum iteration count or whether the fitness of all legitimate chromosomes in the current population is within the set threshold range.

10. A field path planning device with full coverage based on an improved genetic algorithm, characterized in that: The device includes: a field environment map construction module and a path planning module based on an improved genetic algorithm; The field environment map construction module is used to construct a field environment map using a grid method; the grid in the field environment map is divided into two types: free grid without obstacles and grid with obstacles; The path planning module based on the improved genetic algorithm is used to encode chromosomes in the free grid in the field environment map, and randomly generate several initial chromosomes based on the chromosome-encoded field environment map. It is also used to adjust the initial chromosomes to make the chromosome paths the shortest continuous paths, obtaining legal chromosomes. The initial chromosomes and their corresponding legal chromosomes are combined to generate chromosome pairs, and each chromosome pair is used as the current population for iteration. Furthermore, it is used to construct a fitness function based on a multi-objective equilibrium criterion, and use the fitness function to calculate the fitness of each legal chromosome in the current population. It is also used to evolve the initial chromosomes in the current population to generate the next generation population, which serves as the parent population for the next iteration. Finally, it is used to determine whether to end the current iteration. If yes, the chromosome with the highest fitness in the current population is output and decoded to obtain a full-coverage path; if no, the iteration count is incremented by 1, and the next iteration begins.