Unmanned aerial vehicle path planning method and device, storage medium and computer equipment
By introducing a main motion direction strategy for UAVs and open list management, combined with cost evaluation and backtracking mechanisms, the path planning of UAVs is optimized, solving the problem of redundant search in traditional algorithms and achieving efficient, fitting, and cost-effective path planning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGXI POWER GRID CO LTD NANNING POWER SUPPLY BUREAU
- Filing Date
- 2025-12-04
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional UAV 3D path planning algorithms suffer from redundant searches when expanding nodes, resulting in high computational overhead and difficulty in meeting real-time requirements, especially in dynamic obstacle avoidance in complex environments.
A main motion direction strategy for drones is introduced, and the search process is managed by combining open and closed lists. Neighbor node selection and path generation are optimized through cost evaluation and backtracking mechanisms.
This reduces unnecessary expansion directions, improves search efficiency and path fit, and ensures that the planned path achieves a cost-effective flight trajectory while meeting environmental constraints.
Smart Images

Figure CN121900435A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of path planning technology, and in particular to a method and apparatus for unmanned aerial vehicle (UAV) path planning, a storage medium, and a computer device. Background Technology
[0002] With the widespread application of unmanned aerial vehicles (UAVs) in fields such as power line inspection, disaster relief, logistics delivery, and aerial surveillance, their autonomous navigation and real-time obstacle avoidance capabilities have become key core technologies. Path planning, as the decision-making basis for autonomous flight of UAVs, directly affects the efficiency, safety, and reliability of their mission execution. Especially in complex three-dimensional environments, UAVs need to dynamically avoid dense obstacles, adapt to environmental changes, and meet the physical constraints of the aircraft. Therefore, researching efficient and adaptable high-dimensional path planning methods has significant engineering implications.
[0003] Currently, search-based path planning algorithms such as A Traditional methods, including their variants, are widely used because they can ensure the finding of the optimal path in a known environment. However, when applied to UAV 3D path planning, traditional methods still have the following limitations: when expanding nodes, the algorithm often performs a large number of redundant searches in irrelevant areas, resulting in high computational overhead and difficulty in meeting real-time requirements. Summary of the Invention
[0004] In view of this, this application provides a method and apparatus for UAV path planning, a storage medium, and a computer device. It incorporates the UAV's main direction of motion into the neighbor node selection strategy, reducing unnecessary expansion directions and improving search efficiency and path fit. Simultaneously, by managing the search process through open and closed lists, and combining cost evaluation and backtracking mechanisms, it ensures that the planned path satisfies environmental constraints while achieving a cost-effective flight trajectory.
[0005] According to one aspect of this application, a method for unmanned aerial vehicle (UAV) path planning is provided, comprising: Obtain the flight start point and target end point of the UAV, and determine the flight space of the UAV based on the flight start point and the target end point; Initialize the open list and the closed list, add the flight starting point to the open list, determine the node with the minimum total cost from the open list as the current node, remove the current node from the open list and add it to the closed list; If the current node does not meet the preset conditions, then based on the main motion direction of the UAV, the feasible neighbor nodes of the current node are determined from the flyable space, the total cost of the feasible neighbor nodes is calculated, the open list is updated based on the feasible neighbor nodes and the corresponding total cost, and the current node is recorded as the parent node of the feasible neighbor nodes. After the open list is updated, the process returns to the step of determining the node with the minimum total cost from the open list as the current node. The preset conditions include the current node being the target endpoint, and the total cost includes the cost from the flight start point through the current node to the feasible neighbor node. If the current node meets the preset conditions, then based on each node included in the current closed list and the parent node corresponding to each node, the final path of the UAV is obtained by tracing back from the target endpoint to the flight starting point.
[0006] According to another aspect of this application, a drone path planning device is provided, comprising: The flight space determination module is used to obtain the flight start point and target end point of the UAV, and determine the flight space of the UAV based on the flight start point and the target end point; The list initialization module is used to initialize the open list and the closed list, add the flight starting point to the open list, determine the node with the minimum total cost from the open list as the current node, remove the current node from the open list and add it to the closed list; The search module is used to determine feasible neighbor nodes of the current node from the flyable space based on the main motion direction of the UAV if the current node does not meet the preset conditions, calculate the total cost of the feasible neighbor nodes, update the open list based on the feasible neighbor nodes and the corresponding total cost, and record the current node as the parent node of the feasible neighbor nodes. After the open list is updated, it returns to the step of determining the node with the minimum total cost from the open list as the current node. The preset conditions include the current node being the target endpoint, and the total cost includes the cost from the flight start point through the current node to the feasible neighbor node. The path generation module is used to obtain the final path of the UAV by backtracking from the target endpoint to the flight starting point based on each node included in the current closed list and the parent node corresponding to each node, if the current node meets the preset conditions.
[0007] According to another aspect of this application, a storage medium is provided on which a computer program is stored, which, when executed by a processor, implements the above-described UAV path planning method.
[0008] According to another aspect of this application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described UAV path planning method.
[0009] By employing the aforementioned technical solutions, this application provides a UAV path planning method and apparatus, storage medium, and computer equipment. This method incorporates the UAV's main motion direction into the neighbor node selection strategy, reducing unnecessary expansion directions and improving search efficiency and path fit. Simultaneously, by managing the search process through open and closed lists, and combining cost evaluation and backtracking mechanisms, it ensures that the planned path achieves a cost-effective flight trajectory while meeting environmental constraints.
[0010] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0011] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 A flowchart illustrating a UAV path planning method provided in an embodiment of this application is shown. Figure 2 A flowchart illustrating another UAV path planning method provided in an embodiment of this application is shown; Figure 3 This illustration shows a top view of the path generation effect of this application and a conventional algorithm, provided by an embodiment of this application. Figure 4 This illustration shows a main view of the path generation effect of this application and a traditional algorithm, provided by an embodiment of this application. Figure 5 This paper shows a schematic diagram of the structure of a UAV path planning device provided in an embodiment of this application; Figure 6 A schematic diagram of the device structure of a computer device provided in an embodiment of this application is shown. Detailed Implementation
[0012] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0013] This embodiment provides a method for UAV path planning, such as Figure 1 As shown, the method includes: Step 101: Obtain the flight start point and target end point of the UAV, and determine the flight space of the UAV based on the flight start point and the target end point.
[0014] Step 102: Initialize the open list and the closed list, add the flight starting point to the open list, determine the node with the minimum total cost from the open list as the current node, remove the current node from the open list and add it to the closed list.
[0015] Step 103: If the current node does not meet the preset conditions, then based on the main motion direction of the UAV, determine the feasible neighbor nodes of the current node from the flyable space, calculate the total cost of the feasible neighbor nodes, update the open list based on the feasible neighbor nodes and the corresponding total cost, and record the current node as the parent node of the feasible neighbor nodes. After the open list is updated, return to the step of determining the node with the minimum total cost from the open list as the current node. The preset conditions include the current node being the target endpoint, and the total cost includes the cost from the flight start point through the current node to the feasible neighbor node.
[0016] Step 104: If the current node meets the preset conditions, then based on each node included in the current closed list and the parent node corresponding to each node, backtrack from the target endpoint to the flight starting point to obtain the final path of the UAV.
[0017] This application provides a UAV path planning method that, in conjunction with the UAV's flight direction constraints, gradually finds the optimal or feasible path to the target destination within the flyable space through iterative search and cost evaluation.
[0018] First, the drone's flight start point and destination are obtained, and the drone's flyable space is determined accordingly. The flyable space can be constructed based on environmental data such as geographic information, obstacle distribution, and airspace restrictions, defining the area within which the drone is allowed to fly. This provides a basic constraint framework for subsequent path search, ensuring that the planned path conforms to actual flight conditions.
[0019] Next, the open and closed lists are initialized, with the flight start point added to the open list. The open list stores nodes to be examined, while the closed list records nodes that have already been processed. In each iteration, the node with the minimum total cost is selected from the open list as the current node, removed from the open list, and added to the closed list. This ensures that the search proceeds in the direction of lower overall cost. It is important to note that when the flight start point is initially added to the open list, the open list contains only the flight start point; at this point, the flight start point is the node with the minimum total cost in the open list.
[0020] Next, it is determined whether the current node meets preset conditions, such as whether the current node is the target endpoint or whether the search count corresponding to the current node has reached a preset number. If the current node does not meet the preset conditions, feasible neighbor nodes of the current node need to be determined within the flight space based on the main motion direction of the UAV. The main motion direction can be set based on the current orientation or mission route of the UAV to filter adjacent positions that conform to flight habits or dynamic constraints. Subsequently, the total cost of each feasible neighbor node is calculated. This total cost may include the actual cost from the flight start point to the node (such as the distance already flown) and the estimated heuristic cost to the target endpoint. Based on the total cost calculation results, the existing nodes in the open list and the total cost information of the nodes are updated according to the feasible neighbor nodes and their corresponding total costs. At the same time, the current node is recorded as the parent node of the feasible neighbor nodes in this round to establish a path backtracking relationship. After the update is completed, the loop returns to the previous step and selects the node with the smallest total cost in the open list to continue expansion.
[0021] If the current node meets the preset conditions, the search terminates. At this point, using the node and parent node relationships recorded in the closed list, starting from the target endpoint, the search proceeds back to the flight start point along the parent node pointer, thus constructing a complete path from the flight start point to the target endpoint, which serves as the final flight route of the UAV.
[0022] By applying the technical solution of this embodiment, the main motion direction of the UAV is incorporated into the neighbor node selection strategy, reducing unnecessary expansion directions and improving search efficiency and path fit. Simultaneously, by managing the search process through open and closed lists, and combining cost evaluation and backtracking mechanisms, it is ensured that the planned path achieves a cost-effective flight trajectory while meeting environmental constraints.
[0023] Optionally, in this embodiment of the application, step 103, "determining feasible neighbor nodes of the current node from the flyable space based on the main motion direction of the UAV," includes: calculating the target direction vector from the current node to the target endpoint; determining candidate neighbor nodes corresponding to the current node according to the flyable space, removing candidate neighbor nodes included in the closed list, and calculating the neighbor direction vector from the current node to each retained candidate neighbor node; for each neighbor direction vector, calculating the angle between the neighbor direction vector and the target direction vector, and if the angle does not exceed a preset angle, then determining the candidate neighbor node corresponding to the neighbor direction vector as the feasible neighbor node.
[0024] In this embodiment, firstly, the target direction vector from the current node to the target endpoint is calculated. This vector clarifies the approximate direction of the UAV's travel from its current position to the target position, providing a reference for subsequently determining whether neighboring nodes conform to the travel trend. Next, candidate neighboring nodes corresponding to the current node are determined based on the flyable space. The flyable space is the area within which the UAV can safely fly, and candidate neighboring nodes are those adjacent to the current node within this range and theoretically reachable. Then, candidate neighboring nodes included in the closed list are removed. The closed list contains a set of nodes that have already been processed during path planning and are no longer considered. Removing these nodes avoids redundant calculations and invalid path exploration, improving the efficiency of path planning.
[0025] For each retained candidate neighbor node, calculate the neighbor direction vector pointing from the current node to that node. These neighbor direction vectors reflect the directional information from the current node to each candidate neighbor node. Then, for each neighbor direction vector, calculate the angle between it and the target direction vector. The magnitude of the angle reflects the degree of deviation between the candidate neighbor node's direction and the target direction. If the angle does not exceed a preset angle, it indicates that the candidate neighbor node is relatively close to the target direction, meeting the requirement for the UAV to travel towards the target direction. In this case, the candidate neighbor node corresponding to the neighbor direction vector is determined as a feasible neighbor node. Here, the preset angle can be an empirical value or a threshold set according to the specific application scenario, used to control the degree of deviation between the neighbor node's direction and the target direction, ensuring that the path planning both moves towards the target and has a certain degree of flexibility to adapt to the actual flight environment.
[0026] This application's embodiments clarify the overall target direction of the UAV's flight by calculating the target direction vector, providing an intuitive reference for subsequent neighbor node selection and making path planning more targeted. By combining the flyable space to determine candidate neighbor nodes and eliminating candidate neighbor nodes included in the closed list, invalid calculations and repeated path exploration are avoided, greatly improving the efficiency of path planning, especially suitable for UAV path planning in complex environments. By calculating the angle between the neighbor direction vector and the target direction vector to determine whether a neighbor node is feasible, this method is simple, intuitive, and effective, ensuring that the UAV adapts to various situations in the actual flight environment while moving towards the target direction, improving the rationality and feasibility of path planning.
[0027] Optionally, in this embodiment, step 103, "calculating the total cost of the feasible neighbor node," includes: obtaining the first cumulative actual cost from the flight start point to the current node, and calculating the first Euclidean distance from the current node to the feasible neighbor node as the target actual cost; adding the first cumulative actual cost to the target actual cost to obtain the second cumulative actual cost from the flight start point to the feasible neighbor node; calculating the second Euclidean distance between the feasible neighbor node and the target endpoint as the first heuristic distance, and calculating the three-dimensional diagonal distance between the feasible neighbor node and the target endpoint as the second heuristic distance; performing a weighted summation of the first heuristic distance and the second heuristic distance according to a preset first weight coefficient and second weight coefficient to obtain a hybrid heuristic cost; determining the dynamic weight coefficient corresponding to the feasible neighbor node; multiplying the dynamic weight coefficient by the hybrid heuristic cost, and adding the product to the second cumulative actual cost to obtain the total cost corresponding to the feasible neighbor node.
[0028] In this embodiment, firstly, the first cumulative actual cost from the flight start point to the current node is obtained. This cost reflects the actual costs incurred by the UAV in flying from the start point to the current node, such as flight distance and energy consumption. Next, the first Euclidean distance from the current node to a feasible neighbor node is calculated and used as the target actual cost. The Euclidean distance intuitively reflects the straight-line distance between the two nodes and, to a certain extent, represents the flight distance cost required to reach the neighbor node from the current node. Then, the first cumulative actual cost is added to the target actual cost to obtain the second cumulative actual cost from the flight start point to the feasible neighbor node. This combines historical flight costs with the costs that may be incurred in the current step, comprehensively considering the actual cost of the UAV reaching the feasible neighbor node.
[0029] Next, the second Euclidean distance between feasible neighbor nodes and the target endpoint is calculated as the first heuristic distance. Euclidean distance quickly measures the straight-line distance from a feasible neighbor node to the target endpoint, providing a basic indicator for assessing the proximity of the feasible neighbor node to the target. Simultaneously, the three-dimensional diagonal distance between the feasible neighbor node and the target endpoint is calculated as the second heuristic distance. The three-dimensional diagonal distance considers the actual flight conditions in three-dimensional space and, compared to Euclidean distance, more accurately reflects the actual flight distance trend from the feasible neighbor node to the target endpoint in three-dimensional space. Then, based on preset first and second weighting coefficients, the first and second heuristic distances are weighted and summed to obtain the hybrid heuristic cost. By setting different weighting coefficients, the proportions of the two heuristic distances in the hybrid heuristic cost can be flexibly adjusted to adapt to different flight environments and path planning requirements.
[0030] Furthermore, the dynamic weight coefficient corresponding to the feasible neighbor node is determined. This dynamic weight coefficient can be dynamically adjusted based on factors such as the current flight environment and the drone's status. For example, in areas with many obstacles and high flight risks, the dynamic weight coefficient can be appropriately increased to place greater emphasis on heuristic information and guide the drone to choose a safer path. Finally, the dynamic weight coefficient is multiplied by the hybrid heuristic cost, and the product is added to the second accumulated actual cost to obtain the total cost corresponding to the feasible neighbor node. This combines the actual cost with the dynamically adjusted heuristic cost, comprehensively considering the costs already incurred by the drone and potential future trends, making the calculated total cost more accurately reflect the merits of the feasible neighbor node in the overall path planning.
[0031] This application's embodiments comprehensively consider both actual cost and heuristic cost to fully evaluate the merits of each feasible neighbor node. The actual cost reflects the costs already incurred by the UAV, while the heuristic cost reflects the degree to which feasible neighbor nodes are close to the target. Combining the two makes path planning more rational. Furthermore, introducing three-dimensional diagonal distance as one of the heuristic distances more accurately reflects the actual flight situation in three-dimensional space compared to simply using Euclidean distance, thus improving the accuracy of path planning. By setting dynamic weight coefficients, the proportion of heuristic cost can be flexibly adjusted according to the actual flight environment and UAV status, enhancing the adaptability and robustness of path planning, enabling the UAV to select a better path in complex and ever-changing flight environments.
[0032] Optionally, in this embodiment of the application, the step of "determining the dynamic weight coefficient corresponding to the feasible neighbor node" includes: The dynamic weighting coefficients are calculated based on the following formula: ; in, These are the initial weight parameters. The coordinates of the target endpoint are... The coordinates of the feasible neighbor nodes are given. The coordinates of the flight start point are given.
[0033] In this embodiment, It can be a pre-set base weight value, providing an initial adjustment benchmark for the entire dynamic weight calculation. Different The value can affect the magnitude and trend of the final dynamic weight coefficient, and can be adjusted according to specific application scenarios and needs. This embodiment adaptively adjusts the weight based on the relative distance from the current node to the target endpoint: when the search is far from the target endpoint, the dynamic weight coefficient is larger to enhance the heuristic effect and accelerate the search speed; as the search approaches the target endpoint, the dynamic weight coefficient gradually decreases to reduce heuristic bias and improve path optimality. This balances search efficiency and path quality, achieving a balance between efficiency and accuracy.
[0034] In this embodiment of the application, optionally, the open list also records the total cost of the nodes; the step 103 of "updating the open list based on the feasible neighbor nodes and the corresponding total cost" includes: for each feasible neighbor node, determining whether the feasible neighbor node already exists in the open list; if the feasible neighbor node does not exist in the open list, then adding the feasible neighbor node and the corresponding total cost to the open list; if the feasible neighbor node already exists in the open list, then comparing the newly calculated total cost with the total cost of the feasible neighbor node already stored in the open list; if the newly calculated total cost is less than the stored total cost, updating the total cost corresponding to the feasible neighbor node in the open list to the newly calculated total cost; if the newly calculated total cost is greater than or equal to the stored total cost, discarding the newly calculated total cost.
[0035] In this embodiment, for each feasible neighbor node, the following operations can be performed: First, determine if the feasible neighbor node exists in the open list. If the feasible neighbor node does not exist in the open list, then the feasible neighbor node and its corresponding total cost can be added to the open list so that nodes can be selected and expanded later based on the size of the total cost.
[0036] If the feasible neighbor node already exists in the open list, the newly calculated total cost for that feasible neighbor node can be compared with the total cost already stored in the open list to determine if the cost of the new path to the node is better. When the cost of the new path to the node is lower, it means a better way to reach the node has been found. In this case, updating the total cost information of the feasible neighbor node in the open list allows subsequent expansions to prioritize this better path, improving the efficiency and quality of path planning. However, if the newly calculated total cost is greater than or equal to the stored total cost, the newly calculated total cost can be discarded, and the total cost of the feasible neighbor node is not updated. This avoids unnecessary updates to the open list, reducing the waste of computational resources and time.
[0037] This application's embodiments ensure that the total cost information of nodes stored in the open list is always optimal or near optimal by determining whether a feasible neighbor node exists in the open list and updating the total cost accordingly. This provides an accurate data foundation for selecting the optimal path. This update mechanism helps to quickly converge to the optimal path during the search process, enabling UAVs to plan the optimal flight path from the flight start point to the target destination more efficiently, thus improving the performance and reliability of the entire path planning algorithm.
[0038] In this embodiment of the application, optionally, step 104, "based on each node included in the current closed list and the parent node corresponding to each node, backtracking from the target endpoint to the flight starting point to obtain the final path of the UAV," includes: setting the target endpoint as the current backtracking node and initializing the path node sequence; adding the current backtracking node to the path node sequence; searching for the parent node corresponding to the current backtracking node in the closed list and updating the found parent node as the new current backtracking node; adding the new current backtracking node to the path node sequence and returning to the step of searching for the parent node corresponding to the current backtracking node in the closed list until the new current backtracking node is the flight starting point; reversing the order of the nodes in the path node sequence to obtain an ordered node sequence from the flight starting point to the target endpoint, as the initial path; selecting multiple nodes from the ordered node sequence as control points, and generating a smooth flight path based on the control points using a Bézier curve, as the final path of the UAV.
[0039] In this embodiment, the closed list records the nodes that have been processed during the path search process and their related information. By making reasonable use of this information to trace back from the target endpoint to the flight starting point and further optimize the path, a feasible and smooth flight path can be provided for the UAV.
[0040] Specifically, first, the target endpoint is set as the current backtracking node, and the path node sequence is initialized, with the current backtracking node added to it. Next, the parent node corresponding to the current backtracking node is found in the closed list, and the found parent node is updated as the new current backtracking node. The closed list stores the correspondence between each node and its parent node. By finding the parent node of the current backtracking node, the previous node before the current node can be clearly identified, thus gradually approaching the flight starting point.
[0041] Next, the new current backtracking node is added to the path node sequence, and the process returns to the step of finding the parent node corresponding to the current backtracking node from the closed list, until the new current backtracking node is the flight start point. By repeatedly finding the parent node and updating the current backtracking node, the nodes on the path are added to the path node sequence in sequence until the flight start point is reached. At this point, the order of the nodes in the path node sequence is the reverse order from the target endpoint to the flight start point.
[0042] Furthermore, the order of nodes in the path node sequence is reversed to obtain an ordered node sequence from the flight start point to the target destination, which serves as the initial path. This reversal ensures the node order conforms to the actual flight sequence of the UAV from the start point to the target destination, forming a preliminary flight path. However, this initial path may consist of discrete nodes and is not smooth enough. Therefore, multiple nodes can be selected from the ordered node sequence as control points, and a smooth flight path can be generated using Bézier curves based on these control points, serving as the UAV's final path. Here, selecting appropriate control points defines the shape of the Bézier curve. Using the Bézier curve, a smooth curve can be generated based on these control points, making the UAV's flight path smoother, reducing turns and jitter during flight, and improving flight stability and efficiency.
[0043] In a specific embodiment, control points can be determined in the following manner: (1) All critical nodes: The flight start point, all intermediate nodes (inflection points) and the target endpoint in the ordered node sequence are directly used as control points. This method can strictly ensure that the smooth path passes through all the inflection points of the original path, and the path accuracy is the highest, but the number of control points is large, so the amount of calculation is large.
[0044] (2) Sparsification of key nodes: The ordered node sequence is thinned or sampled, for example: Uniform sampling: Select one node as a control point in an ordered sequence of nodes at fixed intervals.
[0045] Retain significant inflection points: By calculating the angle of change of direction of adjacent path segments, only nodes whose direction changes exceed a certain threshold (i.e., true inflection points) are selected as control points, and those intermediate nodes that are on an approximate straight line are discarded.
[0046] Flight start point, target endpoint, and intermediate sampling points: Ensure that the flight start point and target endpoint are mandatory, and then select several representative nodes in the intermediate part according to the rules.
[0047] This application embodiment, by disabling list backtracking, can accurately and efficiently construct a path from the flight start point to the target destination. It makes full use of the node information recorded during the path search process, avoids repeated calculations and searches, and improves the efficiency of path generation. The backtracked path is reversed and smoothed based on Bézier curves, so that the final flight path is not only logically correct, but also smooth and fluent, which better meets the actual flight needs of UAVs and helps to improve the stability and safety of UAV flight.
[0048] In this embodiment of the application, optionally, step 101, "determining the flyable space of the UAV based on the flight start point and the target end point," includes: determining the candidate flight space of the UAV based on the flight start point and the target end point; obtaining obstacle information corresponding to the candidate flight space, and constructing a three-dimensional grid map based on the obstacle information and the candidate flight space, wherein each grid in the three-dimensional grid map is marked as an obstacle grid or a free grid; expanding each obstacle grid according to the physical radius and safety distance of the UAV, and marking the expanded grid as an expanded obstacle grid; updating the free grid based on the expanded obstacle grid, and determining the space formed by the updated final free grid as the flyable space of the UAV.
[0049] In this embodiment, firstly, candidate flight spaces for the UAV are determined based on the flight start point and the target endpoint. Specifically, by connecting the flight start point and the target endpoint and considering a certain spatial range expansion, an area that may contain the UAV's flight path is initially delineated as a candidate flight space. This space provides a basic framework for subsequent obstacle analysis and flight area determination.
[0050] Next, obstacle information corresponding to the candidate flight space is obtained, and a 3D grid map is constructed based on the obstacle information and the candidate flight space. Here, obstacle information can include the location, shape, size, etc. of obstacles. Then, the candidate flight space is divided into small 3D grids, and each grid is marked as an obstacle grid (with obstacles) or a free grid (without obstacles) according to the obstacle information, thus forming a 3D grid map that presents the distribution of obstacles in the space in an intuitive and easily computable way.
[0051] Next, based on the drone's physical radius and safe distance, each obstacle grid is expanded, and the expanded grid is marked as an expanded obstacle grid. Considering the drone's physical size and the need to maintain a safe distance from obstacles during flight, the obstacle grid is expanded according to the drone's physical radius and a preset safe distance. The expanded grid range better reflects the area the drone needs to avoid during flight, ensuring the drone has sufficient space to pass safely.
[0052] Furthermore, due to the presence of the expanded obstacle grid, some areas originally marked as free grids may no longer be suitable for drone flight due to their proximity to the expanded obstacle area. Therefore, the free grid can be updated based on the expanded obstacle grid. Those free grids that still meet the conditions for safe flight are retained, and the space formed by these finally determined free grids is the flight space in which the drone can fly safely.
[0053] This application embodiment constructs a three-dimensional grid map, which clearly and intuitively presents the distribution of obstacles within the candidate flight space, providing a convenient and accurate data foundation for subsequent obstacle processing and flight space determination. By inflating the obstacle grid based on the UAV's physical radius and safety distance, the safety of the UAV during flight is fully guaranteed, avoiding collision risks caused by ignoring its own size and safety distance. By updating the free grid based on the inflated obstacle grid, the flight space of the UAV is accurately determined, providing a reliable spatial range for UAV path planning. This helps to plan safe and feasible flight paths, improving the success rate and reliability of UAV flight missions.
[0054] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the specific implementation process of this embodiment, another UAV path planning method is provided, such as... Figure 2 As shown, the method includes: Step 1, Environment Modeling and Initialization: First, the flyable space is determined based on the UAV's flight start point and target endpoint. Then, the open and closed tables are initialized, and the starting point (i.e., the flight start point) is added to the open table as the starting node for path search. In this application, the UAV path planning method expands obstacles during the mapping process. During actual flight, based on the UAV's own radius and safe distance, obstacles are expanded within a certain range on the grid map to form an expanded obstacle region, ensuring that collisions with obstacles are avoided during path planning.
[0055] Step 2, Node Search: During the path search process, the search expands from the current node to its surrounding feasible neighbor nodes. First, it checks if the `open` list is empty; if empty, it determines there is no feasible path and ends the search. To avoid infinite loops, a maximum number of iterations can be set; if the target endpoint is not found after reaching this maximum number of iterations, the search terminates, and the path is determined to be unreachable. In each loop, the node with the lowest total cost is selected from the `open` list as the current node (`current`), removed from the `open` list, and added to the `closed` list, indicating that the node has already been searched to avoid repeated visits. Then, candidate neighbor nodes around the current node are searched. If a candidate neighbor node is not in the `closed` list and is not within the obstacle range, then the candidate neighbor nodes (`neighbors`) are obtained. Traditional A When performing path search, the algorithm traverses the neighborhood of the current node (which has 26 directions in 3D space) each time, introducing a large number of redundant nodes and increasing computational overhead. This application addresses this issue in traditional A... Based on the algorithm, combined with the main motion direction of the UAV, a strategy based on the main motion direction is adopted. By calculating the angle between the vector from the parent node to the target endpoint and the vector from the parent node to the candidate neighbor node, only feasible neighbor nodes within a 90-degree range with the main motion direction are retained for search, thereby reducing the number of search nodes, improving the efficiency of 3D path planning, and ensuring that the search direction is consistent with the actual motion direction of the UAV.
[0056] Assume the target direction vector determined by the current node and the target endpoint is: The formula is as follows: ; In the formula, The coordinates of the target endpoint; These are the coordinates of the current node.
[0057] Suppose that the direction vector determined by the current node is obtained by searching the next node. The formula is as follows: ; In the formula, The coordinates of the next node (candidate neighbor node) obtained through the search of the current node.
[0058] Then, the node extension direction (i.e., the included angle) based on the main motion direction is: , The calculation formula is as follows: ; Step 3, Cost Calculation: After obtaining feasible neighbor nodes in Step 2, calculate the total cost of each feasible neighbor node, and simultaneously set the current node as the parent node of a feasible neighbor node for subsequent path backtracking. The formula for calculating the cost function can be: ; In the formula, Let be the cost function from the flight start point through the current node, feasible neighbor nodes, all the way to the target destination. The second cumulative actual cost from the flight origin to feasible neighbor nodes. For dynamic weighting coefficients, The hybrid heuristic cost from feasible neighbor nodes to the target endpoint.
[0059] A heuristic function combining Euclidean distance and three-dimensional diagonal distance is adopted, which considers both the shortest straight distance to the target endpoint and the allowed diagonal movement within the grid, thereby enabling A to... The search results generate smoother paths with shorter overall path lengths that are closer to the actual shortest path.
[0060] The calculation formula can be: ; In the formula, and The first and second weighting coefficients can be taken as... .
[0061] Furthermore, dynamic weight coefficients can be introduced when calculating the hybrid heuristic cost, adaptively adjusting the weights based on the relative distances of feasible neighbor nodes to the target endpoint. When the search is far from the target endpoint, the weights are larger to enhance the heuristic effect and accelerate the search; as the search progresses closer to the target endpoint, the weights gradually decrease to reduce heuristic bias and improve path optimality. This balances search efficiency and path quality, achieving a equilibrium between efficiency and accuracy. The formula for calculating the dynamic weight parameters is as follows: ; In the formula, These are the initial weight parameters, which we will use in this case. .
[0062] Step 4, Path Backtracking and Generation: When a feasible neighbor node successfully reaches the target endpoint during the search process, it indicates that a feasible path has been found. At this point, starting from the target endpoint, its parent nodes are backtracked sequentially until the flight start point is reached, thus generating a complete planned path. This path is a series of discrete node sequences that record the flight trajectory of the UAV from the flight start point to the target endpoint.
[0063] Step 5, Path Optimization: To improve the smoothness and feasibility of the path, the results can be optimized after path backtracking. Specifically, the Bézier curve method can be used to smooth the discrete path, thereby reducing turning points and improving the stability and safety of the UAV during flight. The formula for calculating the Bézier curve is: ; In the formula, For the index of the control point; For the first One control point; This is the curve order, which can be set to n = number of control points - 1; These are curve parameters.
[0064] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, a verification of the effectiveness of the above-described UAV path planning method is provided: This experiment was conducted on the MATLAB R2022a platform. A 3D rasterized obstacle environment based on real data was built on the platform. The space size was 500×500×500, the number of obstacles was 50, the starting point was set to (10, 10, 1), the ending point was set to (400, 450, 50), and the maximum number of iterations was 1000.
[0065] As shown in Table 1, compared with traditional A Compared to other algorithms, the experimental results show that the UAV path planning method in this application exhibits significant advantages in 3D path planning, with improvements across multiple performance metrics. Regarding search efficiency, the UAV path planning method in this application combines the UAV motion direction obtained from the parent space path planning, employs a strategy based on the main motion direction for searching, and significantly reduces unnecessary node expansion by adjusting the search process through an improved heuristic weight function. Experimental data show that the traditional A... The algorithm requires an average of 11,440 nodes to search, while the UAV path planning method in this application only requires 4,725, reducing the number of nodes by approximately 58.7%. This indicates that the improved heuristic function can more effectively guide the search direction and avoid ineffective searches in areas with dense obstacles. In terms of computational performance, the UAV path planning method in this application has an average running time of 0.052 seconds, compared to the traditional A... The algorithm's processing time of 0.153 seconds represents a speed improvement of approximately 66%. This increased efficiency makes the algorithm more suitable for real-time path planning applications for UAVs. Regarding the average path length, the UAV path planning method in this application plans a path of 599.64 meters, approximately 2.0% shorter than the traditional algorithm's 612.12 meters. This improvement is attributed to the precise guidance of the hybrid heuristic function and the dynamic weight adjustment mechanism, enabling the algorithm to find a path closer to the optimal path in complex 3D environments and avoiding the path detours caused by the traditional algorithm's over-reliance on straight-line distance estimation.
[0066] Table 1 Comparison of Path Data
[0067] Figure 3 and Figure 4 This paper demonstrates the path planning results of the UAV path planning method in this application compared to traditional algorithms, where the traditional A... The paths generated by the algorithm are represented by solid blue lines, while the paths generated by the UAV path planning method in this application are represented by solid red lines. The paths generated by the UAV path planning method in this application clearly tend to select open areas with sparse obstacles. Especially within the coordinate range (360,360,20) to (400,418,50), traditional algorithm paths closely follow the edges of obstacles, while the paths generated by the UAV path planning method in this application maintain a better safety margin. This path selection characteristic benefits from the obstacle density cost term introduced in the improved heuristic function, enabling the algorithm to actively avoid high-risk areas.
[0068] In summary, the comprehensive performance improvement of the UAV path planning method presented in this application has been verified through 3D simulation experiments. Experimental data shows that the UAV path planning method presented in this application significantly outperforms traditional algorithms in path planning efficiency, reducing average running time by 66% and the number of search nodes by 58.7%, demonstrating the algorithm's high efficiency in complex 3D environments. Furthermore, the average path length planned by the UAV path planning method presented in this application is shortened by 2.0%, maintaining a safe distance of more than 3 grid units from obstacles, which not only improves the economy of the path but also significantly enhances the stability and safety of UAV flight. Experimental results demonstrate that the UAV path planning method presented in this application exhibits excellent adaptability, robustness, and practicality in complex 3D environments, providing reliable technical support for UAV autonomous navigation.
[0069] Furthermore, as Figure 1 To specifically implement the method, this application provides a UAV path planning device, such as... Figure 5 As shown, the device includes: The flight space determination module is used to obtain the flight start point and target end point of the UAV, and determine the flight space of the UAV based on the flight start point and the target end point; The list initialization module is used to initialize the open list and the closed list, add the flight starting point to the open list, determine the node with the minimum total cost from the open list as the current node, remove the current node from the open list and add it to the closed list; The search module is used to determine feasible neighbor nodes of the current node from the flyable space based on the main motion direction of the UAV if the current node does not meet the preset conditions, calculate the total cost of the feasible neighbor nodes, update the open list based on the feasible neighbor nodes and the corresponding total cost, and record the current node as the parent node of the feasible neighbor nodes. After the open list is updated, it returns to the step of determining the node with the minimum total cost from the open list as the current node. The preset conditions include the current node being the target endpoint, and the total cost includes the cost from the flight start point through the current node to the feasible neighbor node. The path generation module is used to obtain the final path of the UAV by backtracking from the target endpoint to the flight starting point based on each node included in the current closed list and the parent node corresponding to each node, if the current node meets the preset conditions.
[0070] Optionally, the search module is used for: Calculate the target direction vector from the current node to the target endpoint; Based on the flyable space, determine the candidate neighbor nodes corresponding to the current node, remove the candidate neighbor nodes included in the closed list, and calculate the neighbor direction vector from the current node to each of the remaining candidate neighbor nodes. For each neighbor direction vector, calculate the angle between the neighbor direction vector and the target direction vector. If the angle does not exceed a preset angle, then the candidate neighbor node corresponding to the neighbor direction vector is determined as the feasible neighbor node.
[0071] Optionally, the search module is further configured to: Obtain the first cumulative actual cost from the flight start point to the current node, and calculate the first Euclidean distance from the current node to the feasible neighbor node as the target actual cost. Add the first cumulative actual cost to the target actual cost to obtain the second cumulative actual cost from the flight start point to the feasible neighbor node. Calculate the second Euclidean distance between the feasible neighbor node and the target endpoint as the first heuristic distance, and calculate the three-dimensional diagonal distance between the feasible neighbor node and the target endpoint as the second heuristic distance; Based on the preset first and second weight coefficients, the first heuristic distance and the second heuristic distance are weighted and summed to obtain the hybrid heuristic cost; Determine the dynamic weight coefficients corresponding to the feasible neighbor nodes; Multiply the dynamic weight coefficient by the hybrid heuristic cost, and add the product to the second cumulative actual cost to obtain the total cost corresponding to the feasible neighbor node.
[0072] Optionally, the search module is further configured to: The dynamic weighting coefficients are calculated based on the following formula: ; in, These are the initial weight parameters. The coordinates of the target endpoint are... The coordinates of the feasible neighbor nodes are given. The coordinates of the flight start point are given.
[0073] Optionally, the open list also records the total cost of the nodes; the search module is further configured to: For each feasible neighbor node, determine whether the feasible neighbor node already exists in the open list; If the feasible neighbor node does not exist in the open list, then the feasible neighbor node and its corresponding total cost are added to the open list; If the feasible neighbor node already exists in the open list, the newly calculated total cost is compared with the total cost of the feasible neighbor node already stored in the open list; if the newly calculated total cost is less than the stored total cost, the total cost corresponding to the feasible neighbor node in the open list is updated to the newly calculated total cost; if the newly calculated total cost is greater than or equal to the stored total cost, the newly calculated total cost is discarded.
[0074] Optionally, the path generation module is used to: Set the target endpoint as the current backtracking node, initialize the path node sequence, and add the current backtracking node to the path node sequence; Find the parent node corresponding to the current backtracking node from the closed list, and update the found parent node to the new current backtracking node; Add the new current backtracking node to the path node sequence, and return to the step of finding the parent node corresponding to the current backtracking node from the closed list, until the new current backtracking node is the flight start point; Reverse the order of the nodes in the path node sequence to obtain an ordered node sequence from the flight start point to the target destination, which serves as the initial path; Multiple nodes are selected from the ordered node sequence as control points, and a smooth flight path is generated based on the control points using a Bézier curve as the final path of the UAV.
[0075] Optionally, the flight space determination module is used for: Based on the flight start point and the target destination, the candidate flight space of the UAV is determined; Obstacle information corresponding to the candidate flight space is obtained, and a three-dimensional grid map is constructed based on the obstacle information and the candidate flight space, wherein each grid in the three-dimensional grid map is marked as an obstacle grid or a free grid; Based on the physical radius and safe distance of the UAV, each obstacle grid is expanded, and the expanded grid is marked as an expanded obstacle grid. Based on the expanding obstacle grid, the free grid is updated, and the space formed by the updated final free grid is determined as the flight space of the UAV.
[0076] It should be noted that other corresponding descriptions of the functional units involved in the UAV path planning device provided in this application embodiment can be found in the following references. Figures 1 to 4 The corresponding descriptions in the method will not be repeated here.
[0077] This application also provides a computer device, which may specifically be a personal computer, a server, a network device, etc. Figure 6 As shown, the computer device includes a bus, a processor, memory, and a communication interface, and may also include an input / output interface and a display device. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores location information. The network interface allows communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the various method embodiments.
[0078] Those skilled in the art will understand that Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0079] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, having stored thereon a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0080] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0081] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0082] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0083] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0084] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for unmanned aerial vehicle (UAV) path planning, characterized in that, include: Obtain the flight start point and target end point of the UAV, and determine the flight space of the UAV based on the flight start point and the target end point; Initialize the open list and the closed list, add the flight starting point to the open list, determine the node with the minimum total cost from the open list as the current node, remove the current node from the open list and add it to the closed list; If the current node does not meet the preset conditions, then based on the main motion direction of the UAV, the feasible neighbor nodes of the current node are determined from the flyable space, the total cost of the feasible neighbor nodes is calculated, the open list is updated based on the feasible neighbor nodes and the corresponding total cost, and the current node is recorded as the parent node of the feasible neighbor nodes. After the open list is updated, the process returns to the step of determining the node with the minimum total cost from the open list as the current node. The preset conditions include the current node being the target endpoint, and the total cost includes the cost from the flight start point through the current node to the feasible neighbor node. If the current node meets the preset conditions, then based on each node included in the current closed list and the parent node corresponding to each node, the final path of the UAV is obtained by tracing back from the target endpoint to the flight starting point.
2. The method according to claim 1, characterized in that, The step of determining feasible neighbor nodes of the current node from the flyable space based on the main motion direction of the UAV includes: Calculate the target direction vector from the current node to the target endpoint; Based on the flyable space, determine the candidate neighbor nodes corresponding to the current node, remove the candidate neighbor nodes included in the closed list, and calculate the neighbor direction vector from the current node to each of the remaining candidate neighbor nodes. For each neighbor direction vector, calculate the angle between the neighbor direction vector and the target direction vector. If the angle does not exceed a preset angle, then the candidate neighbor node corresponding to the neighbor direction vector is determined as the feasible neighbor node.
3. The method according to claim 1, characterized in that, The calculation of the total cost of the feasible neighbor nodes includes: Obtain the first cumulative actual cost from the flight start point to the current node, and calculate the first Euclidean distance from the current node to the feasible neighbor node as the target actual cost. Add the first cumulative actual cost to the target actual cost to obtain the second cumulative actual cost from the flight start point to the feasible neighbor node. Calculate the second Euclidean distance between the feasible neighbor node and the target endpoint as the first heuristic distance, and calculate the three-dimensional diagonal distance between the feasible neighbor node and the target endpoint as the second heuristic distance; Based on the preset first and second weight coefficients, the first heuristic distance and the second heuristic distance are weighted and summed to obtain the hybrid heuristic cost; Determine the dynamic weight coefficients corresponding to the feasible neighbor nodes; Multiply the dynamic weight coefficient by the hybrid heuristic cost, and add the product to the second cumulative actual cost to obtain the total cost corresponding to the feasible neighbor node.
4. The method according to claim 3, characterized in that, The determination of the dynamic weight coefficients corresponding to the feasible neighbor nodes includes: The dynamic weighting coefficients are calculated based on the following formula: ; in, These are the initial weight parameters. The coordinates of the target endpoint are... The coordinates of the feasible neighbor nodes are given. The coordinates of the flight start point are given.
5. The method according to claim 1, characterized in that, The open list also records the total cost of the nodes; updating the open list based on the feasible neighbor nodes and their corresponding total costs includes: For each feasible neighbor node, determine whether the feasible neighbor node already exists in the open list; If the feasible neighbor node does not exist in the open list, then the feasible neighbor node and its corresponding total cost are added to the open list; If the feasible neighbor node already exists in the open list, the newly calculated total cost is compared with the total cost of the feasible neighbor node already stored in the open list; if the newly calculated total cost is less than the stored total cost, the total cost corresponding to the feasible neighbor node in the open list is updated to the newly calculated total cost; if the newly calculated total cost is greater than or equal to the stored total cost, the newly calculated total cost is discarded.
6. The method according to claim 1, characterized in that, The process of tracing back from the target endpoint to the flight starting point based on each node in the current closed list and the parent node of each node to obtain the final path of the drone includes: Set the target endpoint as the current backtracking node, initialize the path node sequence, and add the current backtracking node to the path node sequence; Find the parent node corresponding to the current backtracking node from the closed list, and update the found parent node to the new current backtracking node; Add the new current backtracking node to the path node sequence, and return to the step of finding the parent node corresponding to the current backtracking node from the closed list, until the new current backtracking node is the flight start point; Reverse the order of the nodes in the path node sequence to obtain an ordered node sequence from the flight start point to the target destination, which serves as the initial path; Multiple nodes are selected from the ordered node sequence as control points, and a smooth flight path is generated based on the control points using a Bézier curve as the final path of the UAV.
7. The method according to claim 1, characterized in that, Determining the flyable space of the UAV based on the flight start point and the target destination includes: Based on the flight start point and the target destination, the candidate flight space of the UAV is determined; Obstacle information corresponding to the candidate flight space is obtained, and a three-dimensional grid map is constructed based on the obstacle information and the candidate flight space, wherein each grid in the three-dimensional grid map is marked as an obstacle grid or a free grid; Based on the physical radius and safe distance of the UAV, each obstacle grid is expanded, and the expanded grid is marked as an expanded obstacle grid. Based on the expanding obstacle grid, the free grid is updated, and the space formed by the updated final free grid is determined as the flight space of the UAV.
8. A path planning device for unmanned aerial vehicles (UAVs), characterized in that, include: The flight space determination module is used to obtain the flight start point and target end point of the UAV, and determine the flight space of the UAV based on the flight start point and the target end point; The list initialization module is used to initialize the open list and the closed list, add the flight starting point to the open list, determine the node with the minimum total cost from the open list as the current node, remove the current node from the open list and add it to the closed list; The search module is used to determine feasible neighbor nodes of the current node from the flyable space based on the main motion direction of the UAV if the current node does not meet the preset conditions, calculate the total cost of the feasible neighbor nodes, update the open list based on the feasible neighbor nodes and the corresponding total cost, and record the current node as the parent node of the feasible neighbor nodes. After the open list is updated, it returns to the step of determining the node with the minimum total cost from the open list as the current node. The preset conditions include the current node being the target endpoint, and the total cost includes the cost from the flight start point through the current node to the feasible neighbor node. The path generation module is used to obtain the final path of the UAV by backtracking from the target endpoint to the flight starting point based on each node included in the current closed list and the parent node corresponding to each node, if the current node meets the preset conditions.
9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.
10. A computer device, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.