Path planning method and system for unmanned soil sampling vehicle
By establishing a grid map in unmanned soil sampling vehicles, it is transformed into a single warehouse multi-travel provider problem, and using improved genetic algorithms and A-star algorithms to generate the optimal path, the problems of vehicle storage upper limit and path planning are solved, and sampling efficiency and path planning are improved.
Patent Information
- Application Number
- CN202311674255.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2025-07-25
AI Technical Summary
In multi-target path planning, existing unmanned soil sampling vehicles cannot effectively solve the problems of vehicle storage upper limit and path optimization, resulting in insufficiency of sampling.
By establishing a grid map, soil sampling point information is generated, and it is converted into a single warehouse multi-travel provider problem. It is solved using improved genetic algorithms, and path smoothing is combined with A-star algorithm and Bezier curve to generate the optimal path.
It realizes the generation of the optimal soil sampling path according to actual needs, meets vehicle kinematic constraints without collisions, and improves the sampling efficiency and accuracy of path planning.
Smart Images

Figure CN120368971A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicle path planning, and specifically to a path planning method and system for an unmanned soil sampling vehicle. Background Art
[0002] Soil analysis technology is the most direct means of knowing soil data and plays a guiding role in how to arrange appropriate planting and fertilization plans and improve the utilization rate of soil. The problems caused by manual soil sampling mainly include that the consistency of the soil depth and soil sample quality of sampling cannot be reliably guaranteed; the specific positions of sampling points cannot be determined; sampling and packaging require manual operations, which are time-consuming and laborious, and the operation efficiency is not high. In recent years, with the development of agricultural digitalization and intelligentization, it has made it possible to realize an unmanned soil sampling vehicle. Relying on an automated soil sampling vehicle can save labor costs and achieve high-precision, high-consistency, and large-sample-number soil collection. Combining sampling detection with remote sensing data and ground agricultural sensor data for agricultural situation inversion, an accurate fertility model and operation prescription map can be established. According to more accurate soil data, operations such as precise and targeted fertilizer application and sprinkler irrigation can be realized, improving agricultural production efficiency, increasing crop yields, reducing costs, and increasing production profits.
[0003] The path planning method is a key technology for realizing vehicle automation. Vehicle path planning refers to finding a path that meets the vehicle dynamics constraints between the target point and the starting point, and at the same time can satisfy the shortest path length and no collision with obstacles. On this basis, an unmanned soil sampling vehicle also needs to satisfy sampling all target soil sampling points. The current global path planning for vehicles with multiple target points usually only considers the shortest path generated by passing through all target points once. However, since the number of soil samples stored in the soil sampling vehicle itself is limited, it needs to return to the soil sample unloading point after reaching the storage limit. Therefore, the path planning of the soil sampling vehicle needs to be divided into multiple times. How to plan the sampling path of the unmanned soil sampling vehicle is of great help in improving production efficiency.
[0004] Therefore, the present invention provides a path planning method for an unmanned soil sampling vehicle. Summary of the Invention
[0005] In view of the above existing problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by the present invention is as follows: First, by delimiting the working area required for the unmanned soil sampling vehicle, a grid map is built. Then, the soil sampling density and the coordinate information of the soil sample unloading point are set. According to the above information and combined with the soil sampling layout method, the vehicle background generates the coordinate information of the required soil sampling points, and saves and sends this information to the path planning module of the soil sampling vehicle. This can help users set different sampling areas and sampling densities according to actual needs, thereby improving the applicability of the unmanned soil sampling vehicle.
[0007] By combining the upper limit of single sampling of the soil sampling vehicle, the global optimal sampling path problem is transformed into a single-warehouse multi-traveling salesman problem, and an improved genetic algorithm is used to solve the problem. The obtained sampling point order is connected sequentially using the A* algorithm, and then the Bezier curve is used to smooth the path, so as to obtain an optimal working path that meets the vehicle kinematics and does not collide.
[0008] To solve the above technical problem, the present invention provides the following technical solution: A path planning method for an unmanned soil sampling vehicle, including:
[0009] Setting system data and establishing a grid map; generating all required soil sampling point information and establishing a mathematical model; transforming the optimized soil sampling path problem into a constrained single-warehouse multi-traveling salesman problem; using an improved genetic algorithm to solve the constrained single-warehouse multi-traveling salesman problem; sequentially connecting the soil sampling points using the A* algorithm according to the order of the optimal soil sampling path points; smoothing the path to generate an optimal path.
[0010] As a preferred solution of the path planning method for an unmanned soil sampling vehicle according to the present invention, wherein: The establishment of the grid map includes setting, in the vehicle background, after delimiting the working area required for the unmanned soil sampling vehicle, collecting the map information within the working area through the navigation module, and building the grid map.
[0011] As a preferred solution of the path planning method for an unmanned soil sampling vehicle according to the present invention, wherein: The generation of all required soil sampling point information includes setting the robot operation sampling density and sampling method, sampling density and the location of the soil sample unloading point through the background, and combining the grid map information, the system will obtain the total number S of soil sampling points required for this task n and the location coordinate information of each required soil sampling point;
[0012] By establishing a mathematical model for the optimal node set and the soil sampling vehicle tour path and considering the constraints to be met;
[0013] The mathematical model is expressed as,
[0014]
[0015]
[0016] Wherein, l ij represents the Euclidean distance from soil sampling node i to soil sampling node j, x i is the x coordinate of soil sampling node i, y i is the y coordinate of soil sampling node i, x j is the x coordinate of soil sampling node j, y j is the y coordinate of soil sampling node j, L represents the objective function to be solved, x k ij represents whether the k-th path from soil sampling node i to soil sampling node j is selected by the soil sampling vehicle in the k-th soil sampling tour path. If selected, then x k ij = 1, otherwise x k ij = 0;
[0017] The constraint condition is expressed as
[0018]
[0019] Wherein, and represent that the in-degree and out-degree of node numbered 0 must both be m, indicating that the soil sampling vehicle departs from the soil sample unloading point and will return m times, completing m tour paths, represents that all nodes that need to be sampled have been sampled once, represents that each tour path conforms to the single sampling upper limit N of the soil sampling vehicle, represents that the in-degree and out-degree of all sampling nodes are equal.
[0020] As a preferred solution of the path planning method for the unmanned soil sampling vehicle described in the present invention, wherein: the conversion into a constrained single-depot multi-traveling salesman problem includes regarding the required soil sampling points S n as S n cities to be passed through. The number of tour paths m that the soil sampling vehicle needs to plan is regarded as m traveling salesmen. By using a fixed soil sample unloading point, the problem of optimizing the sampling path sequence of the unmanned soil sampling vehicle can be considered as a single-depot multi-traveling salesman problem.
[0021] As a preferred solution of the path planning method for the unmanned soil sampling vehicle described in the present invention, wherein: the improved genetic algorithm solution includes population initialization, using a two-form chromosome coding method. The first chromosome is a random sequence of all required soil sampling nodes, and the second chromosome is the number of soil sampling nodes required for each of the m tour paths. The first chromosome is initialized with a random sequence, and the second chromosome is implemented using a specified initialization selection rule;
[0022] Calculate the population fitness, add the soil sample unloading point operation, and form m independent paths by adding the soil sample unloading point to the sequence of all required soil sampling nodes in the first chromosome. Use k t to represent the position of the t-th added point in the sequence, that is, add the soil sample unloading point at the position after the k t -th point in the sequence. When t = 1, the k t of the first added point is 0, indicating that the addition is made at the beginning of the sequence. When 2 ≤ t ≤ m + 1, k t is calculated by accumulating the number of soil sampling nodes required for the previous t tour paths plus one, and is expressed as
[0023]
[0024] Fitness function, calculate the overall travel length D through the node sequence after adding the soil sample unloading point, and is expressed as
[0025]
[0026] In the formula, a represents the node at the a-th position in the sequence, and d a,a+1 represents the distance between the node at the a-th position and the node at the a + 1-th position;
[0027] Use the reciprocal of the overall travel length D as the fitness function F, and the specific formula is as follows:
[0028]
[0029] Perform the operation of generating offspring according to the population fitness, and use the roulette wheel method to select parent individuals. The roulette wheel method calculates the probability of each individual appearing in the offspring according to the fitness value of the individual, and randomly selects individuals according to this probability to form the offspring population. The selection probability of individual i is expressed as
[0030]
[0031] In the formula, the fitness value F i of individual i, and the sum of the fitness values of all individuals
[0032] Crossing strategy, by randomly generating two different integers in [0, S n , assign them to x1 and x2 according to their magnitudes respectively. Perform an exchange operation on the segments in the [x1, x2] interval of the first chromosome of the two parents and delete the duplicate nodes. For the nodes missing due to the exchange, fill them in sequence at the end of the first chromosome of the offspring. For the second chromosome of the two parents, form the second chromosome of the offspring by the way of all-exchange;
[0033] Mutation strategy, adopt the same mutation strategy for two different chromosomes, and use the single-point random mutation method to mutate these two chromosomes;
[0034] Selection strategy, use the elitist selection strategy, the role of which is to retain the individuals with larger fitness values in each iteration process;
[0035] Judge whether the set number of iterations is reached. When the set number of iterations is not reached, increment the current number of iterations by one and return to the previous step; when the set number of iterations is reached, output the individual with the optimal fitness obtained by the improved genetic algorithm this time. After adding the soil sample unloading point operation, obtain the order of the optimal soil sampling path points.
[0036] As a preferred scheme of the path planning method for the unmanned soil sampling vehicle described in the present invention, wherein: the connection of the soil sampling points includes establishing a grid map, inflating the obstacle nodes. When starting the search, empty the open list and the closed list, and then put the starting point into the open list; calculate the cost f(n) of the node by using the cost function to search for an optimal path, which is expressed as,
[0037] f(n) = g(n) + h(n) (8)
[0038] In the formula, f(n) is the cost function from the starting point through node n to the end point, g(n) is the actual cost from the starting point to node n, and h(n) is the estimated cost from node n to the end point.
[0039] As a preferred scheme of the path planning method for the unmanned soil sampling vehicle described in the present invention, wherein: the path smoothing includes calculating the slope between points of the trajectory coordinates generated by A*, finding the inflection points by finding the points where the slope changes before and after, taking the inflection points and the two adjacent trajectory points as the control points of the Bezier curve, and performing smoothing processing on this point by using the quadratic Bezier curve, which is expressed as,
[0040] P(t) = (1 - t) 2 ·P0 + 2t(1 - t)·P1 + t 2 ·P2, t ∈ [0, 1].
[0041] Another object of the present invention is to provide a path planning system for an unmanned soil sampling vehicle, which can solve the path planning and optimization problems in the soil sampling process through map construction, effective generation of soil sampling points, path optimization algorithms, and path smoothing processing.
[0042] To solve the above technical problems, the present invention provides the following technical solutions: A path planning system for an unmanned soil sampling vehicle, including: a map construction module, a soil sampling point generation module, a path optimization module, and a smoothing processing module; the map construction module is used to set system data and establish a grid map; the soil sampling point generation module is used to generate all required soil sampling point information and establish a mathematical model; the path optimization module is used to transform the problem of optimizing the soil sampling path into a constrained single-depot multi-traveling salesman problem and solve it using an improved genetic algorithm; the smoothing processing module is used to connect the soil sampling points in sequence according to the order of the optimal soil sampling path points using the A* algorithm, smooth the path, and generate an optimal path.
[0043] A computer device includes a memory and a processor, the memory stores a computer program, and it is characterized in that when the processor executes the computer program, the steps of the path planning method for an unmanned soil sampling vehicle as described above are implemented.
[0044] A computer-readable storage medium stores a computer program thereon, and it is characterized in that when the computer program is executed by a processor, the steps of the path planning method for an unmanned soil sampling vehicle as described above are implemented.
[0045] The beneficial effects of the present invention: The path planning method for an unmanned soil sampling vehicle provided by the present invention can generate the coordinate information of the required soil sampling points according to the set actual area and sampling density, and can better arrange the soil sampling plan according to the actual situation. The present invention transforms the global path optimization problem of the soil sampling vehicle into a single-depot multi-traveling salesman problem according to the single sampling upper limit of the soil sampling vehicle and the total number of required soil sampling points, and uses an improved genetic algorithm to optimize and solve the problem, and can obtain the order of the optimal soil sampling path points. The present invention connects the optimal soil sampling path point sequence in sequence using the A* algorithm, and then smooths the path using a Bezier curve, so as to obtain an optimal working path that satisfies the vehicle kinematics and does not collide. Description of the Drawings
[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0047] Figure 1 The overall flowchart of a path planning method for an unmanned soil sampling vehicle provided by an embodiment of the present invention.
[0048] Figure 2 The schematic flowchart of an improved genetic algorithm in a path planning method for an unmanned soil sampling vehicle provided by the first embodiment of the present invention.
[0049] Figure 3 The graph of the optimal total distance corresponding to the number of iterations in a path planning method for an unmanned soil sampling vehicle provided by the fourth embodiment of the present invention.
[0050] Figure 4 The connection graph of each point of the optimal path in a path planning method for an unmanned soil sampling vehicle provided by the fourth embodiment of the present invention. Detailed implementation manners
[0051] To make the above objects, features, and advantages of the present invention more obvious and understandable, the following will describe the detailed implementation manners of the present invention with reference to the accompanying drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0052] In the following description, many specific details are set forth to facilitate a thorough understanding of the present invention. However, the present invention may be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0053] Embodiment 1
[0054] Refer to Figure 1 - Figure 2 , which is an embodiment of the present invention, and provides a path planning method for an unmanned soil sampling vehicle, including:
[0055] S1. Set system data and establish a grid map.
[0056] The navigation of the soil sampling vehicle uses the Beidou reliable positioning and the fusion of inertial / laser / vision multi-source sensor positioning data, which can realize the perception of the external environment of the operation area, continuous reliable positioning, and precise navigation. After setting the required working area of the unmanned soil sampling vehicle in the vehicle background, the map information in the working area is collected through the navigation module, and the grid map is built.
[0057] S2. Generate all the required soil sampling point information and establish a mathematical model.
[0058] S21. Soil sampling vehicle soil sampling point generation method. By setting the robot operation sampling density and sampling method in the background, the sampling density and the location of the soil sample unloading point, and combining the grid map information, the system will obtain the total number of soil sampling points S required for this task. n and the location coordinate information of each required soil sampling point. Save the coordinate information of the soil sample unloading point to the node and set the number to 0. The remaining nodes need to save the coordinate information of all required soil sampling points and press 1 to S n Number them sequentially.
[0059] S22, by establishing a mathematical model for the optimal node set and soil sampling vehicle circular path and taking into account the constraints that need to be met. n Generally, it will exceed the upper limit N of a single sampling of the soil sampling vehicle, so the sampling path needs to be divided into multiple times. How to ensure the optimal global sampling path is a problem that needs to be considered when designing the path planning system for unmanned soil sampling vehicles. Furthermore, since the time required for unloading soil samples is relatively long, in order to ensure the maximum sampling efficiency, the shorter the unloading times, the better. The present invention adopts the total number of soil sampling points S required for this task. n The result is rounded up to the upper limit N of a single sampling of the soil sampling vehicle, and the total number of planned tour paths for this task is m. How to optimize the total length of these m tour paths becomes a problem that needs to be considered in the present invention.
[0060] S221, mathematical model establishment,
[0061]
[0062] In the formula, l ij represents the Euclidean distance from soil sampling node i to soil sampling node j, x i is the x-coordinate of soil sampling node i, y i is the y coordinate of soil sampling node i, x j is the x-coordinate of soil sampling node j, y j is the y coordinate of soil sampling node j;
[0063]
[0064] In the formula, L represents the target function, x k ij Indicates whether the k-th path from soil sampling node i to soil sampling node j is selected by the soil sampling vehicle in the k-th soil sampling tour path. If selected, x k ij =1, otherwise x k ij =0.
[0065] S222. Constraint establishment:
[0066]
[0067] In the formulas, the first two formulas indicate that the in-degree and out-degree of the node numbered 0 must both be m, which means that the soil sampling vehicle starts from the soil sample unloading point and will return m times, completing m round-trip paths. The third formula indicates that soil sampling has been performed once for all nodes that need to be sampled. The fourth formula indicates that each round-trip path conforms to the single-sampling upper limit N of the soil sampling vehicle. The fifth formula indicates that the in-degree and out-degree of all sampling nodes are equal.
[0068] S3. Transform the problem of optimizing the soil sampling path into a constrained single-depot multi-traveling salesman problem.
[0069] The description of the classical multi-traveling salesman problem is as follows: There are m traveling salesmen who need to traverse a set of cities with n cities and finally return to the starting point to form a loop. It is required that except for the starting point, all cities must be visited exactly once. Find the arrangement plan with the shortest total length that meets the above conditions. The required soil sampling points S n can be regarded as the S n cities to be passed through, and the number m of round-trip paths that the soil sampling vehicle needs to plan is regarded as m traveling salesmen.
[0070] Furthermore, since the present invention uses a fixed soil sample unloading point, the problem of optimizing the sampling path sequence of the unmanned soil sampling vehicle can be transformed into a single-depot multi-traveling salesman problem for consideration, but the number of samplings in a single round-trip path needs to be less than the maximum number of samplings, which can be achieved by adding parameter constraints.
[0071] S4. Use an improved genetic algorithm to solve the constrained single-depot multi-traveling salesman problem.
[0072] When solving, a two-form chromosome coding method is used, and certain rule restrictions are proposed for the initialization process of the second chromosome. Then, the genetic algorithm is optimized through the strategies of selection, crossover, and mutation until the optimal sampling path sequence of the unmanned soil sampling vehicle is finally obtained. For example Figure 2 , including the following steps:
[0073] S41. Population initialization. A two-form chromosome coding method is used. The first chromosome is a random sequence of all required soil sampling nodes, and the second chromosome is the number of soil sampling nodes required for each round-trip path in the m round-trip paths. The first chromosome is initialized with a random sequence. Since the number of soil sampling nodes in a single time needs to be less than the single-sampling upper limit N of the soil sampling vehicle, the present invention realizes this by adding an initialization selection rule for the second chromosome.
[0074] The rules are as follows:
[0075] For the selection of the number of soil sampling nodes required for each of the m round-trip paths, first, divide the actual number of sampling points S n by the upper limit N of the single sampling of the soil sampling vehicle to obtain the remainder N1.
[0076] N1 = S n % N (4)
[0077] Further, when N1 = 0, n j = N (1 ≤ j ≤ m); when N1 > 0, randomly select a number n1 in the interval [N1, N], and save n1 as the number of soil sampling nodes required for the first round-trip path into the second chromosome.
[0078] Further, for the i-th (2 ≤ i ≤ m - 1) segment of the path, subtract the length of the previous i - 1 segments of the path from the actual number of sampling points S n and then divide by the upper limit N of the single sampling of the soil sampling vehicle to obtain the remainder N i .
[0079]
[0080] Further, when N i = 0, n j = N (i ≤ j ≤ m); when N i > 0, randomly select a number n i in the interval [N i , N], and save n i as the number of soil sampling nodes required for the i-th round-trip path into the second chromosome.
[0081] Further, the number of soil sampling nodes n m required for the m-th round-trip path is the actual number of sampling points S n minus the number of soil sampling nodes required for the previous m - 1 round-trip paths. Save n m as the number of soil sampling nodes required for the m-th round-trip path into the second chromosome.
[0082]
[0083] S42. Calculate the fitness of the population:
[0084] S421. Operation of adding soil sample unloading points. Since the second chromosome stores the number of soil sampling nodes required for m round-trip paths, to facilitate subsequent fitness calculation, it is necessary to add soil sample unloading points to all the required soil sampling node sequences in the first chromosome to form m independent paths. The adding method is to add one point at each end of the node sequence and add m - 1 points in the middle of the node sequence, for a total of m + 1 points. In the present invention, k t represents the position of the t-th added point in the sequence, that is, adding a soil sample unloading point at the position after the k t -th point in the sequence. When t = 1, k t of the first added point is 0, indicating adding at the beginning position of the sequence. When 2 ≤ t ≤ m + 1, k t can be calculated by accumulating the number of soil sampling nodes required for the previous t round-trip paths plus one. The specific formula is as follows:
[0085]
[0086] S422. Fitness function. The overall journey length D can be calculated through the node sequence after adding soil sample unloading points. The specific formula is as follows:
[0087]
[0088] In the formula, a represents the node at the a-th position in the sequence, and d a,a+1 represents the distance between the node number saved at the a-th position and the node number saved at the a + 1-th position.
[0089] Furthermore, since the shorter the overall path length, the better, the reciprocal of the overall journey length D is used as the fitness function F. The specific formula is as follows:
[0090]
[0091] S43. Generating offspring operation according to the population fitness:
[0092] Select individuals with high fitness from an old population to generate a new population. In the present invention, the roulette wheel method is used to select parent individuals. The roulette wheel method calculates the probability of each individual appearing in the offspring according to the fitness value of the individual and randomly selects individuals according to this probability to form the offspring population. The selection probability calculation formula for individual i is as follows:
[0093]
[0094] In the formula, the fitness value F i of individual i, and the sum of the fitness values of all individuals
[0095] A probability region is formulated according to the selection probability P(i) of all individuals i. Further, by generating another random number between 0 and 1, the individual is determined to be selected based on which probability region the random number appears in. The selected individual is used as the parent for subsequent crossover operations.
[0096] S44. Crossover strategy: Since each individual has two different chromosomes and the content stored in each chromosome is different, corresponding crossover strategies need to be set for the two different chromosomes according to actual requirements. Specifically, the first chromosome stores a random sequence of all required soil sampling nodes. By changing the access order of different soil sampling nodes, the overall path length can be affected. In the present invention, two different integers are randomly generated in [0, S n , and are respectively assigned to x1 and x2 according to their magnitudes. The segments in the [x1, x2] interval of the first chromosomes of the two parents are exchanged, and the duplicate nodes are deleted. The nodes missing due to the exchange are filled in sequence at the end of the first chromosome of the offspring. The second chromosome stores the number of soil sampling nodes required for each tour path among m tour paths. Since the initialization method of the second chromosome adopted in the present invention will cause the selection of the number of soil sampling nodes required for each tour path in the previous tour paths to affect the number of soil sampling nodes required for each tour path in the subsequent tour paths, in order to prevent problems caused by partial exchange of the second chromosome, the present invention uses the method of completely exchanging the second chromosomes of the two parents to form the second chromosome of the offspring.
[0097] S45. Mutation strategy: The present invention adopts the same mutation strategy for the two different chromosomes and uses the single-point random mutation method to mutate these two chromosomes. The single-point random mutation method can increase the diversity of the overall population and has the effect of preventing the algorithm from falling into local optimum. Specifically, the mutation strategy of the first chromosome of the parent forms a new first chromosome of the offspring by randomly swapping the positions of two soil sampling nodes. The mutation strategy of the second chromosome of the parent forms a new second chromosome of the offspring by randomly swapping the number of soil sampling nodes required for each tour path in the two tour paths.
[0098] S46. Selection strategy: The present invention uses the elitist selection strategy, which is to retain the individuals with larger fitness values in each iteration process and prevent them from mutating or crossing over, so as to maximize the inheritance of the optimal solution. The number of elite individuals accounts for 10% of the population.
[0099] S47. Determine whether the set number of iterations is reached:
[0100] When the set number of iterations is not reached, increment the current number of iterations and return to the previous step; when the set number of iterations is reached, output the individual with the optimal fitness obtained by the improved genetic algorithm this time. After the operation of adding the soil sample unloading point in S421, the order of the optimal soil sampling path points can be obtained.
[0101] S5. Connect the soil sampling points in sequence according to the order of the optimal soil sampling path points using the A* algorithm.
[0102] First, by receiving map information, obstacle information, and target point information, a grid map is established. Since the A* algorithm does not consider the volume size of obstacles and vehicles, in order to prevent the generated path from colliding with obstacles, the present invention uses the method of obstacle expansion to solve this problem, and the expansion radius is the vehicle width plus a certain distance for capacity.
[0103] For m tour paths, connect the soil sampling points in the tour paths in sequence using the A* algorithm. The A* algorithm speeds up the calculation speed of the algorithm by adding a heuristic function h(n) on the basis of the Dijstar algorithm. In the present invention, h(n) is calculated using the Euclidean distance, and the calculation formula is as follows:
[0104]
[0105] In the formula, x n , y n are the abscissa and ordinate of node n, x z , y z are the abscissa and ordinate of the end point. The cost function of the A* algorithm:
[0106] f(n) = g(n) + h(n) (12)
[0107] f(n) is the cost function from the starting point through node n to the end point, g(n) is the actual cost from the starting point to node n, and h(n) is the estimated cost from node n to the end point.
[0108] The search process of the A* algorithm is as follows:
[0109] When the A* algorithm of the present invention performs path search, it uses an 8-neighborhood search method. First, two empty lists are defined, named the open list open_list and the closed list close_list. The open list stores the nodes waiting to be searched, and the closed list stores the nodes that have been searched. Each node has three attributes: the parent node number, g(n), and h(n). When starting the search, the open list and the closed list are emptied, and then the starting point is placed in the open list; the cost function f(n) is used to calculate the cost of the node to search for an optimal path. The node with the smallest f(n) in the open list is added to the closed list, and then the adjacent nodes of this node are searched. If the adjacent node is in the closed list, the node will be ignored; if the adjacent node is in the open list, then compare whether the value of g(n) is smaller after passing through this node. If it holds, update the parent node to this node; if it does not hold, do not make any changes; if the adjacent node has not been searched, add it to the open list. This process continues until the search end point is added to the closed list.
[0110] S6. Path smoothing to generate the optimal path.
[0111] The present invention uses the Bezier algorithm to smooth the trajectory generated by A*. The Bezier curve controls the shape of the curve by selecting control points, and the formed trajectory curve is continuous and differentiable, and satisfies the vehicle kinematic constraints. The Bezier curve formed by n + 1 control points (P0, P1,... P n ) is defined as:
[0112]
[0113] In the formula, B(t) is the Bernstein polynomial.
[0114]
[0115] The present invention calculates the slope between points from the trajectory coordinates generated by A*, finds the inflection points by identifying the points where the slope changes before and after, and uses the inflection point and the two adjacent trajectory points as the control points of the Bezier curve to smooth this point using a quadratic Bezier curve. Since only the inflection points are smoothed, the situation of excessive calculation and inability to run will not occur.
[0116] The equation expression of the quadratic Bezier curve is:
[0117] P(t) = (1 - t) 2 ·P0 + 2t(1 - t)·P1 + t 2 ·P2, t ∈ [0, 1] (15)
[0118] Embodiment 2
[0119] An embodiment of the present invention provides a path planning system for an unmanned soil sampling vehicle, including:
[0120] A map construction module, a soil sampling point generation module, a path optimization module, and a smoothing processing module.
[0121] The map construction module is used to set system data and establish a grid map.
[0122] The soil sampling point generation module is used to generate all the required soil sampling point information and establish a mathematical model;
[0123] The path optimization module is used to transform the problem of optimizing the soil sampling path into a constrained single-depot multi-traveling salesman problem and solve it using an improved genetic algorithm.
[0124] The smoothing processing module is used to connect the soil sampling points in sequence according to the order of the optimal soil sampling path points using the A* algorithm, smooth the path, and generate the optimal path.
[0125] Embodiment 3
[0126] An embodiment of the present invention, which is different from the previous two embodiments, is as follows:
[0127] If the said function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, or a part of this 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0128] The logic and / or steps represented in the flowchart or otherwise described herein can be considered, for example, as a definable sequence list of executable instructions for implementing a logical function, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0129] More specific examples (non-exhaustive list) of computer-readable media include the following: electrical connection parts with one or more wirings (electronic devices), portable computer disk cartridges (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing it in a suitable manner when necessary, and then storing it in a computer memory.
[0130] It should be understood that the various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0131] Embodiment 4
[0132] Referring to Figure 3 - Figure 4 , an embodiment of the present invention provides a path planning method for an unmanned soil sampling vehicle. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through simulation experiments. The simulation has been run in an environment with an Intel processor and 6GB of RAM. The operating system used is 64-bit Windows 7 Ultimate. The soil path optimization system is simulated using the PYTHON programming language, data is recorded, and data graphs are plotted.
[0133] The experimental data are as follows: the upper limit of single sampling of the soil sampling vehicle, the coordinates of the soil sample unloading point are (82, 76), the total number of soil sampling points, the numbers and coordinates of each point are shown in Table 1, and the experimental results are shown in Table 1.
[0134] Table 1 Coordinate Table of Soil Sampling Point Numbers
[0135] Number X Coordinate Y Coordinate 1 96 44 2 50 5 3 49 8 4 13 7 5 29 89 6 58 30 7 84 39 8 14 24 9 2 39 10 3 82 11 5 10 12 98 52 13 84 25 14 61 59 15 1 65 16 88 51 17 91 2 18 19 32 19 93 3 20 50 93 21 98 14 22 5 42 23 42 9 24 61 62 25 9 97 26 80 55 27 57 69 28 23 15 29 20 70 30 85 60 31 98 5
[0136] The improved genetic algorithm is used, and the algorithm parameters are: the population number is 500, the number of iterations is 400, the crossover probability is 0.4, and the mutation probability is 0.4. The experimental results are: the optimal path sequence is [[16,30],[12,1,7,13,19,17,31,21,6,26],[24,14,27,29,15,10,25,5,20],[22,9,18,8,11,4,28,23,2,3]], the optimal total distance is 725.6, and the path sequence with the soil sample unloading point number inserted before and after each path is [[0,16,30,0],[0,12,1,7,13,19,17,31,21,6,26,0],[0,24,14,27,29,15,10,25,5,20,0],[0,22,9,18,8,11,4,28,23,2,3,0]].
[0137] Figure 3 It is detailed that through 400 iterations, the improved genetic algorithm optimizes the total distance of the soil path. As the number of iterations increases, the total distance of the path gradually decreases and finally reaches the optimal value of 725.6.
[0138] Figure 4 It shows the image formed by connecting the coordinates of each point on the optimal path, which can clearly represent the circular tour path required for soil sampling and the distribution of soil sampling points on each circular tour path.
[0139] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not restrictive. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
Claims
1. A path planning method for an unmanned soil sampling vehicle, characterized in that, Including: Set system data and establish a grid map; Generate all required soil sampling point information and establish a mathematical model; Transform the problem of optimizing the soil sampling path into a constrained single-depot multi-traveling salesman problem; Use an improved genetic algorithm to solve the constrained single-depot multi-traveling salesman problem; Connect the soil sampling points in sequence according to the order of the optimal soil sampling path points using the A* algorithm; Smooth the path to generate the optimal path.
2. The path planning method for an unmanned soil sampling vehicle according to claim 1, characterized in that: The establishment of the grid map includes setting in the vehicle background to collect map information within the working area through the navigation module after delimiting the working area required by the unmanned soil sampling vehicle, and constructing the grid map.
3. The path planning method for an unmanned soil sampling vehicle according to claim 2, characterized in that: The generation of all required soil sampling point information includes setting the robot operation sampling density and sampling method, the sampling density and the location of the soil sample unloading point through the background, and combining the grid map information. The system will obtain the total number S of soil sampling points required for this task n and the location coordinate information of each required soil sampling point; Establish a mathematical model based on the optimal node set and the soil sampling vehicle's tour path and consider the constraints to be satisfied; The mathematical model is expressed as where l ij represents the Euclidean distance from soil sampling node i to soil sampling node j, x i is the x - coordinate of soil sampling node i, y i is the y - coordinate of soil sampling node i, x j is the x - coordinate of soil sampling node j, y j is the y - coordinate of soil sampling node j, L represents the objective function to be solved, x k ij represents whether the path from soil sampling node i to soil sampling node j in the k - th path is selected by the soil sampling vehicle in the k - th soil sampling tour path. If it is selected, then x k ij = 1, otherwise x k ij = 0; The constraints are expressed as wherein, and represent that the in-degree and out-degree of the node numbered 0 must both be m, indicating that the soil sampling vehicle departs from the soil sample unloading point and will return m times, completing m round-trip paths, represents that soil sampling has been performed once on all nodes that need to be sampled, represents that each round-trip path meets the single-sampling upper limit N of the soil sampling vehicle, represents that the in-degree and out-degree of all sampling nodes are equal.
4. The path planning method for an unmanned soil sampling vehicle according to claim 3, characterized in that: The conversion into a constrained single-depot multi-traveling salesman problem includes regarding the required soil sampling points S n as the S n cities to be visited. The number m of round-trip paths that the soil sampling vehicle needs to plan is regarded as m traveling salesmen. By adopting a fixed soil sample unloading point, the problem of optimizing the sampling path sequence of the unmanned soil sampling vehicle can be considered as a single-depot multi-traveling salesman problem.
5. The path planning method for an unmanned soil sampling vehicle according to claim 4, characterized in that: The solution of the improved genetic algorithm includes population initialization, using a two-form chromosome coding method. The first chromosome is a random sequence of all required soil sampling nodes, and the second chromosome is the number of soil sampling nodes required for each tour path among m tour paths. The first chromosome is initialized with a random sequence, and the second chromosome is implemented using a specified initialization selection rule; Calculate the population fitness and add the operation of the soil sample unloading point. By adding the soil sample unloading point to all the required soil sampling node sequences in the first chromosome, m independent paths are formed. Use k t to represent the position of the t-th added point in the sequence, that is, add the soil sample unloading point at the position after the k t -th point in the sequence. When t = 1, k t of the first added point is 0, indicating that the addition is made at the beginning of the sequence. When 2 ≤ t ≤ m + 1, k t is calculated by accumulating the number of soil sampling nodes required for the previous t tour paths plus one, expressed as Fitness function, calculate the overall travel length D through the node sequence after adding the soil sample unloading points, expressed as where a represents the node at the a-th position in the sequence, and d a,a+1 represents the distance between the node at the a-th position and the node at the (a + 1)-th position; Use the reciprocal of the overall travel length D as the fitness function F, and the specific formula is as follows: Generate offspring operations according to the population fitness, use the roulette wheel method to select parent individuals. The roulette wheel method calculates the probability of each individual appearing in the offspring based on the fitness value of the individual, and randomly selects individuals according to this probability to form the offspring population. The selection probability of individual i is expressed as In the formula, the fitness value F of individual i i , and the sum of the fitness values of all individuals Crossing strategy, by randomly generating two different integers in [0, S n , and assigning them to x1 and x2 according to their magnitudes. Perform a swapping operation on the segments in the [x1, x2] interval of the first chromosome of the two parents and delete the duplicate nodes. For the nodes missing due to the swapping, fill them in sequence at the end of the first chromosome of the offspring. For the second chromosome of the two parents, perform a full swap to form the second chromosome of the offspring; Mutation strategy, adopt the same mutation strategy for two different chromosomes, and use the single-point random mutation method to mutate these two chromosomes; Selection strategy, use the elitist selection strategy, which is used to retain the individuals with larger fitness values in each iteration process; Judge whether the set number of iterations is reached. When the set number of iterations is not reached, increment the current number of iterations by one and return to the previous step; when the set number of iterations is reached, output the individual with the optimal fitness obtained by this improved genetic algorithm. After the operation of adding the soil sample unloading points, obtain the order of the optimal soil sampling path points.
6. The path planning method for an unmanned soil sampling vehicle according to claim 5, characterized in that: The connection of the soil sampling points includes establishing a grid map, dilating the obstacle nodes. When starting the search, empty the open list and the closed list, and then put the starting point into the open list; calculate the cost f(n) of the node using the cost function to search for an optimal path, expressed as f(n) = g(n) + h(n) (8) In the formula, f(n) is the cost function from the starting point through node n to the end point, g(n) is the actual cost from the starting point to node n, and h(n) is the estimated cost from node n to the end point.
7. The path planning method for an unmanned soil sampling vehicle according to claim 6, characterized in that: The path smoothing includes calculating the slope between points for the trajectory coordinates generated by the A* algorithm. By finding the points where the slope changes before and after, i.e., the inflection points, the inflection points and the two adjacent trajectory points are used as the control points of the Bezier curve, and the quadratic Bezier curve is used to smooth this point, expressed as, P(t) = (1 - t) 2 ·P0 + 2t(1 - t)·P1 + t 2 ·P2, t ∈ [0, 1].
8. A system adopting the path planning method for an unmanned soil sampling vehicle as described in any one of claims 1 to 7, characterized in that, including: a map construction module, a soil sampling point generation module, a path optimization module, and a smoothing processing module; The map construction module is used to set system data and establish a grid map; The soil sampling point generation module is used to generate all the required soil sampling point information and establish a mathematical model; The path optimization module is used to transform the problem of optimizing the soil sampling path into a constrained single-depot multi-traveling salesman problem and solve it using an improved genetic algorithm; The smoothing processing module is used to connect the soil sampling points in sequence according to the order of the optimal soil sampling path points using the A* algorithm, smooth the path, and generate the optimal path.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the path planning method for an unmanned soil sampling vehicle according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the path planning method for an unmanned soil sampling vehicle according to any one of claims 1 to 7.