An indoor AGV path planning method based on ant colony algorithm
By improving the adaptive pseudo-random probability selection and differentiation-level pheromone update of the ant colony algorithm, combined with the smoothing of B-spline curve, the problems of low search efficiency and poor path quality in large-scale complex maps are solved. , achieving rapid and efficient AGV path planning and improving path smoothness.
Patent Information
- Application Number
- CN202111149575.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2024-11-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional ant colony algorithms have problems such as low global search efficiency, slow convergence speed, excessive path turn and insufficient smoothness in indoor AGV path planning, especially in large-scale and complex maps.
The improved ant colony algorithm is adopted to introduce adaptive pseudo-random probability selection and differentiation-level pheromone update strategy, combining the three-time uniform B-spline curve for path smoothing, optimize the heuristic function and state transfer probability, and improve the convergence speed of the algorithm and Path quality.
It realizes the rapid search of better paths in large-scale complex maps, reduces the number of turns and path length, improves the transportation efficiency and path quality of AGV, and reduces the probability of falling into local optimal solutions.
Smart Images

Figure CN113848919B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of robot technology application, and in particular to an indoor AGV path planning method based on ant colony algorithm. Background Art
[0002] Path planning is one of the key technologies in the development of mobile robot navigation, and has very important applications in many fields, such as autonomous driving, AGV logistics warehousing, ground mobile robot navigation, etc. Among them, AGV path planning technology actually refers to finding a safe path from the starting node to the target location in the AGV free movement space based on one or more parameters (such as minimum energy consumption, shortest path, shortest running time, etc.). Its essence is to obtain the optimal or feasible solution under various constraints. The quality of the path planning results will intuitively affect the real-time performance of the AGV task and the quality of the results.
[0003] Path planning began as early as the 1960s. The basis of path planning is the establishment of an environmental model, which directly affects the choice of algorithms. Environmental modeling mainly includes grid (raster) models, geometric models, and topological models. Among them, the grid model is widely used. However, for large-scale environments, too many grids will cause more memory and large amount of calculation. Early research on path planning algorithms was mainly aimed at global static planning, such as visibility graph method and A* algorithm. However, with the continuous development of artificial intelligence, the superiority of intelligent algorithms based on bionics has gradually emerged, such as ant colony algorithm, particle swarm algorithm, and sparrow algorithm. For complex and large-scale maps, early path planning algorithms often cannot obtain good solution results. With the development of artificial intelligence, more and more people are focusing on the research of intelligent bionic algorithms in path planning.
[0004] The ant colony algorithm has the characteristics of being easy to combine with other planning algorithms, strong robustness, positive feedback, and heuristics. The ant colony algorithm is a probabilistic algorithm for finding optimized paths. It imitates the process of ants looking for food. In the process of looking for food, ants release a substance called pheromone. Ants with shorter paths will release more pheromones. As time goes by, shorter paths will accumulate more and more pheromones, and more and more ants will choose this path. Finally, the optimal path is found under the positive feedback mechanism. It has become a hot topic since its inception. Researchers widely use the improved ant colony optimization algorithm to solve various complex combinatorial optimization problems. As a swarm intelligence algorithm, it was first used to solve the TSP problem. Similarly, it has been successfully proved to be able to solve the path planning problem. However, as a probabilistic optimization intelligent algorithm, like other intelligent algorithms, it has some obvious disadvantages, such as slow convergence, easy deadlock and low search efficiency, especially in large-scale complex maps. The algorithm search efficiency is poor. Summary of the invention
[0005] The purpose of the present invention is to provide an indoor AGV path planning method based on ant colony algorithm to solve the shortcomings of traditional ant colony algorithm, such as low global search efficiency, slow convergence speed, too many turns in the planned path and not smooth enough.
[0006] The present invention is implemented as follows: an indoor AGV path planning method based on ant colony algorithm comprises the following steps:
[0007] a. Build a grid map and set the starting node and target node for the AGV.
[0008] b. Initialize the parameters of the ant colony algorithm; the parameters of the ant colony algorithm include: the number of ants m, the maximum number of iterations NC, the pheromone importance factor α, the initial pheromone concentration τ ij (0), maximum value β_max and minimum value β_min of important factors of heuristic function, pheromone volatility factor ρ, adaptive state transition probability selection parameter q 0 , pheromone intensity Q, number of elite ants (including first-level ants and second-level ants) ε.
[0009] c. Place the ant on the starting node.
[0010] d. Calculate the improved heuristic function and select the next node according to the improved adaptive pseudo-random probability. The improved adaptive pseudo-random probability transfer rule is shown in the following formula:
[0011]
[0012] Among them, q is a random value between 0 and 1, q 0 is the adaptive state transition probability selection parameter, is the roulette random selection model of the traditional ant colony algorithm. The calculation formula is as follows:
[0013]
[0014] Among them, τ ij (t) is the pheromone concentration between grid nodes (i, j), η ij (t) is the heuristic function, allowed is the set of nodes to be selected by AGV next time; α is the pheromone importance factor, and β is the influencing factor of the heuristic function importance;
[0015] The calculation formula of β is as follows:
[0016] β=β_max-(β_max-β_min)×(N / NC)
[0017] Where N is the current number of iterations, NC is the maximum number of iterations, β_max is the maximum value of the important factor of the heuristic function, and β_min is the minimum value of the important factor of the heuristic function;
[0018] Improved heuristic function η ij The calculation formula of (t) is as follows:
[0019]
[0020]
[0021]
[0022] Among them, (x e ,y e ) represents the coordinates of the target node, (x j ,y j ) represents the coordinates of the next node; C ij is the direction factor, ψ is the angle between the straight line between the previous node and the current node and the straight line between the current node and the next node; a and b are the influence parameters for adjusting the direction and distance respectively, and a+b=1;
[0023] q 0 The calculation formula is as follows:
[0024]
[0025] q 0 The initial value is 0.9, and the adaptive state transition probability selection parameter q 0 Adjust the ratio of deterministic and random selection of the next moving node.
[0026] e. Determine whether the current ant has reached the target node. If so, execute step f; otherwise, execute step d.
[0027] f. Determine whether the maximum number of ants has been reached; if so, proceed to step g; otherwise, increase the number of ants by 1 and proceed to step c.
[0028] g. Record the optimal path length found by the first-level ants, the better path length found by the second-level ants, and the worst path length found by the ordinary ants during this iteration. At the same time, calculate the average path found by all surviving ants in the entire ant colony, and dynamically adjust the pheromone based on the improved differentiation-hierarchical ant update strategy.
[0029] The first-level ants refer to the ants that find the optimal path length in the current iteration process, and the second-level ants refer to the ants that find a relatively optimal path length in the current iteration process. All ants except the first-level ants and the second-level ants are ordinary ants; the surviving ants refer to the ants that can reach the target node from the starting node.
[0030] Pheromones are dynamically adjusted based on the improved differentiation-grading ant update strategy. The specific formula is as follows:
[0031] τ ij (t+1)=(1-ρ)τ ij (t)+ρΔτ ij +Δτ ij ′-Δτ ij ″
[0032]
[0033]
[0034]
[0035]
[0036] Among them, L k The length of the path found by the kth ant, L b is the optimal path length of this iteration, L w is the worst path length of this iteration, L a is the average path length of this iteration; L gb is the global optimal path length, L gw is the global worst path length.
[0037] h. Determine whether the maximum number of iterations has been reached. If so, execute step i; if not, increase the number of iterations by 1, and then execute step c.
[0038] i. Based on the optimal path, use the cubic uniform B-spline curve to smooth the path and output the final path.
[0039] In step i, the path is smoothed using a cubic uniform B-spline curve. The specific calculation formula is as follows:
[0040]
[0041] P t Given n+1 control points P t (i=0,1,2,……,n) coordinates, F l,n is the B-spline basis function;
[0042] F l,n The expression is as follows:
[0043]
[0044] t is the independent variable.
[0045] When n=3, the basis function of the cubic B-spline curve is as follows:
[0046]
[0047] The grid map is constructed in step a, which specifically includes: using the Kinect camera on the AGV to obtain the obstacle position information around the car and generate an environmental depth map; using image processing technology to binarize the obtained environmental depth map, and then performing spot analysis to separate the foreground and background of the grid map; expanding the obstacles and reserving a safety distance, which is the radius of the robot, and treating the AGV as a particle in the operating space.
[0048] The grid number and coordinates can be converted using the following formula:
[0049]
[0050] Among them, ceil is the integer function, mod is the remainder function, d′ is the grid side length, pos is the grid number, MM is the map size, and S is the number of grids in each row or column.
[0051] The present invention is particularly aimed at large-scale maps and complex maps. Due to the shortcomings of the traditional ant colony algorithm, ants are prone to deadlock and stagnation, making it difficult to find the optimal path. The present invention proposes an AGV global path planning method based on an improved differentiated-hierarchical ant colony algorithm. By applying the improved ant colony algorithm to the AGV indoor path planning, the AGV can quickly search for a collision-free and optimal path from the starting node to the target node in the actual environment, thereby improving transportation efficiency and reducing manual transportation costs.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] (1) By using the distance function and direction function as heuristic factors, the heuristic function is improved to increase the heuristic nature of the algorithm, guide the ants to search towards better directions and location nodes, effectively reduce the sharp turns that may occur during the movement of the AGV, and improve the path quality.
[0054] (2) By improving the state transition probability and adaptive parameter adjustment strategy, the control parameters of the algorithm are constantly adjusted and changed in the process of continuous iteration. In the early stage of the algorithm, the importance factor of the heuristic function is relatively large to increase the convergence speed of the algorithm. In the later stage, as the importance factor of the heuristic function continues to decrease, the possibility of the algorithm exploring other better paths is increased, thereby achieving the purpose of reducing the probability of falling into the local optimal solution and reducing the interference of algorithm parameter selection on algorithm efficiency.
[0055] (3) Based on the differentiated-graded pheromone update, the pheromone update method is improved, so that the algorithm has a faster convergence speed in maps of different sizes while maintaining a better solution, improving the positive feedback of the algorithm, and effectively avoiding the algorithm from stagnating in large-scale maps or falling into a local optimal solution due to excessive pheromone on a certain path. Finally, based on the optimal path, the path is smoothed using cubic uniform B-splines, and the path length is further shortened, reducing the wear on the vehicle body hardware caused by the discontinuity of turns.
[0056] (4) Traditional intelligent algorithms are rarely used in actual applications. The present invention applies the improved algorithm to AGV, which can quickly obtain a better path in the actual environment, verifying its effectiveness in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 The figure is a flow chart of the method of the present invention.
[0058] Figure 2 This is a schematic diagram of the principle of obtaining depth data by the AGV vehicle-mounted Kinenct camera of the present invention.
[0059] Figure 3 This is the occupancy grid map of the robot and obstacles obtained by the present invention in the actual environment.
[0060] Figure 4 It is a two-dimensional map obtained by the present invention through image processing technology in a real environment.
[0061] Figure 5 This is the grid diagram required for the simulation of the present invention.
[0062] Figure 6 It is a schematic diagram of the direction factor rotation angle of the present invention.
[0063] Figure 7 This is the path planning diagram of the traditional ant colony algorithm in a 20*20 complex environment.
[0064] Figure 8 This is the path planning diagram of Experiment 1 of the present invention in a 20*20 complex environment.
[0065] Fig. 9 This is the path planning diagram of Experiment 2 of the present invention in a 20*20 complex environment.
[0066] Fig.10 This is the path planning diagram of Experiment 3 of the present invention in a 20*20 complex environment.
[0067] Fig.11 This is the path planning diagram of the improved algorithm of the present invention (after smoothing based on Experiment 3) in a 20*20 complex environment.
[0068] Fig.12 This is a comparison chart of iterative convergence of the improved algorithm of the present invention in a 20*20 complex environment.
[0069] Fig.13 This is the path planning diagram of the traditional ant colony algorithm in a 50*50 complex environment.
[0070] Fig.14 This is the path planning diagram of the present invention in a 50*50 complex environment.
[0071] Fig.15 This is the iterative convergence diagram of the present invention in a 50*50 complex environment.
[0072] Figure 16-Figure 19 All of them are example diagrams of path planning of the present invention in a 70*70 actual environment.
[0073] Fig. 20 For the present invention Fig.19 The corresponding iterative convergence diagram. DETAILED DESCRIPTION
[0074] The feasibility and advantages of the present invention are further described in detail in conjunction with the accompanying drawings and several specific embodiments. The description herein is only for explaining the present invention and is not intended to limit the present invention. The main steps of the present invention are as follows: Figure 1 As shown:
[0075] Step 1: Construct a simulation grid map and a two-dimensional map of the actual environment, and set the starting node and target node.
[0076] The actual environment map construction method is as follows: The infrared camera in the Kinect sensor has a resolution of 640*480 and can observe objects within a range of 0.5m to 5m. If the object is not within the range, the measured data is invalid. The field-of-view (FOV) range of Kinect is 57°. For the convenience of explanation, the present invention only uses one row of depth images for two-dimensional composition, such as Figure 2 As shown:
[0077] The value of each pixel represents the distance from the camera to the object and is mapped to the corresponding point (x, y) in the world coordinate system. Figure 2 Point P in the center row is the 400th pixel as the world coordinate. The value of this pixel received from the Kinect sensor is d, which is the distance between point P and the camera plane. Therefore, p x =d,p y= Lsin(α) = dtan(α). The angle α can be calculated based on the distance from the desired point to the center (pixel) of the row, and the horizontal field of view of the Kinect sensor is as follows: α = (400-320) × 57 / 640 = 7.12°, where 320 refers to the center pixel of the sensor. Therefore, in the local coordinate system of the AGV, we can get p y =d tan(7.12°).
[0078] Once the robot's position (x, y, θ) is known, the odometer data can be used to map point P to the position in the world coordinate system, where θ is the steering angle of the AGV. Because the odometer data is initialized to 0 after the robot is started, the starting node of the created map is based on the robot's initial position.
[0079] When the robot moves around a two-dimensional space, all points can be mapped to the world coordinate system. These points can be used to generate an occupancy grid map covering the entire area. Using the AGV's onboard Kinect camera to obtain information about the location of obstacles around the car, a depth map of the environment can be generated. This information, together with the position and orientation of the robot chassis, can be used for autonomous map construction. To generate a 2D map, the present invention will use the planar data received from the Kinect depth image. Figure 3 As shown in , all points can be mapped to the world coordinate system. These points can be used to generate an occupancy grid map covering the entire area through data processing, and the depth information obtained by the camera can be used to locate the car and the surrounding environment, such as Figure 3 As shown:
[0080] After obtaining the depth information containing the actual environment, it needs to be processed into a two-dimensional map required for AGV path planning. The specific steps are to use image processing technology to binarize the obtained occupancy grid map, and then perform spot analysis to separate the foreground and background of the occupancy grid map. The black area is an obstacle, the white area is a free passage area, and the gray area is an area not explored by the camera. For irregular obstacles, they are expanded and a certain safety distance is reserved, where the safety distance is set as the radius of the robot. The robot can then be simplified into a particle to improve the safety of the car's movement. The two-dimensional map used for AGV path planning after processing with image processing technology is as follows: Figure 4 shown.
[0081] Figure 5 This is the grid diagram required for path planning simulation in Matlab simulation environment. Specifically:
[0082] The grid method is used to model the environment. The white grid represents the grid where the AGV can walk, and the black grid represents the grid where obstacles are. A two-dimensional coordinate system is established. At the same time, the robot's operating environment is processed as follows:
[0083] (1) The obstacle is expanded and the AGV is regarded as a particle in the operating space.
[0084] (2) The AGV travels at a constant speed during movement, without any acceleration or deceleration.
[0085] (3) Land Figure 1 Once established, it will no longer change with the movement of the AGV, that is, the present invention is applicable to global path planning.
[0086] Each node has a corresponding serial number in the coordinate system, and the coordinates of its center point are taken as the coordinates of the node. The grid serial number and coordinates can be converted using the formula:
[0087]
[0088] Among them, ceil is the integer function, mod is the remainder function, d′ is the grid side length, pos is the grid number, MM is the map size, and S is the number of grids in each row or column.
[0089] Step 2: Initialize the algorithm parameters: the number of ants m is 100, the maximum number of iterations NC is 100, the pheromone importance factor α is 1, the maximum value β_max and minimum value β_min of the heuristic function importance factor are 0.85 and 0.25 respectively, the pheromone volatility factor ρ is 0.3, and the pseudo probability initial value q is 0 Take 0.9, the initial pheromone concentration τ ij (0) is taken as 8, the pheromone intensity Q is taken as 1, the number of elite ants (including first-level ants and second-level ants) ε is taken as 5, the influence parameter a of the adjustment direction is taken as 0.25, and the influence parameter b of the adjustment distance is taken as 0.75.
[0090] Step 3: Place all ants on the starting node and add the starting node to the taboo table.
[0091] Step 4: Calculate the improved heuristic function, select the next position node (referred to as the next node) according to the improved adaptive pseudo-random probability, add the current node to the taboo table, and update the taboo table.
[0092] The role of the heuristic function is to enable the ant colony algorithm to guide ants to find high-quality mobile nodes. The traditional ant colony algorithm only uses the inverse of the current node to the next node as the only heuristic factor, and the difference between adjacent position nodes is very small, which makes the heuristic information of the target node very weak. Especially in large-scale environmental maps with large grids, the guiding effect of the traditional heuristic function is very poor, which is also one of the main reasons for the slow convergence speed of the algorithm and poor search efficiency. The present invention designs a new heuristic distance factor as a heuristic distance function based on the distance from the current node to the target node to increase the heuristic between its adjacent nodes. At the same time, it is considered to avoid sharp turns in the path, reduce the number of turns, and improve the quality of the path. This paper takes the angle formed by the straight line between the previous position node of the current position node of the AGV and the current position node and the straight line between the current node and the next candidate node as the direction heuristic factor, and applies different weight coefficients to the distance heuristic factor and the direction heuristic factor respectively to adjust their degree of influence. The improved heuristic function in the step four is:
[0093]
[0094] Wherein, a and b are the influence parameters of adjustment direction and distance respectively, and a+b=1. je is the distance factor, (x e ,y e ) represents the coordinates of the target node, (x j ,y j ) represents the coordinates of the next selected node. ij is the direction factor (i is the current node, j is the next node), the formula is:
[0095]
[0096] Direction factor is shown as Figure 6 As shown:
[0097] Where ψ is the angle between the straight line between the previous position node of the current position node and the current position node and the straight line between the current node and the next node to be selected. From the direction factor function, we can see that when the ψ angle is large, the value of the direction factor is small, so the probability of the node being selected is higher. When ψ is 180°, the three position nodes are a straight line, that is, there is no corner between the next position node and the current node. At this time, the value of the direction factor is extremely large, and the ant is more inclined to choose this node.
[0098] The improved pseudo-random state transition probability strategy is used to select the next location node for AGV movement. The improved state probability transition rule is shown in the following formula:
[0099]
[0100] Where q is the initial value (a random value between 0 and 1), 0 is the adaptive state transition probability selection parameter, is the roulette random selection model of the traditional ant colony algorithm. The formula is as follows:
[0101]
[0102] Among them, τ ij (t) is the pheromone concentration between grid nodes (i, j), η ij (t) is the heuristic function, allowed is the set of the next candidate mobile nodes for AGV; α is the influencing factor of the importance of pheromone concentration; β is the influencing factor of the importance of the heuristic function.
[0103] This paper adopts a new parameter adjustment method based on adaptive greedy strategy. In the process of continuous iteration, the control parameters of the algorithm are constantly adjusted and changed. In the early stage of the algorithm, the importance factor of the heuristic function is large to increase the convergence speed of the algorithm. In the later stage, as the importance factor of the heuristic function continues to decrease, the possibility of the algorithm exploring other better paths is increased, thereby improving the global exploration ability of the algorithm and reducing the interference of algorithm parameter selection on algorithm efficiency. The heuristic information importance factor will change in the form of nonlinear changes, as shown in the following formula:
[0104] β=β_max-(β_max-β_min)×(N / NC)
[0105] Among them, β_max and β_min are the maximum and minimum values of the importance factor of the heuristic function, respectively, and a suitable range can be obtained according to the parameter configuration. NC is the maximum number of iterations, and N is the current number of iterations.
[0106] In addition, in order to improve the search speed and avoid the local optimal problem during the search process, an adaptive state transfer selection parameter q is added 0 Adjust the ratio of deterministic and random selection of the next moving node. The specific formula is as follows:
[0107]
[0108] Where N is the current number of iterations, NC is the maximum number of iterations, and q 0 The starting value is 0.9. In the early stage of the algorithm, due to q 0 When the value of is large, the ants tend to choose the path node with the maximum value of the product of the heuristic function and the pheromone concentration as the next moving position node, which is a deterministic selection mode. Therefore, it is beneficial to accelerate the convergence speed of the algorithm. On the contrary, as the number of iterations increases, q 0As the number of paths decreases, the path selection tends to be more like the traditional roulette random selection mode. This increases the diversity of path selection and further increases the global search capability of the algorithm, preventing the algorithm from falling into a local optimal solution.
[0109] Step 5: Determine whether the current ant has reached the target node. If so, go to the next step; otherwise, jump back to step 4.
[0110] Step 6: Add 1 to the number of ants, that is: m=m+1, and determine whether the maximum number of ants has been reached. If so, go to the next step, otherwise go to step 3.
[0111] Step 7: Record the optimal path length found by the first-level ants, the better path length found by the second-level ants, and the worst path length found by the ordinary ants during this iteration. At the same time, calculate the path mean of all "surviving" ants in the entire ant colony (ants that find the path from the starting node to the target node), and dynamically adjust the pheromone based on the differentiated-hierarchical ant update strategy.
[0112] The pheromone update strategy is a process in which the ant colony algorithm continuously realizes positive feedback. It is in this way that the ant colony guides the next generation of ants to continuously converge to an optimal path. Therefore, the pheromone update method will have a huge impact on the quality of the searched path and the convergence speed of the solution. In the traditional ant colony algorithm, after each iteration, each ant updates the pheromone according to the length of the path it constructs. When the difference in path length is small, the difference in pheromone becomes very small, which is one of the main reasons why the algorithm is prone to fall into the local optimal solution in complex and large-scale environments.
[0113] Based on the above analysis, in order to improve the quality of the solution while accelerating the convergence speed, the present invention proposes a pheromone update strategy based on differentiation-grading ants. In each iteration process, the quality of the path found by each ant is different and has certain differences. If each ant updates the pheromone for the path it finds, then especially in large-scale maps, some poor paths may interfere with the search of future ants, which is not conducive to the exploration of the optimal path and weakens the positive feedback of the algorithm. On the other hand, if only the pheromone on the optimal path is updated, it is possible to lose the exploration of some better paths (possibly the optimal path), and the algorithm is prone to fall into the local optimal solution. Therefore, based on the idea of elite ants, there is a strict hierarchy in the biological population. Individuals with higher levels have higher priorities and can guide lower-level individuals. Ants are graded to increase the pheromones searched by better ants. Ants that find the contemporary optimal path length are regarded as first-level ants, ants that find better paths are regarded as second-level ants, and other ants are ordinary ants. According to the differences in the path lengths searched by different ants, the pheromone increments of different paths are adjusted. Increase the guidance of better paths and reduce the interference of worse paths, thereby increasing the positive feedback of the algorithm and accelerating the convergence of the algorithm. After all ants have completed a complete path construction (from the starting node to the target node), find the optimal path length L for this iteration. b and the worst path length L w , and calculate the average path length L of all ants in this iteration a Using the three information characteristics of the ant population, making full use of the path quality information of the ants, and mobilizing the differences in path quality to update the pheromone on the path found by the ants, the pheromone update method is carried out according to the following formula:
[0114]
[0115] Where, L k is the length of the path found by the kth ant, Q is the pheromone intensity, and ρ is the pheromone volatility factor.
[0116] In addition, in order to make the ant search path always follow the direction of the better path, based on the best and worst ant idea, the global best path is encouraged to increase the amount of pheromone on its path; on the contrary, the global worst path is punished to reduce the amount of pheromone on its path. The final global pheromone update rule is as shown in the following formula:
[0117] τ ij (t+1)=(1-ρ)τ ij (t)+ρΔτ ij +Δτ ij ′-Δτ ij ″
[0118]
[0119]
[0120] Among them, L gb is the global optimal path length, L gw is the global worst path length.
[0121] Based on the differentiated-graded ant pheromone update strategy, the pheromone amount on each path is dynamically updated, and differentiated information is updated for paths of different qualities. This increases the guiding role of better ants in the ant colony on future generations of ants and reduces the interference of poorer ants on path search. This allows the algorithm to make full use of the characteristic information of the ant colony population, effectively speeding up the convergence speed while maintaining a good global search capability.
[0122] Step 8: Add 1 to the number of iterations, that is, N=N+1, and determine whether the maximum number of iterations has been reached. If so, go to the next step, otherwise go to step 3.
[0123] Step 9: Based on the optimal path, use the cubic uniform B-spline curve to smooth the path and output the final path.
[0124] On the basis of obtaining the optimal solution, the optimal path is smoothed using cubic uniform B-spline to further improve the smoothness of the path and reduce the wear on the body hardware caused by the discontinuity of turning during the actual movement of the AGV. Its expression is:
[0125]
[0126] P t For a given n+1 control point P t (i=0,1,2,……,n) coordinates. These control points are used to define the direction and limit range of the spline curve. l,n is the B-spline basis function, representing the l-th k-th order B-spline basis, and t is the independent variable. Its expression is:
[0127]
[0128] When n=3, the basis function of the cubic B-spline curve is expressed as:
[0129]
[0130] In order to verify the effectiveness and superiority of the above improved method, the present invention first uses the improved ant colony algorithm to simulate in MATLAB, and then uses the experimental platform to verify the effect of the improved ant colony algorithm of the present invention in a real environment. In order to reduce the contingency of the experiment, each algorithm and improvement scheme are tested 20 times.
[0131] First, a gradient comparison experiment is conducted in a relatively complex 20*20 scale grid map environment to verify the advantages of each step of the improved algorithm of the present invention. The specific process of the gradient comparison experiment is: on the basis of the traditional ant colony algorithm, the improved scheme of the algorithm in this paper is added in sequence to verify the effectiveness of each step of the improved scheme. Experiment 1: on the basis of the traditional ant colony algorithm, the improved adaptive pseudo-probability state transfer and parameter dynamic adjustment strategy of this paper are added; Experiment 2: on the basis of Experiment 1, the improved heuristic function of this paper is added; Experiment 3: on the basis of Experiment 2, the differential-grading ant colony pheromone update strategy proposed in this paper is added. Improved ant colony algorithm: based on the optimal path obtained in Experiment 3, cubic B-spline is used for smoothing. The parameters of the traditional ant colony algorithm are: m is 50, NC is 100, α is 3, β is 7, ρ is 0.3, and Q is 1. The algorithm parameters of Experiment 1 are: m is 50, NC is 100, α is 3, β is 7, ρ is 0.1, and Q is 1. The parameters of Experiment 2, Experiment 3 and the improved ant colony algorithm are the same: m is 100, NC is 100, α is 1, β_max and β_min are 0.85 and 0.25 respectively, ρ is 0.1, Q is 1, the number of primary ants is 1, the number of secondary ants is 4, a is 0.25, and b is 0.75. The experimental results are shown in Figure 7 to Figure 12 The specific evaluation performance index comparison is given in Table 1.
[0132] Table 1 Comparison of evaluation indicators of path planning gradient experiment in 20*20 complex environment map
[0133]
[0134] It can be clearly seen from Table 1 that the optimal path length obtained by the traditional ant colony algorithm search is 32.3848, the worst value is 44.2843, the average number of corners is 13, the average number of iterations is 20, and the number of simulations to obtain the optimal path solution is only once. Although the traditional algorithm can obtain a path from the starting node to the target node, it has obvious shortcomings in terms of path quality and convergence speed, which is also a common shortcoming of the traditional ant colony algorithm in complex maps. This is mainly because the traditional ant colony algorithm has a greater impact on the path quality due to parameter changes. Secondly, because of the positive feedback brought by pheromones, the algorithm is prone to fall into the local optimal solution in some complex environments, thereby affecting the global search ability of the algorithm and losing the optimal solution. In response to the above problems, the embodiments of the present invention adopt different improvement methods to improve the efficiency of the algorithm. It can be seen from the data in Table 1 that in the improved experiment 1, whether it is the optimal value, the worst value, or other performance indicators, there is a certain degree of improvement, but the convergence speed slows down after adding the adaptive pseudo-probability state transfer and the dynamic adjustment of parameters, indicating that the improvement has a certain effectiveness. After adding the improvement of the heuristic function on the basis of Experiment 1, the corners of the path have been significantly improved, indicating the effectiveness of the improvement in Experiment 2. After adding the improvement strategy based on differentiated-graded ant pheromone on the basis of Experiment 2, the optimal path length was reduced by 11.6% compared with the traditional method, and the number of corners was reduced by 55.6%. The obtained path length is better, the corners are smaller, the convergence speed is faster, the stability is better, and the overall algorithm search efficiency is higher.
[0135] In practical applications, the map environment is generally complex and large in scale. In order to further verify the feasibility and advantages of the improved algorithm in this paper in large-scale complex maps, this paper designs more complex trap obstacles in a 50*50 scale environment, and compares the traditional algorithm with different performance indicators to analyze the superiority of the improved algorithm in this paper. The parameters are set as follows: m is 100, NC is 100, α is 1, β_max and β_min are 0.85 and 0.25 respectively, ρ is 0.1, Q is 1, the number of first-level ants is 1, the number of second-level ants is 7, a is 0.2, and b is 0.8. The simulation results are as follows: Figure 13 to Figure 15 The performance evaluation table is shown in Table 2:
[0136] Table 2 Comparison of evaluation indexes of the traditional method and the proposed algorithm for 50*50 complex environment maps
[0137]
[0138] It can be seen from the simulation results that the traditional ant colony algorithm obtains a path length of 80.8122 in a large-scale map, with 32 turns, and obtains the optimal path only once and cannot converge. This is because the traditional ant colony algorithm has very weak heuristic information in large-scale complex maps. At this time, pheromones cannot play a significant role in guiding ants, which causes ants to search blindly in the process of searching for paths, resulting in path intersections, more turning points and longer paths. It is precisely because the shortcomings of the traditional ant colony algorithm are clearly exposed in large-scale complex environments that the practicality of the algorithm has been challenged. The improved algorithm of the present invention can obtain an optimal path in a large-scale complex map while still maintaining a faster convergence speed. The optimal path can be obtained in 20 simulations, and the introduction of adaptive parameter adjustment makes the algorithm less affected by parameter fluctuations, which fully demonstrates the stability and superiority of the present invention. Moreover, after three uniform B-spline processing, the path length is shorter and the smoothness is better. The obtained path is more suitable for the real movement of AGV, making the algorithm advantages of the present invention more obvious.
[0139] Based on the obvious effect of the simulation results, the present invention is applied to the real environment for experiments, and the map construction is as described in detail in step 1 above. The algorithm parameters are: m is 100, NC is 100, α is 1, β_max and β_min are 0.85 and 0.25 respectively, ρ is 0.1, Q is 1, the number of first-level ants is 1, the number of second-level ants is 7, a is 0.2, and b is 0.8. The experimental results of path planning from any starting node to the target node are as follows: Figures 16 to 20 As shown,
[0140] It can be seen from the experimental results that in the actual environment map obtained by the AGV on-board camera, the improved algorithm of the present invention can quickly find a path of optimal length from any starting node to any target node, and the path converges quickly, has fewer corners, and the curvature at the corners is continuous and meets the constraints of AGV kinematics, which is more suitable for the actual movement of the AGV. The planned path points correspond one-to-one to the actual environment, and the generated path points are sent to the AGV cart one by one. The controller is used to control the cart to track these path points, so that the path tracking of the AGV can be realized, and the movement of the AGV from the starting node to the target node can be realized. In summary, the experimental results fully affirm the practical application ability of the present invention and reflect the advantages of the present invention.
Claims
1. An indoor AGV path planning method based on ant colony algorithm, characterized in that: The steps include: a. Build a grid map and set the starting node and target node for the AGV; b. Initialize the parameters of the ant colony algorithm; the parameters of the ant colony algorithm include: the number of ants m, the maximum number of iterations NC, the pheromone importance factor α, the initial pheromone concentration τ ij (0), maximum value β_max and minimum value β_min of important factors of heuristic function, pheromone volatility factor ρ, adaptive state transition probability selection parameter q0, pheromone intensity Q, number of elite ants ε; c. Place the ant on the starting node; d. Select the next node according to the improved adaptive pseudo-random probability. The improved adaptive pseudo-random probability transfer rule is as shown in the following formula: Among them, q is a random value between 0 and 1. is the roulette random selection model of the traditional ant colony algorithm. The calculation formula is as follows: Among them, τ ij (t) is the pheromone concentration between grid nodes (i, j), η ij (t) is the heuristic function, allowed k is the set of nodes to be selected by AGV next time; β is the influence factor of the importance of the heuristic function; The calculation formula of β is as follows: β=β_max-(β_max-β_min)×(N / NC) Where N is the current iteration number; Heuristic function η ij The calculation formula of (t) is as follows: Among them, (x e ,y e ) represents the coordinates of the target node, (x j ,y j ) represents the coordinates of the next node; C ij is the direction factor, d je is the distance factor, ψ is the angle between the straight line between the previous node and the current node and the straight line between the current node and the next node; a and b are the influence parameters of the adjustment direction and distance respectively, and a+b=1; The calculation formula of q0 is as follows: e. Determine whether the current ant has reached the target node. If yes, execute step f; otherwise, execute step d. f. Determine whether the maximum number of ants has been reached; if so, proceed to step g; otherwise, add 1 to the number of ants and proceed to step c; g. Record the optimal path length found by the first-level ants, the better path length found by the second-level ants, and the worst path length found by the ordinary ants during this iteration. At the same time, calculate the average path found by all surviving ants in the entire ant colony, and dynamically adjust the pheromone based on the improved differentiation-grading ant update strategy; The first-level ants refer to the ants that find the optimal path length in the current iteration process, and the second-level ants refer to the ants that find a relatively optimal path length in the current iteration process. All ants except the first-level ants and the second-level ants are ordinary ants; the surviving ants refer to the ants that can reach the target node from the starting node; Pheromones are dynamically adjusted based on the improved differentiation-grading ant update strategy. The specific formula is as follows: t ij (t+1)=(1-ρ)τ ij (t)+ρΔτ ij +Δt ij ′-Δτ ij ″ Among them, L k The length of the path found by the kth ant, L b is the optimal path length of this iteration, L w is the worst path length of this iteration, L a is the average path length of this iteration; L gb is the global optimal path length, L gw The global maximum Differential path length; Δτ ij ′ is the amount of pheromone on the global optimal path, Δτ ij ″ is the amount of pheromone on the global worst path; h. Determine whether the maximum number of iterations has been reached. If so, execute step i; if not, increase the number of iterations by 1, and then execute step c; i. Based on the optimal path, use the cubic uniform B-spline curve to smooth the path and output the final path.
2. The indoor AGV path planning method based on ant colony algorithm according to claim 1 is characterized in that: In step i, the path is smoothed using a cubic uniform B-spline curve. The specific calculation formula is as follows: P t Given n+1 control points P t (i=0,1,2,......,n) coordinates, F l,n is the B-spline basis function; F l,n The expression is as follows: t is the independent variable.
3. The indoor AGV path planning method based on ant colony algorithm according to claim 2 is characterized in that: n = 3, the basis function of the cubic B-spline curve is as follows:
4. The indoor AGV path planning method based on ant colony algorithm according to claim 1 is characterized in that: In step b, the pheromone importance factor α is 1, the pheromone volatility factor ρ is 0.1, and the pheromone intensity Q is 1.
5. The indoor AGV path planning method based on ant colony algorithm according to claim 1 is characterized in that: The grid map is constructed in step a, which specifically includes: using the Kinect camera on the AGV to obtain the obstacle position information around the car and generate an environmental depth map; using image processing technology to binarize the obtained environmental depth map, and then performing spot analysis to separate the foreground and background of the grid map; expanding the obstacles and reserving a safety distance, which is the radius of the robot, and treating the AGV as a particle in the operating space.
6. The indoor AGV path planning method based on ant colony algorithm according to claim 5 is characterized in that: The grid number and coordinates can be converted using the following formula: Among them, ceil is the integer function, mod is the remainder function, d′ is the grid side length, pos is the grid number, MM is the map size, and S is the number of grids in each row or column.
