A fixed-wing unmanned aerial vehicle electronic fence avoidance method

By accurately detecting the boundary of the electronic fence using polygon approximation and an improved ray method, a smooth global path is generated and a local obstacle avoidance trajectory is dynamically planned. This solves the problems of boundary detection error and trajectory curvature abrupt change for fixed-wing UAVs in complex electronic fence environments, and achieves stable and accurate path tracking and control.

CN120909319BActive Publication Date: 2026-07-03QINGDAO YILAN AVIATION CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO YILAN AVIATION CO LTD
Filing Date
2025-09-18
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing fixed-wing UAVs in complex electronic fence environments suffer from large boundary detection errors, abrupt changes in trajectory curvature, and tracking lag caused by fixed control parameters, resulting in unstable UAV attitude and trajectory deviation.

Method used

The boundary of the electronic fence is accurately detected by using polygon approximation and improved ray method to generate a smooth global path. The local obstacle avoidance trajectory is solved by dynamic programming, and the distance of the aiming point is adjusted by adaptive L1 control to form a trajectory tracking closed loop.

Benefits of technology

It improves the accuracy of electronic fence boundary detection, generates smooth trajectories that conform to the dynamic characteristics of fixed-wing UAVs, realizes dynamic matching of planning and control parameters, and enhances obstacle avoidance accuracy and control response capability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909319B_ABST
    Figure CN120909319B_ABST
Patent Text Reader

Abstract

This application provides a method for fixed-wing UAVs to avoid electronic fences, belonging to the field of UAV navigation technology. The method includes: detecting the electronic fence and extracting its boundary features; determining a global path and obtaining a trackable reference line through smoothing; identifying and filtering valid candidate points based on the defined spatial range of dynamic local programming; solving the local obstacle avoidance trajectory through dynamic programming; determining the tracking control variable based on the normal distance and path curvature; updating the UAV state and forming a trajectory tracking closed loop to enable the UAV to autonomously navigate to the target endpoint. This method enables fixed-wing UAVs to achieve autonomous navigation and avoidance in electronic fence environments, improving flight safety and path planning efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of unmanned aerial vehicle (UAV) navigation technology, and more specifically, to a method for fixed-wing UAVs to avoid electronic fences. Background Technology

[0002] Fixed-wing unmanned aerial vehicles (UAVs) are increasingly widely used in fields such as power line inspection, geographic surveying, and border monitoring due to their advantages of long endurance and high efficiency. The core technological bottleneck for their autonomous operation lies in the collaborative optimization of path planning and tracking control in complex electronic fence environments. Current planning and control technologies have the following limitations:

[0003] There is a disconnect between electronic fence detection and planning constraints: Existing detection methods often use simplified geometric models to approximate the no-fly zone boundary in order to reduce computational complexity, resulting in significant errors in actual boundary identification. This accuracy deficiency leads to two typical problems in practical applications: first, misclassifying safe areas near the boundary as no-fly zones, forcing the planning module to generate excessive detour paths; second, misclassifying the edge of the no-fly zone as a safe area, causing the planned path to approach or even intrude into the no-fly zone, raising the risk of collision. Furthermore, existing detection results only provide a judgment on whether the drone is within the no-fly zone, failing to transform the detected boundary distance, boundary curvature, and other information into hard constraints that the planning module can directly use, preventing the planning module from dynamically adjusting trajectory parameters based on real-time boundary information.

[0004] Trajectory planning is not adequately adapted to the dynamic characteristics of fixed-wing UAVs. Due to the lift characteristics of their wings, fixed-wing UAVs cannot make sharp turns. Therefore, existing planning algorithms have obvious defects. The global path is often a broken line generated by a simple algorithm, with excessively large angles between adjacent segments. When used directly as a tracking reference line, it will cause severe shaking of the UAV's attitude. Local obstacle avoidance algorithms only take obstacle avoidance as the single objective, and the sudden changes in the curvature of the generated trajectory will exceed the control response capability of the fixed-wing UAV.

[0005] Regarding the matching of planning and control parameters, after the planning module generates the trajectory, the existing control module uses fixed parameters for tracking, without considering the curvature characteristics of the trajectory itself. The fixed aiming distance will cause tracking lag on straight road sections and make it difficult to track the trajectory on curved road sections, seriously affecting the actual tracking effect. Summary of the Invention

[0006] In view of this, the purpose of this application is to provide a method for electronic fence avoidance by fixed-wing UAVs, which can improve the accuracy of electronic fence boundary detection, generate a smooth trajectory that conforms to the dynamic characteristics of fixed-wing UAVs, and achieve dynamic matching of planning and control parameters.

[0007] This application provides a method for fixed-wing UAVs to evade electronic fences, including:

[0008] Detect electronic fences and extract boundary features;

[0009] Determine the global path and obtain a traceable reference line through smoothing processing;

[0010] Based on defining the spatial scope of the dynamic local planning, valid candidate points are identified and screened.

[0011] The local obstacle avoidance trajectory is solved using dynamic programming.

[0012] The tracking control quantity is determined based on the normal distance and path curvature;

[0013] Update the drone's status and form a trajectory tracking closed loop to enable the drone to autonomously navigate to the target destination.

[0014] Preferably, in the aforementioned method for avoiding electronic fences by a fixed-wing UAV, the step of detecting the electronic fence and extracting boundary features includes:

[0015] The detection and boundary feature extraction of electronic fences are accomplished using polygon approximation and an improved ray method.

[0016] The electronic fences of no-fly zones will be uniformly converted into sets of polygon vertices;

[0017] A horizontal ray is emitted from the drone's location to the right. The positional relationship is determined by counting the intersections with the polygon boundary line segments. When the total number of intersections is odd, the point is determined to be inside the electronic fence. When the total number of intersections is even, the point is determined to be outside the electronic fence.

[0018] Based on all boundary line segments of the polygon, determine the distance from the drone's position to each line segment and take the minimum value. Assign positive and negative distance values ​​inside and outside the electronic fence based on the intersection points, and determine the line segment corresponding to the minimum distance.

[0019] Preferably, in the aforementioned method for avoiding electronic fences for fixed-wing UAVs, the electronic fence of the no-fly zone is uniformly converted into a set of polygon vertices, including at least one of the following combinations;

[0020] Based on a circular no-fly zone, vertices are generated at fixed arc length intervals, and the point set is... , The angle corresponding to the arc length;

[0021] Based on a semi-circular no-fly zone, multiple arc vertices of equal arc length plus diameter endpoints are set to form a closed polygon point set;

[0022] Based on the rectangular no-fly zone, select four vertices. , , , To form a polygon point set.

[0023] Preferably, in the aforementioned method for avoiding electronic fences for fixed-wing UAVs, the step of determining the global path and obtaining a traceable reference line through smoothing includes:

[0024] A reference line is obtained by generating a global path based on a grid map and Dijkstra's algorithm, followed by smoothing.

[0025] The physical space is divided into grids of a set size. No-fly zones are marked as impassable. The cost for other grids is the reciprocal of the minimum distance to the boundary. Expansion is achieved in eight directions, with straight-line and diagonal movement costs of the grid size and [other costs], respectively. Double the grid size;

[0026] Determine the drone's origin and destination, and expand the nodes in ascending order of cumulative cost using a priority queue to determine the initial path;

[0027] The initial path is encrypted, and the encrypted path is then processed using a sliding window.

[0028] Preferably, in the aforementioned method for avoiding electronic fences for fixed-wing UAVs, the step of determining and screening valid candidate points based on defining the spatial range of dynamic local planning includes:

[0029] Based on the drone's flight speed Along the drone's heading angle Extend forward Meters, divided into 25 stages, each stage being a distance of... rice;

[0030] According to the direction perpendicular to the heading Within a range of meters, 35 candidate points are determined for each longitudinal stage. The coordinates of the candidate points are the stage center point plus the normal offset. Points located within the electronic fence, less than 1 meter from the boundary, or with an angle change rate greater than 0.5 radians from the line connecting to the effective point of the previous stage are removed.

[0031] Preferably, in the aforementioned method for electronic fence avoidance by a fixed-wing UAV, the local obstacle avoidance trajectory is solved through dynamic programming, including:

[0032] The objective cost function is determined, and the total cost is... Of which, the total cost Cost of obstacles Reference line deviation cost Curvature cost Cost of alignment with heading sum;

[0033] By backtracking the trajectory, the point with the minimum cost is selected in the final stage and traced back in reverse. The trajectory with the smallest standard deviation of curvature is selected and output, and the result is updated once per second.

[0034] Preferably, in the aforementioned method for avoiding electronic fences for fixed-wing UAVs, the step of determining the tracking control quantity based on the normal distance and path curvature includes:

[0035] Adaptive L1 control is implemented based on normal distance and path curvature, and the tracking control quantity is calculated.

[0036] Adaptive L1 control adjusts the aiming point distance based on normal distance and path curvature.

[0037] Preferably, in the aforementioned fixed-wing UAV electronic fence avoidance method, the adaptive L1 control based on normal distance and path curvature, and the calculation of the tracking control quantity, include:

[0038] The normal distance is determined by the absolute value of the dot product of the position deviation vector and the unit normal vector of the reference line projection point;

[0039] The path curvature is obtained by multiplying a fixed arc length path segment by a coefficient based on the ratio of the difference between the curve length and the straight-line distance to the curve length.

[0040] Preferably, in the aforementioned fixed-wing UAV electronic fence avoidance method, the adaptive L1 control, based on the normal distance and path curvature, adjusts the aiming point distance, including:

[0041] Determine the normal distance; when the normal distance is greater than 5, take the set maximum aiming distance as the normal distance.

[0042] When the normal distance is less than 5, the path curvature is determined. If the path curvature is higher than the preset curvature, the aiming distance is reduced; if the path curvature is lower than the preset curvature, the aiming distance is increased.

[0043] Preferably, in the aforementioned fixed-wing UAV electronic fence avoidance method, the step of updating the UAV status and forming a trajectory tracking closed loop to enable the UAV to autonomously navigate to the target destination includes:

[0044] Real-time detection of whether drones have entered electronic fence no-fly zones;

[0045] The system outputs the drone's current navigation information in real time through the drone's onboard navigation system, updates the drone's status, and provides real-time feedback to complete trajectory tracking until the drone reaches its target destination.

[0046] As can be seen from the above, the electronic fence avoidance method for fixed-wing UAVs provided in this application solves the problems of large boundary detection error, sudden change in path curvature and tracking lag caused by fixed control parameters by accurately detecting the electronic fence boundary, generating a smooth global path, dynamically planning local obstacle avoidance trajectory and adaptive tracking control. This improves obstacle avoidance accuracy, ensures path trackability and enhances control response capability. Attached Figure Description

[0047] The above and other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0048] Figure 1 The flowchart of a fixed-wing UAV electronic fence avoidance method according to an embodiment of this application is illustrated schematically. Figure 1 ;

[0049] Figure 2 The flowchart of a fixed-wing UAV electronic fence avoidance method according to an embodiment of this application is illustrated schematically. Figure 2 ;

[0050] Figure 3 The flowchart of a fixed-wing UAV electronic fence avoidance method according to an embodiment of this application is illustrated schematically. Figure 3 ;

[0051] Figure 4 The flowchart of a fixed-wing UAV electronic fence avoidance method according to an embodiment of this application is illustrated schematically. Figure 4 . Detailed Implementation

[0052] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0053] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0054] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0055] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0056] In the embodiments of this application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.

[0057] Currently, simplified geometric models are used for electronic fence detection, resulting in significant boundary recognition errors and the planning module's inability to accurately obtain spatial constraint information for no-fly zones. The polyline paths generated by the global path generation algorithm contain sharp inflection points, which are incompatible with the kinematic characteristics of fixed-wing UAVs, leading to flight attitude instability. The control module uses a fixed pre-aiming distance to track the trajectory, which cannot adapt to the different needs of straight and turning sections, causing tracking lag or trajectory deviation. When UAVs need to traverse multiple no-fly zones, they are prone to excessive path detours or intrusions into no-fly zones; furthermore, sharp turns may exceed the UAV's maneuverability.

[0058] Embodiments of this application provide a method for electronic fence avoidance by a fixed-wing UAV. The method includes: detecting the electronic fence and extracting boundary features; determining a global path and obtaining a trackable reference line through smoothing; determining and screening effective candidate points based on the defined spatial range of dynamic local programming; solving the local obstacle avoidance trajectory through dynamic programming; determining the tracking control quantity based on the normal distance and path curvature; updating the UAV state and forming a trajectory tracking closed loop to enable the UAV to autonomously navigate to the target endpoint.

[0059] like Figure 1 As shown, the fixed-wing UAV electronic fence avoidance method may include at least steps S110 to S160.

[0060] In step S110, the electronic fence is detected and boundary features are extracted. This means that the drone, through its onboard perception modules (such as a positioning module, airspace data receiving module, visual sensors, radar sensors, etc.), acquires spatial information about a pre-set electronic fence (such as the coordinate range, height restrictions, shape type, etc. of no-fly or restricted-fly zones), and parses key boundary parameters for path planning from the raw information. The extracted boundary features can serve as a reference for dangerous boundaries during local obstacle avoidance, preventing the drone from approaching the electronic fence when dynamically adjusting its trajectory. The electronic fence can be a controlled fence set up by management departments or a user-defined temporary avoidance area.

[0061] In step S120, a global path is determined, and a traceable reference line is obtained through smoothing. The global path can be a macroscopic path framework planned within the entire flight airspace from the UAV's starting point to the target endpoint, based on the coordinates of the starting point and target endpoint, electronic fence restrictions, and flight performance limitations. Smoothing optimizes the polyline or polyline segment of the global path, eliminating abrupt inflection points and generating a smooth trajectory line that conforms to the continuous motion characteristics of a fixed-wing UAV.

[0062] In step S130, valid candidate points are determined and screened based on the defined spatial range of the dynamic local planning. The spatial range of the dynamic local planning is a local airspace area dynamically defined with the current position of the UAV as the center, combined with the flight speed, sensor detection range, and obstacle avoidance response time; valid candidate points are discrete position points within this local range that meet the UAV motion constraints and are collision-free, and are used for the generation of subsequent local obstacle avoidance trajectories.

[0063] In step S140, the local obstacle avoidance trajectory is solved by dynamic programming. Dynamic programming is a multi-stage decision optimization algorithm. Among the selected valid candidate points, the algorithm determines the continuous point sequence with the minimum total cost by defining a cost function according to the time and space stages. This sequence is the local obstacle avoidance trajectory, which is used to avoid the electronic fence boundary within the current local area.

[0064] In step S150, the tracking control quantity is determined based on the normal distance and the path curvature. The normal distance can be the vertical distance from the current actual position of the UAV to the reference line; the path curvature is the curvature value of the current tracking point on the reference line; the tracking control quantity is the actuator command output by the UAV flight control system, used to adjust the attitude and speed of the UAV so that the UAV returns to the reference line and follows its turn.

[0065] In step S160, the UAV state is updated and a trajectory tracking closed loop is formed to enable the UAV to autonomously navigate to the target endpoint. The trajectory tracking closed loop compares the updated actual state with the target state along the reference line, such as the target position, target speed, and target heading. After calculating the deviation, a new control variable is generated. Through continuous closed-loop iteration, the UAV is ensured to fly along the reference line and eventually autonomously reach the target endpoint. After reaching the target endpoint, the closed-loop control generates control variables such as deceleration, level flight, and landing to enable the fixed-wing aircraft to plan a landing trajectory based on the endpoint site conditions, thus completing the autonomous navigation closed loop.

[0066] According to the embodiments of this application, by using polygon approximation and improved ray diffraction to complete electronic fence detection and boundary feature extraction, the boundary recognition error can be reduced and the detection accuracy can be improved. At the same time, by extracting features such as the minimum boundary distance and the nearest boundary line segment, these features can be directly used as hard constraints for the planning module, avoiding excessive detours and no-fly zone intrusions, and realizing the collaborative optimization of detection and planning. Redundant points are removed, linear interpolation is densified, and windows are smoothed for the global path, outputting a smooth global path trajectory. The use of a fusion multi-objective cost function ensures that local trajectories with low curvature change rate can be selected, which can match the turning capability of the UAV and prevent attitude jitter. Adaptive L1 control adjusts the pre-aiming point distance based on normal distance and path curvature, which can improve the path tracking accuracy of fixed-wing UAVs and limit the control range of normal acceleration and roll angle. Compared with fixed pre-aiming parameters, it can improve trajectory tracking accuracy and control overshoot problem. The detected boundary distance, boundary curvature, and other information can be transformed into hard constraints that the planning module can directly use, which prevents the planning module from dynamically adjusting trajectory parameters based on real-time boundary information.

[0067] Based on the aforementioned embodiments, step S120, which involves detecting the electronic fence and extracting boundary features, includes: using polygon approximation and an improved ray method to complete the electronic fence detection and boundary feature extraction, wherein: the no-fly zone electronic fence is uniformly converted into a set of polygon vertices; a horizontal ray is emitted from the drone's position to the right, and the positional relationship is determined by counting the intersections with the polygon boundary line segments; when the total number of intersections is odd, the point is determined to be inside the electronic fence, and when the total number of intersections is even, the point is determined to be outside the electronic fence;

[0068] Based on all boundary line segments of the polygon, determine the distance from the drone's position to each line segment and take the minimum value. Assign positive and negative distance values ​​inside and outside the electronic fence based on the intersection points, and determine the line segment corresponding to the minimum distance.

[0069] Traditional electronic fence detection uses simplified circular or rectangular models, resulting in boundary recognition errors down to the meter level. This application, however, improves boundary positioning accuracy to the millimeter level through precise polygon vertex transformation and an improved ray casting method. Existing path planning directly uses polyline paths as reference lines, leading to attitude oscillations when the UAV turns. This application's path densification and smoothing technology ensures the reference line curvature is continuously differentiable, perfectly adapting to the kinematic characteristics of fixed-wing UAVs. Traditional control modules use fixed pre-aiming distances to track trajectories, failing to balance response speed and tracking accuracy on straight and turning sections. This application's adaptive adjustment mechanism reduces tracking lag by 75% on straight sections and trajectory deviation by 60% on sharp turns.

[0070] From the drone's location Emit horizontal right-hand rays ( , Determine positional relationships by counting intersection points:

[0071] For polygon boundary line segments ( , If the line segment and the ray do not intersect ( , Both are greater than or less than If the endpoint is on the ray, then it is not counted; or (Left endpoint only) If the line segment crosses the ray ( ), then count once; or ), calculate the coordinates of the intersection point: ,like If the line segment is collinear with the ray, then count once; If the total number of intersections is odd, the point is determined to be inside the electronic fence; if the total number of intersections is even, the point is determined to be outside the electronic fence.

[0072] This application improves the accuracy of no-fly zone boundary recognition by two orders of magnitude, providing reliable spatial constraint data for path planning. The generated global reference line has a continuous and smooth curvature, completely eliminating the sharp turning points of traditional polygonal paths and reducing attitude angle fluctuations during UAV turning by more than 80%. Dynamic local planning, combined with multi-objective optimization and candidate point selection mechanisms, reduces the trajectory curvature change rate by 65% ​​while ensuring obstacle avoidance safety. The adaptive tracking control module adjusts the pre-aiming distance according to real-time path characteristics, improving straight-line tracking response speed by 40% and sharp-turn control accuracy by 55%, ultimately achieving safe and stable flight of fixed-wing UAVs in complex electronic fence environments.

[0073] Calculate the minimum distance between a point and the boundary: Calculate this by traversing all boundary segments of the polygon. The distance to each line segment is calculated, and the minimum value is taken. The distance calculation is divided into three cases:

[0074] The point is in the region of the reverse extension line: ;

[0075] The point is in the region of the positive extension line: ;

[0076] Point in the vertical projection area: .

[0077] When the point is outside the electronic fence area (including the boundary), ,internal .Record The corresponding line segment This is used for subsequent local obstacle avoidance.

[0078] The polygon approximation method transforms no-fly zones of different shapes into a set of polygons composed of vertex coordinates. This can be achieved by generating vertex sequences through parsing the geometric parameters of circular, semi-circular, or rectangular no-fly zones. This feature provides a unified data interface for subsequent boundary feature calculations through standardized geometric representation. The improved ray casting method involves emitting a horizontal ray to the right from the UAV's current position and determining the positional relationship by calculating the number of intersections with the polygon boundary. This is achieved using endpoint coincidence determination rules and collinearity handling mechanisms. This feature eliminates the misjudgment problem of the traditional ray casting method in scenarios with collinear boundaries, improving the stability of positional relationship determination. Distance classification calculation can be performed based on the relative spatial relationship between the UAV's position and the polygon boundary, using three calculation modes: backward extension distance, forward extension distance, and vertical projection distance. This is achieved through vector cross product and normalization processing. This feature ensures the accuracy of the minimum distance value by accurately distinguishing the distance calculation methods of different regions.

[0079] This application achieves high-precision identification of no-fly zone boundaries and effective conversion of distance constraints. Through the synergistic effect of polygon vertex sets and improved ray casting, the boundary identification error is reduced to the centimeter level, avoiding the risk of misjudgment caused by model simplification. The signed minimum distance value output by the distance classification calculation mechanism provides constraint parameters with both direction and magnitude for local obstacle avoidance trajectory planning, enabling the planning module to dynamically adjust trajectory curvature and safety margin. The establishment of collinearity handling rules effectively solves the misjudgment problem of traditional ray casting in scenarios with parallel boundaries, improving the reliability of positional relationship judgment.

[0080] Based on the aforementioned embodiments, step S120 involves uniformly converting the no-fly zone electronic fence into a polygon vertex set, including at least one of the following combinations;

[0081] Based on a circular no-fly zone, vertices are generated at fixed arc length intervals, and the point set is... , The angle corresponding to the arc length; wherein, the fixed arc length interval for generating vertices can be based on the circumference of the circular no-fly zone and a fixed ground distance to generate vertices. Specifically, it can be achieved using an arc length parameterization equation. By controlling the uniform distribution of the actual spacing between adjacent vertices, the difference in vertex density in the curvature variation area can be avoided.

[0082] Based on a semi-circular no-fly zone, multiple arc vertices of equal arc length plus diameter endpoints are set to form a closed polygon point set. The arc vertices of equal arc length plus diameter endpoints can be generated by dividing the semi-circular no-fly zone into arc parts with equal arc lengths and adding endpoints at both ends of the diameter. Specifically, this can be achieved using geometric construction methods to ensure the integrity of the closed polygon.

[0083] Based on the rectangular no-fly zone, select four vertices. , , , This forms a polygon point set. The four vertices forming the polygon point set can be achieved by directly selecting the four corner points of the rectangular no-fly zone as vertices, specifically using coordinate extraction methods while preserving the original rectangular boundary features.

[0084] Among them, various types of electronic fences, such as circles, semicircles, and rectangles, are uniformly converted into a set of polygon vertices.

[0085] For a circle (center is) , radius is No-fly zone, in accordance with Generate 60 vertices at intervals, with the following coordinates: To ensure the polygon approximates a circular electronic fence, the polygon point set of the circular region is formed by the coordinates of the points mentioned above. Vertices are generated at fixed arc length intervals, for example, every [missing information]. A vertex is generated by measuring meters, and its coordinates are calculated from the center and radius of the circle. This ensures that the straight-line distance between adjacent vertices projected onto the ground is equal, avoiding the excessively large vertex spacing that occurs with traditional equal-angle sampling when the radius is large.

[0086] For a semi-circular no-fly zone, multiple vertices are generated by dividing the arc segment into equal arc lengths. At the same time, endpoints are added at both ends of the diameter. Following the point selection method for a circular no-fly zone, 30 arc vertices of equal arc length plus the diameter endpoints are set to form a closed polygon point set.

[0087] For rectangular no-fly zones, simply select the four vertices of the rectangular border. , , , This forms a polygonal point set. For a rectangular no-fly zone, the coordinates of its four vertices (top left, bottom left, top right, and bottom right) are directly extracted. For example, by inputting the coordinates of the diagonal vertices, the four corner points are automatically generated, eliminating redundant vertices.

[0088] Traditional circular no-fly zone modeling uses an equal-angle sampling method. At the same angular interval, the ground distance between adjacent vertices of a larger radius circle is significantly greater than that of a smaller radius circle, leading to inconsistent boundary approximation accuracy. Generating vertices at fixed arc length intervals ensures that circles of different radii maintain the same vertex distribution with consistent ground spacing. Existing semi-circular modeling methods only use arc vertices without closing the endpoints, resulting in polygonal opening defects. Introducing the diameter endpoints creates a strictly closed structure. Traditional rectangular modeling uses dense interpolation points to approximate the boundary, while directly selecting corner points reduces the number of vertices while preserving geometric accuracy.

[0089] This application achieves high-precision unified modeling of no-fly zones of different shapes. The uniformity of vertex spacing in circular no-fly zones is improved by approximately 40%, the boundary closure integrity of semi-circular no-fly zones reaches 100%, and the number of vertices in rectangular no-fly zones is reduced by 75%. This modeling method provides precise geometric constraints for the path planning module, effectively avoiding path planning failures caused by boundary approximation errors.

[0090] In step S120, determining the global path and obtaining a traceable reference line through smoothing includes: generating a global path based on a grid map and Dijkstra's algorithm, and obtaining a reference line through smoothing; wherein, the physical space is divided according to a set grid size, the no-fly zone grid is marked as impassable, the cost of the remaining grids is the reciprocal of the minimum distance of the boundary, and expansion is carried out in 8 directions, with the costs of straight-line and diagonal movement being the grid size and [other costs not specified in the original text]. Double the grid size; determine the drone's origin and destination, expand nodes in ascending order of cumulative cost through a priority queue to determine the initial path; encrypt the initial path, and apply sliding window processing to the encrypted path.

[0091] like Figure 2 As shown, based on the aforementioned embodiments, S120 may include steps S210 to S230.

[0092] In step S210, the physical space According to the set grid size The area is divided into no-fly zones, and the grid is marked as impassable (at a cost of...). The cost of the remaining grid cells is... The direction is expanded in 8 directions, and the cost of moving in a straight line is... The cost of the diagonal is .

[0093] The grid size can be achieved by dividing the physical space into uniform square units, specifically using 10 meters as the dividing benchmark. Adjusting the grid size can balance path accuracy and computational efficiency. The reciprocal of the minimum boundary distance serves as the grid cost. This can be achieved by calculating the shortest distance from the UAV's current position to the no-fly zone boundary in real time and taking its reciprocal, ensuring the path automatically avoids the no-fly zone boundary during generation. Eight-directional expansion allows movement in the up, down, left, right, and four diagonal directions of adjacent grids during path search. This can be achieved by setting movement direction vectors and corresponding cost weights, conforming to the turning constraints of actual UAV movement. The pruning strategy eliminates redundant points in the path, specifically using a three-point collinearity judgment method. When the cosine of the angle formed by three consecutive path points exceeds 0.99, they are considered collinear, and the intermediate point is deleted. The sliding window processing performs local path smoothing, specifically using a mean filter with a window length of 5 path points, eliminating high-frequency jitter while preserving the overall path trend.

[0094] In step S220, the origin and destination of the UAV are determined. An initial path is determined by expanding nodes in ascending order of cumulative cost using a priority queue. Dijkstra's algorithm is used for path search. The origin S and destination E of the UAV are set, and an initial polyline path is generated by expanding nodes in ascending order of cumulative cost using a priority queue. Furthermore, a pruning strategy (discarding nodes whose cumulative cost exceeds 1.5 times that of the current optimal solution) is used to improve path search efficiency.

[0095] In the path generation phase, no-fly zones are first converted into impassable areas. The passage cost of non-no-fly zone grids is inversely proportional to the shortest distance to the no-fly zone boundary, ensuring that the generated path automatically selects the optimal route away from the boundary within the safe area. When using Dijkstra's algorithm for global path search, 8-directional expansion and differentiated movement cost design ensure that the path conforms to the UAV's kinematic constraints. After the initial path is generated, redundant nodes are eliminated by three-point collinearity judgment to reduce unnecessary turning operations. Subsequently, the path is densified by linear interpolation, for example, by inserting intermediate points between adjacent path points, increasing the path point density to three times that of the original path and enhancing path continuity. Finally, a sliding window is used to locally smooth the densified path, for example, by calculating a weighted average coordinate using five consecutive points as a group, eliminating the jagged fluctuations caused by grid discretization and generating a reference line with continuous curvature.

[0096] In step S230, the initial path is encrypted, and a sliding window process is applied to the encrypted path for three consecutive path points. , , If the cosine of the included angle is greater than 0.98, the cells are considered collinear and are discarded. The initial path is encrypted using linear interpolation, and a 5-point sliding window is applied to the encrypted path to smooth out local jitter and achieve path smoothing.

[0097] This application transforms discrete polylines into continuous curves through a combination of path densification and sliding window smoothing, limiting the rate of change of the reference line curvature to within the maneuverability range of a fixed-wing UAV. Existing path smoothing methods often employ global optimization algorithms, resulting in high computational complexity and difficulty in real-time updates. This application utilizes local sliding window processing, significantly reducing the computational load while maintaining path smoothness. It effectively solves the UAV attitude jitter problem caused by global path polyline transformation, generating a reference line with continuous curvature that conforms to the turning capability limitations of a fixed-wing UAV, enabling the tracking control module to smoothly guide the UAV along the reference line. Path densification enhances the density of path points, avoiding tracking lag caused by sparse path points; sliding window smoothing suppresses high-frequency fluctuations in the local path, preventing drastic changes in control commands. The final reference line retains the obstacle avoidance characteristics of the global path while possessing good trackability, ensuring stable flight of the UAV in complex electronic fence environments.

[0098] Based on the defined spatial scope of the dynamic local planning, the effective candidate points are determined and screened as follows: based on the UAV's flight speed, a certain distance is extended forward along the heading angle and divided into multiple stages, with the distance of each stage being related to the speed; candidate points are determined within the range perpendicular to the heading direction, and the coordinates of the candidate points are the stage center point plus the normal offset, removing points located within the electronic fence, too close to the boundary, or with an excessively large rate of change of the angle between the line connecting to the effective point of the previous stage.

[0099] Based on the drone's flight speed Along the drone's heading angle Extend forward Meters, divided into 25 stages, each stage being a distance of... Meters; based on the direction perpendicular to the heading Within a range of meters, 35 candidate points are determined for each longitudinal stage. The coordinates of the candidate points are the stage center point plus the normal offset. Points located within the electronic fence, less than 1 meter from the boundary, or with an angle change rate greater than 0.5 radians from the line connecting to the effective point of the previous stage are removed.

[0100] The longitudinal range is based on an unmanned aerial vehicle (UAV) flight speed of 10 m / s as an example, along the UAV's heading angle. Extend forward 250 meters and divide the path into 25 stages, each stage being [distance missing]. Meters; the lateral range is that which can be determined according to the direction perpendicular to the heading. Within a range of meters, 35 candidate points are generated in each longitudinal stage;

[0101] The spatial scope of dynamic local planning can be a forward extension distance dynamically adjusted according to real-time flight speed, for example, 25 times the speed value, divided into 25 stages. This design ensures sufficient look-ahead distance during high-speed flight by using speed-correlated extension lengths, avoiding planning lag. The candidate point normal offset generation mechanism ensures effective coverage of the lateral obstacle avoidance space by setting an offset range in the vertical direction of the heading, such as ±5 meters. The angular change rate screening condition ensures that the candidate point set meets the turning angular velocity limits of fixed-wing UAVs by limiting the directional abrupt change of the line connecting adjacent stage points, for example, not exceeding 0.5 radians.

[0102] The implementation process begins by calculating the total forward extension length based on the current flight speed; for example, an extension of 250 meters at a speed of 10 meters per second. The space is then divided into multiple equidistant stages, each with a length linearly related to the speed, for example, with each stage spaced 10 meters apart. Within each stage, candidate points are generated laterally along a direction perpendicular to the flight path, for example, 35 points are evenly generated within a ±5-meter range. Candidate points located within or near the no-fly zone boundary are excluded through geometric calculations; for example, points less than 1 meter from the boundary are discarded. Furthermore, the rate of change of direction of the line connecting a candidate point to a valid point in the previous stage is calculated, for example, using the ratio of the difference in the flight angle between two adjacent points to the distance, to filter candidate points exceeding the maximum permissible curvature. The resulting set of candidate points ensures both the feasibility of the obstacle avoidance path and satisfies the kinematic constraints of the UAV.

[0103] The coordinate system transformation relationship is: the tangential unit vector is The normal unit vector is .

[0104] The coordinates of a candidate point can be represented as: the j-th candidate point in the i-th stage. ,in , .

[0105] Remove points within the electronic fence and points less than 1 meter from the boundary, and remove points whose angle change rate with the line connecting to the valid points in the previous stage is greater than 0.5 radians. The candidate points are then selected using the above filtering rules.

[0106] Existing screening mechanisms often use obstacle distance as a single criterion, failing to incorporate the UAV's turning ability into the screening criteria, which easily leads to trajectories with abrupt curvature changes. This application achieves a match between the candidate point distribution and the UAV's dynamic characteristics through a dual screening method of velocity-adaptive spatial partitioning and angle change rate.

[0107] This application effectively solves the problem of sudden changes in curvature of local obstacle avoidance trajectories exceeding controllability. By dynamically adjusting the candidate point generation range, it ensures obstacle avoidance foresight at different speeds; through an angle change rate screening mechanism, it eliminates candidate points that do not conform to the turning characteristics of UAVs; and the final generated local trajectory curvature is continuous and smooth, significantly improving the stability and safety of trajectory tracking.

[0108] Solving the local obstacle avoidance trajectory through dynamic programming includes: determining the target cost function, where the total cost is the sum of obstacle cost, reference line deviation cost, curvature cost, and heading consistency cost; and using trajectory backtracking to select the point with the minimum cost in the final stage and backtracking to select the trajectory with the minimum curvature standard deviation for output, updating once per second.

[0109] The objective cost function can be a composite evaluation system integrating four indicators: obstacle distance, reference line deviation, trajectory curvature, and heading consistency. Specifically, it can be implemented using a weighted summation method. The obstacle cost is determined by calculating the distance between the candidate point and the electronic fence boundary; the reference line deviation cost is calculated by the lateral offset of the candidate point from the global reference line; the curvature cost is obtained by accumulating the absolute values ​​of the curvature of the trajectory segments formed by connecting adjacent candidate points; and the heading consistency cost is calculated by the angular difference between the current heading and the reference line direction. This composite cost function can evaluate candidate trajectories from multiple dimensions, including safety, trackability, and dynamic constraints.

[0110] The objective cost function is determined, and the total cost is... Of which, the total cost Cost of obstacles Reference line deviation cost Curvature cost Cost of alignment with heading The sum of; among which, The cost of the obstacle is calculated using the following formula: ,in This represents the minimum distance from the candidate point to the boundary. The cost of the reference line deviation is calculated using the following formula: ,in Points on the global reference line; The curvature cost is calculated using the following formula: ,in The angle between the directions of the connecting lines. The length of the line segment; The cost of course consistency is calculated using the following formula: ,in The angle between the line and the heading angle.

[0111] In the final stage, the point with the minimum cost is selected by trajectory backtracking, and the trajectory with the smallest standard deviation of curvature is output, updated once per second. The state transition equation of DP is: By using trajectory backtracking, three points with minimum cost are selected in the final stage. This process is then reversed back to the first stage, and the trajectory with the smallest standard deviation of curvature is output, with updates performed every second. The trajectory backtracking mechanism can be implemented during the dynamic programming solution process, starting from the last planning stage and tracing back to the minimum cost path of candidate points in each stage. Specifically, a linked list structure can be used to store the optimal predecessor node of each candidate point, and the entire trajectory is constructed by recursively accessing the predecessor node. This mechanism ensures that the optimal obstacle avoidance path is selected globally.

[0112] In the dynamic programming solution process, after generating a set of candidate points in each planning stage, the connection cost between each candidate point and all valid points in the previous stage is calculated, and the path with the minimum cumulative cost is recorded. After the cost calculation for all stages is completed, the candidate point with the minimum cumulative cost is selected as the endpoint from the final stage, and its predecessor node is traced backward to form a complete trajectory. Among multiple trajectories with similar cumulative costs, the standard deviation of curvature for each trajectory is further calculated, and the trajectory with the smoothest curvature change is selected as the final output. This selection criterion can effectively suppress abrupt changes in trajectory curvature, ensuring that the generated local obstacle avoidance trajectory meets the minimum turning radius constraint of the fixed-wing UAV. The update frequency setting of once per second can balance the real-time obstacle avoidance requirements and computational resource consumption, avoiding processor overload caused by high-frequency updates. This application introduces a curvature standard deviation selection mechanism, which prioritizes the path with the smoothest curvature change among multiple candidate trajectories, effectively solving the problem of abrupt changes in trajectory curvature.

[0113] This application can generate smooth obstacle avoidance trajectories that conform to the dynamic characteristics of fixed-wing UAVs, avoiding control instability caused by sharp turns. The design of the composite cost function enables the planned trajectory to achieve an optimal balance between obstacle avoidance safety and flight stability. The trajectory backtracking mechanism combined with the curvature screening criterion significantly reduces the abrupt change in trajectory curvature, and the heading consistency constraint reduces the frequency of UAV attitude adjustment, thereby reducing the response pressure on the tracking control module, and ultimately achieving synergistic optimization of safe obstacle avoidance and accurate tracking.

[0114] The step of determining the tracking control quantity based on the normal distance and path curvature includes: implementing adaptive L1 control based on the normal distance and path curvature, and calculating the tracking control quantity; the adaptive L1 control adjusts the pre-aiming point distance based on the normal distance and path curvature.

[0115] like Figure 3 As shown, based on the aforementioned embodiments, the fixed-wing UAV electronic fence avoidance method may include steps S310 to S320.

[0116] In step S310, adaptive L1 control is implemented based on the normal distance and path curvature, and the tracking control quantity is calculated. The normal distance can be the vertical distance from the UAV's current position to the reference path, specifically calculated as the absolute value of the dot product of the position deviation vector and the unit normal vector of the reference line projection point, used to quantify the degree of lateral deviation of the UAV from the reference path. The path curvature can be the degree of bending of the reference path, specifically obtained by truncating a fixed arc-length path segment and multiplying it by a coefficient based on the ratio of the difference between the curve length and the straight-line distance to the curve length, used to characterize the trajectory's turning requirements.

[0117] In step S320, adaptive L1 control adjusts the aiming point distance based on the normal distance and path curvature. Adaptive L1 control can be a control method that dynamically adjusts the aiming distance based on real-time calculated normal distance and path curvature. Specifically, it can be implemented by setting a maximum aiming distance threshold and combining it with curvature judgment logic to match tracking requirements under different trajectory shapes. The aiming point distance can be a lead parameter used in the control system to predict the target being tracked. Specifically, it can be dynamically adjusted through the joint mapping relationship between normal distance and curvature to balance the stability of straight-line tracking and the sensitivity of turning tracking.

[0118] By calculating the normal distance from the UAV's current position to the reference path in real time, it is determined whether the distance exceeds a safe threshold. When the normal distance exceeds the threshold, the maximum pre-aiming distance is used to enhance tracking stability. When the normal distance is within the safe range, the pre-aiming distance is further adjusted based on the path curvature. In cases of high path curvature, the pre-aiming distance is shortened to improve the response speed of turning tracking; in cases of low path curvature, the pre-aiming distance is extended to reduce the oscillation amplitude of straight-line tracking. This geometrically based dual-parameter collaborative adjustment mechanism allows the control parameters to adapt to the tracking requirements of different path segments, thereby solving the tracking lag or turning difficulties caused by fixed-parameter control.

[0119] This application introduces a joint control mechanism of normal distance and path curvature to achieve dynamic optimization of the aiming distance, enabling control parameters to automatically match the geometric characteristics of the trajectory, thereby maintaining high-precision tracking in both straight and curved paths. It effectively solves the problem of decreased tracking performance caused by mismatch between the planned trajectory and control parameters, achieving stable tracking of fixed-wing UAVs on straight paths and precise turning on curved paths, thus improving the reliability and adaptability of autonomous navigation in complex electronic fence environments.

[0120] The adaptive L1 control based on normal distance and path curvature calculates the tracking control quantity by: determining the normal distance based on the absolute value of the dot product of the position deviation vector and the unit normal vector of the reference line projection point; and obtaining the path curvature by multiplying the ratio of the difference between the curve length and the straight-line distance to the curve length by a coefficient of 0.1 after truncating a fixed arc length path segment.

[0121] Normal distance ,in, This is the position deviation vector. This is the unit normal vector at the projection point of the reference line.

[0122] The path curvature is measured using a local curvature calculation method, taking the projection point of the UAV's current position on the reference path as the starting point, and intercepting a fixed arc length along the direction of travel of the reference line. Given a path segment of 10 meters, find the starting point A and ending point B of this curved path, and calculate the curve length of the reference line. Simultaneously calculate the straight-line distance from the starting point to the ending point. The formula for calculating local curvature is defined as follows: .

[0123] During trajectory tracking, real-time calculation of the normal distance reflects the degree of lateral error of the UAV deviating from the reference line. When the error is large, the pre-aiming distance adjustment mechanism is triggered. Path curvature is calculated by extracting a fixed arc-length path segment, such as a 10-meter segment, calculating the ratio of the difference between the actual length of the curve and the straight-line distance at both ends, and multiplying this ratio by a coefficient of 0.1 to convert it into a curvature parameter. When a high-curvature path segment is detected, such as a curve with a turning radius of less than 50 meters, the system automatically shortens the pre-aiming distance to enhance trajectory following accuracy. In low-curvature or straight path segments, such as gentle curves with a turning radius greater than 200 meters or during straight flight phases, the pre-aiming distance is increased to improve tracking stability.

[0124] This application establishes a dual-parameter adjustment mechanism for normal distance and path curvature. For example, it uses a 20-meter pre-aiming distance on straight sections and switches to an 8-meter pre-aiming distance on sharp turns, achieving dynamic matching between control parameters and path characteristics. This effectively solves the response lag problem of fixed pre-aiming distance control methods during straight-line tracking and the trajectory deviation problem caused by turning sections. Through the synergistic effect of normal distance and path curvature, the UAV maintains smooth tracking during straight-line flight and achieves precise trajectory following during sharp turns, improving control accuracy and flight stability under complex paths.

[0125] This application further proposes a technical solution for adjusting the aiming point distance based on the normal distance and path curvature during adaptive L1 control. Specifically, it includes: using the maximum aiming distance when the normal distance is greater than a set threshold; and dynamically adjusting the aiming distance according to the level of path curvature when the normal distance is less than or equal to the set threshold.

[0126] The normal distance can be the vertical distance between the current position of the UAV and the projection point of the reference line. Specifically, it can be calculated by the absolute value of the dot product of the position deviation vector and the unit normal vector of the reference line projection point. This parameter is used to quantify the degree to which the UAV deviates from the reference line.

[0127] The path curvature can be the degree of curvature of the reference line trajectory. Specifically, it can be achieved by taking a fixed arc length path segment, calculating the ratio of the difference between the curve length and the straight line distance to the curve length, and multiplying it by a preset coefficient. This parameter is used to characterize the turning requirements of the trajectory.

[0128] The aiming distance can be the forward-looking distance used in the control algorithm to predict trajectory tracking. Specifically, it can be achieved by dynamically adjusting the parameter range. This parameter directly affects the UAV's response speed to path changes and tracking stability.

[0129] When the normal distance exceeds a set threshold, the system automatically switches to the maximum pre-aiming distance mode. In this mode, the UAV tracks the path with a larger forward-looking distance, avoiding drastic control maneuvers due to excessive deviation. When the normal distance is within a safe range, the system makes a secondary judgment based on the real-time calculated path curvature: for high-curvature path segments, the pre-aiming distance is shortened to improve steering response accuracy; for low-curvature path segments, the pre-aiming distance is extended to enhance trajectory tracking smoothness. This hierarchical adjustment mechanism is implemented through real-time calculations by the embedded system, updating the pre-aiming distance parameters every 0.1 seconds.

[0130] Adaptive L1 control adjusts the aiming point distance based on normal distance and path curvature, including: determining the normal distance; when the normal distance is greater than 5, taking the set maximum aiming distance as the normal distance; when the normal distance is less than 5, judging the path curvature; if the path curvature is higher than the preset curvature, decreasing the aiming distance; if the path curvature is lower than the preset curvature, increasing the aiming distance.

[0131] when At that time, the maximum pre-aiming distance L1 is set to 30 meters; when When the path curvature is higher than the preset curvature, that is, when the path curvature is... For high curvature, reduce the aiming distance L1 to 15 meters; if the radial curvature is lower than the preset curvature, that is, the path curvature... For low curvature, the aiming distance L1 is increased to 25 meters.

[0132] The normal acceleration output controlled by L1 is ,in The deviation between the azimuth angle of the preview point and the current heading angle is converted into the roll angle control command for the fixed-wing UAV. ,in The local gravitational acceleration, normal acceleration, and roll angle can be limited based on the actual flight characteristics of the UAV.

[0133] In some specific implementations, the threshold can be set to 5 meters, and the maximum aiming distance can be set to 30 meters. The path curvature can be determined using a curvature threshold method; for example, a curvature value exceeding 0.05 is considered a high-curvature path. The aiming distance adjustment can be set as a linear function of the curvature value, for example, aiming distance = base value × (1 - curvature coefficient × curvature).

[0134] This application establishes a dynamic mapping relationship between pre-aiming distance and path curvature by introducing dual judgment conditions of normal distance and path curvature, overcoming the deficiency that a single parameter cannot adapt to the tracking needs of multiple scenarios. It effectively solves the trajectory tracking delay caused by insufficient pre-aiming distance during straight-line flight of fixed-wing UAVs, and the trajectory deviation caused by excessive pre-aiming distance during curved flight, achieving precise tracking control under complex paths. This scheme, through an online parameter dynamic adjustment mechanism, enables the UAV to adapt to flight paths with different curvature characteristics, significantly improving the stability of the autonomous navigation system.

[0135] The process of updating the drone status and forming a trajectory tracking closed loop to enable the drone to autonomously navigate to the target destination includes: determining in real time whether the drone has entered an electronic fence no-fly zone; updating the drone status and providing real-time feedback based on the drone's onboard navigation system to complete trajectory tracking until the drone reaches the target destination.

[0136] One method for real-time determination of whether a drone has entered an electronic fence no-fly zone is to continuously monitor the spatial relationship between the drone's position and the no-fly zone boundary. Specifically, an improved ray casting method combined with polygon vertex sets can be used to determine the positional relationship. When a drone is detected entering the no-fly zone, obstacle avoidance trajectory adjustments are immediately triggered. This eliminates the delay errors present in traditional detection methods and avoids the risk of path deviation due to misjudgment.

[0137] like Figure 4 As shown, a fixed-wing UAV electronic fence avoidance method may include at least the following steps: inputting environmental parameters, including a starting point and an ending point, taking the fixed-wing UAV autonomously flying from the starting point to the ending point in an area containing an electronic fence as an example. The steps include: detecting the electronic fence and extracting boundary features; generating a global path and smoothing it; defining the spatial range of dynamic local programming and screening valid candidate points; solving the local obstacle avoidance trajectory using dynamic programming; detecting the electronic fence and extracting boundary features; calculating adaptive L1 control variables; updating the UAV state and forming a trajectory tracking closed loop to enable the UAV to autonomously navigate to the target ending point.

[0138] The real-time navigation information output by the UAV's onboard navigation system can be obtained by using multi-source sensor data fusion technology to acquire accurate flight state parameters. Specifically, data fusion of GPS and inertial measurement unit can be used to achieve real-time updates of position, velocity, and attitude angles. This process provides dynamic input to the control module, enabling trajectory generation to be iteratively optimized based on the latest state.

[0139] In the trajectory tracking closed loop, the real-time position information output by the navigation system is input to the electronic fence detection module, which calculates the distance relationship between the UAV and the no-fly zone boundary to determine whether obstacle avoidance is triggered. When a safe flight state is detected, the control module continuously tracks the global path; when a risk of no-fly zone intrusion is detected, the local planning module immediately generates an obstacle avoidance trajectory. The flight state update frequency is synchronized with the trajectory planning cycle, ensuring that the control parameters can dynamically adjust the pre-aiming distance based on the real-time heading angle and speed. For example, a larger pre-aiming distance is used during the straight flight phase to reduce tracking lag, and the pre-aiming distance is automatically shortened during the turning phase to improve trajectory following accuracy. By cyclically executing state updates, trajectory adjustments, and control quantity calculations, a complete closed loop from perception to execution is formed until the UAV reaches the target endpoint.

[0140] By continuously monitoring the UAV's position and boundary relationships, obstacle avoidance responses can be triggered within milliseconds, preventing path deviations caused by detection delays. This solves the problem of tracking lag or turning difficulties caused by poor matching of planning and control parameters, enabling precise autonomous navigation of the UAV in complex no-fly zones. Real-time status updates and closed-loop control mechanisms ensure that the flight trajectory always adapts to the dynamic environment, avoiding control failures caused by fixed parameters; continuous judgment of no-fly zone intrusions effectively prevents accidental entry into risky areas, ensuring flight safety; real-time coordination between navigation information and the control module improves path tracking accuracy, ultimately ensuring that the UAV accurately reaches its target destination.

[0141] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.

Claims

1. A fixed-wing drone electronic fence avoidance method, characterized in that, include: Detect electronic fences and extract boundary features; Determine the global path and obtain a traceable reference line through smoothing processing; Based on defining the spatial scope of the dynamic local planning, valid candidate points are identified and screened. The local obstacle avoidance trajectory within the spatial range of the dynamic local programming is solved by dynamic programming algorithm, wherein the target cost function is determined, and the total cost of the target cost function is the sum of obstacle cost, reference line deviation cost, curvature cost and heading consistency cost; The tracking control quantity is determined based on the normal distance and the path curvature, wherein the normal distance is the vertical distance from the current actual position of the UAV to the reference line; Update the drone's status and form a trajectory tracking closed loop to enable the drone to autonomously navigate to the target destination.

2. The method of claim 1, wherein, The process of detecting electronic fences and extracting boundary features includes: The detection and boundary feature extraction of electronic fences are accomplished using polygon approximation and an improved ray method. Convert electronic fences into a unified set of polygon vertices; A horizontal ray is emitted from the drone's location to the right. The positional relationship is determined by counting the intersections with the polygon boundary line segments. When the total number of intersections is odd, the point is determined to be inside the electronic fence. When the total number of intersections is even, the point is determined to be outside the electronic fence. Based on all boundary line segments of the polygon, determine the distance from the drone's position to each line segment and take the minimum value. Assign positive and negative values ​​to the distances inside and outside the electronic fence based on the intersection points, and determine the line segment corresponding to the minimum distance.

3. The fixed-wing UAV electronic fence avoidance method according to claim 2, characterized in that, Converting electronic fences into a unified set of polygon vertices includes at least one of the following combinations; Based on the fact that the electronic fence is a circular no-fly zone, within which... The center of the circular no-fly zone Given a radius, vertices are generated at fixed arc length intervals, and the point set is... , The angle corresponding to the arc length; Based on the fact that the electronic fence is a semi-circular no-fly zone, multiple arc vertices of equal arc length plus diameter endpoints are set to form a closed polygon point set; Based on the fact that the electronic fence is a rectangular no-fly zone, four vertices are selected. , , , To form a polygon point set.

4. The fixed-wing UAV electronic fence avoidance method according to claim 1, characterized in that, The process of determining the global path and obtaining a traceable reference line through smoothing includes: A reference line is obtained by generating a global path based on a grid map and Dijkstra's algorithm, followed by smoothing. The physical space is divided into grids of a set size. No-fly zones are marked as impassable. The cost of other grids is the reciprocal of the minimum distance from the drone's current position to the no-fly zone boundary. Expansion is performed in eight directions, with straight-line and diagonal movement costs being the grid cost and [other costs, not specified in the original text]. Double grid cost; Determine the path from the drone's starting point to its destination, and expand the nodes in ascending order of cumulative cost using a priority queue to determine the initial path; The initial path is encrypted, and the encrypted path is then processed using a sliding window.

5. The fixed-wing UAV electronic fence avoidance method according to claim 1, characterized in that, The process of determining and screening valid candidate points based on the defined spatial scope of the dynamic local programming includes: Based on the drone's flight speed Extend forward along the direction of the drone's flight path Meters, divided into 25 stages, each stage being a distance of... rice; According to the direction perpendicular to the heading Within a range of meters, 35 candidate points are determined for each stage. The coordinates of the candidate points are the stage center point plus the normal offset perpendicular to the heading direction. Points located within the electronic fence, less than 1 meter from the boundary, or with an angle change rate greater than 0.5 radians from the line connecting to the effective point of the stage are removed.

6. The fixed-wing UAV electronic fence avoidance method according to claim 1, characterized in that, Solving local obstacle avoidance trajectories using dynamic programming algorithms also includes: The dynamic local programming is divided into multiple stages. By backtracking the trajectory, the point with the minimum cost is selected in the last stage of each stage and the trajectory with the minimum standard deviation of curvature is selected and output. The process is updated once per second.

7. The fixed-wing UAV electronic fence avoidance method according to claim 1, characterized in that, The determination of the tracking control quantity based on the normal distance and path curvature includes: Adaptive L1 control is implemented based on normal distance and path curvature, and the tracking control quantity is calculated; the adaptive L1 control adjusts the aiming point distance based on normal distance and path curvature.

8. The fixed-wing UAV electronic fence avoidance method according to claim 7, characterized in that, The adaptive L1 control based on normal distance and path curvature includes calculating the tracking control quantity as follows: The normal distance is determined by the absolute value of the dot product of the position deviation vector and the unit normal vector of the reference line projection point; The path curvature is obtained by multiplying a fixed arc length path segment by a coefficient based on the ratio of the difference between the curve length and the straight-line distance to the curve length.

9. The fixed-wing UAV electronic fence avoidance method according to claim 7, characterized in that, The adaptive L1 control adjusts the aiming point distance based on normal distance and path curvature, including: Determine the normal distance; when the normal distance is greater than 5, take the set aiming distance as the normal distance. When the normal distance is less than 5, the path curvature is determined. If the path curvature is higher than the preset curvature threshold, the aiming distance is reduced; if the path curvature is lower than the preset curvature threshold, the aiming distance is increased.

10. The fixed-wing UAV electronic fence avoidance method according to claim 1, characterized in that, The process of updating the drone's status and forming a trajectory tracking closed loop to enable the drone to autonomously navigate to its target destination includes: Real-time detection of whether drones have entered the electronic fence; The system outputs the drone's current navigation information in real time through the drone's onboard navigation system, updates the drone's status, and provides real-time feedback to complete trajectory tracking until the drone reaches its target destination.