Unmanned aerial vehicle path planning method and system based on CBF

By combining RRT algorithm and CBF technology, the real-time and security problems of drones' path planning in dynamic environments are solved, and efficient and stable path planning is achieved to adapt to changes in complex environments.

CN120386378APending Publication Date: 2025-07-29SHANGHAI UNIVERSITY OF ELECTRIC POWER
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510448668.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

Existing drone path planning methods face challenges such as obstacle uncertainty, airspace restrictions and dynamic environmental changes in complex and dynamic unstructured environments. Traditional algorithms have shortcomings in real-time and computing efficiency, making it difficult to ensure safety and stability in drone navigation.

Method used

The path planning method based on control obstacle function (CBF) is adopted, combined with the rapidly exploring RRT algorithm, by establishing a drone flight map, using the RRT algorithm to generate the initial path, and using CBF evaluation and optimization to ensure the safety and smoothness of the path, and real-time path planning is achieved using a two-threaded architecture.

Benefits of technology

Rapidly generate and optimize paths in dynamic environments to ensure the stability and safety of drone flights, improve the real-time and computing efficiency of path planning, and enhance the adaptability to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386378A_ABST
    Figure CN120386378A_ABST
Patent Text Reader

Abstract

The invention relates to a CBF-based unmanned aerial vehicle path planning method and system. Firstly, an unmanned aerial vehicle flight map is established, a flight starting point and a flight ending point are determined in the map, and obstacles are marked; based on the marked unmanned aerial vehicle flight map, a first flight path is generated by using an RRT algorithm; and finally, evaluating and optimizing the first flight path by using the CBF to obtain an optimal flight path, thereby completing the path planning of the unmanned aerial vehicle. Firstly, in a path generation thread, collision detection is performed on a new node by using an RRT algorithm, and then in a path optimization thread, CBF security constraints and CBF optimization constraints are used for further obstacle avoidance. Compared with the prior art, the method has the advantages of being good in real-time performance, high in calculation efficiency, stable, safe and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of unmanned aerial vehicles, and in particular, to a method and system for path planning of unmanned aerial vehicles based on CBF. Background Art

[0002] In the fields of industrial automation and intelligent manufacturing, the path planning technology of unmanned aerial vehicles has become the key to improving work efficiency and task execution reliability. The existing path planning methods can be mainly divided into two categories: the planning method based on predefined paths and the real-time planning method based on sensor data. The former controls the flight of the unmanned aerial vehicle by setting fixed paths, while the latter depends on real-time sensor data to dynamically adjust the path. However, these methods still face many challenges in complex and dynamic unstructured environments, especially in dealing with obstacle uncertainty, airspace restrictions, and environmental dynamic changes.

[0003] For sensor-based path planning methods, such as lidar, visual sensors, etc., although they can obtain environmental data in real time, a major problem they face is the high-dimensionality and noise problems of the data. These factors may lead to the instability of the path planning algorithm in real-time decision-making, and even misjudgment, affecting the flight safety of the unmanned aerial vehicle. Currently, some scholars use lidar-based data in the research on unmanned aerial vehicle obstacle avoidance and path planning methods, and this data may have errors in dense obstacle or complex environments, resulting in inaccurate path planning.

[0004] In addition, there are still deficiencies in traditional path planning algorithms. Regarding the problems of low operation efficiency, slow convergence speed, and blindness of the search space in path planning such as obstacle avoidance in complex working conditions for the Rapidly-exploring Random Trees (RRT) algorithm, and the problems of large randomness, many invalid nodes, and low convergence efficiency in path planning for the Informed-RRT* algorithm. The path planned by the A* algorithm is close to obstacles, has many turning points, and cannot guarantee the safety of the unmanned aerial vehicle during the navigation process. Currently, there are also some algorithms for robot path planning. These traditional path planning algorithms perform well in static environments, but in dynamic environments, their convergence speed is slow and the computational complexity is high, making it difficult to be applied in scenarios with high real-time requirements such as unmanned aerial vehicle navigation.

[0005] In the invention patent with the publication number CN117451070A, a photovoltaic robot planning algorithm based on an improved RRT algorithm is proposed. It improves the sampling strategy, performs resampling optimization, and further optimizes the robot path planning scheme. However, its real-time performance and computational efficiency are not good. Since the unmanned aerial vehicle (UAV) path planning needs to be carried out in a three-dimensional space, it involves the dynamic constraints of the aircraft, flight stability and safety guarantee, and real-time adaptation ability in a dynamic environment. Compared with robot path planning, the path search and optimization of UAVs face problems such as high-dimensional path planning, aircraft dynamics modeling, dynamic environment adaptation, and limited computational resources, requiring higher real-time performance and computational efficiency. Summary of the Invention

[0006] The purpose of the present invention is to provide a CBF-based UAV path planning method and system to overcome the defects of the above-mentioned existing technologies.

[0007] The purpose of the present invention can be achieved through the following technical solutions:

[0008] According to one aspect of the present invention, a CBF-based UAV path planning method is provided. The method steps include:

[0009] S1. Establish a UAV flight map, determine the flight starting point and the flight ending point in the map, and mark the obstacles;

[0010] S2. Based on the marked UAV flight map, use the RRT algorithm to generate a first flight path that does not contain collision nodes;

[0011] S3. Use CBF to evaluate and optimize the first flight path to obtain the optimal flight path, thereby completing the UAV path planning.

[0012] As a preferred technical solution, the UAV flight map in S1 is a two-dimensional environmental map, including obstacles, airspace restrictions, and flight areas.

[0013] As a preferred technical solution, in the UAV flight map in S1, the environment is represented in the form of a matrix or grid, and 0 and 1 are used to represent the obstacle position information. Its specific representation is:

[0014] M(i, j) ∈ {0, 1}

[0015] Wherein, M(i, j) = 1 indicates that there is an obstacle at this position; while M(i, j) = 0 indicates that this position is a free area.

[0016] As a preferred technical solution, in S2, when using the RRT algorithm to generate the first flight path, the specific steps are:

[0017] S21. Initialize the tree, and set the flight starting point of the UAV as the root node x of the treestart ;

[0018] S22. In the UAV flight map, the randomly sampled point is used as a random point, and the node closest to this random point on the current tree is found as the nearest node;

[0019] S23. Calculate the direction from the nearest node to the random point, and expand a new node along this direction;

[0020] S24. Perform a collision detection on the new node. If the new node does not collide with an obstacle, proceed to step S25; otherwise, discard the new node;

[0021] S25. Repeat steps S22, S23, and S24 to continuously expand new nodes until a node close to the flight end point appears in the tree;

[0022] S26. Trace back the path from the node close to the flight end point to the flight start point, and the UAV flight path is obtained.

[0023] As a preferred technical solution, the coordinates of the new node expanded in S23 are:

[0024]

[0025] where x new is the new node; x near is the nearest node; x rand is the random point; δ is the step size.

[0026] As a preferred technical solution, the specific steps for using CBF to evaluate and optimize the first flight path in S3 are: establish CBF safety constraints and CBF optimization constraints. Using the CBF safety constraints, evaluate the relative positions of each node and the obstacles in the first flight path one by one. If a node does not meet the safety constraints, adjust the path or reselect the expansion direction from the previous node using the CBF optimization constraints until all nodes meet the safety constraints, thereby obtaining the optimal flight path.

[0027] As a preferred technical solution, the specific formula for the established CBF safety constraint is:

[0028] C(x, O i ) = ||x - O i || 2 - r i 2

[0029] where C(x, O i ) is the safety constraint; x is the UAV position; O i is the obstacle position; r i is the radius of the obstacle O i ;

[0030] As a preferred technical solution, the specific formula for CBF optimization constraint is:

[0031]

[0032] Wherein, is the time derivative of the safety constraint; α is the constraint strength coefficient, α > 0; C(x, O i ) is the safety constraint.

[0033] According to another aspect of the present invention, there is provided a UAV path planning system based on CBF. The system works by applying a UAV path planning method based on CBF as described above. The system includes a map construction module, a path generation module, and a path optimization module;

[0034] The map construction module is used to establish a UAV flight map, determine the flight starting point and the flight ending point in the map, and mark the obstacles;

[0035] The path generation module embeds the RRT algorithm. Based on the marked UAV flight map, it uses the RRT algorithm to generate the first flight path;

[0036] The path optimization module embeds the CBF function. It uses CBF to evaluate and optimize the first flight path to obtain the optimal flight path, thereby completing the UAV path planning.

[0037] As a preferred technical solution, the path generation module and the path optimization module form a dual-thread architecture through a shared memory interface;

[0038] The path generation thread executes the RRT algorithm. In the path generation thread, the RRT algorithm is used to perform collision detection on new nodes;

[0039] The path optimization thread runs the CBF constraint detection and path correction in real time. In the path optimization thread, the CBF safety constraint and the CBF optimization constraint are used for further obstacle avoidance;

[0040] The two threads use an asynchronous communication mechanism to achieve UAV path planning.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] 1. The present invention first establishes and labels a UAV flight map, then generates a first flight path using the RRT algorithm based on the labeled UAV flight map, and then utilizes CBF to evaluate and optimize the first flight path to obtain the optimal flight path, thereby completing the UAV path planning. It solves the problem that in a dynamic environment, traditional path planning algorithms have poor adaptability to environmental changes and are difficult to quickly adjust the path. By combining the RRT algorithm and CBF evaluation and optimization, the present invention can quickly generate and optimize in a complex dynamic environment, thereby ensuring that the aircraft can quickly and real-time avoid obstacles in a complex environment, while maintaining flight stability, adapting to dynamic factors such as wind speed changes and airflow interference, and finally obtaining a high-quality path, thus enhancing the real-time performance of path planning.

[0043] 2. The present invention dynamically evaluates by combining the fast exploration characteristics of RRT with CBF technology in UAV path planning, and the path generation module and the path optimization module form a dual-thread architecture through a shared memory interface; the path generation thread executes the RRT algorithm, and the path optimization thread runs CBF constraint detection and path correction in real time. First, in the path generation thread, the RRT algorithm is used to perform collision detection on new nodes; then, in the path optimization thread, CBF safety constraints and CBF optimization constraints are used for further obstacle avoidance; the two threads use an asynchronous communication mechanism to achieve UAV path planning. It solves the problems of slow convergence speed and poor stability existing in traditional path planning algorithms when dealing with continuous action spaces. At the same time, by jointly evaluating and optimizing the first flight path using CBF safety constraints and CBF optimization constraints, the optimization process has high computational efficiency.

[0044] 3. By applying the combination of CBF and RRT to UAV path planning, the present invention can quickly generate a path that meets safety constraints in a dynamically changing environment. Specifically, CBF provides necessary safety constraints for the RRT algorithm to ensure that the UAV's path does not cross dangerous areas; through this combination, the stability and safety of path planning can be significantly improved. Especially when dealing with challenges such as dense obstacles and dynamic environmental changes, the UAV always meets safety constraints during flight, showing stronger stability and safety.

[0045] 4. By introducing the combination of CBF function and RRT algorithm, using the RRT algorithm to generate the first flight path, and utilizing CBF to evaluate and optimize the first flight path, the present invention solves the problem that in an unstructured environment, traditional sensor-based path planning methods are easily affected by noise interference, resulting in low path planning accuracy; thus effectively improving the accuracy and robustness of path planning and reducing the influence of external interference.

[0046] 5. The present invention solves the problems of difficult high-dimensional path planning for UAVs and difficult aircraft dynamics modeling by setting the UAV flight map as a two-dimensional environmental map, including obstacles, airspace restrictions, and flight areas, and further enhances the environmental adaptability of path planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a schematic diagram of the steps of a UAV path planning method based on CBF in the present invention;

[0048] Figure 2 It is a schematic diagram of the principle of the RRT algorithm in the embodiment;

[0049] Figure 3 It is a schematic diagram of the path planning simulation based on CBF in the embodiment;

[0050] Figure 4 It is a schematic diagram of the comparison of path planning before and after adding CBF in the embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0051] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0052] The present invention proposes a UAV path planning method based on the CBF function and integrating the RRT algorithm. By combining the safety constraints of CBF and the fast path search ability of RRT, the present invention can provide a safe and efficient path planning solution for UAVs in a dynamic and uncertain environment.

[0053] In the field of industrial automation, this method enables UAVs to adapt to complex production environments, perform tasks such as material handling and equipment inspection, improve production efficiency and operation safety. In the field of power inspection, UAVs can quickly navigate in power facilities, avoid collisions, improve inspection efficiency, and reduce personnel risks. In the field of urban logistics, UAVs can effectively perform precise delivery by optimizing flight paths, improve logistics efficiency, and have strong adaptability especially in complex urban airspaces. In the field of disaster rescue, UAVs can perform tasks in extreme environments, avoid obstacles through real-time path planning, quickly reach the target area, and support disaster response. This method can also be widely applied to fields such as agricultural plant protection and environmental monitoring to achieve efficient path planning and task execution. In addition, the method of the present invention can also be used as an educational and research tool to provide effective support for teaching and research in the fields of robotics, artificial intelligence, and automation control, and promote the development of related technologies.

[0054] Example 1

[0055] In this embodiment, an improved UAV path planning method based on the Control Barrier Function (CBF) algorithm is applied. By combining the Rapidly-exploring Random Tree (RRT) algorithm, this method significantly improves the path planning efficiency and safety of UAVs in dynamic environments. Traditional path planning algorithms usually rely on the assumption of a static environment and are difficult to adapt to complex and ever-changing working environments, especially in unstructured or dynamic environments. By introducing the CBF technology, strict safety constraints are added to the path planning process in the present invention to ensure that the UAV can avoid obstacles in real time during flight and prevent entering unsafe areas. The CBF technology ensures that the path not only meets the basic requirements from the starting point to the target point but also maintains an efficient and safe flight mode in a dynamic environment by implementing real-time safety evaluations during the optimization process. The method steps are as Figure 1 shown and specifically include:

[0056] S1. Establish a UAV flight map, determine the flight starting point and the flight ending point in the map, and mark the obstacles;

[0057] S2. Based on the marked UAV flight map, use the RRT algorithm to generate a first flight path that does not contain collision nodes;

[0058] S3. Use CBF to evaluate and optimize the first flight path to obtain the optimal flight path, thus completing the UAV path planning.

[0059] In this method, as a control theory tool, CBF can effectively introduce safety constraints into the path planning algorithm, solving the limitations of traditional algorithms in the face of complex obstacles, dynamically changing environments, and flight stability. By combining the fast exploration characteristics of the RRT algorithm, the present invention realizes efficient path search and avoids the problems of uneven paths, long paths, and low flight efficiency commonly found in pure RRT algorithms. At the same time, the CBF technology can dynamically adjust the path to ensure that the UAV can avoid potential obstacles during flight and stay within the safe area, effectively improving the robustness and stability of path planning.

[0060] This path planning method based on the combination of CBF and RRT algorithms can not only provide a more reliable path planning scheme in complex industrial environments but also provide more extensive and effective technical support for the application of UAVs in other fields (such as power inspection, urban logistics, agricultural plant protection, and disaster rescue). Through this method, UAVs can more flexibly adapt to changing environments, ensuring high efficiency, safety, and real-time performance during flight, thus promoting the in-depth application and development of UAV technology in various industries.

[0061] The specific steps are as follows:

[0062] Step 1: Determine the flight map of the drone

[0063] In the first step of path planning, we need to establish a map of the two-dimensional environment, usually generated by sensors or pre-input map data. The map will serve as the flight environment of the drone, including obstacles, airspace restrictions, and flight areas. The environment is represented in the form of a matrix or grid, where the value of each grid represents whether the position is empty or an obstacle. Let the map be M, with a size of m×n, and each element M(i,j) is specifically: 1 represents an obstacle, and 0 represents a passable area.

[0064] M(i, j) ∈ {0, 1}

[0065] Where M(i, j) = 1 indicates that there is an obstacle at this position, and M(i, j) = 0 indicates that this position is a free area.

[0066] Step 2: Determine the starting and ending points of the flight and mark the obstacles

[0067] In this step, we need to mark the initial position x0 = (x0, y0) and the target position x T = (x T , y T ) of the drone according to the task requirements, and mark the positions of all obstacles. The initial position x0 and the target position x T are known, and the path is planned based on this information. Obstacle positions: The obstacles marked on the map are represented by the coordinate set O = {O1, O2,..., O k} of the obstacle areas.

[0068] Step 3: Introduce the RRT algorithm

[0069] The core idea of the RRT algorithm is to explore the path by randomly expanding a tree structure, so as to quickly find a feasible path, adapt to the dynamic changes of a complex environment, and generate a path from the starting point to the target. In this embodiment, the principle of the RRT algorithm is as Figure 2 shown. First, initialize the tree, set the root node as the starting point x start , and denote the tree structure as T = {x start}. Randomly sample a point x free in the configuration space C rand . Find the nearest node: Find a node x rand in the tree T that is closest to the random point x near , and calculate the direction from x near to x rand . Along the direction from x near to xrand Expand a new node x in the direction of new . The coordinates of the new node are:

[0070]

[0071] where x near is the nearest node of the current tree, and x rand is the randomly generated target node, and δ is the step size.

[0072] After each new node is expanded, the RRT algorithm performs collision detection on the new node to confirm that the node does not collide with obstacles. If the new node is valid and feasible, it will be added to the tree. The expansion process continues until a certain node of the tree approaches the target point x goal . When the expanded node is close enough to the target point, the algorithm stops expanding and starts backtracking the path. The backtracking process is to trace the parent nodes of each node in the tree, and finally return from the target node to the starting point to obtain a complete path.

[0073] The randomness of the RRT algorithm enables it to quickly explore a feasible path in a complex environment. Especially when facing obstacles or unstructured environments, it can efficiently avoid obstacles and find a path connecting the starting point and the target. By continuously expanding the tree and random sampling, RRT can cope with dynamic environmental changes and adapt to complex task requirements.

[0074] Step 4: Incorporate CBF for optimization

[0075] Integrating CBF into the RRT algorithm process, the main technical difficulties include: First, how to effectively embed the dynamic constraints of CBF (such as the maximum acceleration and tilt angle of the aircraft) into the RRT path generation process to ensure that the path not only meets the safety constraints but also remains feasible; Second, the constraint requirements of CBF need to be checked and satisfied in real time, which may increase the computational burden, especially in a dynamic environment where the path needs to be quickly adjusted to maintain the balance between real-time performance and path optimization; In addition, the path generated by RRT is usually relatively rough. How to achieve path smoothing after incorporating CBF to avoid sharp turns or rapid flights and ensure the stability of the aircraft is also a challenge; Finally, in a dynamic environment, how to update the obstacle information in real time and adjust the path to avoid collisions while meeting the CBF constraints increases the complexity of the algorithm.

[0076] During the expansion process of the RRT algorithm, whenever a new node x is generated newWhen performing regular collision detection, we also apply CBF to further optimize the path. Specifically, CBF takes into account the distance between the current position of the UAV and the obstacles, and adjusts the path in real time according to safety requirements to prevent the UAV from flying into unsafe areas or encountering collisions. The control barrier function defines the safety boundaries to ensure that the UAV's path always avoids entering unsafe areas. For obstacle O i and the UAV position x, the safety constraint can be expressed as:

[0077] C(x, O i ) = ||x - O i || 2 - r i 2

[0078] where r i is the radius of obstacle O i , ensuring that the distance between the UAV and the obstacle is greater than r i .

[0079] By introducing a safety constraint condition, CBF requires the UAV to always maintain a certain safety distance during path planning. Specifically, CBF evaluates the relative positions of each new node and the surrounding obstacles to ensure that the new node is within a safe area. If a new node violates the safety constraint, CBF avoids potential collisions by adjusting the path or reselecting the expansion direction. To ensure the safety of the path, the path update can be completed through the following CBF optimization constraints:

[0080]

[0081] where is the time derivative of the obstacle constraint, and α is a positive constant representing the strength of the constraint. This constraint ensures that the distance between the UAV and the obstacle always remains safe.

[0082] Step 5: Obtain the optimized path

[0083] Combining the path generated by RRT and the path optimized by CBF, through repeated adjustment and optimization, a safe and efficient path is finally obtained. The path avoids all obstacles and satisfies all safety constraints during flight. The UAV will not enter dangerous areas during flight, thus ensuring flight safety. The optimized path P final is the optimized path of the UAV from the starting point x0 to the target point x T . The optimized path is more concise and smooth than the initial RRT path, reducing unnecessary turns and flight segments, making the flight more efficient. The continuity and stability of the path are good, avoiding flight instability caused by excessive sharp turns or uneven paths.

[0084] In summary, the UAV path planning method in this solution solves the problem that in a dynamic environment, traditional path planning algorithms have poor adaptability to environmental changes and are difficult to quickly adjust the path. By combining the RRT algorithm and CBF evaluation and optimization, the present invention can quickly generate and optimize in a complex dynamic environment, thereby ensuring that the aircraft can quickly and real-time avoid obstacles in a complex environment, while maintaining flight stability, adapting to dynamic factors such as wind speed changes and airflow interference, and finally obtaining a high-quality path, thus enhancing the real-time performance of path planning.

[0085] Embodiment 2

[0086] In this embodiment, a UAV path planning system is applied. The system includes a map construction module, a path generation module, and a path optimization module;

[0087] The map construction module is used to establish a UAV flight map, determine the flight start point and flight end point in the map, and mark the obstacles;

[0088] The path generation module embeds the RRT algorithm. Based on the marked UAV flight map, the RRT algorithm is used to generate the first flight path;

[0089] The path optimization module embeds the CBF function. It uses CBF evaluation and optimization of the first flight path to obtain the optimal flight path, thereby completing the UAV path planning.

[0090] The path generation module and the path optimization module form a dual-thread architecture through a shared memory interface; the path generation thread executes the RRT algorithm. In the path generation thread, the RRT algorithm is used to perform collision detection on new nodes; the path optimization thread runs CBF constraint detection and path correction in real time. In the path optimization thread, CBF safety constraints and CBF optimization constraints are used for further obstacle avoidance; the two threads use an asynchronous communication mechanism to implement UAV path planning, improve calculation efficiency, and enhance the real-time performance of path planning.

[0091] The specific solution of the UAV path planning method applied by this system is as in Embodiment 1.

[0092] In this embodiment, the specific implementation of using this system for UAV path planning is as follows:

[0093] 1. Set the environment.

[0094] 1.1. Environmental parameter configuration. First, we set a working area of a fixed size in a two-dimensional space, including the positions of obstacles, the starting point, and the target point. A two-dimensional matrix map was created to represent the working environment. The value of each matrix element determines whether the position is a blank area or an obstacle. In this section of the code, map is a 10x10 matrix, where a value of 1 represents an obstacle, and a value of 0 represents a blank area that the drone can pass through. This matrix representation simplifies the environmental modeling, enabling the path planning algorithm to easily access the data of each position.

[0095] 1.2. Starting point and target point. The starting point and the target point are the core data in the path planning algorithm, which identify the start and end of the path. In the code, the starting point start is set to (1,1), and the target point goal is set to (10,10), which is the lower right corner of the map. These points serve as the starting and ending points of the algorithm search during the path planning process, helping to determine the direction and goal of the planned path.

[0096] 2. Introduction of the algorithm

[0097] 2.1. RRT algorithm. First, two key parameters were set for the RRT algorithm: max_iter: controls the maximum number of iterations of the algorithm to prevent excessive calculation. step_size: specifies the expansion step size of the tree. Each time the tree is expanded from the current tree node towards the target direction, the step size is step_size. Next, the tree of the starting node was initialized. The data structure of the tree is represented by a matrix containing the starting point and the index of the parent node. Each node contains three pieces of information: the coordinates [x,y] of the node. The index of the parent node, which is used to backtrack the path. In each iteration, first, a random point (random_point) is sampled randomly in the map. Then, the nearest tree node nearest_node to this random point is found, which is done by calculating the distances between all nodes in the tree and the random point. Next, we calculate the expansion path from nearest_node to random_point through the steer() function. This function calculates the direction from the current node to the target node and expands the tree to a new node new_node according to the set step size (step_size).

[0098] 2.2. When expanding a new node each time, the safety of the path is verified through a control barrier function (CBF). The CBF determines whether the path is safe by checking the relative position of the new node to the obstacle. is_safe() calls the check_collision() function to determine whether there will be a collision with the obstacle between the current node and the new node. If the new node is safe and there is no collision, the algorithm adds the node to the tree and checks whether the target area is reached. If the new node is close enough to the target point, the algorithm stops expanding and backtracks to generate a complete path. If no path can be found within the specified maximum number of iterations, the algorithm outputs a prompt message of "Failed to reach the target". If the path is successfully generated, the final path is backtracked and generated through the reconstruct_path function, starting from the target node and backtracking all the way to the starting node to form a complete path.

[0099] 3. Obtain the training results

[0100] 3.1. Shortest path search. After the path expansion is completed, we need to search backward for the optimal path from the target node to the starting node. By calculating the distance from each node to the target node, the shortest path is selected for backtracking. During the backtracking process, starting from the target node, the parent nodes are gradually traced, and finally a shortest path is obtained.

[0101] 3.2. Path display and visualization. After the path search is completed, we use the plot function to draw the optimal path. This path starts from the starting point, passes through a series of nodes, and finally reaches the target point. The simulation results are as Figure 3 shown. In the graphical interface, the obstacles in the map are displayed as black blocks, the nodes of the tree are represented by blue, the starting point is represented by a green dot, and the target point is marked with a magenta dot. The generated path is represented by a red line segment, intuitively showing the effect of path planning.

[0102] The simulation shows the flight process of the UAV from the starting point to the target point. By introducing the control barrier function (CBF) technology, it is ensured that the UAV does not collide with any obstacles during the flight process. At the same time, the RRT algorithm is used in the path planning process, effectively expanding the search space, and the path optimization enables the UAV to find a shortest and safe path in a complex environment.

[0103] 4. Result comparison

[0104] The path planning of the RRT algorithm often relies on random sampling and tree expansion, and does not consider the dynamic influence of obstacles and path safety. Even if the RRT algorithm successfully finds a path from the starting point to the target, it may collide with obstacles or enter an unsafe area. After adding the CBF, the path planning process will be enhanced, so that the generated path can not only go from the starting point to the target point, but also avoid obstacles and ensure the safety of the path.

[0105] The comparison of the path planning results before and after adding the CBF to the path planning process using this solution is as Figure 4 shown. Among them, the blue circles represent the tree without adding CBF, the green circles represent the tree with adding CBF, the red lines represent the paths without adding CBF, and the blue lines represent the paths with adding CBF. It can be seen that:

[0106] 1) Path length and flight efficiency: Without CBF, due to the lack of constraints on the safe area, the RRT will generate a longer and more tortuous path; after adding CBF, the path length is usually shorter and more straight, reducing the redundancy of flight.

[0107] 2) Path safety: Without CBF, the path will pass through obstacles, resulting in extremely low flight safety; after introducing CBF, all paths are subject to safety checks, avoiding collisions, and the path safety is significantly improved.

[0108] 3) Path smoothness: Without CBF, the path generated by the RRT will have abrupt turns, resulting in an uneven path; after adding CBF, due to safety constraints, the path will be smoother and more natural during flight.

[0109] Through the above algorithm flow and the way of solving problems, this solution successfully improves the path planning efficiency and safety of the UAV in a dynamic environment by combining the fast exploration ability of the RRT algorithm and the safety constraints of the CBF technology. The optimization of each step ensures the efficiency and stability of the path, especially in the case of dense obstacles and dynamic environmental changes, showing significant advantages. The experimental results show that this solution shows excellent path planning effects in complex and unstructured environments, significantly improving the flight efficiency and safety of the UAV, and has broad application prospects.

[0110] As mentioned above, it is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A UAV path planning method based on CBF, characterized in that, The method steps include: S1. Establish a UAV flight map, determine the flight starting point and the flight ending point in the map, and mark the obstacles; S2. Based on the marked UAV flight map, use the RRT algorithm to generate a first flight path that does not contain collision nodes; S3. Utilize CBF to evaluate and optimize the first flight path to obtain the optimal flight path, thereby completing the UAV path planning.

2. The method for path planning of an unmanned aerial vehicle based on CBF according to claim 1, wherein, The UAV flight map in S1 is a two-dimensional environmental map, including obstacles, airspace restrictions, and flight areas.

3. A CBF-based UAV path planning method according to claim 2, characterized in that In the UAV flight map in S1, the environment is represented in a matrix or grid manner, and 0 and 1 are used to represent the obstacle position information, and its specific representation is: M(i, j) ∈ {0, 1} where M(i, j) = 1 indicates that there is an obstacle at this position; while M(i, j) = 0 indicates that this position is a free area.

4. A CBF-based UAV path planning method according to claim 1, characterized in that The specific steps of using the RRT algorithm in S2 to generate the first flight path are: S21. Initialize the tree and set the starting point of the drone flight as the root node x of the tree start ; S22. In the UAV flight map, randomly sample points as random points, and find the node closest to this random point on the current tree as the nearest node; S23. Calculate the direction from the nearest node to the random point, and expand a new node along this direction; S24. Perform a collision detection on the new node. If the new node does not collide with the obstacle, proceed to step S25; otherwise, discard the new node; S25. Repeat steps S22, S23, and S24 to continuously expand new nodes until a node close to the flight ending point appears in the tree; S26. Trace back the path from the node close to the flight ending point to the flight starting point, that is, obtain the UAV flight path.

5. The CBF-based UAV path planning method according to claim 4, characterized in that: The coordinates of the newly expanded node in S23 are: Among them, x new is a new node; x near is the nearest node; x rand is a random point; δ is the step size.

6. The CBF-based UAV path planning method according to claim 1, characterized in that: The specific steps of using CBF to evaluate and optimize the first flight path in S3 are: Establish CBF safety constraints and CBF optimization constraints. Utilize the CBF safety constraints to evaluate the relative positions of each node in the first flight path and the obstacles one by one. If a node does not meet the safety constraints, from the previous node, utilize the CBF optimization constraints to adjust the path or reselect the expansion direction until all nodes meet the safety constraints, thereby obtaining the optimal flight path.

7. A CBF-based UAV path planning method according to claim 6, wherein, The specific formula for establishing the CBF safety constraints is: C(x, O i ) = ||x - O i || 2 - r i 2 Among them, C(x, O i ) is a safety constraint; x is the position of the UAV; O i is the position of the obstacle; r i is the radius of the obstacle O i .

8. A method for path planning of an unmanned aerial vehicle based on CBF according to claim 6, characterized in that, The specific formula for the CBF optimization constraints is: in, is the time derivative of the safety constraint; α is the constraint strength coefficient, α>0; C(x,O i ) is a safety constraint.

9. A CBF-based UAV path planning system, characterized in that: The system operates using a CBF-based UAV path planning method as described in any one of claims 1-8. The system includes a map construction module, a path generation module, and a path optimization module; The map construction module is used to establish a UAV flight map, determine the flight starting point and the flight ending point in the map, and mark the obstacles; The path generation module embeds the RRT algorithm, and based on the marked UAV flight map, uses the RRT algorithm to generate a first flight path; The path optimization module embeds the CBF function, and it utilizes CBF to evaluate and optimize the first flight path to obtain the optimal flight path, thereby completing the UAV path planning.

10. A CBF-based UAV path planning system according to claim 9, characterized in that, The path generation module and the path optimization module form a dual-thread architecture through a shared memory interface; the path generation thread executes the RRT algorithm. In the path generation thread, the RRT algorithm is used to perform collision detection on new nodes; the path optimization thread runs CBF constraint detection and path correction in real time. In the path optimization thread, CBF safety constraints and CBF optimization constraints are used for further obstacle avoidance; The two threads use an asynchronous communication mechanism to achieve UAV path planning.

Citation Information

Patent Citations

  • Photovoltaic robot planning algorithm and planning system based on improved RRT* algorithm

    CN117451070A