Method and system for unmanned aerial vehicle to automatically fly around no-fly zone
By combining the Voronoi diagram and rasterized map with the A* search algorithm, the safety distance and path are dynamically adjusted, which solves the problems of low efficiency and poor stability in path planning of drones in dynamic no-fly zones and realizes efficient and stable detour path generation.
Patent Information
- Application Number
- CN202511024834.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-07-24
AI Technical Summary
When faced with dynamic no-fly zones, existing drones have inefficient path planning, insufficient dynamic adaptability, and poor flight stability. They are unable to effectively avoid polygonal no-fly zones, resulting in mission failures and safety hazards.
The Voronoi diagram and raster map are combined with the A* search algorithm to dynamically adjust the safety distance and path. Through Bezier curve smoothing and multi-objective optimization, a detour path that conforms to the flight characteristics of the drone is generated, and real-time monitoring and local replanning are carried out.
It improves the efficiency and safety of path planning, achieves real-time response to dynamic environments, reduces computing overhead, reduces sharp turns, improves flight stability and adaptability, and is suitable for various no-fly zone types.
Smart Images

Figure CN120803027A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of scheme design of automatic flying around no-fly zones by unmanned aerial vehicles, and particularly relates to a method and system for automatic flying around no-fly zones by unmanned aerial vehicles. BACKGROUND
[0002] With the wide application of unmanned aerial vehicles in logistics, inspection, surveying and mapping and other fields, the safety of autonomous flight of unmanned aerial vehicles faces severe challenges. The existing technology mainly relies on artificial pre-planning of flight routes to avoid no-fly zones, which has three major defects: Low efficiency: Artificial planning needs to repeatedly adjust the flight route to avoid polygon no-fly zones, which consumes a lot of time and is easy to overlook. Especially in the dense no-fly zone scenario (such as urban airspace), the time consumption of path planning increases exponentially with the number of no-fly zones.
[0003] Insufficient dynamic adaptability: The traditional static map cannot respond to temporary no-fly zone updates (such as sudden military exercises, fire areas). When the no-fly zone changes dynamically, the unmanned aerial vehicle needs to interrupt the task and return or emergency hover, resulting in task failure.
[0004] Poor flight stability: The path generated based on Dijkstra, RRT and other algorithms is mostly a broken line, which has a large number of sharp turns. The unmanned aerial vehicle needs to frequently accelerate and decelerate when executing such a path, which not only increases energy consumption, but also easily causes attitude instability and causes a crash accident.
[0005] Although individual solutions use A* algorithm to optimize path length, they still do not solve the three major problems: High computational complexity: When directly processing irregular no-fly zone polygons, the algorithm needs to traverse a large number of invalid nodes; Real-time re-planning is missing: unable to dynamically adjust the path during flight; Weak physical feasibility: ignoring the dynamics constraints of unmanned aerial vehicles (such as minimum turning radius).
[0006] Therefore, there is an urgent need for an autonomous flying around technology that supports dynamic no-fly zone avoidance, has low computational overhead, and meets the flight characteristics of unmanned aerial vehicles.
[0007] Therefore, the existing technology still needs further development. SUMMARY
[0008] The purpose of the present application is to overcome the above technical deficiencies and provide a method and system for automatic flying around no-fly zones by unmanned aerial vehicles to solve the problems existing in the prior art.
[0009] To achieve the above technical purpose, according to the first aspect of the present application, the present application provides a method for automatic flying around no-fly zones by unmanned aerial vehicles, comprising: S100, initialize flight task parameters: set the starting point and the ending point, load the no-fly zone polygon data, and configure an initial value of the minimum safe distance of the bypass; the initial value can be dynamically updated during the flight; S200, construct a safe path planning base graph: generate a Voronoi graph based on the no-fly zone boundary points and the center points, and mark the feasible flight area and the no-fly zone; or divide the flight area by using a rasterized map; S300, dynamic path search: calculate the bypass path on the Voronoi graph or the rasterized map by using an A* search algorithm; the heuristic function of the A* search algorithm is the Euclidean distance from the current point to the ending point, and the cost function includes the wind speed and the energy consumption weight; S400, path optimization: perform a Bezier curve smoothing processing on the path generated by the A* search algorithm to reduce the sharp turns; and perform a multi-objective optimization on the path to balance the path length, the energy consumption and the obstacle avoidance rate.
[0010] Specifically, the construction of the Voronoi graph in step S200 includes: extracting the boundary points and the center points of all no-fly zone polygons; generating a Voronoi graph covering the flight area to keep a safe distance between the path and the no-fly zone boundary.
[0011] Specifically, the cost function g(n) of the A* search algorithm satisfies: ; wherein is a dynamically adjusted weight coefficient.
[0012] Specifically, it further includes dynamic no-fly zone detection: rasterize the flight area to monitor the predicted trajectory points of the unmanned aerial vehicle in the future T seconds in real time; if the trajectory point falls into the no-fly zone grid, trigger the path re-planning.
[0013] Specifically, the minimum bypass safe distance is dynamically adjusted based on the initial value, and the calculation satisfies: ; wherein, is the real-time speed of the unmanned aerial vehicle, is the weight coefficient, is the basic buffer distance.
[0014] Specifically, the Bezier curve smoothing processing includes: extracting the curvature change points in the path as control points, and constraining the positions of the control points to maintain the no-fly zone safe distance; generate a continuous and smooth path by fitting a third-order Bezier curve; Limit the maximum curvature of the path to ensure that the UAV can execute; and perform no-fly zone re-detection after fitting.
[0015] Specifically, the multi-objective optimization adopts a Dijkstra variant algorithm, and performs local fine adjustment on the basis of the path generated by the A* search algorithm, and the total cost function is: TotalCost Distance Energy consumption Obstacle density Wherein, is a dynamic adjustment weight coefficient, and the weight coefficient is dynamically switched according to the flight mode.
[0016] Specifically, the path re-planning is local optimization: Only the R meter range around the affected path segment is re-planned; The optimization target is to minimize the cumulative change of the heading angle.
[0017] Specifically, the multi-objective optimization in step S400 includes: Adjust the path slope according to the real-time pitch angle and roll angle of the UAV; In mountainous terrain, the path with low climb rate is preferentially selected.
[0018] According to the second aspect of the application, a system for automatically flying around a no-fly zone by a UAV is provided, comprising: An acquisition module is configured to initialize flight task parameters, set a starting point and an ending point, load no-fly zone polygon data, and configure an initial value of a minimum circumnavigation safety distance; the initial value can be dynamically updated during flight; A control module is configured to construct a safety path planning base graph: generate a Voronoi graph based on no-fly zone boundary points and center points, and mark the feasible flight area and the no-fly zone; or divide the flight area by using a rasterized map; perform dynamic path search: calculate the circumnavigation path on the Voronoi graph or the rasterized map by using an A* search algorithm; the heuristic function of the A* search algorithm is the Euclidean distance from the current point to the ending point, and the cost function includes wind speed and energy consumption weight; perform path optimization: perform Bezier curve smoothing processing on the path generated by the A* search algorithm to reduce sharp turns; and perform multi-objective optimization on the path to balance the path length, energy consumption and obstacle avoidance rate.
[0019] Advantages: The present application realizes the following significant progress through the innovative technical scheme: 1. Improve the efficiency and safety of path planning: ① Voronoi graph preprocessing: convert the no-fly zone boundary into a safety path skeleton, so that the A* search node is reduced by more than 70%, and the calculation time is reduced to 1 / 3 of the traditional method; ②Dynamic safety distance mechanism: automatically expand the no-fly zone boundary according to real-time flight state (speed, wind speed, positioning error), ensure that the UAV always maintains a safe buffer space; ③Ray method no-fly zone detection: quickly determine the position risk through lightweight geometric calculation, avoid complex geographic information system call.
[0020] 2. Real-time response to dynamic environment: ①Local re-planning window: only the path segment affected by the new no-fly zone (radius ≤100 meters) is optimized, the overall route is stable, and the re-planning response speed is improved by 3 times; ②Multi-objective optimization engine: dynamically balance between path length, energy consumption, and obstacle density, and adapt to different task modes (such as energy saving priority / obstacle avoidance priority) through weight coefficients.
[0021] 3. Optimize flight physical performance: ①Bezier curve smoothing: convert jagged paths into continuous trajectories that meet the minimum turning radius of the UAV, reduce sharp turns by more than 90%, and significantly reduce mechanical wear and tear; ②Three-dimensional dynamics compensation: automatically adjust the path slope according to the pitch angle / roll angle to avoid stall risk in mountainous terrain.
[0022] 4. Expand application scenario compatibility: ①Heterogeneous no-fly zone support: handle government-established no-fly zones (fixed polygons), temporary no-fly zones (dynamic circles / rectangles), and natural obstacle zones (mountains, high-voltage lines) simultaneously; ②Hardware resource optimization: the algorithm can run in real time on embedded chips (such as Jetson Nano), meeting the computing power needs of consumer-grade to industrial-grade UAVs. BRIEF DESCRIPTION OF DRAWINGS
[0023] Figure 1 is the flowchart of the method for automatically flying around the no-fly zone of the UAV provided in the specific embodiments of the present application; Figure 2 is the system composition schematic diagram of the system for automatically flying around the no-fly zone of the UAV provided in the specific embodiments of the present application. DETAILED DESCRIPTION
[0024] For the personnel in the art to better understand the technical solutions of the present application, the technical solutions of the present application are described clearly and completely below in combination with the drawings of the present application. Based on the embodiments in the present application, other similar embodiments obtained by the personnel in the art without making creative efforts should all belong to the scope of protection of the present application. In addition, the directional words mentioned in the following embodiments, such as “up”, “down”, “left”, “right” and the like are only the directions of the drawings, and therefore, the directional words used are used for illustration but not for limiting the present application.
[0025] The present application is further described below in combination with the drawings and preferred embodiments.
[0026] Please refer to Figure 1 , the present application provides a method for automatically flying around a no-fly zone by a UAV, comprising: S100, initializing flight task parameters: setting a starting point and an ending point, loading no-fly zone polygon data, and configuring an initial value of a minimum safe distance for flying around; the initial value can be dynamically updated in flight.
[0027] It can be understood that the initial value of the minimum safe distance for flying around (such as a default of 20 meters) is dynamically updated in flight based on real-time sensor data, and the “initial value” is only used as a starting point parameter, and the safe distance parameter itself is actually updated, so as to avoid ambiguity of “dynamic updating of the initial value”.
[0028] It needs to be further explained that, regarding step S100, the specific solutions designed by the present application include: ① defining a starting point : a current GPS coordinate (latitude and longitude) of the UAV; ② defining an ending point : a target point GPS coordinate; ③ defining a no-fly zone polygon: a polygon region defined by a vertex sequence ; ④ defining a minimum safe distance : ; Wherein: Base_Buffer: a basic safe buffer distance (default 20 meters); : a real-time speed of the UAV (unit: m / s); : a real-time wind speed (unit: m / s); : an estimated value of GPS positioning error (unit: meters); : a weight coefficient (dynamically adjusted according to a flight environment); Example: high-speed flight , From 0.5 to 1.2, expand the safety distance to cope with inertia risk.
[0029] It can be understood that the minimum detour safety distance Configured as a basic value at initialization, but dynamically updated during flight according to real-time sensor data (such as speed, wind speed) to ensure that the safety buffer distance adapts to the dynamic environment. The dynamic update logic is detailed in the formula implementation of claim 5.
[0030] It can be understood that the initialization configuration of Only as a basic reference value, real-time recalculation is performed by the embedded processor during flight, and the weight coefficients a, β, γ are dynamically adjusted by the flight controller based on the task mode (such as energy-saving mode or obstacle avoidance mode), ensuring parameter continuity.
[0031] It needs to be further explained that the dynamic adjustment of weight coefficients a, β is based on the UAV dynamics model and wind tunnel test calibration, with a value range of a∈[0.5,1.5] and β∈[0.1,0.5], and default values of a=0.7 and β=0.3; wherein, a increases to 1.2 in high-speed flight mode (V>15m / s) to compensate for inertia risk, and β is linearly adjusted based on the wind speed- heading angle under headwind conditions.
[0032] It needs to be further explained that the weight coefficients a, β, γ are set according to the actual flight data set, wherein a is used for speed compensation (range [0.8,1.2]), β is used for wind speed compensation (range [0.2,0.4]), and γ is used for GPS error compensation (range [1.0,1.5]); The specific value is optimized online by the embedded controller, including the increase of a weight when V increases.
[0033] It can be understood that the weight coefficient is a dimensionless scaling factor used to balance the dimensional differences and contribution weights of different physical quantities (distance, wind speed, energy consumption, etc.). Its value is not limited to the range [0,1], and the specific design depends on: The order of magnitude difference of physical quantities (such as wind speed unit m / s vs distance unit m); The priority of the task scenario (such as obstacle avoidance priority vs energy saving priority); Value freedom: From a mathematical point of view, the weight coefficient can be any positive real number (including >1).
[0034] It needs to be further explained that when the weight is >1, it indicates that the system strengthens a certain constraint in a specific scenario: 1. Physical quantity compensation: Example: γ·GPS error in the safety distance formula: GPS error = 10m, if γ = 1.5, then compensation term = 15m; Technical effect: offset the misjudgment of no-fly zone caused by positioning drift.
[0035] 2. Mode priority switching: Example: γ = 1.0 (near the upper limit value) in the total cost function; Effect: Prioritize obstacle avoidance rate in obstacle-dense areas (sacrifice part of path length).
[0036] 3. Nonlinear effect balance: When the wind speed resistance cost is exponentially related to the speed, β > 1 is needed to achieve linear approximation; It can be understood that the value range is set based on avoiding excessive weight causing algorithm distortion, and the application limits the range by constraint: 1. Kinetic boundary: α max = 1.5 derived from the maximum thrust limit of the unmanned aerial vehicle (excessive will lead to the path being un-flyable); 2. Upper limit of sensor error: γ max = 1.5 corresponds to 10% margin of the maximum positioning error (15m) of GPS.
[0037] In other preferred embodiments of the application, the values of the weight coefficients α, β, and γ are adjusted dynamically according to the flight mode of the unmanned aerial vehicle: Energy-saving mode: preferentially reduce energy consumption (β = 0.6, α = 0.2, γ = 0.2); Obstacle avoidance mode: preferentially avoid obstacles (γ = 0.6, α = 0.3, β = 0.1); The sum of the weights always satisfies α + β + γ = 1, which is calibrated by 200 sets of mountain flight test data.
[0038] S200, construct a safe path planning base map: generate a Voronoi diagram based on the boundary points and center points of the no-fly zone, and mark the feasible flight area and no-fly zone; or use a rasterized map to divide the flight area.
[0039] Specifically, the construction of the Voronoi diagram in step S200 includes: Extract the boundary points and center points of all no-fly zone polygons; Generate a Voronoi diagram covering the flight area, so that the path maintains a safe distance from the no-fly zone boundary.
[0040] It should be further explained that regarding step S200, the specific scheme designed by the application includes: Scheme A, Voronoi diagram generation: ① Extract the boundary point set {B1, B2, …, Bm}; ②Calculate the center point of the no-fly zone ; ③Generate a Voronoi diagram based on the point set to make the path away from the no-fly zone boundary; Scheme B, gridding map: ①Divide the flight area into 10m×10m grids; ②Label the grid attributes: SafeZone: feasible region (white grid); NoFlyZone: no-fly zone (red grid).
[0041] S300, dynamic path search: use A* search algorithm to calculate the flight path on the Voronoi diagram or gridding map; the heuristic function of the A* search algorithm is the Euclidean distance from the current point to the end point, and the cost function includes wind speed and energy consumption weight.
[0042] Specifically, the cost function g(n) of the A* search algorithm satisfies: ; Wherein is a dynamically adjusted weight coefficient.
[0043] Specifically, it further includes dynamic no-fly zone detection: Grid the flight area and monitor the predicted trajectory points of the unmanned aerial vehicle in the future T seconds in real time; If the trajectory point falls into the no-fly zone grid, trigger path re-planning.
[0044] It should be further pointed out that after the Bezier curve fitting, the trajectory point detection is applied to the smooth path segment, and if any predicted point falls into the no-fly zone grid, local re-planning is immediately performed within the affected radius R meters, and the optimization goal is to minimize the heading angle change.
[0045] Further, in the Bezier curve equation , add the path point coordinate boundary condition to ensure ; The maximum curvature limit Combined with the no-fly zone buffer, is the minimum turning radius of the unmanned aerial vehicle.
[0046] It can be understood that the Bezier smoothing does not introduce deviation risk, because the control point is derived from the curvature extreme point of the path generated by the A* search algorithm, and the re-planning mechanism provides redundant protection.
[0047] Specifically, the minimum detour safety distance is dynamically adjusted based on the initial value, and its calculation satisfies: ; wherein, is the real-time speed of the UAV, is the weight coefficient, is the basic buffer distance, is the minimum real-time distance that must be maintained between the UAV / vehicle and the obstacle, and can be set according to actual conditions, and the greater the value, the higher the safety, and the application is preferably 5 meters according to experimental tests.
[0048] Specifically, the path re-planning is local optimization: only the R-meter range around the affected path segment is re-planned; the optimization goal is to minimize the cumulative change in the heading angle.
[0049] It should be further explained that, regarding step S300, the application designs the following specific solutions: ① Design a cost function: wherein, : the actual distance (unit: meters) from the starting point to the node ; : the wind resistance coefficient (default , is the included angle between the heading and the wind direction); : dynamic weight (default ); ② Design a heuristic function: wherein, is the Euclidean distance (straight-line distance) from the node to the end point .
[0050] S400, path optimization: the path generated by the A* search algorithm is subjected to Bezier curve smoothing processing to reduce sharp turns; the path is subjected to multi-objective optimization to balance the path length, energy consumption, and obstacle avoidance rate.
[0051] Specifically, the Bezier curve smoothing processing includes: extracting the curvature change points in the path as control points, and constraining the control point positions to maintain a safety distance from the no-fly zone; generating a continuous and smooth path by fitting a third-order Bezier curve; limiting the maximum curvature of the path to ensure that the UAV can execute it; and performing no-fly zone re-detection after fitting.
[0052] It should be noted that the application designs the following safety mechanisms: Before smoothing, the control points are selected to be constrained by the no-fly zone boundary to ensure the fitted path points maintain a minimum safety distance from the no-fly zone After smoothing, real-time no-fly zone detection is performed (e.g., the ray method of claim 4), and if the path points deviate, local re-planning is triggered.
[0053] Specifically, the multi-objective optimization uses a Dijkstra variant algorithm to make local fine adjustments based on the path generated by the A* search algorithm, and the total cost function is: TotalCost Distance Energy consumption Obstacle density wherein, is a dynamic adjustment weight coefficient, and the weight coefficient is dynamically switched according to the flight mode.
[0054] It can be understood that the application designs a dynamic switching logic for the weight coefficient: in the energy-saving mode, β=0.6 is given priority, and in the obstacle avoidance mode, γ=0.8 is given priority; the value ranges are a∈[0.4, 0.8], β∈[0.3, 0.7], and γ∈[0.5, 1.0], which are based on the task simulation results to ensure the minimization of the total cost.
[0055] Specifically, the multi-objective optimization in step S400 includes: Adjusting the path slope according to the real-time pitch angle and roll angle of the unmanned aerial vehicle; Prioritize low climb rate paths in mountainous terrain.
[0056] It should be further noted that regarding the dynamic adjustment of the path slope, the application designs the following specific solutions: 1. Design a slope-attitude coupling control model: ① Input parameters: Real-time pitch angle (unmanned aerial vehicle head and tail inclination); Real-time roll angle (left and right inclination of the fuselage); Terrain elevation gradient (altitude change per unit distance); ② Control logic: ; wherein: Theoretical minimum climb slope of the unmanned aerial vehicle (determined by the dynamics of the model); Weight coefficient (calibrated through wind tunnel test).
[0057] ③ Dynamic adjustment strategy: When (machine head up) and (uphill): reduce the path slope to 0.7 times the original, compensate for insufficient power; When (lateral inclination) and (downhill): increase the path slope to 1.2 times the original, resist lateral wind deviation.
[0058] 2. Design of slope smooth transition technology ① Subsection control: divide the continuous path into sections of length (for speed, for allowed acceleration); ② Slope transition constraint: ; Implementation process: ① Read the current slope θ0; ② Calculate the next path point slope θ1; ③ Calculate Δθ ≤ threshold, then directly connect; Calculate Δθ > threshold, then insert transition point θ' = (θ0 + θ1) / 2]; ④ Recursively detect new subsection.
[0059] Further, regarding the low climbing rate path optimization strategy in mountainous areas, the specific scheme designed by the present application includes: 1. Recognition of mountainous terrain features: ① Judgment basis: Calculate the terrain roughness using the following formula: The judgment basis is > Typical threshold (typical mountain ); Where: : represents the elevation value (i.e. altitude : represents the average value of the elevations of all points in the selected area, i.e. ; represents the total number of measurement points in the selected area; : represents the absolute deviation of the elevation of each point from the average elevation; : represents the sum of the absolute deviations of the elevations of all points.
[0060] Elevation standard deviation ; The length of the continuous climbing section is > preset value (default 500m).
[0061] ② Design multi-objective optimization function: Cost function design: Where: is the total factory of the path, and the optimization goal is to minimize; is the average climb rate, and the optimization target is ≤3% (safety threshold); is the number of steep slope sections (slope > 8%), and the optimization goal is to minimize it; 、 、 In order to dynamically adjust the weight coefficient, the weight coefficient is dynamically switched according to the flight mode.
[0062] ③ Design a low climb rate path generation algorithm. The code includes: def generate_low_climb_path(terrain_map): # Step 1: Construct a contour topology map contour_graph = extract_contour_isolines(terrain_map, step=5m) # Step 2: Filter the feasible path set candidate_paths = [] for contour_line in contour_graph: if contour_line.slope<0.08: # Slope<8% path = connect_contour_segments(contour_line, max_gap=100m) candidate_paths.append(path) # Step 3: Optimal energy consumption optimal_path = min(candidate_paths, key=lambda p: p.cost_energy) # Step 4: Secondary smoothing (ensuring curvature continuity) return bezier_smoothing(optimal_path, control_point_strategy="curvature_guided") It is understandable that the above solution has the following technical advantages: 1. Slope-attitude dynamic coupling: Solve the pain point: Traditional static paths are prone to power saturation in strong winds or steep slopes; Innovation: Convert real-time attitude data into slope control parameters to achieve adaptive flight capability.
[0063] 2. Optimal energy consumption in mountainous areas: Technical breakthrough: Generate natural low climb rate paths through contour topology analysis (instead of forcibly reducing slope); Safety gain: Reduce steep slope segment frequency by >60%, significantly reduce motor overload risk.
[0064] 3. Balance between smoothness and efficiency: Design segmented constraint model to avoid excessive smoothing leading to detours (path length growth ≤8%); Design transition point recursive insertion to eliminate curvature discontinuity points (max centripetal acceleration decreased by 40%).
[0065] Implementation example: In mountainous area test (maximum elevation difference 620m): Average climb rate of path generated by original A* search algorithm: 6.2% → after optimization: 2.9%; Motor peak power reduction: 28% (M300 model actual test data).
[0066] It can be understood that the present application realizes the safety-energy-smoothness triple guarantee of unmanned mountain flight for the first time through dynamic feedback control and terrain feature driven optimization.
[0067] It needs to be further explained that regarding step S500, the specific scheme designed by the present application includes: ① Design total cost function: Among them: : Total path length (unit: meters); : Energy cost ( related to speed and climb rate); : Obstacle density (unit: pieces / square meter); : Mode weight (energy saving mode , obstacle avoidance mode ).
[0068] ② Design a cubic Bezier curve equation: Among them: : Path segment start / end point; : Control point (generated by curvature extreme point); : curve parameters (step size 0.1 generates continuous trajectory); Constraint: Maximum Curvature ( is the minimum turning radius of the drone).
[0069] It should be further explained that regarding dynamic no-fly zone detection and re-planning, the solutions designed by the present invention include: ① Prediction trajectory detection: (1) Based on the UAV state (position (x, y), velocity V, heading angle θ), the trajectory point set {Q1, Q2, …, Qk} in the next T seconds is calculated; (2) Perform no-fly zone judgment for each Qi: Inside = {true if the ray method returns an odd intersection point false otherwise.
[0070] ② Local replanning: Trigger conditions: (1) The new no-fly zone is detected to intersect with the predicted trajectory; (2) Optimization objectives: in: 、 : New / original path heading angle (unit: radians); ΔD: path length change (unit: meter); λ: Smoothing factor (default 0.3).
[0071] It should be further explained that the present invention designs the following code: 1. Key data structure, MyLatLng class: class MyLatLng { double latitude; / / latitude coordinate (unit: degrees) double longitude; / / longitude coordinate (unit: degrees) public MyLatLng(double lat, double lon) { this.latitude = lat; this.longitude = lon; } } Technical role: Encapsulates the geographic coordinates of the drone as the basic data type for path planning; All algorithms (A* search, NoFlyZone detection) are based on this coordinate object manipulation.
[0072] 2. NoFlyZone detection, NoFlyZone class: class NoFlyZone { List <mylatlng>polygon; / / No-fly zone polygon vertex sequence public boolean isInside(MyLatLng point) { int intersections = 0; for (int i = 0, j = polygon.size() - 1; i <polygon.size(); j= i++) { MyLatLng p1 = polygon.get(i); MyLatLng p2 = polygon.get(j); if ((p1.latitude>point.latitude) != (p2.latitude>point.latitude)&& (point.longitude<(p2.longitude - p1.longitude) * (point.latitude - p1.latitude) / (p2.latitude - p1.latitude) + p1.longitude)) { intersections++; } } return (intersections % 2 == 1); / / An odd number of intersections means it is in the no-fly zone } } Technical principle: Ray Casting Algorithm: ①Emit horizontal rays from the detection point to the right; ② Calculate the number of intersections between the ray and each edge of the polygon; ③ For odd-numbered intersections, the point is determined to be inside the polygon (no-fly zone); for even-numbered intersections, the point is determined to be outside the polygon (safe zone).
[0073] 3. Path search generated by the A* search algorithm, AStar Path Finder class: public List <mylatlng>find Path(MyLatLng start, MyLatLng target, List <noflyzone>noFlyZones) { / / 1. Initialize the open set (priority queue) openSet.add(new Node(start, 0)); gScore.put(start, 0.0); fScore.put(start, heuristic(start, target)); while (!openSet.isEmpty()) { Node current = openSet.poll(); / / 2. If we've reached the goal, reconstruct the path if (current.position.equals(target)) { return reconstructPath(target); } / / 3. Explore neighbors for (MyLatLng neighbor : getNeighbors(current.position, noFlyZones)) { / / 4. Calculate tentative g-score: g(n) = g(current) + distance(current, neighbor) double tentativeGScore = gScore.getOrDefault(current.position, Double.MAX_VALUE) + distance(current.position, neighbor); / / 5. If we find a better path, update if (tentativeGScore < gScore.getOrDefault(neighbor, Double.MAX_VALUE)) { cameFrom.put(neighbor, current.position); gScore.put(neighbor, tentativeGScore); fScore.put(neighbor, tentativeGScore + heuristic(neighbor, target)); openSet.add(new Node(neighbor, fScore.get(neighbor))); } } Key technical components: Heuristic function: The heuristic function represents the Euclidean distance (straight-line distance) from the current node to the end point, guiding the search direction; Cost function: g(n) = g(current) + distance(current, n), representing the cumulative movement cost (actual path length) from the starting point to the current node; Node evaluation: f(n) = g(n) + h(n), representing the total cost estimate (core of A* algorithm), preferentially expanding the node with the smallest f(n); Neighbor generation: getNeighbors(), representing generating 8 adjacent points in all directions around the current point (lattice method), and filtering out points in the no-fly zone; Path reconstruction: reconstructPath(), representing tracing back the parent nodes from the end point to generate the complete path.
[0074] Innovation points: Dynamic safety distance fusion: when calling isInNoFlyZone() in getNeighbors(), safety distance control is achieved by expanding the no-fly zone boundary; Multi-objective optimization foundation: g(n) can be extended to include wind speed and energy consumption factors (reference disclosure Dijkstra variant).
[0075] 4. Path smoothing, Bézier curve processing: List <mylatlng>smoothedPath = new ArrayList<>(); for (int i = 0; i<path.size() - 2; i++) { MyLatLng p0 = path.get(i); MyLatLng p1 = path.get(i+1); MyLatLng p2 = path.get(i+2); for (double t = 0; t<= 1; t += 0.1) { double x = (1-t)*(1-t)*p0.latitude + 2*(1-t)*t*p1.latitude + t*t*p2.latitude; double y = (1-t)*(1-t)*p0.longitude + 2*(1-t)*t*p1.longitude + t*t*p2.longitude; smoothedPath.add(new MyLatLng(x, y)); } } Mathematical principles: Second-order Bezier curve equation: Where: : Path segment start / end point; : Control point (take the middle point of the original path); : Curve parameter (generate 10 interpolation points with a step size of 0.1).
[0076] Technical effects: 1. Eliminate jagged paths: convert A* generated polylines to continuous curves; 2. Reduce turning curvature: avoid attitude instability caused by rapid turns of the UAV; 3. Reduce energy consumption: smooth path reduces the number of acceleration and deceleration times (actual test energy saving 15~25%).
[0077] 5. Dynamic safety distance implementation (supplement the briefing book scheme) / / Dynamically calculate safe distance (not explicitly implemented in example code, needs to be extended) double calculateSafeDistance() { double baseBuffer = 20.0; / / Basic safety distance (meters) double alpha = 0.8; / / Speed weight coefficient double beta = 0.3; / / Wind speed weight coefficient double gamma = 1.2; / / GPS error weight coefficient double currentSpeed = getDroneSpeed(); / / Real-time speed (m / s) double windSpeed = getWindSpeed(); / / Real-time wind speed (m / s) double gpsError = getGpsErrorEstimation(); / / GPS error estimation (m) return baseBuffer + alpha * currentSpeed + beta * windSpeed + gamma * gpsError; } Where: currentSpeed: Real-time speed of the drone, the faster the speed, the greater the safety distance (to deal with inertia risk); windSpeed: Environmental wind speed, increase safety distance when flying against the wind (to prevent wind drift); gpsError: GPS positioning accuracy error, the greater the error, the greater the safety distance (to compensate for positioning uncertainty); alpha, beta, gamma: Dynamic weight coefficients, adjusted according to flight mode (e.g. alpha=1.5 in high-speed mode).
[0078] It can be understood that the positioning of the code in the overall scheme includes: 1. Core path planning: AStarPathFinder implements the main algorithm for flying around 2. Safety guarantee: NoFlyZone detection + dynamic safety distance to prevent intrusion 3. Flight optimization: Bezier curve to improve flight stability and energy efficiency 4. Scalability: Voronoi diagram guidance can be implemented by rewriting heuristic(). Dynamic no-fly zone detection is integrated in getNeighbors().
[0079] Note: The example code is a simplified version, and the actual system needs to be expanded: Real-time no-fly zone update monitoring (thread implementation); Dijkstra variant optimization (multi-objective cost function); Three-dimensional terrain elevation integration (z-axis coordinate expansion).
[0080] Please refer to Figure 2 , the present application provides another embodiment, which provides a system for automatically flying around no-fly zones by unmanned aerial vehicles, comprising: An acquisition module 100 is configured to initialize flight task parameters, set a starting point and an ending point, load no-fly zone polygon data, and configure an initial value of a minimum safe distance for circumnavigation; the initial value can be dynamically updated during flight; A control module 200 is configured to construct a safe path planning base graph, generate a Voronoi diagram based on no-fly zone boundary points and center points, and mark a feasible flight area and a no-fly zone; or divide a flight area using a rasterized map; to perform dynamic path search, an A* search algorithm is used to calculate a circumnavigation path on the Voronoi diagram or the rasterized map; the heuristic function of the A* search algorithm is the Euclidean distance from a current point to an ending point, and the cost function includes wind speed and energy consumption weights; to perform path optimization, a path generated by the A* search algorithm is subjected to Bezier curve smoothing processing to reduce sharp turns; the path is subjected to multi-objective optimization to balance path length, energy consumption, and obstacle avoidance rate.
[0081] It should be further explained that the system comprises: A sensor group including a GPS module and a wind speed sensor, which is configured to collect real-time data of the position, heading, and environment of the unmanned aerial vehicle; A navigation module configured to store no-fly zone map data and construct a Voronoi diagram or a rasterized map; A real-time obstacle avoidance processor configured to: (a) listen to no-fly zone update events, and dynamically detect whether a predicted trajectory of the unmanned aerial vehicle intersects with a new no-fly zone; (b) locally re-plan a path segment affected by the new no-fly zone to minimize path changes; A communication module configured to interact with a ground control station to receive no-fly zone update instructions.
[0082] Specifically, the system comprises: ① Sensor group: GPS module (positioning error EGPS≤2m); IMU (measure pitch angle ϕ, roll angle ψ).
[0083] ②anemometer (range 0~30m / s): ③real-time obstacle avoidance processor: Embedded chip (such as NVIDIA Jetson) executes the following threads: while flying: if detect_new_nofly_zone(): # no-fly zone update listening; replan_path(window_radius=100m) # local re-planning; adjust_safe_distance() # dynamic safety distance calculation.
[0084] It should be further pointed out that the software flow designed by the application includes: public void runAutopilot() { MyLatLng start = getGPSPosition(); MyLatLng target = getMissionTarget(); List <noflyzone>zones = loadNoFlyZones(); / / Dynamic safety distance calculation double baseBuffer = 20.0; double alpha = 0.8 * (currentSpeed>15? 1.2 : 1.0); double d_safe = baseBuffer + alpha * currentSpeed +... ; / / Path generation from A* search algorithm List <mylatlng>path = AStarFinder.findPath(start, target, zones, d_safe); / / Bezier smoothing List <mylatlng>smoothPath = BezierCurve.fit(path, maxCurvature=0.1); / / Send to flight controller flightController.executePath(smoothPath); }.
[0085] In a preferred embodiment, the present application also provides an electronic device, which comprises: a memory, and a processor, wherein computer readable instructions are stored on the memory, and the computer readable instructions, when executed by the processor, implement the method for automatically flying around a no-fly zone by a UAV. The computer device can be a server, a terminal, or any other electronic device with necessary computing and / or processing capabilities in a broad sense. In an embodiment, the computer device can include a processor, a memory, a network interface, a communication interface, and the like connected by a system bus. The processor of the computer device can be configured to provide necessary computing, processing, and / or control capabilities. The memory of the computer device can include a non-volatile storage medium and an internal memory. The non-volatile storage medium or the non-volatile storage medium can store an operating system, a computer program, and the like. The internal memory can provide an environment for running the operating system and the computer program in the non-volatile storage medium. The network interface and the communication interface of the computer device can be configured to connect and communicate with external devices through a network. The computer program, when executed by the processor, performs the steps of the method of the present application.
[0086] The present application can be implemented as a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the steps of the method of the embodiments of the present application to be performed. In an embodiment, the computer program is distributed on a plurality of computer devices or processors coupled by a network, such that the computer program is stored, accessed, and executed by one or more computer devices or processors in a distributed manner. A single method step / operation, or two or more method steps / operations, can be performed by a single computer device or processor, or by two or more computer devices or processors. One or more method steps / operations can be performed by one or more computer devices or processors, and one or more other method steps / operations can be performed by one or more other computer devices or processors. One or more computer devices or processors can perform a single method step / operation, or perform two or more method steps / operations.
[0087] As will be appreciated by one of ordinary skill in the art, the steps of the methods of the present application can be directed to relevant hardware, such as computer devices or processors, by way of computer program instructions. The computer program instructions can be stored in any non-transitory computer-readable medium, which, when executed, cause the steps of the present application to be performed. Depending on the circumstances, any reference to a memory, storage, database, or other medium can include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, magnetic tape, floppy diskettes, magneto-optical data storage devices, optical data storage devices, hard disks, solid-state drives, and the like. Examples of volatile memory include random access memory (RAM), external cache memory, and the like.
[0088] The technical features described above can be combined arbitrarily. Although all possible combinations of the technical features are not described, any combination of the technical features should be considered to be covered by the present specification, as long as such a combination does not result in a contradiction.
[0089] The specific embodiments of the present application described above are not to be construed as limiting the scope of the present application. Any other corresponding changes and modifications of the present application according to the technical concept of the present application should be included in the scope of the present application.< / mylatlng> < / mylatlng> < / noflyzone> < / mylatlng> < / noflyzone> < / mylatlng> < / mylatlng>
Claims
1. A method for automatically flying a drone around a no-fly zone, characterized in that: The method comprises: S100, initializing flight mission parameters: setting the start and end points, loading the no-fly zone polygon data, and configuring the initial value of the minimum safe detour distance; this initial value can be dynamically updated during flight; S200, constructing a basic map for safe path planning: generating a Voronoi diagram based on the boundary points and center points of the no-fly zone, marking the feasible flight area and the no-fly zone; or using a rasterized map to divide the flight area; S300, dynamic path search: using an A* search algorithm to calculate a detour path on the Voronoi diagram or rasterized map; the heuristic function of the A* search algorithm is the Euclidean distance from the current point to the end point, and the cost function includes wind speed and energy consumption weights; S400, Path Optimization: The path generated by the A* search algorithm is smoothed using Bezier curves to reduce sharp turns; the path is optimized for multiple objectives, weighing path length, energy consumption, and obstacle avoidance rate.
2. The method for automatically circumventing a no-fly zone for a drone according to claim 1, characterized in that: The construction of the Voronoi diagram in step S200 includes: Extract the boundary points and center points of all no-fly zone polygons; Generate a Voronoi diagram covering the flight area so that the path remains a safe distance from the no-fly zone boundary.
3. The method for automatically circumventing a no-fly zone for a drone according to claim 1, wherein: The cost function g(n) of the A* search algorithm satisfies: ; in, To dynamically adjust the weight coefficient.
4. The method for automatically circumventing a no-fly zone for a drone according to claim 1, wherein: Also includes dynamic no-fly zone detection: The flight area is rasterized to monitor the predicted trajectory points of the drone in the next T seconds in real time; If the trajectory point falls into the no-fly zone grid, path replanning is triggered.
5. The method for automatically flying a drone around a no-fly zone according to claim 1, characterized in that: The minimum detour safety distance Based on the dynamic adjustment of the initialization value, its calculation satisfies: ; in, is the real-time speed of the drone, is the weight coefficient, The base buffer distance.
6. The method for automatically circumventing a no-fly zone for a drone according to claim 1, wherein: The Bezier curve smoothing process includes: Extract the curvature change points in the path as control points, and constrain the positions of the control points to maintain a safe distance from the no-fly zone; Generate a continuous smooth path by fitting a third-order Bezier curve; The maximum curvature of the path is limited to ensure that the drone can execute it, and no-fly zone re-detection is performed after fitting.
7. The method for automatically flying a drone around a no-fly zone according to claim 4, characterized in that: The multi-objective optimization adopts the Dijkstra variant algorithm and performs local fine adjustment based on the path generated by the A* search algorithm. The total cost function is: TotalCost distance Energy consumption Obstacle density; in, In order to dynamically adjust the weight coefficient, the weight coefficient is dynamically switched according to the flight mode.
8. The method for automatically circumventing a no-fly zone for a drone according to claim 1, wherein: The path replanning is a local optimization: Only the area within R meters around the affected path segment is replanned; The optimization goal is to minimize the cumulative change of the heading angle.
9. The method for automatically flying a drone around a no-fly zone according to claim 1, characterized in that: The multi-objective optimization in step S400 includes: Adjust the path slope according to the real-time pitch and roll angles of the drone; In mountainous terrain, prefer low-rate-of-climb paths.
10. A system for automatically flying drones around no-fly zones, characterized in that: include: The acquisition module is used to initialize the flight mission parameters: set the start and end points, load the no-fly zone polygon data, and configure the initial value of the minimum safe detour distance; This initial value can be updated dynamically on the fly; The control module is used to construct a basic map for safe path planning: generate a Voronoi diagram based on the boundary points and center points of the no-fly zone, marking the feasible flight area and the no-fly zone; or use a gridded map to divide the flight area; perform dynamic path search: use an A* search algorithm to calculate the detour path on the Voronoi diagram or gridded map; the heuristic function of the A* search algorithm is the Euclidean distance from the current point to the end point, and the cost function includes wind speed and energy consumption weights; perform path optimization: perform Bezier curve smoothing on the path generated by the A* search algorithm to reduce sharp turns; and perform multi-objective optimization on the path, weighing path length, energy consumption, and obstacle avoidance rate.
Citation Information
Patent Citations
Multi-unmanned aerial vehicle cooperative search and rescue reconnaissance planning method in dynamic environment
CN114721427A
Unmanned aerial vehicle path planning method based on large-range cruise
CN119374598A
Unmanned aerial vehicle trajectory optimization method based on Bezier curve and flight corridor
CN119376416A
Unmanned aerial vehicle voyage cost estimation method
CN120338226A
Smart chair
KR1020210006186A
Cited By
Unmanned aerial vehicle route smoothing method and system facing grid path
CN121612316A
Unmanned aerial vehicle power line inspection path planning method and system for improving three-dimensional obstacle avoidance
CN121806913A