A parking path planning method and system based on improved ant colony algorithm
By improving the ant colony algorithm in intelligent parking robot path planning, using differentiated pheromones and hierarchical division to accelerate the search, and combining the corner evaluation function to optimize the path, the problems of path redundancy and smoothness are solved, and a more efficient and smooth path is achieved. More accurate parking path planning.
Patent Information
- Application Number
- CN202210570957.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-05-24
AI Technical Summary
During path planning of existing intelligent parking robots, the initial pheromones are too uniform, resulting in low search efficiency, redundant paths, and no consideration of actual operating conditions. There are many turns and the path is not smooth.
Using a method based on the improved ant colony algorithm, by differentially processing the initial pheromone, the ant colony is divided into an optimization layer ant colony and an optimization layer ant colony. The estimation function and the corner evaluation function are introduced to optimize the state transition rules and iterate. Search, and finally select the optimal path and smooth it.
The accuracy of path search is improved, the number of turns and path length are reduced, the operating efficiency of the parking robot is improved, and the obtained path is more robust and practical.
Smart Images

Figure CN114721402B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of path planning, and relates to a parking path planning method and system based on an improved ant colony algorithm. Background Art
[0002] As the number of cars continues to increase, the demand for parking spaces in cities is increasing day by day, and the problem of "difficult parking" is becoming increasingly prominent. The development from traditional manually guarded parking lots to mechanically lifted parking garages has solved the problem of "difficult parking" to a certain extent, but there are still defects such as high cost and low capacity. In recent years, smart parking garages have played an important role. Smart parking garages have the characteristics of high space utilization, saving management costs, fully enclosed garages, and high safety. The core of smart parking garages is the smart parking robot, which uses smart parking robots to uniformly plan and store vehicles.
[0003] At present, it is common to use ant colony algorithm for global path planning of intelligent parking robots, but the ant colony algorithm still has certain defects: first, when performing path planning, the initial pheromone is too uniform and lacks certain guidance, resulting in low algorithm search efficiency; second, the ant colony algorithm is a parallel structure, but there is no difference between ant colonies, and there will be a lot of path redundancy when selecting paths; in addition, the ant colony algorithm generates paths without considering the actual operating conditions, and there are problems such as a large number of turns and an uneven path. Summary of the invention
[0004] The purpose of the present invention is to solve the problems in the prior art and to provide a parking path planning method and system based on an improved ant colony algorithm.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A parking path planning method based on an improved ant colony algorithm comprises the following steps:
[0007] S1: Establish a two-dimensional grid map of the garage, perform differential processing on the initial pheromone, and divide the ant population into the optimal layer ant colony and the optimization layer ant colony;
[0008] S2: Calculate the heuristic function and state transition rule of the ant colony in the optimal layer, introduce the estimation function into the heuristic function of the ant colony, perform path optimization through iteration, obtain several search paths of the ant colony in the optimal layer, and judge whether the ant colony in the optimal layer has completed the path search. If so, execute S4, otherwise repeat S2;
[0009] S3: Calculate the heuristic function and state transition rule of the optimization layer ant colony. In the state transition rule, introduce the corner evaluation function, perform path optimization through iteration, obtain several search paths of the optimization layer ant colony, and judge whether the ant colony in the optimization layer has completed the path search. If so, execute S4, otherwise repeat S3;
[0010] S4: After the path search is completed, the pheromones of the optimal layer ant colony and the optimization layer ant colony are updated respectively. Based on the updated optimal layer ant colony and the optimization layer ant colony, it is determined whether the ant colony has reached the target number of iterations. If so, S5 is executed. Otherwise, the optimal layer ant colony executes S2 and the optimization layer ant colony executes S3.
[0011] S5: Select the shortest distance walked by all ants in the optimal layer ant colony and the optimization layer ant colony as the optimal path, smooth the optimal path, and obtain the smoothed path and algorithm convergence curve diagram.
[0012] A further improvement of the present invention is:
[0013] In step S1, the steps of performing differential processing on the initial pheromone are:
[0014] Connect the set starting point and end point, set the area of the path as S1, diffuse part of the area outward from S1, the diffused part of the area is S2, the initialization pheromone concentration of S2 is lower than the pheromone concentration of S1, S2 continues to diffuse part of the area outward, set it as S3, the initialization pheromone concentration of S3 is lower than the pheromone concentration of S2, the initial pheromone content of different areas is expressed as follows:
[0015] τ0=d sg *c (1)
[0016] Among them, d sg is the Euclidean distance from the starting point to the end point; c is the pheromone concentration coefficient.
[0017] In step S1, the method of dividing the ant population into the optimal layer ant colony and the optimization layer ant colony is:
[0018]
[0019] y=mx (3)
[0020] Among them: x is the number of ant colonies in the optimization layer, Ogrid is the number of infeasible grids; Agrid is the number of all grids, m is the number of ants; h is the ant balance factor, and y is the number of ant colonies in the optimization layer.
[0021] The step S2 comprises the following steps:
[0022] The estimation function d(j,g) is introduced into the heuristic function of the optimal layer ant colony:
[0023]
[0024] Among them, ε and ζ are constants with a value range of (0,1); (x j ,y j ) and (x g ,y g ) are the coordinate values of node j and the end grid respectively; d(i,j) and d(j,g) are the Euclidean distances between nodes (i,j) and (j,g) respectively;
[0025] The state transition rule of the optimal layer ant colony is:
[0026]
[0027] in, represents the transition probability, τ ij (t) represents the pheromone concentration between nodes (i, j); η ij (t) represents the heuristic information between nodes (i, j); α and β represent the pheromone concentration coefficient and the heuristic function coefficient respectively; allowed k Represents the set of node grids that ant k can choose in the next step.
[0028] The step S3 comprises the following steps:
[0029] The heuristic function of the optimization layer ant colony is:
[0030]
[0031] Where, d jg is the Euclidean distance between nodes (j, g);
[0032] The state transition rule of the optimization layer ant colony is:
[0033] Introducing the angle evaluation function, first calculate the angle θ1 from the current node to the next node,
[0034]
[0035] Among them, (x i ,y i ) is the current node coordinate, (x j ,y j ) is the coordinate of the next optional node;
[0036] Calculate the angle θ2 between the current node and the end point,
[0037]
[0038] Among them, (xi ,y i ) is the coordinate of the current node, (x g ,y g ) are the coordinates of the end point;
[0039] Difference between Θ1 and Θ2 and take the absolute value.
[0040] Θ=|Θ1-Θ2|(9)
[0041] Among them, when the Θ value is larger, the angle between Θ1 and Θ2 is larger; when the Θ value is smaller, the angle between Θ1 and Θ2 is smaller;
[0042] The corner evaluation function of the optimization layer ant colony is set based on the Θ value:
[0043]
[0044] The state transition rule of the optimization layer ant colony is:
[0045]
[0046] in, represents the transition probability, τ ij (t) represents the pheromone concentration between nodes (i, j); α and β represent the pheromone concentration coefficient and the heuristic function coefficient respectively; allowed k Represents the set of node grids that ant k can choose in the next step.
[0047] In the step S4,
[0048] The steps of updating the pheromone of the optimal layer ant colony are:
[0049]
[0050] Among them, τ ij (t) represents the pheromone on the node (i, j), ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment at node (i, j), and Q represents the pheromone intensity; represents the pheromone released by the kth ant on the path; μ is the pheromone compensation factor, which is used to give additional compensation for the pheromone on the current optimal path;
[0051] The steps of updating the optimization layer ant colony pheromone are as follows:
[0052] τ ij (t+1)=(1-ρ)τ ij (t)+Δτ ij (t)
[0053]
[0054] Where: τ ij (t) represents the pheromone concentration at node (i, j); ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment on the node (i, j) in this ant cycle; represents the pheromone released by the kth ant on the path.
[0055] The step S5 comprises the following steps:
[0056] The optimal path is smoothed by establishing the expression of the B-spline curve:
[0057]
[0058] Where P i is the coordinate for generating the optimal path; D i,k (u) is the basis function of the B-spline curve; u is the independent variable;
[0059] D i,k The expression of (u) is as follows:
[0060]
[0061] In the formula, u i is a non-decreasing sequence of node vector values, which is defined as: (u0,u1,...,u k ,u k+1 ,...,u n+k ).
[0062] A parking path planning system based on an improved ant colony algorithm comprises an ant colony stratification module, an ant colony path search module in an optimization layer, an ant colony path search module in an optimization layer, a pheromone update module and a path processing module;
[0063] Ant colony stratification module, used to build a two-dimensional grid map of the garage, differentiate the initial pheromones, and divide the ant population into the optimal layer ant colony and the optimization layer ant colony;
[0064] The optimal layer ant colony path search module is used to calculate the heuristic function and state transition rule of the optimal layer ant colony, introduce the estimation function into the heuristic function of the optimal layer ant colony, perform path optimization through iteration, obtain several search paths of the optimal layer ant colony, and judge whether the ant colony in the optimal layer has completed the path search;
[0065] The optimization layer ant colony path search module is used to calculate the heuristic function and state transition rule of the optimization layer ant colony. In the state transition rule, the corner evaluation function is introduced to perform path optimization through iteration to obtain several search paths of the optimization layer ant colony and determine whether the ant colony in the optimization layer has completed the path search;
[0066] The pheromone updating module is used to update the pheromones of the optimal layer ant colony and the optimization layer ant colony after the path search is completed, and judge whether the ant colony has reached the target number of iterations based on the updated optimal layer ant colony and the optimization layer ant colony;
[0067] The path processing module is used to select the shortest distance walked by all ants in the optimization layer ant colony and the optimization layer ant colony as the optimal path, smooth the optimal path, and obtain the smoothed path and algorithm convergence curve diagram.
[0068] A terminal device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods disclosed in the present invention when executing the computer program.
[0069] A computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of any method disclosed in the present invention.
[0070] Compared with the prior art, the present invention has the following beneficial effects:
[0071] The present invention discloses a parking path planning method based on an improved ant colony algorithm, which performs differentiated processing on initial pheromones, provides certain guidance to the initial ant colony, avoids the blindness of ant path search, divides the ant colony into an optimization layer ant colony and an optimization layer ant colony, introduces an estimation function into the heuristic function of the optimization layer ant colony, accelerates the convergence of the algorithm, adds a turning angle evaluation function into the state transfer rule of the optimization layer ant colony, reduces path redundancy, obtains multiple paths through iterative search, further selects the optimal path from the multiple paths, and performs additional compensation on the optimal path through updating the pheromones, accelerates the convergence of the algorithm, avoids the blindness of the algorithm search, and finally smoothly optimizes the optimal path to obtain the final path. The present invention reduces the number of turns and the path length of the intelligent parking robot, improves the accuracy of path search, and the obtained path has stronger robustness and practicality, thereby improving the operation efficiency of the parking robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0073] Figure 1 is a flow chart of the present invention;
[0074] Figure 2 A schematic diagram of the relationship between the grid map sequence number and coordinates of the present invention;
[0075] Figure 3 It is a schematic diagram of initial pheromone differentiation of the path planning method of the present invention;
[0076] Figure 4 A schematic diagram of smoothing processing of the path planning method of the present invention;
[0077] Figure 5 It is the optimal path diagram of the existing ant colony algorithm in the 20x20 grid map;
[0078] Figure 6 The optimal path map after smoothing in the 20x20 grid map by the path planning method of the present invention;
[0079] Figure 7 It is the optimal path diagram of the existing ant colony algorithm in the 30x30 grid map;
[0080] Figure 8 The optimal path map after smoothing in the 30x30 grid map by the path planning method of the present invention;
[0081] Fig. 9 It is the convergence curve of the existing ant colony algorithm and the improved ant colony algorithm of the present invention in the 20x20 grid map.
[0082] Fig.10 It is the convergence curve of the existing ant colony algorithm and the improved ant colony algorithm of the present invention in the 30x30 grid map. DETAILED DESCRIPTION
[0083] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0084] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0085] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0086] In the description of the embodiments of the present invention, it should be noted that if the terms "upper", "lower", "horizontal", "inner", etc. indicate an orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of the invention is usually placed when in use, it is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0087] In addition, if the term "horizontal" appears, it does not mean that the component must be absolutely horizontal, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", which does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0088] In the description of the embodiments of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0089] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0090] See also Figure 1 The present invention discloses a parking path planning method based on an improved ant colony algorithm, comprising the following steps:
[0091] Step 1: In order to simplify the processing of the smart garage model, create a grid map of the smart garage, set the relevant parameters of the method operation, and divide the ants into the optimal layer ant colony and the optimization layer ant colony.
[0092] Among them, the raster map is Figure 2 As shown, the black area represents the parking space where there are cars or walls, indicating an infeasible area, represented by 1; the white grid represents the area where the intelligent parking robot can drive freely or the location where the car is parked, represented by 0; a coordinate system is established in the two-dimensional grid map, and the coordinate system is encoded and converted into a serial number:
[0093]
[0094] a is the side length of the two-dimensional grid; i is the grid sequence number; M is the dimension of the grid map; mod is the remainder operation; ceil is the rounding operation; x i ,y i is the coordinate position of each grid;
[0095] When setting the ant parameters, the initial pheromone needs to be processed differently: connect the starting point and the end point, set the area of the path as S1, and set the initial pheromone concentration of the S1 area to the maximum value of the entire map. S1 area diffuses outward to a certain area, which is S2. The initial pheromone concentration of S2 is lower than that of S1 area. S2 area continues to diffuse outward to a certain area, which is S3. The initial pheromone concentration of S3 is lower than that of S2. See Figure 3 ; The expressions of initial pheromone content in different regions are as follows:
[0096] τ0=d sg *c(1)
[0097] Among them, d sg is the Euclidean distance from the starting point to the end point;
[0098] c is the pheromone concentration coefficient, which varies in different regions.
[0099] Among them, ants are divided into layers as follows:
[0100]
[0101] y=mx(3)
[0102] Among them: x is the number of ant colonies in the optimization layer, Ogrid is the number of infeasible grids; Agrid is the number of all grids, m is the number of ants; h is the ant balance factor, and y is the number of ant colonies in the optimization layer.
[0103] Step 2: The optimization layer calculates the heuristic function, calculates the state transition rule of the node to be selected, and uses the roulette method to select the next node.
[0104] Among them, the optimal layer ant colony heuristic function and state transition rules are as follows:
[0105]
[0106] Among them, ε and ζ are constants with a value range of (0,1); (x j ,y j ) and (x g ,y g ) are the coordinate values of node j and the end grid respectively; d(i,j) and d(j,g) are the Euclidean distances between nodes (i,j) and (j,g) respectively; represents the transition probability, τij (t) represents the pheromone concentration between nodes (i, j); η ij (t) represents the heuristic information between nodes (i, j); α and β represent the pheromone concentration coefficient and the heuristic function coefficient respectively; allowed k Represents the set of optional node grids for ant k's next step.
[0107] When the introduction of d jg After the distance formula is obtained, when the distance between the next node grid j and the end grid g is closer, the value of the heuristic function is larger, and combined with the state transition rule, the probability of node j being selected is greater. Therefore, by introducing d jg After that, it is beneficial to improve the efficiency of algorithm search and promote the accelerated convergence of the algorithm.
[0108] Step 3: The optimization layer calculates the heuristic function and the state transition rule of the node to be selected, and uses the roulette method to select the next node. The heuristic function of the optimization layer ant colony is as follows:
[0109]
[0110] Among them, η is the heuristic function of the optimization layer ant colony, d jg is the Euclidean distance between nodes (j, g), which helps ants choose nodes closer to the end point.
[0111] In order to avoid redundant turning points in the ant search process, the corner evaluation function is introduced into the optimization layer ant colony state transition rule, and the corner evaluation function is used as one of the influencing factors of the state transition rule.
[0112] First, find the angle θ1 from the current node to the next node. The expression is as follows:
[0113]
[0114] Among them, (x i ,y i ) is the current node coordinate, (x j ,y j ) is the coordinate of the next optional node; Θ1 is the angle from the current node to the next node.
[0115] Then find the angle θ2 between the current node and the end point, the expression is as follows:
[0116]
[0117] Among them, (x i ,y i ) is the coordinate of the current node, (x g ,y g ) are the coordinates of the end point.
[0118] The angle θ1 between the current node and the next optional node is subtracted from the angle θ2 between the current node and the end point and the absolute value is taken. The expression is as follows:
[0119] Θ=|Θ1-Θ2| (9)
[0120] Among them, when the Θ value is larger, the angle between the two directions is larger; when the Θ value is smaller, the angle between the two directions is smaller.
[0121] Using different Θ values to set the angle evaluation function, the expression is as follows:
[0122]
[0123] The state transfer rules of the optimization layer ant colony are as follows:
[0124]
[0125] in, represents the transition probability, τ ij (t) represents the pheromone concentration between nodes (i, j); α and β represent the pheromone concentration coefficient and the heuristic function coefficient respectively; allowed k Represents the set of optional node grids for ant k's next step.
[0126] Among them, f(Θ) is the angle evaluation function. When the Θ value is smaller, the angles in the two directions are smaller, and the direction of the next optional node is closer to the direction of the end point. The larger the value of the angle evaluation function, the greater the probability of the node being selected. The direction of the end point has a certain guiding effect on node selection, so that the robot moves in the direction of the end point as much as possible, thereby reducing path redundancy.
[0127] Step 4: The optimization layer ant colony and the optimization layer ant colony respectively determine whether the current ant has reached the end point and whether there is a feasible node. If the ant has not reached the end point and there is a feasible node, the optimization layer ant colony jumps to step 2 and the optimization layer ant colony jumps to step 3. If the ant reaches the end point or there is no feasible node, it jumps to step 5.
[0128] Step 5: Determine whether all ants have completed the path search in the iteration. If there are still ants that have not completed the path search, the optimization layer ant colony jumps to step 2 and the optimization layer ant colony jumps to step 3; if all ants have completed the path search, go to step 6.
[0129] Step 6: Record the length of the route walked by each ant and the optimal path in this iteration. The optimal layer ant colony and the optimization layer ant colony each update the pheromone.
[0130] Among them, the pheromone update of the optimal layer ant colony is carried out as follows:
[0131]
[0132] Among them, τ ij (t) represents the pheromone on the node (i, j), ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment at node (i, j), Q pheromone intensity; represents the pheromone released by the kth ant on the path; μ is the pheromone compensation factor, which is used to give additional compensation for the pheromone on the current optimal path.
[0133] Among them, the optimization layer ant colony pheromone update is carried out as follows:
[0134] τ ij (t+1)=(1-ρ)τ ij (t)+Δτ ij (t)
[0135]
[0136] Where: τ ij (t) represents the pheromone concentration at node (i, j); ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment on the node (i, j) in this ant cycle; represents the pheromone released by the kth ant on the path;
[0137] Step 7: Determine whether the number of iterations reaches the maximum number of iterations NC set in advance max If yes, the optimal path is smoothed, and then the smoothed path and the algorithm convergence curve are output; otherwise, the optimization layer ant colony jumps to step 2, and the optimization layer ant colony jumps to step 3.
[0138] Among them, the optimal path is smoothed using the B-spline curve method, and the expression of the B-spline curve is as follows:
[0139]
[0140] Where P i Generate the coordinates of the optimal path for the present invention; D i,k (u) is the basis function of the B-spline curve, where k is 3; u is the independent variable.
[0141] Among them, the B-spline curve basis function D i,k The expression of (u) is as follows:
[0142]
[0143] In the formula, u iis a non-decreasing sequence of node vector values, which is defined as: (u0,u1,...,u k ,u k+1 ,...,u n+k ), generally the first and last values are 0 and 1, and 0 / 0=0 is defined.
[0144] The embodiment of the present invention uses a quasi-uniform cubic B-spline curve method to achieve changes in local control points without affecting the global path, and smoothes the optimal path generated by the algorithm of the present invention at the turning tip. The effect is shown in FIG. Figure 4 .
[0145] The method disclosed in the embodiment of the present invention performs differentiated processing on the initial pheromone when setting the ant parameters in the initial stage. The initial pheromone content in different areas is different. The initial pheromone content is the largest on the path connecting the starting point and the end point, which provides certain guidance to the initial ant colony and avoids the blindness of the ant search.
[0146] The present invention provides a path planning method for an intelligent parking robot based on an improved ant colony algorithm, in which an ant colony is divided into two levels: an optimization layer and an optimization layer; the heuristic function of the ant colony in the optimization layer is integrated with A * The idea of the algorithm is to introduce an estimation function, make additional compensation for the optimal path in the pheromone update rule, accelerate the convergence of the algorithm, and avoid the blindness of the algorithm search; the heuristic function of the optimization layer ant colony selects the distance formula from the next node to the end point, and adds a turning angle evaluation function to the state transfer rule to accelerate the convergence of the algorithm and reduce path redundancy. Finally, the optimal path generated by the embodiment of the present invention is smoothly optimized, which reduces the number of turns of the intelligent parking robot, makes the desired path more robust and practical, improves the operating efficiency of the intelligent parking robot, and successfully completes the parking task.
[0147] The embodiment of the present invention discloses a verification process, see Figure 5-10 , the improved ant colony algorithm described in the present invention is used for comparative verification with the existing ant colony algorithm.
[0148] 20*20 and 30*30 grid maps are established, and the existing algorithm and the improved ant colony algorithm in this paper are used for path planning; Tables 1 and 2 show the simulation results of 50 iterations respectively.
[0149] Table 1 Simulation results of two algorithms in 20*20 environment
[0150]
[0151] Table 2 Simulation results of two algorithms in 30*30 environment
[0152]
[0153] It can be seen from Table 1 that in a 20*20 environment, both the improved ant colony algorithm of the embodiment of the present invention and the existing ant colony algorithm can find the shortest path of 29.213, but the average path of the present invention is shorter than that of the existing ant colony algorithm, which is reduced by about 7.7%. The number of turning points and the optimal number of iterations of the improved ant colony algorithm of the present invention are both smaller than those of the existing ant colony algorithm, which are reduced by 18.2% and 55.5% respectively. By smoothing the optimal path, the smoothed path is 28.633, which is 2% lower than that before smoothing.
[0154] As shown in Table 2, in a 30*30 environment, the improved algorithm of the present invention can search for a shorter path. Compared with the existing ant colony algorithm, the optimal path and the average path are reduced by 11% and 10.8% respectively. The turning point and the optimal number of iterations of the improved algorithm of the present invention are 16 and 9 respectively, which are reduced by 36% and 30.8% compared with the existing ant colony algorithm. By smoothing the optimal path, the smoothed path is 42.824, which is 2.5% lower than before smoothing.
[0155] In summary, in terms of quality of search, convergence speed and redundant turning points, through experimental comparison of different environment maps, the intelligent parking robot path planning method based on the improved ant colony algorithm described in the present invention is better and more practical than the existing ant colony algorithm.
[0156] The embodiment of the present invention discloses a parking path planning system based on an improved ant colony algorithm, including an ant colony stratification module, an optimization layer ant colony path search module, an optimization layer ant colony path search module, a pheromone update module and a path processing module;
[0157] Ant colony stratification module, used to build a two-dimensional grid map of the garage, differentiate the initial pheromones, and divide the ant population into the optimal layer ant colony and the optimization layer ant colony;
[0158] The optimal layer ant colony path search module is used to calculate the heuristic function and state transition rule of the optimal layer ant colony, introduce the estimation function into the heuristic function of the optimal layer ant colony, perform path optimization through iteration, obtain several search paths of the optimal layer ant colony, and judge whether the ant colony in the optimal layer has completed the path search;
[0159] The optimization layer ant colony path search module is used to calculate the heuristic function and state transition rule of the optimization layer ant colony. In the state transition rule, the corner evaluation function is introduced to perform path optimization through iteration to obtain several search paths of the optimization layer ant colony and determine whether the ant colony in the optimization layer has completed the path search;
[0160] The pheromone updating module is used to update the pheromones of the optimal layer ant colony and the optimization layer ant colony after the path search is completed, and judge whether the ant colony has reached the target number of iterations based on the updated optimal layer ant colony and the optimization layer ant colony;
[0161] The path processing module is used to select the shortest distance walked by all ants in the optimization layer ant colony and the optimization layer ant colony as the optimal path, smooth the optimal path, and obtain the smoothed path and algorithm convergence curve diagram.
[0162] A schematic diagram of a terminal device provided in an embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0163] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.
[0164] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0165] The processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0166] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.
[0167] If the module / unit integrated in the terminal device 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 this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0168] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A parking path planning method based on an improved ant colony algorithm, characterized in that: The following steps are involved: S1: Establish a two-dimensional grid map of the garage, perform differential processing on the initial pheromone, and divide the ant population into the optimal layer ant colony and the optimization layer ant colony; S2: Calculate the heuristic function and state transition rule of the ant colony in the optimal layer, introduce the estimation function into the heuristic function of the ant colony, perform path optimization through iteration, obtain several search paths of the ant colony in the optimal layer, and judge whether the ant colony in the optimal layer has completed the path search. If so, execute S4, otherwise repeat S2; S3: Calculate the heuristic function and state transition rule of the optimization layer ant colony. In the state transition rule, introduce the corner evaluation function, perform path optimization through iteration, obtain several search paths of the optimization layer ant colony, and judge whether the ant colony in the optimization layer has completed the path search. If so, execute S4, otherwise repeat S3; S4: After the path search is completed, the pheromones of the optimal layer ant colony and the optimization layer ant colony are updated respectively. Based on the updated optimal layer ant colony and the optimization layer ant colony, it is determined whether the ant colony has reached the target number of iterations. If so, S5 is executed. Otherwise, the optimal layer ant colony executes S2 and the optimization layer ant colony executes S3. S5: Select the shortest distance walked by all ants in the optimal layer ant colony and the optimization layer ant colony as the optimal path, smooth the optimal path, and obtain the smoothed path and algorithm convergence curve diagram; The step S3 comprises the following steps: The heuristic function of the optimization layer ant colony is: Where, d jg is the Euclidean distance between nodes (j, g); The state transition rule of the optimization layer ant colony is: Introducing the angle evaluation function, first calculate the angle θ1 from the current node to the next node, Among them, (x i ,y i ) is the current node coordinate, (x j ,y j ) is the coordinate of the next optional node; Calculate the angle θ2 between the current node and the end point, Among them, (x i ,y i ) is the coordinate of the current node, (x g ,y g ) are the coordinates of the end point; Difference between Θ1 and Θ2 and take the absolute value. Θ=|Θ1-Θ2| (9) Among them, when the Θ value is larger, the angle between Θ1 and Θ2 is larger; when the Θ value is smaller, the angle between Θ1 and Θ2 is smaller; The corner evaluation function of the optimization layer ant colony is set based on the Θ value: The state transition rule of the optimization layer ant colony is: in, represents the transition probability, τ ij (t) represents the pheromone concentration between nodes (i, j); α and β represent the pheromone concentration coefficient and the heuristic function coefficient respectively; allowed k represents the set of node grids that ant k can choose next; In the step S4, The steps of updating the pheromone of the optimal layer ant colony are: Among them, τ ij (t) represents the pheromone on the node (i, j), ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment at node (i, j), and Q represents the pheromone intensity; represents the pheromone released by the kth ant on the path; μ is the pheromone compensation factor, which is used to give additional compensation for the pheromone on the current optimal path; The steps of updating the optimization layer ant colony pheromone are as follows: Where: τ ij (t) represents the pheromone concentration at node (i, j); ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment on the node (i, j) in this ant cycle; represents the pheromone released by the kth ant on the path.
2. The parking path planning method based on improved ant colony algorithm according to claim 1, characterized in that: In step S1, the steps of performing differential processing on the initial pheromone are: Connect the set starting point and end point, set the area of the path as S1, diffuse part of the area outward from S1, the diffused part of the area is S2, the initialization pheromone concentration of S2 is lower than the pheromone concentration of S1, S2 continues to diffuse part of the area outward, set it as S3, the initialization pheromone concentration of S3 is lower than the pheromone concentration of S2, the initial pheromone content of different areas is expressed as follows: τ0=d sg *c (1) Among them, d sg is the Euclidean distance from the starting point to the end point; c is the pheromone concentration coefficient.
3. The parking path planning method based on improved ant colony algorithm according to claim 2 is characterized in that: In step S1, the method of dividing the ant population into the optimal layer ant colony and the optimization layer ant colony is: y=mx (3) Among them: x is the number of ant colonies in the optimization layer, Ogrid is the number of infeasible grids; Agrid is the number of all grids, m is the number of ants; h is the ant balance factor, and y is the number of ant colonies in the optimization layer.
4. The parking path planning method based on improved ant colony algorithm according to claim 1, characterized in that: The step S2 comprises the following steps: The estimation function d(j,g) is introduced into the heuristic function of the optimal layer ant colony: Among them, ε and ζ are constants with a value range of (0,1); (x j ,y j ) and (x g ,y g ) are the coordinate values of node j and the end grid respectively; d(i,j) and d(j,g) are the Euclidean distances between nodes (i,j) and (j,g) respectively; The state transition rule of the optimal layer ant colony is: in, represents the transition probability, τ ij (t) represents the pheromone concentration between nodes (i, j); η ij (t) represents the heuristic information between nodes (i, j); α and β represent the pheromone concentration coefficient and the heuristic function coefficient respectively; allowed k Represents the set of node grids that ant k can choose in the next step.
5. The parking path planning method based on improved ant colony algorithm according to claim 1, characterized in that: The step S5 comprises the following steps: The optimal path is smoothed by establishing the expression of the B-spline curve: Where P i is the coordinate for generating the optimal path; D i,k (u) is the basis function of the B-spline curve; u is the independent variable; D i,k The expression of (u) is as follows: In the formula, u i is a non-decreasing sequence of node vector values, which is defined as: (u0,u1,...,u k ,u k+1 ,...,u n+k ).
6. A parking path planning system based on an improved ant colony algorithm for implementing the method of claim 1, characterized in that: It includes ant colony stratification module, optimization layer ant colony path search module, optimization layer ant colony path search module, pheromone update module and path processing module; Ant colony stratification module, used to build a two-dimensional grid map of the garage, differentiate the initial pheromones, and divide the ant population into the optimal layer ant colony and the optimization layer ant colony; The optimal layer ant colony path search module is used to calculate the heuristic function and state transition rule of the optimal layer ant colony, introduce the estimation function into the heuristic function of the optimal layer ant colony, perform path optimization through iteration, obtain several search paths of the optimal layer ant colony, and judge whether the ant colony in the optimal layer has completed the path search; The optimization layer ant colony path search module is used to calculate the heuristic function and state transition rule of the optimization layer ant colony. In the state transition rule, the corner evaluation function is introduced to perform path optimization through iteration to obtain several search paths of the optimization layer ant colony and determine whether the ant colony in the optimization layer has completed the path search; The pheromone updating module is used to update the pheromones of the optimal layer ant colony and the optimization layer ant colony after the path search is completed, and judge whether the ant colony has reached the target number of iterations based on the updated optimal layer ant colony and the optimization layer ant colony; A path processing module is used to select the shortest distance walked by all ants in the optimization layer ant colony and the optimization layer ant colony as the optimal path, smooth the optimal path, and obtain the smoothed path and algorithm convergence curve diagram; The optimization layer ant colony path search module also includes: The heuristic function of the optimization layer ant colony is: Where, d jg is the Euclidean distance between nodes (j, g); The state transition rule of the optimization layer ant colony is: Introducing the angle evaluation function, first calculate the angle θ1 from the current node to the next node, Among them, (x i ,y i ) is the current node coordinate, (x j ,y j ) is the coordinate of the next optional node; Calculate the angle θ2 between the current node and the end point, Among them, (x i ,y i ) is the coordinate of the current node, (x g ,y g ) are the coordinates of the end point; Difference between Θ1 and Θ2 and take the absolute value. Θ=|Θ1-Θ2| (9) Among them, when the Θ value is larger, the angle between Θ1 and Θ2 is larger; when the Θ value is smaller, the angle between Θ1 and Θ2 is smaller; The corner evaluation function of the optimization layer ant colony is set based on the Θ value: The state transition rule of the optimization layer ant colony is: in, represents the transition probability, τ ij (t) represents the pheromone concentration between nodes (i, j); α and β represent the pheromone concentration coefficient and the heuristic function coefficient respectively; allowed k represents the set of node grids that ant k can choose next; The pheromone update module also includes: The steps of updating the pheromone of the optimal layer ant colony are: Among them, τ ij (t) represents the pheromone on the node (i, j), ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment at node (i, j), and Q represents the pheromone intensity; represents the pheromone released by the kth ant on the path; μ is the pheromone compensation factor, which is used to give additional compensation for the pheromone on the current optimal path; The steps of updating the optimization layer ant colony pheromone are as follows: Where: τ ij (t) represents the pheromone concentration at node (i, j); ρ represents the pheromone volatility factor; Δτ ij (t) represents the pheromone increment on the node (i, j) in this ant cycle; represents the pheromone released by the kth ant on the path.
7. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Cited By
All-wheel steering vehicle parallel parking path planning method considering positioning uncertainty
CN116989808A
