UAV path planning method, device, equipment and medium
By adopting dynamic two-layer neighborhood and custom evaluation functions in drone path planning, the problems of insufficient accuracy and high cost of urban low-altitude flight path planning are solved, and efficient and accurate drone path planning is achieved.
Patent Information
- Application Number
- CN202411142169.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-08-20
AI Technical Summary
The existing drones have insufficient accuracy and high cost in urban low-altitude flight path planning, making it difficult to effectively solve the problem of obstacle detection and calculation difficulty in path planning.
The path planning method based on dynamic double-layer neighborhood generation and custom evaluation functions is adopted. Dynamic double-layer neighborhoods are generated by a combination of global search and local search, and the obstacle node is detected and calculated, and the path node with the lowest cost is selected to achieve no Human-machine path planning.
It improves the accuracy of path planning, reduces calculation costs, balances search efficiency and quality, avoids local optimal problems, and optimizes the drone flight path.
Smart Images

Figure CN118654682B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of drone technology, and in particular to drone path planning methods, devices, equipment and media. Background Art
[0002] With the rapid development of drone technology, the market share of drone equipment is increasing year by year. In the future, there may be a large number of drones flying over cities. However, a large number of drones flying in the low-altitude areas of cities will cause many safety and privacy issues. Therefore, it is particularly important to reasonably plan the low-altitude airspace of cities and strictly set low-altitude no-fly zones.
[0003] In order to address the above-mentioned problems, the flight path of the UAV is planned in the prior art, providing the best route from the starting position to the target position under various standards. However, common path planning methods usually require manual intervention and the path planning accuracy is not high.
[0004] In addition, since the areas available for low-altitude flight operations in urban environments are often divided into various shapes and are uneven, in order to ensure the endurance of the drone while avoiding collisions, the shortest path flight principle is usually adopted. However, this approach will further increase the computational difficulty of drone path planning, resulting in increased computational costs.
[0005] Therefore, no effective solution has been proposed for the problems of insufficient path planning accuracy and high path planning cost of UAVs flying at low altitudes in cities in the existing technology. Summary of the invention
[0006] The embodiments of the present application provide a method, device, equipment and medium for drone path planning, aiming to solve the problems of insufficient path planning accuracy and high path planning cost of drones flying at low altitudes in cities in the prior art methods.
[0007] In a first aspect, an embodiment of the present invention provides a method for UAV path planning, the method comprising:
[0008] Get the starting path node;
[0009] Generate a dynamic double-layer neighborhood of the starting path node based on a node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes a next path node of the starting path node and does not include an obstacle node;
[0010] Based on the detection strategy, all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node are detected as obstacles to obtain obstacle node detection results;
[0011] When the obstacle node detection result is that the current adjacent node of each node is not an obstacle node, the movement cost calculation results of the starting path node passing through each node to reach the target path node are calculated based on the custom evaluation function, and the movement cost calculation results of the starting path node passing through the current adjacent nodes of each node to reach the target path node are calculated respectively, and based on the movement cost calculation results, the node with the smallest cost is selected from each node and the adjacent nodes of each node as the next path node of the starting path node;
[0012] Taking the next path node of the starting path node as the current starting path node, and continuing to calculate and obtain the next path node of the current starting path node until the target path node is reached;
[0013] The path is traced back from the target path node to the starting path node to obtain the planned path of the UAV.
[0014] In a second aspect, an embodiment of the present invention provides a drone path planning device, which includes:
[0015] An acquisition unit, used for acquiring a starting path node;
[0016] A neighborhood generation unit, configured to generate a dynamic double-layer neighborhood of the starting path node based on a node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes a next path node of the starting path node and does not include an obstacle node;
[0017] A node detection unit, configured to perform obstacle node detection on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on a detection strategy to obtain an obstacle node detection result;
[0018] a path node planning unit, for calculating the movement cost calculation results of the starting path node passing through each node to reach the target path node based on a custom evaluation function when the obstacle node detection result is that the current adjacent node of each node is not an obstacle node, and calculating the movement cost calculation results of the starting path node passing through the current adjacent node of each node to reach the target path node based on a custom evaluation function, and selecting a node with the smallest cost from each node and the adjacent nodes of each node as the next path node of the starting path node based on the movement cost calculation results,
[0019] Taking the next path node of the starting path node as the current starting path node, and continuing to calculate and obtain the next path node of the current starting path node until the target path node is reached;
[0020] The planned path generation unit is used to trace back from the target path node along the path nodes to the starting path node to obtain the planned path of the drone.
[0021] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the computer program.
[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the method described in the first aspect above.
[0023] The embodiment of the present invention provides a method and device for planning a path for a drone. Obtain a starting path node; generate a dynamic double-layer neighborhood of the starting path node based on a node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes the next path node of the starting path node and does not include an obstacle node; perform obstacle node detection on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on a detection strategy to obtain an obstacle node detection result; when the detection result is that the current adjacent node of each node is not an obstacle node, calculate the movement cost calculation result of the starting path node passing through each node to reach the target path node based on a custom evaluation function, and calculate the movement cost calculation result of the starting path node passing through the current adjacent nodes of each node to reach the target path node, and select the node with the smallest cost from each node and the adjacent nodes of each node as the next path node of the starting path node based on the movement cost calculation result; take the next path node of the starting path node as the current starting path node, and continue to calculate and obtain the next path node of the current starting path node until the target path node is reached; trace back from the target path node along the path node to the starting path node in reverse order to generate a planned path for the drone.
[0024] In the above method, firstly, a dynamic double-layer neighborhood of the current path node is generated based on a double-layer neighborhood expansion method combining global search and local search. The generated dynamic double-layer neighborhood can achieve a good balance between the search efficiency and search quality of the path node; then, based on the evaluation function, the optimal path node that minimizes the movement cost of the UAV is calculated from the node set of the dynamic double-layer neighborhood, thereby improving the path planning accuracy and reducing the path planning cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0026] Figure 1 A schematic diagram of a flow chart of a drone path planning method provided by an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of a sub-process of a drone path planning method provided by an embodiment of the present invention;
[0028] Figure 3 A schematic diagram of another sub-process of the UAV path planning method provided by an embodiment of the present invention;
[0029] Figure 4 A schematic block diagram of a drone path planning device provided by an embodiment of the present invention;
[0030] Figure 5 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0033] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0034] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0035] The embodiment of the present invention provides a method for planning a path of an unmanned aerial vehicle. Figure 1 A schematic diagram of a flow chart of a method for planning a path for a drone according to an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes steps S110 to S160.
[0036] S110, obtaining a starting path node.
[0037] In this embodiment, the starting path node of the UAV's path to be planned is obtained, wherein the starting path node can be located at any point in the obstacle-free area in the constructed low-altitude path planning area.
[0038] S120. Generate a dynamic double-layer neighborhood of the starting path node based on the node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes the next path node of the starting path node and does not include obstacle nodes.
[0039] In this embodiment, the starting path node is used as the starting point of the UAV planned path, and then a dynamic double-layer neighborhood of the starting path node is generated at the starting path node based on the node neighborhood generation strategy, wherein the node set of the dynamic double-layer neighborhood includes the next path node of the starting path node, and the node set does not include obstacle nodes.
[0040] In one embodiment, a dynamic double-layer neighborhood of a starting path node is generated based on a node neighborhood generation strategy and a starting path node, including: obtaining flight feedback data of a drone flying from the starting path node to each path node in the dynamic double-layer neighborhood, wherein the flight feedback data includes flight time and flight path; then, taking the starting path node as the generation center, dynamically adjusting the neighborhood size based on an adaptive adjustment algorithm or flight feedback data to generate a dynamic double-layer neighborhood of the starting path node; wherein one neighborhood layer in the double-layer neighborhood is used for a global search for path nodes, and the other neighborhood layer is used for a local search for path nodes.
[0041] Preferably, when dynamically adjusting the neighborhood size based on an adaptive adjustment algorithm or flight feedback data to generate a dynamic double-layer neighborhood of the starting path node, specifically including: the first is to use a simulated annealing algorithm to adaptively adjust the size of the double-layer neighborhood centered on the starting path node to obtain a double-layer neighborhood that makes the search efficiency and search quality of the path node reach a better balance. For example, first search for path nodes in a smaller neighborhood, and when the search results are no longer improved, switch to another layer of neighborhood and expand the size of the neighborhood to try to search whether there are path nodes in the neighborhood that make the drone move less costly, until the search results no longer change. Alternatively, first search for path nodes globally in a larger neighborhood, and after obtaining several path nodes, switch to a smaller neighborhood and continuously reduce the size of the neighborhood, and perform a more refined local search to try to search whether there are path nodes in the neighborhood that make the drone move less costly, until the search results no longer change. The second method is to obtain the flight feedback data of the drone flying from the starting path node to each path node in the dynamic double-layer neighborhood in advance, and perform quantitative adjustment analysis on the balance point of the two neighborhoods in the double-layer neighborhood to generate the dynamic double-layer neighborhood of the starting path node. For example, first fix a neighborhood, such as a smaller neighborhood, and then gradually increase the size of the other neighborhood, and calculate a number of flight feedback data of the drone flying from the starting path node to each path node in the dynamic double-layer neighborhood; then, by analyzing these flight feedback data, determine the balance point between the neighborhood used for global search and the neighborhood used for local search, that is, at this balance point, the search efficiency and search quality of the path node reach a better balance state.
[0042] In this embodiment, the dynamically generated double-layer neighborhood can effectively improve the search efficiency and search quality, thereby facilitating the subsequent acquisition of the best path node, thereby improving the accuracy of the planned path and reducing the planning cost.
[0043] S130 , performing obstacle node detection on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on the detection strategy to obtain an obstacle node detection result.
[0044] In this embodiment, after the dynamic double-layer neighborhood of the starting path node is determined through the above steps, obstacle node detection is performed on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on the detection strategy to obtain an obstacle node detection result.
[0045] Preferably, the detection strategy in this embodiment may adopt deep learning algorithms, computer vision technology, etc., which are not specifically limited here.
[0046] S140. When the obstacle node detection result shows that the current adjacent nodes of each node are not obstacle nodes, the movement cost calculation results of the starting path node passing through each node to reach the target path node are calculated based on the custom evaluation function, and the movement cost calculation results of the starting path node passing through the current adjacent nodes of each node to reach the target path node are calculated respectively, and based on the movement cost calculation results, the node with the smallest cost is selected from each node and its adjacent nodes as the next path node of the starting path node.
[0047] In this embodiment, when the obstacle node detection result is that the current adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node are not obstacle nodes, the mobile cost calculation results of the starting path node passing through each node to reach the target path node are calculated based on the custom evaluation function, and the mobile cost calculation results of the starting path node passing through the current adjacent nodes of each node to reach the target path node are calculated. Then, based on the mobile cost calculation results, the node with the smallest cost is selected from each node and the adjacent nodes of each node as the next path node of the starting path node. It should be noted that the current adjacent nodes of each node detected in this embodiment refer to a certain node obtained from the node set of the dynamic double-layer neighborhood of the starting path node, and then each adjacent node of the node is detected for obstacle nodes. Only when it is detected that the adjacent node currently being detected of the node is not an obstacle node, can the subsequent mobile cost calculation be performed; then, according to the above detection method, by analogy, each adjacent node of each node included in the dynamic double-layer neighborhood of the starting path node is detected for obstacle nodes in turn.
[0048] In one embodiment, when the obstacle node detection result is that the current adjacent node of each node included in the dynamic double-layer neighborhood of the starting path node is an obstacle node, the next adjacent node of each node continues to be detected until a node that is not an obstacle node is detected from the adjacent nodes of each node. It should be noted that the next adjacent node in this embodiment refers to the next adjacent node adjacent to the current adjacent node.
[0049] In one embodiment, if Figure 2 As shown, after the obstacle node detection result is that the current adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node are not obstacle nodes, step S140 includes sub-steps S141-S145:
[0050] S141, obtaining all untraversed adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node;
[0051] S142, respectively calculating the sum of the path lengths from any adjacent node of each node to the remaining adjacent nodes that have not been traversed, and obtaining a path length calculation result;
[0052] S143, based on the path length calculation result, select a node with the largest path length calculation result value from each node as the next traversal node of the starting path node;
[0053] It should be noted that the meaning of the next traversal node is equivalent to the next path node, that is, the traversal node is determined to be a path node in the planned path of the drone, and the two are just named differently;
[0054] S144, taking the next traversal node of the starting path node as the current node, and continuing to calculate and obtain the next traversal node of the current node until the target path node is reached;
[0055] S145. Trace back from the target path node along all traversal nodes to the starting path node to obtain the planned path of the drone.
[0056] This optional embodiment solution can effectively overcome the local optimal problem during path planning.
[0057] S150: Taking the next path node of the starting path node as the current starting path node, continue to calculate and obtain the next path node of the current starting path node until the target path node is reached.
[0058] In this embodiment, the next path node of the starting path node is used as the current starting path node, and the next path node of the current starting path node is calculated and obtained until the target path node is reached. The method of calculating and obtaining the next path node of the current starting path node is the same as the method of obtaining the next path node of the starting path node described above.
[0059] S160: trace back from the target path node along the path nodes to the starting path node to generate a planned path for the UAV.
[0060] In this embodiment, starting from the target path node, each path node determined by the above steps is traced back to the starting path node to generate a planned path for the drone.
[0061] In one embodiment, if Figure 3 As shown, after obtaining the planned path of the drone, step S160 also includes sub-steps S161, S162, S163, S164 and S165:
[0062] S161, obtaining all path nodes in the planned path of the UAV;
[0063] S162, selecting any two path nodes from all path nodes, and connecting the any two path nodes with a straight line to obtain a plurality of node connection lines;
[0064] S163, performing path simplification judgment on a plurality of node connection lines based on the path simplification strategy to obtain a judgment result;
[0065] S164, when the result of the judgment is that the current node connection line will pass through the obstacle, retaining the path nodes between the path nodes at the beginning and the end of the current node connection line;
[0066] S165. When the judgment result is that the current node connection line will not pass through the obstacle, all path nodes between the path nodes at the beginning and end of the current node connection line are removed to optimize the planned path of the drone.
[0067] In one embodiment, after obtaining the planned path of the drone, the method further includes:
[0068] Based on the curve smoothing strategy, the path peaks in the planned path of the drone are smoothed to obtain the smoothed planned path of the drone. Specifically, in this embodiment, some smoothing algorithms, such as Bezier curves, spline curves, etc., can be used to smooth the path peaks in the planned path of the drone, so that the planned path of the drone is as smooth as possible, so as to reduce the problem of frequent acceleration and deceleration when the drone encounters path peaks during actual flight, thereby reducing the energy consumption of the drone and reducing the damage to the servo motor and gears.
[0069] In one embodiment, after obtaining the planned path of the drone, the method further includes:
[0070] Get all the path nodes in the planned path of the UAV; move each path node in the planned path of the UAV to the center of the planning grid where these path nodes are located in the low-altitude path planning area, thereby reducing the number of corners in the planned path and smoothing the path to obtain the optimized planned path of the UAV.
[0071] It should be noted that the low-altitude path planning area is a pre-constructed area for planning the flight path of the UAV, wherein the low-altitude path planning area is composed of a large number of planning grids, and the shapes of the planning grids are mostly equipolygons, which are not specifically limited here.
[0072] In some embodiments, after obtaining the planned path of the drone, the above three path smoothing methods can be used to perform three-stage smoothing processing on the path peaks in the planned path of the drone in sequence, thereby improving the path smoothness.
[0073] In the UAV path planning method provided by the embodiment of the present invention, a starting path node is obtained; a dynamic double-layer neighborhood of the starting path node is generated based on a node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes the next path node of the starting path node and does not include environmental obstacle nodes; obstacle node detection is performed on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on the detection strategy to obtain an obstacle node detection result; when the detection result is that the current adjacent node of each node is not an obstacle node, the movement cost calculation result of the starting path node passing through each node to reach the target path node is calculated based on a custom evaluation function, and the movement cost calculation result of the starting path node passing through the current adjacent node of each node to reach the target path node is calculated, and based on the movement cost calculation result, the node with the smallest cost is selected from each node and the adjacent nodes of each node as the next path node of the starting path node; the next path node of the starting path node is used as the current starting path node, and the next path node of the current starting path node is continuously calculated and obtained until the target path node is reached; and the path nodes are traced back from the target path node to the starting path node to obtain the planned path of the UAV.
[0074] In the above method, firstly, a dynamic double-layer neighborhood of the current path node is generated based on a double-layer neighborhood expansion method combining global search and local search. The generated dynamic double-layer neighborhood can achieve a better balance between the search efficiency and the search quality of the path node; then, based on the evaluation function, the optimal path node that minimizes the movement cost of the UAV is calculated from the node set of the dynamic double-layer neighborhood, thereby improving the path planning accuracy and reducing the path planning cost.
[0075] The embodiment of the present invention also provides a UAV path planning device, Figure 4 Schematic block diagram of a drone path planning device provided by an embodiment of the present invention. Figure 4 As shown, the UAV path planning device 100 includes an acquisition unit 110, a neighborhood generation unit 120, a node detection unit 130, a path node planning unit 140 and a planned path generation unit 150.
[0076] The acquisition unit 110 is used to acquire a starting path node.
[0077] In this embodiment, the starting path node of the UAV's path to be planned is obtained, wherein the starting path node can be located at any point in the obstacle-free area in the constructed low-altitude path planning area.
[0078] The neighborhood generation unit 120 is used to generate a dynamic double-layer neighborhood of the starting path node based on the node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes the next path node of the starting path node and does not include the obstacle node.
[0079] In this embodiment, the starting path node is used as the starting point of the UAV planned path, and then a dynamic double-layer neighborhood of the starting path node is generated at the starting path node based on the node neighborhood generation strategy, wherein the node set of the dynamic double-layer neighborhood includes the next path node of the starting path node, and the node set does not include obstacle nodes.
[0080] In one embodiment, a dynamic double-layer neighborhood of a starting path node is generated based on a node neighborhood generation strategy and a starting path node, including: obtaining flight feedback data of a drone flying from the starting path node to each path node in the dynamic double-layer neighborhood, wherein the flight feedback data includes flight time and flight path; then, taking the starting path node as the generation center, dynamically adjusting the neighborhood size based on an adaptive adjustment algorithm or flight feedback data to generate a dynamic double-layer neighborhood of the starting path node; wherein one neighborhood layer in the double-layer neighborhood is used for a global search for path nodes, and the other neighborhood layer is used for a local search for path nodes.
[0081] Preferably, when dynamically adjusting the neighborhood size based on an adaptive adjustment algorithm or flight feedback data to generate a dynamic double-layer neighborhood of the starting path node, specifically including: the first is to use a simulated annealing algorithm to adaptively adjust the size of the double-layer neighborhood centered on the starting path node to obtain a double-layer neighborhood that makes the search efficiency and search quality of the path node reach a better balance. For example, first search for path nodes in a smaller neighborhood, and when the search results are no longer improved, switch to another layer of neighborhood and expand the size of the neighborhood to try to search whether there are path nodes in the neighborhood that make the drone move less costly, until the search results no longer change. Alternatively, first search for path nodes globally in a larger neighborhood, and after obtaining several path nodes, switch to a smaller neighborhood and continuously reduce the size of the neighborhood, and perform a more refined local search to try to search whether there are path nodes in the neighborhood that make the drone move less costly, until the search results no longer change. The second method is to obtain the flight feedback data of the drone flying from the starting path node to each path node in the dynamic double-layer neighborhood in advance, and perform quantitative adjustment analysis on the balance point of the two neighborhoods in the double-layer neighborhood to generate the dynamic double-layer neighborhood of the starting path node. For example, first fix a neighborhood, such as a smaller neighborhood, and then gradually increase the size of the other neighborhood, and calculate a number of flight feedback data of the drone flying from the starting path node to each path node in the dynamic double-layer neighborhood; then, by analyzing these flight feedback data, determine the balance point between the neighborhood used for global search and the neighborhood used for local search, that is, at this balance point, the search efficiency and search quality of the path node reach a better balance state.
[0082] In this embodiment, the dynamically generated double-layer neighborhood can effectively improve the search efficiency and search quality, thereby facilitating the subsequent acquisition of the best path node, thereby improving the accuracy of the planned path and reducing the planning cost.
[0083] The node detection unit 130 is used to perform obstacle node detection on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on the detection strategy to obtain an obstacle node detection result.
[0084] In this embodiment, after the dynamic double-layer neighborhood of the starting path node is determined by the above-mentioned unit, obstacle node detection is performed on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on the detection strategy to obtain an obstacle node detection result.
[0085] Preferably, the detection strategy in this embodiment may adopt deep learning algorithms, computer vision technology, etc., which are not specifically limited here.
[0086] The path node planning unit 140, when the obstacle node detection result is that the current adjacent node of each node is not an obstacle node, calculates the movement cost calculation results of the starting path node through each node to reach the target path node based on the custom evaluation function, and calculates the movement cost calculation results of the starting path node through the current adjacent nodes of each node to reach the target path node, and selects the node with the smallest cost from each node and each node's adjacent nodes as the next path node of the starting path node based on the movement cost calculation results, takes the next path node of the starting path node as the current starting path node, and continues to calculate and obtain the next path node of the current starting path node until the target path node is reached.
[0087] In this embodiment, when the obstacle node detection result is that the current adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node are not obstacle nodes, the mobile cost calculation results of the starting path node passing through each node to reach the target path node are calculated based on the custom evaluation function, and the mobile cost calculation results of the starting path node passing through the current adjacent nodes of each node to reach the target path node are calculated. Then, based on the mobile cost calculation results, the node with the smallest cost is selected from each node and the adjacent nodes of each node as the next path node of the starting path node. It should be noted that the current adjacent nodes of each node detected in this embodiment refer to obtaining a certain node from the node set of the dynamic double-layer neighborhood of the starting path node, and then performing obstacle node detection on each adjacent node of the node. Only when it is detected that the adjacent node currently being detected of the node is not an obstacle node, can the subsequent mobile cost calculation be performed; then, according to the above detection method, by analogy, obstacle node detection is performed on each adjacent node of each node included in the dynamic double-layer neighborhood of the starting path node.
[0088] Next, the next path node of the starting path node is used as the current starting path node, and the next path node of the current starting path node is calculated and obtained until the target path node is reached. The method of calculating and obtaining the next path node of the current starting path node is the same as the method of obtaining the next path node of the starting path node.
[0089] In one embodiment, when the obstacle node detection result is that the current adjacent node of each node included in the dynamic double-layer neighborhood of the starting path node is an obstacle node, the next adjacent node of each node continues to be detected until a node that is not an obstacle node is detected from the adjacent nodes of each node. It should be noted that the next adjacent node in this embodiment refers to the next adjacent node adjacent to the current adjacent node.
[0090] In one embodiment, after the obstacle node detection result is that the current adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node are not obstacle nodes, the details are as follows.
[0091] Get all untraversed adjacent nodes of each node contained in the dynamic double-layer neighborhood of the starting path node.
[0092] The sum of the path lengths from any adjacent node of each node to the remaining untraversed adjacent nodes is calculated separately to obtain the path length calculation result.
[0093] Based on the path length calculation result, the node with the largest path length calculation result value is selected from each node as the next traversal node of the starting path node.
[0094] It should be noted that the meaning of the next traversal node is equivalent to the next path node, that is, the traversal node is determined to be a path node in the planned path of the drone, and the two are just named differently.
[0095] The next traversal node of the starting path node is taken as the current node, and the calculation continues to obtain the next traversal node of the current node until the target path node is reached.
[0096] From the target path node, trace back along all traversal nodes to the starting path node to obtain the planned path of the drone.
[0097] This optional embodiment solution can effectively overcome the local optimal problem during path planning.
[0098] The planned path generation unit 150 is used to trace back from the target path node along the path nodes to the starting path node to generate a planned path for the drone.
[0099] In this embodiment, starting from the target path node, each path node determined by the above-mentioned units is traced back to the starting path node to generate a planned path for the UAV.
[0100] In one embodiment, after obtaining the planned path of the drone, the details are as follows.
[0101] Get all path nodes in the planned path of the drone.
[0102] Select any two path nodes from all path nodes, and connect the any two path nodes with a straight line to obtain several node connection lines.
[0103] Based on the path simplification strategy, a path simplification judgment is performed on several node connection lines to obtain a judgment result.
[0104] When the result of the judgment is that the current node connection line will pass through the obstacle, the path nodes between the path nodes at the beginning and the end of the current node connection line are retained.
[0105] When the judgment result is that the current node connection line will not pass through the obstacle, all path nodes between the path nodes at the beginning and end of the current node connection line are removed to optimize the UAV planning path and obtain the optimized UAV planning path.
[0106] In one embodiment, after obtaining the planned path of the drone, the method further includes:
[0107] Based on the curve smoothing strategy, the path peaks in the planned path of the drone are smoothed to obtain the smoothed planned path of the drone. Specifically, in this embodiment, some smoothing algorithms, such as Bezier curves, spline curves, etc., can be used to smooth the path peaks in the planned path of the drone, so that the planned path of the drone is as smooth as possible, so as to reduce the problem of frequent acceleration and deceleration when the drone encounters path peaks during actual flight, thereby reducing the energy consumption of the drone and reducing the damage to the servo motor and gears.
[0108] In one embodiment, after obtaining the planned path of the drone, the method further includes:
[0109] Get all the path nodes in the planned path of the UAV; move each path node in the planned path of the UAV to the center of the planning grid where these path nodes are located in the low-altitude path planning area, thereby reducing the number of corners in the planned path and smoothing the path to obtain the optimized planned path of the UAV.
[0110] It should be noted that the low-altitude path planning area is a pre-constructed area for planning the flight path of the UAV, wherein the low-altitude path planning area is composed of a large number of planning grids, and the shapes of the planning grids are mostly equipolygons, which are not specifically limited here.
[0111] In some embodiments, after obtaining the planned path of the drone, the above three path smoothing methods can be used to perform three-stage smoothing processing on the path peaks in the planned path of the drone in sequence, thereby improving the path smoothness.
[0112] The unmanned aerial vehicle path planning device provided in the embodiment of the present invention is applied to the above-mentioned unmanned aerial vehicle path planning method, obtaining a starting path node; generating a dynamic double-layer neighborhood of the starting path node based on a node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes the next path node of the starting path node and does not include environmental obstacle nodes; performing obstacle node detection on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on a detection strategy to obtain an obstacle node detection result; when the detection result is that the current adjacent node of each node is not an obstacle node, respectively calculating the movement cost calculation result of the starting path node passing through each node to reach the target path node based on a custom evaluation function, and respectively calculating the movement cost calculation result of the starting path node passing through the current adjacent nodes of each node to reach the target path node, and selecting the node with the smallest cost from each node and the adjacent nodes of each node as the next path node of the starting path node based on the movement cost calculation result; taking the next path node of the starting path node as the current starting path node, continuing to calculate and obtain the next path node of the current starting path node until the target path node is reached; tracing back from the target path node along the path nodes to the starting path node in reverse order to obtain the planned path of the unmanned aerial vehicle. In the above method, firstly, a dynamic double-layer neighborhood of the current path node is generated based on a double-layer neighborhood expansion method combining global search and local search. The generated dynamic double-layer neighborhood can achieve a better balance between the search efficiency and the search quality of the path node; then, based on the evaluation function, the optimal path node that minimizes the movement cost of the UAV is calculated from the node set of the dynamic double-layer neighborhood, thereby improving the path planning accuracy and reducing the path planning cost.
[0113] The above-mentioned UAV path planning method can be implemented in the form of a computer program, which can be used in Figure 5 Runs on the computer device shown.
[0114] See also Figure 5 , Figure 5 is a schematic block diagram of a computer device provided in an embodiment of the present invention. The computer device may be used to execute a drone path planning method.
[0115] See also Figure 5 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a storage medium 503 and an internal memory 504 .
[0116] The storage medium 503 may store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 may execute the drone path planning method, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.
[0117] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .
[0118] The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the drone path planning method.
[0119] The network interface 505 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 500 to which the solution of the present invention is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0120] The processor 502 is used to run a computer program 5032 stored in a memory to implement corresponding functions in the above-mentioned UAV path planning method.
[0121] Those skilled in the art will understand that Figure 5 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Figure 5 The embodiments shown are consistent and will not be described again here.
[0122] It should be understood that in the embodiment of the present invention, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0123] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps included in the above-mentioned drone path planning method are implemented.
[0124] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0125] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.
[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0127] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0128] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk.
[0129] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for UAV path planning, characterized in that: The method comprises: Get the starting path node; Generate a dynamic double-layer neighborhood of the starting path node based on a node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes a next path node of the starting path node and does not include an obstacle node; Based on the detection strategy, all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node are detected as obstacles to obtain obstacle node detection results; When the obstacle node detection result is that the current adjacent node of each node is not an obstacle node, the movement cost calculation results of the starting path node passing through each node to reach the target path node are calculated based on the custom evaluation function, and the movement cost calculation results of the starting path node passing through the current adjacent nodes of each node to reach the target path node are calculated respectively, and based on the movement cost calculation results, the node with the smallest cost is selected from each node and the adjacent nodes of each node as the next path node of the starting path node; Taking the next path node of the starting path node as the current starting path node, and continuing to calculate and obtain the next path node of the current starting path node until the target path node is reached; The path nodes are traced back from the target path node to the starting path node to obtain the planned path of the UAV.
2. The method according to claim 1, characterized in that The generating of the dynamic double-layer neighborhood of the starting path node based on the node neighborhood generation strategy and the starting path node comprises: Acquire flight feedback data of the UAV flying from the starting path node to each path node in the dynamic double-layer neighborhood, wherein the flight feedback data includes flight time and path complexity; Taking the starting path node as the generation center, the neighborhood size is dynamically adjusted based on an adaptive adjustment algorithm or the flight feedback data to generate a dynamic double-layer neighborhood of the starting path node; wherein one layer of the double-layer neighborhood is used for global search of path nodes, and the other layer of the neighborhood is used for local search of path nodes.
3. The method according to claim 1, characterized in that After performing obstacle node detection on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on the detection strategy to obtain an obstacle node detection result, the method includes: When the obstacle node detection result is that the current adjacent node of each node is an obstacle node, the next adjacent node of each node continues to be detected until a node that is not an obstacle node is detected and obtained from the adjacent nodes of each node.
4. The method according to claim 1, characterized in that: After the obstacle node detection result is that the current adjacent node of each node is not an obstacle node, the method further includes: Obtaining all untraversed adjacent nodes of each node contained in the dynamic double-layer neighborhood of the starting path node; Calculate the sum of the path lengths from any adjacent node of each node to the remaining adjacent nodes that have not been traversed, and obtain a path length calculation result; Based on the path length calculation result, a node with the largest path length calculation result value is selected from the nodes as the next traversal node of the starting path node; Taking the next traversal node of the starting path node as the current node, continue to calculate and obtain the next traversal node of the current node until the target path node is reached; From the target path node, trace back along all traversal nodes to the starting path node to obtain the planned path of the drone.
5. The method according to any one of claims 1 to 4, characterized in that: After obtaining the planned path of the drone, the method includes: Obtain all path nodes in the planned path of the drone; Selecting any two path nodes from all the path nodes, and connecting the any two path nodes to obtain a plurality of node connection lines; Performing path simplification judgment on the plurality of node connection lines based on the path simplification strategy to obtain a judgment result; When the judgment result is that the current node connection line will pass through the obstacle, retain the path nodes between the path nodes at the beginning and the end of the current node connection line; When the judgment result is that the current node connection line will not pass through the obstacle, all path nodes between the path nodes at the beginning and end of the current node connection line are removed to optimize the planned path of the drone.
6. The method according to any one of claims 1 to 4, characterized in that: After obtaining the planned path of the drone, the method further includes: Based on the curve smoothing strategy, the path peaks in the planned path of the UAV are smoothed to obtain a smoothed planned path of the UAV.
7. The method according to any one of claims 1 to 4, characterized in that: After obtaining the planned path of the drone, the method further includes: Obtain all path nodes in the planned path of the drone; Each path node in the planned path of the UAV is moved to the center position of the planning grid where each path node is located in the low-altitude path planning area to obtain an optimized planned path of the UAV.
8. A drone path planning device, characterized in that: The device comprises: An acquisition unit, used for acquiring a starting path node; A neighborhood generation unit, configured to generate a dynamic double-layer neighborhood of the starting path node based on a node neighborhood generation strategy and the starting path node, wherein the node set of the dynamic double-layer neighborhood includes a next path node of the starting path node and does not include an obstacle node; A node detection unit, configured to perform obstacle node detection on all adjacent nodes of each node included in the dynamic double-layer neighborhood of the starting path node based on a detection strategy to obtain an obstacle node detection result; a path node planning unit, for calculating the movement cost calculation results of the starting path node passing through each node to reach the target path node based on a custom evaluation function when the obstacle node detection result is that the current adjacent node of each node is not an obstacle node, and calculating the movement cost calculation results of the starting path node passing through the current adjacent node of each node to reach the target path node based on a custom evaluation function, and selecting a node with the smallest cost from each node and the adjacent nodes of each node as the next path node of the starting path node based on the movement cost calculation results, Taking the next path node of the starting path node as the current starting path node, and continuing to calculate and obtain the next path node of the current starting path node until the target path node is reached; The planned path generation unit is used to trace back from the target path node along the path nodes to the starting path node in reverse order to obtain the planned path of the UAV.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
