An unmanned aerial vehicle gridized patrol route automatic generation method
By converting irregular regions into convex hull polygons and fitting rectangles, a zigzag flight path is generated based on endurance constraints, solving the endurance and coverage problems of UAVs in irregular regions and achieving efficient flight path planning.
Patent Information
- Application Number
- CN202611299187.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2046-08-26
AI Technical Summary
Existing technologies struggle to generate drone patrol routes in irregular areas, leading to battery life issues and coverage blind spots. Traditional methods struggle to balance full coverage with battery life requirements.
By converting irregular regions into convex hull polygons, fitting the minimum bounding rectangle, and performing longitudinal segmentation based on UAV endurance constraints, a zigzag flight path is generated, redundant inflection points are eliminated, and the flight path length is ensured to be within the endurance range.
The generated flight routes ensure full coverage and avoid unnecessary flights, significantly shorten the total flight distance, enhance the robustness of the system, and prevent mission unavailability due to unreasonable nest location.
Smart Images

Figure CN122858487B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of unmanned aerial vehicle (UAV) route planning technology, and specifically relates to a method for automatically generating gridded patrol routes for UAVs. Background Technology
[0002] In recent years, with the booming development of the low-altitude economy and the in-depth advancement of smart policing, drones, with their advantages of maneuverability and wide field of view, have gradually transformed from a single tactical auxiliary tool into a core node in the normalized security and prevention system. Especially in urban applications, the large-scale deployment of automated ground-based drone nests to build a grid-based patrol model of "nest + drone" has become a key path to achieve full-area perception and all-weather response in urban airspace.
[0003] However, existing technologies still face significant challenges in practical applications. Due to the inherent limitations of administrative boundaries and geographical environments, the actual patrol grids are often irregular areas of varying shapes. Traditional route planning methods, based on regular rectangles or preset waypoints, are difficult to adapt directly to such complex terrain. This leads to a fundamental contradiction between "full coverage" and "endurance": on the one hand, to ensure no blind spots in security, the route needs to cover the entire area as much as possible, but this often results in the flight range exceeding the drone's rated endurance limit; on the other hand, forcibly compressing the route length can easily create patrol blind spots, or cause ineffective flights and wasted power due to the route cutting through irregular boundaries. Summary of the Invention
[0004] The purpose of this invention is to overcome the defects in the existing technology and provide a method for automatically generating gridded patrol routes for unmanned aerial vehicles (UAVs).
[0005] This invention provides a method for automatically generating gridded patrol routes for unmanned aerial vehicles (UAVs), comprising the following steps: Step 1: Obtain the latitude and longitude coordinates of the drone nest and the vertex coordinates of the grid area to be patrolled, and transform all coordinates to a Cartesian coordinate system; Step 2: Perform convex hull transformation on the polygons of the patrol grid area to generate convex hull polygons; Step 3: Fit the minimum bounding rectangle to the convex hull polygon to determine the planning boundary of the patrol area; Step 4: Based on the UAV's endurance constraints, set the calibrated maximum patrol distance L of the UAV. Calculate the available range margin based on the distance between the nest location and the starting and ending waypoints in the convex hull polygon, and determine the number of longitudinal segments based on the range margin. ; Step 5: Based on the number of vertical segments The minimum bounding rectangle is evenly divided along the longitudinal direction into... A rectangular partition is formed, and a candidate waypoint set H is generated based on the intersection of each vertical dividing line and the convex hull polygon. Step 6: Remove redundant inflection points from the candidate waypoint set H, construct a zigzag diagonal route, and generate the final waypoint set D; Step 7: Convert all planar coordinates in the waypoint set D back to geographic latitude and longitude coordinates, and output the patrol route that the UAV can execute.
[0006] A further solution is to convert the coordinates in step 1 to: ; ; in, Latitude Longitude These are the latitude and longitude coordinates of the reference point, taken from the departure point of the flight route.
[0007] A further solution is that the convex hull transformation process in step 2 is as follows: Traverse all vertices of the patrol mesh polygon and select The point with the smallest coordinates is used as the base point. If there are multiple The point with the smallest coordinates is selected. The point with the smallest coordinates is used as the base point. ; Calculate the remaining points relative to the base point The polar angles are determined and sorted from smallest to largest. If the polar angles are the same, they are sorted according to their polar angle relative to the base point. Sort by distance from nearest to farthest; Initialize stack Given three points, iterate through the sorted points in sequence. , , , judge from arrive Then The turning process is as follows: ; when Pop the stack vertex, stack The remaining points are used as vertices of the convex hull, and the vertices of the convex hull form a new patrol area polygon.
[0008] A further solution is that, in step 3, the convex hull polygon has m vertices, and the coordinates of the four vertices of the minimum bounding rectangle are: ; ; ; ; width of the rectangle for: ; Height of the rectangle for: ; in, , , , Let these be the coordinates of the four vertices of the minimum bounding rectangle. This represents the vertices of the convex hull polygon.
[0009] A further embodiment is that, in step 4, the starting waypoint is located within the convex hull polygon. The vertex with the smallest coordinates, the termination waypoint is the vertex in the convex hull polygon. The vertex with the largest coordinates; Distance from the nacelle to the starting waypoint and the distance from the terminal waypoint to the nest Calculated using the Euclidean distance formula; The available range margin ,when At that time, the nest should be reselected or the patrol grid should be reassigned.
[0010] A further solution is that, in step 4, when At that time, we obtained: ; We can deduce that: ; in, Round down to the nearest integer.
[0011] A further solution is that, in step 5, the vertical dividing line... for: , ;
[0012] The process of generating the candidate waypoint set H is as follows: Calculate each vertical dividing line one by one The intersection points with each side of the convex hull polygon, if the two endpoints of the side lie on the longitudinal dividing line If they are on the same side, there is no intersection. If the edge is on the vertical dividing line If the condition is met, then both endpoints of that side are added to the candidate waypoint set H. If one endpoint of the edge lies on the vertical dividing line If the endpoint is above the set H, then add the endpoint to the candidate waypoint set H; If the two endpoints of the side are on the vertical dividing line On the opposite side, the intersection point is calculated using a linear interpolation formula and added to the candidate waypoint set H; Remove duplicates from the candidate waypoint set and sort them by... Coordinates are sorted in ascending order. If they are the same, sort them in ascending order by y.
[0013] A further proposed solution is that the process of generating the final waypoint set D in step 6 is as follows: Add the starting waypoint to the candidate waypoint set H and set it as the current waypoint; Initialize the final waypoint set D, add the starting waypoint to the final waypoint set D, and set it as the current waypoint; Candidate points are selected one by one from the candidate waypoint set H; If candidate points Coordinates and current waypoint If the coordinates are the same, discard the candidate point; If a candidate point and the current waypoint are both located on the same side of the horizontal median of the minimum bounding rectangle, then discard the candidate point. If a candidate point and the current waypoint are located on opposite sides of or on the center line of a rectangle, then the candidate point is retained. After traversing all candidate points, the termination waypoint is added to the final waypoint set D to obtain the UAV patrol route.
[0014] A further solution is that the process of inversely converting the planar coordinates back to geographic latitude and longitude coordinates in step 7 is as follows: ; .
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This invention uses the maximum cruising distance L of the UAV as a pre-constraint condition to derive the upper limit formula for the number of segments n. By performing reverse calculation and forcibly rounding down, it ensures from the source that the length of the generated route is necessarily less than the remaining range. This completely solves the pain point of traditional methods where the engine range is exceeded only after the route planning is completed, leading to mission failure.
[0016] (2) This invention abandons the practice of directly using the diagonal of a rectangle and proposes to find the intersection of the longitudinal bisector with the actual patrol convex polygon in real time. The waypoint is only retained when the intersection point is located on the opposite side of the current waypoint (alternating between the upper and lower halves); otherwise, it is discarded. This solves the problem that the diagonal of the rectangle is prone to flying out of the actual patrol area (the concave part), ensuring full coverage and avoiding ineffective detours, thus significantly shortening the total flight distance.
[0017] (3) The present invention introduces the actual distance from the nest to the start and end points of the grid in the limiting conditions. Calculate the dynamic margin And proposed when An anomaly detection mechanism is implemented (e.g., the nest is too far away and needs to be reassigned). The substantive impact of nest deployment location on patrol missions is considered, preventing mission unavailability due to unreasonable nest location and enhancing the system's robustness. Attached Figure Description
[0018] The following figures are for illustrative purposes only and are not intended to limit the scope of the invention, wherein: Figure 1 : Schematic diagram of converting patrol grid polygons into convex hull polygons; Figure 2 A schematic diagram showing how the patrol mesh after convex hull transformation is approximated as a minimum rectangle; Figure 3 : Schematic diagram of uniformly divided convex polygons in the patrol grid; Figure 4 : Schematic diagram of route generation; Figure 5 : Flowchart of the method of this invention. Detailed Implementation
[0019] To make the objectives, technical solutions, design methods, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.
[0020] like Figure 5 As shown, this invention provides a method for automatically generating gridded patrol routes for unmanned aerial vehicles (UAVs), aiming to solve technical problems such as traditional route planning easily exceeding endurance limits, blind spots in coverage, and deviations from boundaries in irregular patrol areas. The method includes the following steps: Step 1: Load the latitude and longitude of the UAV nest and the coordinates of the grid area to be patrolled. To facilitate fast 2D geometric calculations, convert all coordinates to a Cartesian coordinate system (XY). ; ; in, Latitude Longitude It is the latitude and longitude of the reference point, taken from the latitude and longitude of the aircraft nest (i.e., the take-off point of the flight path); , The units are degrees, x and y are meters, 111320 and 110574 are approximate conversion factors for meters per degree, and latitude is converted to radians when calculating cosine.
[0021] Step 2: The grid area is represented on the map as an irregular polygon, sometimes it may be a concave polygon, such as... Figure 1 As shown, to facilitate route planning, the grid area is subjected to convex hull transformation.
[0022] Let the patrol grid vertex array be defined. for: .
[0023] The steps for convex hull transformation are as follows: Step 2.1: Select the base point: Traverse all polygon vertices and find The point with the smallest coordinates (if multiple such points exist, select one of them). The point with the smallest coordinates will be used as the base point. .
[0024] Step 2.2: Polar Angle Sort: (1). Calculate the values of all other points relative to the base point. The polar angle (the angle between the polar angle and the positive x-axis). (2) Sort all points in ascending order of polar angle; (3) If multiple points have the same polar angle, they are sorted by their distance from the base point, with the closer points listed first. Step 2.3: Construct the convex hull: (1). Initialize a stack , base point Push the first two sorted points onto the stack; (2). For each sorted point (i ranges from 3 to m-1): a) When there are at least two points in the stack, check the direction formed by the two points before the top of the stack and the current point. Given three points... , , , judge from arrive Then The turning process is as follows: ; if Turn counterclockwise (left turn), if Turn clockwise (right turn), if The three points are collinear.
[0025] b) If the turn is not counterclockwise (i.e., constitutes a right turn or collinearity), pop from the stack. The vertex.
[0026] c) Move the current point Push onto stack .
[0027] (3). Stack The remaining points are the vertices of the convex hull, and these vertices form a new patrol area polygon. The vertices in the array are placed into array V.
[0028] Step 3: As Figure 2 As shown, to facilitate the average area division, the patrol mesh after convex hull transformation is approximated as a minimum rectangle: Suppose the convex hull polygon has m vertices, and the coordinates of the four vertices abcd of the axis-aligned circumscribed rectangle are: ; ; ; ; The width w of the rectangle is: ;
[0029] The height h of the rectangle is: ;
[0030] Step 4: Due to the limited battery life of the drones, the maximum length of each drone patrol route cannot exceed the designated distance. If the route length exceeds the drone's designated cruising distance, the drone will automatically return and will be unable to complete the subsequent patrol mission. Therefore, for a given patrol grid unit, the automatically generated patrol route has two requirements: first, the patrol route must cover the entire area of the grid; second, the total length of the patrol route cannot exceed the drone's designated maximum cruising distance (i.e., the total length of the drone from takeoff from the pod, through all waypoints, and back to the pod must be less than or equal to the drone's designated maximum cruising distance). Therefore, the designated maximum patrol distance of the drone is set to L, and the smallest rectangle is divided into several equal rectangles, such as... Figure 3 and Figure 4 As shown, the diagonals of these rectangles are approximate diagonal segments. The sum of all diagonal segments, plus the distance from the nest to the first waypoint, plus the distance from the last waypoint to the nest, must be less than or equal to L.
[0031] The point with the smallest x-axis in the patrol grid convex polygon is selected as the first waypoint, and the point with the largest x-axis in the patrol grid convex polygon is selected as the return point.
[0032] The first waypoint is: ; The last return point is: ; Let the location of the nest be... Distance from the naval base to the first waypoint: ; The distance from the return point to the aircraft nest is: ; Suppose the smallest rectangle of the patrol grid is divided into n smaller rectangles on average. If the drone patrols along the diagonal, then the patrol length is: ; Given the maximum cruising length limit of the UAV, solve for n: ; Right now: ; For ease of calculation, let: ; if This indicates that the distance between the nest location and the assigned patrol grid is too far, indicating an unreasonable arrangement. The nest should be reselected or the patrol grid should be reassigned. The simplified calculation formula is: ; Since the distance is non-negative, squaring both sides gives: ; ; ; Round the value of n down to the nearest integer.
[0033] Step 5: Based on the above formula, the value of n is estimated using the diagonal. The patrol grid convex polygon is vertically and evenly divided into n rectangles. The intersection points of the small rectangles and the patrol grid convex polygon are calculated and used as intermediate waypoints. This avoids patrolling outside the grid area caused by directly patrolling along the diagonal, reducing the total route length. The intersection points of the n-1 vertical lines dividing the patrol grid with the polygon are used as intermediate waypoints. The vertical dividing lines are represented as follows: ; in, ,and It is an integer.
[0034] (1) For lines 1 to n-1: ; (2) Calculate the intersection of this straight line with the vertex array of the patrol mesh convex polygon one by one. The intersection of each edge in the middle: ; if If the edge is on the same side as the line, then there is no intersection. Jump (2) and take the next edge to calculate; if This indicates that the entire edge lies on a straight line. Add the two points to the set of intersection points H; if ,and , will point Add to the intersection set H; if ,and , will point Add to the intersection set H; if and The coordinates of the intersection point are: ; Point Add the intersection point set H.
[0035] (3) Traverse set H. If there are duplicate coordinates, perform a deduplication operation and keep only one coordinate.
[0036] (4) Reorder the intersection points in H according to the x-values from smallest to largest to form a new set H. If the x-values are the same, put the smaller y-value first.
[0037] Step 6: Construct patrol routes: (1) Initialize the waypoint set D, and set the starting waypoint. Join D as the first waypoint; set the current waypoint. .
[0038] (2) Take the intersection points one by one from set H. .
[0039] (3) If If the waypoint cannot form a diagonal patrol route in the direction of travel, discard the waypoint and proceed to step (2); if and ,or and If the waypoint is on the same side of the convex polygon as the current waypoint (i.e., both are on the lower half or both are on the upper half), and a diagonal patrol route cannot be formed, discard the waypoint and proceed to step (2); if and ,or and , waypoint Add it to waypoint set D.
[0040] (4) Let Proceed to step (2) and take the next intersection point for judgment.
[0041] (5) After all intersection points have been determined, the final return point will be determined. Add it to waypoint set D.
[0042] Step 7: Convert all XY coordinates in the waypoint set to WGS84 coordinates: ; ; in, These are the latitude and longitude coordinates of the reference point, taken as the latitude and longitude coordinates of the nest's location.
[0043] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for automatically generating gridded patrol routes for unmanned aerial vehicles (UAVs), characterized in that, Includes the following steps: Step 1: Obtain the latitude and longitude coordinates of the drone nest and the vertex coordinates of the grid area to be patrolled, and transform all coordinates to a Cartesian coordinate system; Step 2: Perform convex hull transformation on the polygons of the patrol grid area to generate convex hull polygons; Step 3: Fit the minimum bounding rectangle to the convex hull polygon to determine the planning boundary of the patrol area; Step 4: Based on the UAV's endurance constraints, set the calibrated maximum patrol distance L of the UAV. Calculate the available range margin based on the distance between the nest location and the starting and ending waypoints in the convex hull polygon, and determine the number of longitudinal segments based on the range margin. ; Step 5: Based on the number of vertical segments The minimum bounding rectangle is evenly divided along the longitudinal direction into... A rectangular partition is formed, and a candidate waypoint set H is generated based on the intersection of each vertical dividing line and the convex hull polygon. Step 6: Remove redundant inflection points from the candidate waypoint set H, construct a zigzag diagonal route, and generate the final waypoint set D; Step 7: Convert all planar coordinates in the waypoint set D back to geographic latitude and longitude coordinates, and output the patrol route that the UAV can execute; The process of generating the final waypoint set D in step 6 is as follows: Add the starting waypoint to the candidate waypoint set H and set it as the current waypoint; Initialize the final waypoint set D, add the starting waypoint to the final waypoint set D, and set it as the current waypoint; Candidate points are selected one by one from the candidate waypoint set H; If candidate points Coordinates and current waypoint If the coordinates are the same, discard the candidate point; If a candidate point and the current waypoint are both located on the same side of the horizontal median of the minimum bounding rectangle, then discard the candidate point. If a candidate point and the current waypoint are located on opposite sides of the horizontal centerline of the minimum bounding rectangle or on the horizontal centerline of the minimum bounding rectangle, then the candidate point is retained. After traversing all candidate points, the termination waypoint is added to the final waypoint set D to obtain the UAV patrol route.
2. The method for automatically generating gridded patrol routes for unmanned aerial vehicles according to claim 1, characterized in that, The coordinates in step 1 are converted to: ; ; in, Latitude Longitude These are the latitude and longitude coordinates of the reference point, taken from the departure point of the flight route.
3. The method for automatically generating gridded patrol routes for unmanned aerial vehicles according to claim 1, characterized in that, The convex hull transformation process in step 2 is as follows: Traverse all vertices of the patrol mesh polygon and select The point with the smallest coordinates is used as the base point. If there are multiple The point with the smallest coordinates is selected. The point with the smallest coordinates is used as the base point. ; Calculate the remaining points relative to the base point The polar angles are determined and sorted from smallest to largest. If the polar angles are the same, they are sorted according to their polar angle relative to the base point. Sort by distance from nearest to farthest; Initialize stack Given three points, iterate through the sorted points in sequence. , , , judge from arrive Then The turning process is as follows: ; when Pop the stack vertex, stack The remaining points are used as vertices of the convex hull, and the vertices of the convex hull form a new patrol area polygon.
4. The method for automatically generating gridded patrol routes for unmanned aerial vehicles according to claim 3, characterized in that, In step 3, assuming the convex hull polygon has m vertices, the coordinates of the four vertices of the minimum bounding rectangle are: ; ; ; ; width of the rectangle for: ; Height of the rectangle for: ; in, , , , Let these be the coordinates of the four vertices of the minimum bounding rectangle. This represents the vertices of the convex hull polygon.
5. The method for automatically generating UAV gridded patrol routes according to claim 4, characterized in that, In step 4, the starting waypoint is the point in the convex hull polygon. The vertex with the smallest coordinates, the termination waypoint is the vertex in the convex hull polygon. The vertex with the largest coordinates; Distance from the nacelle to the starting waypoint and the distance from the terminal waypoint to the nest Calculated using the Euclidean distance formula; The available range margin ,when At that time, the nest should be reselected or the patrol grid should be reassigned.
6. The method for automatically generating UAV grid-based patrol routes according to claim 5, characterized in that, In step 4, when At that time, we obtained: ; We can deduce that: ; in, Round down to the nearest integer.
7. The method for automatically generating UAV grid-based patrol routes according to claim 6, characterized in that, In step 5, the vertical dividing line for: , ; The process of generating the candidate waypoint set H is as follows: Calculate each vertical dividing line one by one The intersection points with each side of the convex hull polygon, if the two endpoints of the side lie on the longitudinal dividing line If they are on the same side, there is no intersection. If the edge is on the vertical dividing line If the condition is met, then both endpoints of that side are added to the candidate waypoint set H. If one endpoint of the edge lies on the vertical dividing line If the endpoint is above the set H, then add the endpoint to the candidate waypoint set H; If the two endpoints of the side are on the vertical dividing line On the opposite side, the intersection point is calculated using a linear interpolation formula and added to the candidate waypoint set H; Remove duplicates from the candidate waypoint set and sort them by... Coordinates are sorted in ascending order. If they are the same, sort them in ascending order by y.
8. The method for automatically generating gridded patrol routes for unmanned aerial vehicles according to claim 1, characterized in that, The process of inversely converting the plane coordinates back to geographic latitude and longitude coordinates in step 7 is as follows: ; 。
Citation Information
Patent Citations
Method for automatically bypassing patrol route of unmanned aerial vehicle in no-fly zone
CN122650970A
