Unmanned aerial vehicle obstacle avoidance route optimization method based on improved ant colony algorithm
By improving the method of combining ant colony algorithm and environmental model, the UAV obstacle avoidance route is optimized, and the problems of high computing complexity, contradiction between smoothness and energy efficiency and poor adaptability in the existing technology are solved, and fast, smooth and safe route generation is achieved to meet real-time requirements.
Patent Information
- Application Number
- CN202510695554.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing drone obstacle avoidance route optimization method based on conventional A* algorithm has problems such as high computational complexity, contradiction between energy efficiency and route smoothness, poor adaptability and difficulty in meeting real-time requirements.
The improved ant colony algorithm is adopted to generate the initial route in combination with the pre-acquisitioned environmental model, and the route is optimized through pheromone update strategy, dynamic adjustment of pheromone volatility coefficient and potential field heuristic function, and further process redundant waypoints and inflection points through three optimizations to generate smooth and safe routes.
It realizes the rapid generation of obstacle avoidance tracks in complex dynamic environments, meets the system's real-time requirements, and eliminates redundant waypoints while ensuring obstacle avoidance safety, smooths the corners of the route, and improves the flight stability and energy efficiency of the drone.
Smart Images

Figure CN120215535A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned aerial vehicle obstacle avoidance route optimization, and in particular to a method for optimizing an unmanned aerial vehicle obstacle avoidance route based on an improved ant colony algorithm. Background Art
[0002] With the development of science and technology, the use of drones for inspections, collaborative logistics and other tasks is increasing. As a result, the lack of drone obstacle avoidance capabilities makes it difficult to meet actual needs. Based on this, technicians in the field have developed a variety of different drone route optimization methods, among which the drone route optimization method based on the A* algorithm is the best method with comprehensive capabilities. However, the existing drone obstacle avoidance routes planned based on the conventional A* algorithm still have great limitations, including: 1) High computational complexity. The traditional A* algorithm is time-consuming to calculate in high-dimensional environments or dynamic obstacle scenes, and it is difficult to meet real-time requirements. 2) The contradiction between energy efficiency and route smoothness. The shortest route may include frequent acceleration and deceleration or sharp turns, which increases energy consumption; while smooth routes: such as B-spline curves will sacrifice obstacle avoidance safety. In addition, existing methods rarely consider dynamic constraints comprehensively: such as maximum acceleration and inclination angle limits. 3) Poor adaptability. Offline planning algorithms are difficult to adapt to environmental changes. Online learning methods: such as reinforcement learning require a large amount of training data, which is time-consuming and more difficult to meet the real-time requirements of the system.
[0003] In view of the limitations of the above obstacle avoidance routes, the current route optimization methods all have certain defects, such as: 1) Optimization based on the Douglas-Peucker classic trajectory thinning algorithm: Although the route is simplified, it will excessively delete key obstacle avoidance points: such as obstacle bumps in the collision map. 2) Bezier curve smoothing: high-order curves are complex to calculate and may violate the kinematic constraints of unmanned vehicles: such as the maximum steering angle limit of drones. Summary of the invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the defects existing in the above-mentioned prior art, thereby providing a method for optimizing the obstacle avoidance route of a UAV based on an improved ant colony algorithm.
[0005] A method for optimizing the obstacle avoidance route of a UAV based on an improved ant colony algorithm, comprising: S1. Generate the initial UAV obstacle avoidance route based on the improved ant colony algorithm and the pre-acquired current environment model; S2. Control the drone to move along the currently planned route and perform the first judgment: whether it has reached the destination; when the first judgment result is yes, the route optimization ends; S3. When the result of the first judgment is no, execute the second judgment: whether an obstacle is detected; when the result of the second judgment is yes, execute step S4; when the result of the first judgment is no, loop through steps S1 to S3 until the result of the second judgment is yes; S4. Trigger the improved ant colony algorithm to re-plan the route; S5. Optimize the re-planned route three times, and loop through steps S4 to S5 until the verification result of the re-planned route shows that the optimized route is safe; S6. Update the current environment model based on the position; S7. Travel along the latest verified route under the current environment model, and perform the third judgment: whether the end point is reached; when the result of the third judgment is yes, end the route optimization; S8. When the result of the third judgment is no, loop through steps S2 to S8 until the result of the third judgment is yes to end the route optimization.
[0006] Preferably, the improved ant colony algorithm is obtained by improving the pheromone update strategy, pheromone evaporation coefficient and adding a potential field heuristic function based on the conventional ant colony algorithm.
[0007] Preferably, the improved pheromone update expression is: ; In the formula: is the increment of pheromone left by ants on the route; is the length of the best route in the current iteration, while represents the length of the worst route; is the number of ants that found the best route, is the number of ants that found the worst route; where is a preset constant representing the importance of pheromone; represents the increment of pheromone on the best route; represents the weakening amount of pheromone on the worst route; is the length of the route passed by the ant.
[0008] Preferably, the improved pheromone evaporation coefficient expression is: ; In the formula: represents the pheromone evaporation coefficient; represents the current iteration number, while represents the maximum iteration number.
[0009] Preferably, in the process of improving the conventional ant colony algorithm, the heuristic information update expression obtained by introducing the concept of potential field attraction is: ; <1; In the formula: represents a potential field attraction based on the square of the distance between the node and the target node; ; represents the potential field constant; represents a node to the target node distance; represents the attenuation coefficient; represents the node to the target node heuristic information value.
[0010] Preferably, the re - planned route is optimized three times, specifically: The first route optimization: delete redundant waypoints on the straight line; The second route optimization: delete redundant inflection points; The third route optimization: arc - smooth the inflection points of the route.
[0011] Preferably, for the first route optimization: delete redundant waypoints on the straight line, specifically including: Improve the multi - segment straight - line routes existing in the route re - planned by the ant colony algorithm; Retain the two endpoints of each straight - line route, delete all redundant waypoints between the two endpoints of the straight - line route, and complete the first route optimization.
[0012] Preferably, for the second route optimization: delete redundant inflection points, specifically including: For any obstacle - avoidance route segment, connect the starting point and the ending point of the route to the remaining inflection points in the corresponding obstacle - avoidance route segment to form multiple route line segments; calculate and judge in sequence along the route whether the minimum distance from the corresponding obstacle to each route line segment belongs to the safe distance; delete all redundant inflection points between the inflection points greater than the safe distance and the ending point of the route, and complete the second route optimization.
[0013] Preferably, for the third route optimization: arc - smooth the inflection points of the route, specifically including: Dynamically obtain values from the incoming route and the outgoing route of the remaining inflection points after the second route optimization according to the actual situation of the route, and respectively obtain the incoming arc point and the outgoing arc point at the same distance as the corresponding inflection point; Based on the geometric method and the known distance between the incoming arc point and the corresponding inflection point as the radius, obtain the corresponding center inside the corresponding inflection point; Based on the center and the known radius, calculate and generate the arc path between the incoming arc point and the outgoing arc point as the latest route, and delete the route between the original incoming arc point and the outgoing arc point, and complete the third route optimization.
[0014] The technical solution of the present invention has the following advantages: The trajectory obstacle - avoidance bionic algorithm of the present invention: improves the ant colony algorithm, and can quickly generate an obstacle - avoidance trajectory for a complex dynamic environment, meeting the real - time requirements of the system.
[0015] The route obstacle avoidance optimization method of the present invention: eliminate redundant waypoints, and eliminate unnecessary redundant waypoints in the route on the premise of ensuring obstacle avoidance safety. Process the smoothness of the route corners, convert sharp corners into self-tuning curvature arcs, and create smooth and stable flight conditions for the UAV. Description of the Drawings
[0016] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0017] Figure 1 Schematic diagram of the route comparison between the improved ant colony algorithm and the conventional ant colony algorithm of the present invention; Figure 2 Schematic diagram of the comparison of the convergence performance between the improved ant colony algorithm and the conventional ant colony algorithm of the present invention; Figure 3 Schematic diagram of the route optimization comparison example of the present invention; Figure 4 Schematic diagram of the route generated by the improved ant colony algorithm in Embodiment 2 of the present invention; Figure 5 Schematic diagram of the example of the first route optimization result in Embodiment 2 of the present invention; Figure 6 Schematic diagram of the connection of each route segment in the first iteration of the second route optimization in Embodiment 2 of the present invention; Figure 7 Schematic diagram of the result of the second route optimization in Embodiment 2 of the present invention; Figure 8 Schematic diagram of the detailed control process of the second route optimization in Embodiment 2 of the present invention; Figure 9 Schematic diagram of the logic of the third route optimization in Embodiment 2 of the present invention; Figure 10 Schematic diagram of the result of the third route optimization with multiple obstacles in Embodiment 2; Figure 11 Schematic diagram of an angle of a local three-dimensional path instance; Figure 12 Schematic diagram of another angle of a local three-dimensional path instance; Figure 13 Schematic diagram of the three-dimensional environment comparison of the route generated by the conventional ant colony algorithm and the route generated by the improved ant colony algorithm under multiple obstacles; Figure 14 For Figure 13 Schematic diagram of the result of the first route optimization further based on... Figure 15 For Figure 14 A schematic diagram of an angle of a three - dimensional path instance; Figure 16 For Figure 14 Another schematic diagram of an angle of a three - dimensional path instance; Figure 17 For Figure 14 A schematic diagram of the three - dimensional path performing the third route optimization after the second route optimization; Figure 18 For Figure 17 A schematic diagram of the final optimization result; Figure 19 A flowchart of the overall method of the present invention. Specific embodiments
[0018] Next, the technical solutions of the present invention will be clearly and completely described in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present invention.
[0019] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying 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 of the present invention. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0020] In the description of the present invention, it should be noted that unless otherwise clearly defined and limited, the terms "installed", "connected", "connected" 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 directly connected, or indirectly connected through an intermediate medium, and it can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0021] In addition, the technical features involved in different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0022] Embodiment 1 Such as Figure 19This embodiment discloses a method for optimizing the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm, which combines the track obstacle avoidance bionic algorithm and the route obstacle avoidance optimization method, including: S1. Generate an initial obstacle avoidance route for the unmanned aerial vehicle based on the improved ant colony algorithm and the pre-acquired current environment model; S2. Control the unmanned aerial vehicle to travel along the current planned route and execute the first judgment: whether it reaches the end point; when the result of the first judgment is yes, end the route optimization; S3. When the result of the first judgment is no, execute the second judgment: whether an obstacle is detected; when the result of the second judgment is yes, execute step S4; when the result of the first judgment is no, loop to execute steps S1 to S3 until the result of the second judgment is yes; S4. Trigger the improved ant colony algorithm to re-plan the route; S5. Optimize the re-planned route three times, and loop to execute steps S4 to S5 until the verification result of the re-planned route shows that the optimized route is safe; S6. Update the current environment model based on the position; S7. Travel along the latest verified route in the current environment model and execute the third judgment: whether it reaches the end point; when the result of the third judgment is yes, end the route optimization; S8. When the result of the third judgment is no, loop to execute steps S2 to S8 until the result of the third judgment is yes to end the route optimization.
[0023] Specifically: The improved ant colony algorithm used in this embodiment is based on the conventional ant colony algorithm, and is obtained by improving the pheromone update strategy, the pheromone evaporation coefficient, and adding a potential field heuristic function.
[0024] First, the conventional ant colony algorithm: The probability formula of the conventional ant colony algorithm: ; is the probability of selecting the next node from node , is the pheromone concentration from node to node . is the heuristic information value from node to the target node , and are parameters for adjusting the importance of pheromone and heuristic information. represents from node to neighbor nodes The sum of the product of the pheromone concentration and the heuristic information.
[0025] After each iteration, the pheromone is updated according to the route taken by the ants. The update formula is: ; Pheromone will evaporate over time to prevent the infinite accumulation of pheromone on the route and avoid the algorithm falling into a local optimum. The pheromone evaporation coefficient value is usually set in the interval (0, 1) to control the attenuation rate of the pheromone. is the current iteration number, is the current ant, is the sum of all ants that left pheromone on the route in this iteration. is the increment of pheromone left by the ant on the route, usually inversely proportional to the length of the route. The calculation of the increment can be . Among them, is a preset constant representing the importance of the pheromone, is the length of the route taken by the ant. represents the total increment of pheromone left on the route in this iteration.
[0026] Improvement Point 1: Adjustment of the pheromone update strategy: In the pheromone update mechanism of the ant colony algorithm, the traditional method mainly relies on the quality of the route traversed by the ants to adjust the pheromone concentration on the route. However, in order to more effectively balance exploration and exploitation, in this embodiment, the influence of the best route and the worst route is considered to optimize the calculation method of the pheromone increment. The improved pheromone update formula: ; In the formula: is the length of the best route in the current iteration, while represents the length of the worst route; is the number of ants that found the best route, is the number of ants that found the worst route; for each ant, if the route searched by the ant belongs to one of the best routes in the current iteration, then the pheromone increment on that route should include an additional enhancement term . represents the pheromone increment on the best route; among them is a preset constant representing the importance of pheromone. By increasing the pheromone concentration on the optimal route, more ants are encouraged to choose this high-quality route, thus accelerating the process of the algorithm converging to the global optimal solution. For ants that have chosen the worst route in the current iteration, the pheromone concentration on this route needs to be reduced to prevent other ants from repeating the same inefficient route. This setting helps prevent the algorithm from falling into a local optimum and promotes the exploration of new possible routes. Represents the amount of pheromone reduction on the worst route.
[0027] Improvement Point 2: Dynamic adjustment of the pheromone evaporation coefficient: In the traditional setting, the pheromone evaporation coefficient is usually regarded as a static parameter with a fixed value. However, this setting fails to fully utilize the dynamic characteristics of the pheromone update mechanism during the search process. To enhance the adaptability and optimization performance of the algorithm, the pheromone evaporation coefficient is designed as a function that changes with the number of iterations. The improved expression of the pheromone evaporation coefficient is: ; In the formula: represents the pheromone evaporation coefficient; represents the current number of iterations, while represents the maximum number of iterations.
[0028] In the initial stage of the improved ant colony algorithm execution, by setting a lower pheromone evaporation coefficient compared to the conventional setting , specifically manifested as the actual pheromone evaporation coefficient value being higher than the pheromone evaporation coefficient value of the conventional setting, the exploration ability of the solution space is effectively promoted, thus avoiding the algorithm from falling into a local optimal solution prematurely. This strategy is beneficial to maintaining population diversity and inspiring the discovery of potential high-quality solutions. As the iteration process progresses, gradually reduce the value of the pheromone evaporation coefficient , indicating that this process of increasing the pheromone evaporation coefficient helps to strengthen the convergence of the algorithm, prompting ants to focus more quickly on high-potential solution regions and ultimately achieving the precise positioning of the global optimal solution.
[0029] Improvement Point 3: Improvement of the potential field heuristic function: In the process of improving the ant colony algorithm, introducing the concept of potential field attraction significantly enhances the guiding efficiency of heuristic information, making individual ants more inclined to move towards the target point during the route selection process. The update of heuristic information is as follows: ; <1; In the formula: represents a potential field attraction based on the square of the distance between the node and the target node; ; represents the potential field constant; represents a node to the target node distance; represents the attenuation coefficient; represents a node to the target node heuristic information value; To further enhance this heuristic strategy, in this embodiment, an attenuation coefficient is innovatively proposed, and < 1; its role is to adjust the effectiveness of the heuristic information according to the distance between the node and the target point. As the distance increases, the attenuation coefficient tends to 0, thereby weakening the influence of nodes far from the target point on the ant decision-making process. This mechanism ensures that even if the pheromone concentration of some nodes far from the target point is relatively high, due to the influence of a large attenuation coefficient , the probability of these nodes being selected as the next flight path will also decrease significantly, effectively avoiding the problem of the algorithm falling into a local optimal solution and improving the global search ability.
[0030] To evaluate the comprehensive improvement effect of introducing the pheromone update strategy optimization, dynamically adjusting the evaporation coefficient, and the potential field heuristic function in the conventional ant colony algorithm, simulation experiments are carried out in a grid map environment with a size of 30×30. Two groups of comparative experiments are designed to comprehensively evaluate the impact of these improvement measures on the algorithm performance.
[0031] The first group of comparative experiments is as Figure 1 shows the difference in flight path planning between the conventional ant colony algorithm and the improved ant colony algorithm. In the figure, the red trajectory represents the flight path generated by the conventional ant colony algorithm, and the purple trajectory represents the flight path generated by the improved ant colony algorithm. During the experiment, the starting point S and the ending point T are fixed at positions (1,30) and (30,1) respectively, ensuring the consistency and comparability of the experimental conditions.
[0032] The second group of comparative experiments is as Figure 2 focuses on analyzing the convergence performance of the two algorithms during the iteration process. By comparing the convergence curves of the two algorithms to the optimal solution, a deeper understanding of the impact of different strategies on the algorithm convergence speed and final quality can be obtained. Among them, Figure 2 the red curve in
[0033] All experiments adopt a unified parameter configuration: = 1, = 7, = 100, = 100, = 50, the initial pheromone concentration = 8, the potential field constant P = 0.01, = 0.3. To reduce the influence of accidental factors on the experimental results, the algorithms under each configuration were independently run 20 times, and the corresponding average performance metrics were recorded. The experimental data are summarized in Table 1.
[0034] As shown in Table 1, the average route length is the average of the route lengths of the conventional ant colony algorithm and the improved ant colony algorithm after 20 simulation experiments, and the average convergence point is the average of the iteration numbers corresponding to the convergence points of the two after 20 simulation experiments.
[0035] Table 1 Analysis and comparison of route optimization effects
[0036] Through the analysis of the comparative experiments, the improved ant colony algorithm shows significant superiority in both route length optimization and convergence speed. This algorithm not only reduces the optimal route length by 10.41% compared to the basic ant colony algorithm, but also significantly reduces the required number of iterations by 96% after optimization.
[0037] Example 2 On the basis of Example 1, a route optimization scheme is further disclosed: Route optimization: Although the conventional ant colony algorithm was improved in Example 1, there are still a large number of redundant routes and too many inflection points in the routes generated based on the improved ant colony algorithm. This indicates that although the improved ant colony algorithm improves the real-time efficiency of the UAV route planning system used in actual applications, it does not generate the optimal route. Specifically, as Figure 3 shown, the route generated based on the improved ant colony algorithm from point S to point T is S - A - B - C - D - E - F - G - H - T, and it is obvious from the figure that the route S - E - T is more optimized, thus showing the existence of redundant sections and route points in S - A - B - C - D - E - F - G - H - T. Points B, C, D, and F are redundant route points on the same straight line, and points A, G, and H are redundant inflection points, further confirming that the route generated based on the improved ant colony algorithm is a non-optimal result.
[0038] Therefore, in this Example 2, it also includes three optimizations for the route re-planned based on the improved ant colony algorithm, which are: The first route optimization: deleting the redundant route points on the straight line; The second route optimization: deleting the redundant inflection points; The third route optimization: arcifying the transition of the route inflection points.
[0039] First route optimization: Delete redundant waypoints on a straight line, specifically including: Improve the ant colony algorithm to replan the route, and there are multiple straight-line routes in the replanned route; Retain the two endpoints of each straight-line route, delete all redundant waypoints between the two endpoints of the straight-line route, and complete the first route optimization.
[0040] For ease of understanding, in this Embodiment 2, a specific example is further disclosed. From Figure 3 It can be seen that the route generated based on the improved ant colony algorithm directly passes through point E from the starting point S and then reaches the end point T, which is better than the original route S-A-B-C-D-E-F-G-H-T. All the intermediate points on the same straight line, such as B, C, D, and F, are redundant waypoints, and the effect will be better if they are deleted.
[0041] Therefore, in this Embodiment 2, a new optimization idea is designed to remove redundant waypoints and redundant inflection points. After the first route optimization to remove redundant waypoints, such as Figure 4 First, delete B, C, and D, which are redundant waypoints between point A and point E as endpoints. Just one straight line with two endpoints A and E can ensure the planning of the route from A to E. Similarly, delete point F between E and G. Finally, the first route optimization result is obtained: the route S-A-E-G-H-T as Figure 5 shown.
[0042] Second route optimization: Delete redundant inflection points, specifically including: S101. For any section of obstacle avoidance route, connect the starting point and the ending point of the route to the remaining inflection points in the section of obstacle avoidance route to form multiple route line segments; S202. Calculate and determine in sequence along the route direction whether the minimum distance from the corresponding obstacle to each route line segment belongs to the safe distance starting from the starting inflection point; S303. Delete all redundant inflection points between the inflection point belonging to the safe distance and the ending point of the route, and complete the second route optimization.
[0043] Such as Figure 8 The detailed control execution process of the second route optimization specifically includes: S1011. Import the first optimized waypoint R u , u = 1, 2... v, u represents the total number of waypoints to be optimized, and v represents the maximum number of waypoints to be optimized; set parameters I, J, and initialize I = v; S1022. Determine whether I is greater than 1: If not, execute S1033; if so, execute S1044; S1033. Output the second optimized waypoint library, and the process ends; S1044. Output J = 1; S1055. Calculate the route R based on the J value I -R JThe minimum distance ξ from all obstacles within the range to the flight path R I -R J ; S1066. Determine whether ξ is less than the safety distance; if not, execute S1077: Save the coordinates of point J to the second optimized waypoint library, output I = J; and loop to execute steps S1022 to S1077 until the judgment result of step S1022 is yes; If the judgment result of step S1066 is yes, then execute step S1088: J = J + 1; and input it to step S1055, loop to execute steps S1055 to S1088 until the judgment result of step S1066 is no and the judgment result of step S1022 is no.
[0044] Specifically: For the sake of understanding, on the basis of the first flight path optimization result, a specific example is further disclosed: 1) As Figure 6 Connect the end point of the flight path to the remaining inflection points in the obstacle avoidance flight path of the corresponding segment to form multiple flight path segments: Further execute steps S101 to S202 on the basis of the first flight path optimization result. In this embodiment, the safety distance is taken as 1 grid unit. If ξ≥1, it is passable; otherwise, judge the connection line between the next inflection point and the end point of the flight path. ξ represents the minimum distance from the corresponding obstacle to each flight path segment. Specifically, in this embodiment, as Figure 6 shown, sequentially judge whether the line segments of the connections S-T, A-T, E-T, G-T, and H-T are passable: Judge S-T. S-T obviously passes through the obstacle in the figure, does not meet ξ≥1, and is not passable; similarly, judge A-T, which also obviously passes through the obstacle in the figure and is not passable. Judge E-T. It does not pass through the obstacle. Calculate the distances from all obstacle points to the E-T line segment, and the results all meet ξ≥1, so it is passable. Then delete the inflection points G and H between point E and point T.
[0045] 2) As Figure 6 Connect the start point of the flight path to the remaining inflection points in the obstacle avoidance flight path of the corresponding segment in real time to form multiple flight path segments: Specifically: Judge whether it is passable between the points S, A to E. Similarly, using the method in step 1), it is found that S-E is passable, then delete point A. Until it is found that it is passable between the start point of the flight path and any inflection point, the removal of inflection points is completed, and the second flight path optimization ends. The flight path S-A-T after removing the redundant inflection points A, G, and H is obtained. The number of flight path inflection points is reduced, achieving the effect of optimizing the flight path. The flight path completed after two optimizations is as Figure 7As shown. It should be noted that in actual implementation, the second route optimization is an iterative method, and the termination condition of the iteration is until the temporary end point of the entire route is found as the starting point, and the second route optimization ends. For example, the above point E is one of the temporary route end points.
[0046] After the first route optimization and the second route optimization, a large number of redundant waypoints and redundant inflection points are reduced. However, since it is a flight route, this path is still not smooth enough for the drone, especially at the inflection points. Therefore, the third route optimization is carried out to smooth the route corners. In this embodiment, an excessive arc is selected as the method for optimizing the route corners.
[0047] Third route optimization: Transition the route corners into arcs, specifically including: According to the actual situation of the route, dynamically obtain values from the incoming route and the outgoing route of the remaining inflection points after the second route optimization respectively, and obtain the incoming arc point and the outgoing arc point at the same distance from the corresponding inflection point respectively; Based on the geometric method and the known distance between the incoming arc point and the corresponding inflection point as the radius, obtain the corresponding center of the circle inside the corresponding inflection point; Based on the center of the circle and the known radius, calculate and generate the arc path between the incoming arc point and the outgoing arc point as the latest route, and delete the route between the original incoming arc point and the outgoing arc point to complete the third route optimization.
[0048] Specifically, taking the Figure 9 route in as an example: The optimization design of the transition arc is as follows. Among them, X, L, and Y are adjacent path points, L is the turning point of the path line. Find a point M1 and a point N1 on the line segments XL and LY respectively at the same distance from point L. The distances of the line segments LM1 and LN1 are dynamically obtained according to the actual situation of the path.
[0049] After setting the distances of the line segments LM1 and LN1, taking M1 and N1 as the perpendicular points, draw the perpendicular lines of the line segments XL and LY and intersect at point Z. At this time, point Z is the center of the circle to be drawn, and the lengths of the line segments M1Z and N1Z are the radii of the circle, and draw the arc . At this time, the route: X - -Y is the result after the third route optimization.
[0050] As in the Figure 10 example, the turning angle of the path after the arc processing is no longer sharp. During the operation, the speed of the drone is stable, the efficiency is improved, and the energy consumption is reduced.
[0051] Figure 11 - 12 are schematic diagrams of different angles of a local three-dimensional path instance; as in Figure 13 - 14 and Figure 17 - 18 are the effect diagrams of the optimization process of applying the method of this embodiment to multiple obstacles.Figure 15 - 16 Schematic diagrams of different angles for the second route optimization in a multi-obstacle scenario.
[0052] Obviously, the above embodiments are merely examples for clear illustration and not limitations on the implementation manners. For those of ordinary skill in the art, other different forms of changes or alterations can be made based on the above description. It is not necessary and impossible to enumerate all implementation manners here. And the obvious changes or alterations derived therefrom still fall within the protection scope of the present invention.
Claims
1. An optimization method for the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm, characterized in that Including: S1. Generate an initial obstacle avoidance route for the UAV based on the improved ant colony algorithm and the pre-acquired current environment model; S2. Control the UAV to travel along the current planned route and perform the first judgment: whether it reaches the end point; When the result of the first judgment is yes, end the route optimization; S3. When the result of the first judgment is no, perform the second judgment: whether an obstacle is detected; When the result of the second judgment is yes, execute step S4; when the result of the first judgment is no, loop through steps S1 to S3 until the result of the second judgment is yes; S4. Trigger the improved ant colony algorithm to re-plan the route; S5. Optimize the re-planned route three times, and loop through steps S4 to S5 until the verification result of the re-planned route shows that the optimized route is safe; S6. Update the current environment model based on the position; S7. Travel along the latest verified route under the current environment model and perform the third judgment: whether it reaches the end point; When the result of the third judgment is yes, end the route optimization; S8. When the result of the third judgment is no, loop through steps S2 to S8 until the result of the third judgment is yes to end the route optimization.
2. The method for optimizing the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 1, wherein The improved ant colony algorithm is obtained by improving the pheromone update strategy, the pheromone evaporation coefficient and adding a potential field heuristic function based on the conventional ant colony algorithm.
3. An optimized method for the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 2, characterized in that, The improved pheromone update expression is: ; Wherein: is the increment of pheromone left by ants on the route; is the length of the best route in the current iteration, while represents the length of the worst route; is the number of ants that found the best route, is the number of ants that found the worst route; where is a preset constant representing the importance of pheromone; represents the increment of pheromone on the best route; represents the decrement of pheromone on the worst route; is the length of the route passed by the ant.
4. An optimization method for the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 2, characterized in that The improved pheromone evaporation coefficient expression is: ; Wherein: represents the pheromone evaporation coefficient; represents the current iteration number, and represents the maximum iteration number.
5. The method for optimizing the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 2, wherein, During the process of improving the conventional ant colony algorithm, the heuristic information update expression obtained by introducing the concept of potential field attraction is: ; <1; Wherein: represents a potential field attraction based on the square of the distance between a node and a target node; ; represents a potential field constant; represents a node to the target node distance; represents an attenuation coefficient; represents the heuristic information value of the node to the target node value.
6. The method for optimizing the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 1, wherein The re-planned route is optimized three times, respectively: The first route optimization: Delete redundant waypoints on the straight line; The second route optimization: Delete redundant inflection points; The third route optimization: Round the inflection points of the route.
7. An optimized method for the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 6, characterized in that The first route optimization: Delete redundant waypoints on the straight line, specifically including: There are multiple straight line routes in the route re-planned by the improved ant colony algorithm; Retain the two end points of each straight line route, delete all redundant waypoints between the two end points of the straight line route, and complete the first route optimization.
8. The method for optimizing the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 6, characterized in that The second route optimization: Delete redundant inflection points, specifically including: For any obstacle avoidance route, connect the start point and the end point of the route to the remaining inflection points in the corresponding section of the obstacle avoidance route to form multiple route segments; Calculate and judge in turn along the route whether the minimum distance from the corresponding obstacle to each route segment belongs to the safe distance; Delete all redundant inflection points between the inflection points greater than the safe distance and the end point of the route, and complete the second route optimization.
9. An optimization method for the obstacle avoidance route of an unmanned aerial vehicle based on an improved ant colony algorithm according to claim 6, characterized in that, The third route optimization: Round the inflection points of the route, specifically including: Dynamically obtain values from the incoming route and the outgoing route of the remaining inflection points after the second route optimization according to the actual situation of the route, and respectively obtain the incoming arc point and the outgoing arc point at the same distance from the corresponding inflection point; Based on the geometric method and the known distance between the incoming arc point and the corresponding inflection point as the radius, obtain the corresponding center inside the corresponding inflection point; Calculate and generate the arc path between the incoming arc point and the outgoing arc point based on the center and the known radius as the latest route, and delete the route between the original incoming arc point and the outgoing arc point, and complete the third route optimization.
Citation Information
Patent Citations
AGV (Automated Guided Vehicle) route planning method and system based on ant colony algorithm and multi-intelligent agent Q learning
CN108776483A
Snake-like robot motion planning method based on reinforcement learning
CN114578830A
Path planning method for indoor mobile robot
CN118394080A
Cited By
Path planning method based on umbrella-sky optimization improved model
CN120445232A
Path planning method based on umbrella lizard optimization improved model
CN120445232B
Multi-unmanned aerial vehicle collaborative planning system and method based on environment perception convolutional neural network and ant colony optimization
CN121475214A