Method, system, device and storage medium for generating and planning UAV flight paths

The flight path boundary is generated by calculating the intersection through vector rotation and linear equations, and the flight path is cut based on the UAV's endurance. This solves the problems of computational complexity and platform dependence in existing technologies and realizes efficient and versatile route planning.

CN120506957BActive Publication Date: 2025-09-16SIYI TECH (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511006179.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-09-16
Estimated Expiration
2045-07-22

AI Technical Summary

Technical Problem

Existing UAV route planning methods rely on angle calculation and map platform interface, which are computationally complex and have poor versatility.

Method used

By obtaining the direction vector of the initial route, rotating and expanding the vector, calculating the intersection using linear equations, generating the flight strip boundary, and cutting the flight strip according to the drone's endurance, regional upload of route data is achieved.

Benefits of technology

It reduces the amount of calculation, reduces dependence on map platforms, improves the versatility and efficiency of planning, and supports uploading route data by region.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120506957B_ABST
    Figure CN120506957B_ABST
Patent Text Reader

Abstract

This application proposes a method, system, device and storage medium for generating and planning a UAV flight path. The method includes: obtaining each waypoint P in the initial route. i , get each flight segment P i P i+1 Direction vector; Rotate the direction vector 90 degrees clockwise and counterclockwise to obtain the normal vector and unit normal vector. According to the unit normal vector and the outward expansion distance d, for each segment P i P i+1 Expand in two expansion directions to obtain the first expansion boundary A i A i+1 '、B i B i+1 Determine whether two adjacent outward expansion boundaries intersect. If so, calculate the coordinates of the intersection and use it as a new boundary point. If not, connect the two adjacent boundary points to generate a new outward expansion boundary to obtain the final flight path. Upload the route data, which includes multiple parallel routes parallel to the initial route. Connect the multiple parallel routes end to end to obtain the target route. The flight path route generation and planning method of this application is simple to calculate and only relies on the basic vector operation library, making it highly versatile.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of unmanned aerial vehicle (UAV) trajectory planning, and in particular to a method, system, device, and storage medium for generating and planning UAV flight paths. Background Art

[0002] Drones are currently widely used in agricultural plant protection, topographic mapping, power inspection, and other fields. Route planning automatically creates a mapping strip (or flight strip) based on a user-defined route, subject to specific constraints. Multiple routes are then generated within the strip to enable surveying and photography.

[0003] Existing strip area planning generally adopts the angle offset method. For example, the Chinese patent application publication number CN107154066A discloses a two-dimensional display method for parallel line buffer patrol routes. This method uses the latitude and longitude information of the patrol route passing points and the buffer distance, and utilizes the map platform measurement and analysis secondary development interface to calculate the patrol route line segment direction angle, the latitude and longitude information of the parallel line position points, and the latitude and longitude information of the adjacent parallel line intersection points; according to the screening rules of the buffer range marking points, the position points and intersection points are identified to obtain the patrol route buffer range marking point combination; then, the map platform graphic plotting secondary development interface is used to draw the patrol route and buffer range to obtain a strip area.

[0004] However, the above method needs to calculate the direction angle through trigonometric functions and angle modulo, which is relatively complicated. The angle difference between adjacent line segments needs to be analyzed in four cases. The logical branches are complex and the measurement interface of the map platform needs to be called, which has poor versatility. Summary of the Invention

[0005] In order to solve the technical problems of the existing strip area planning method relying on angle calculation, logical redundancy and platform dependence, the present application proposes a generation planning method, system, device and storage medium for UAV flight path.

[0006] According to the first aspect of the present application, a method for generating and planning a UAV flight path is proposed, comprising:

[0007] Get each waypoint P in the initial route planned by the user in the two-dimensional coordinate system i , get each flight segment P i P i+1 The direction vector of , where i∈[1, n-1], n is the number of waypoints;

[0008] For each flight segment P i P i+1The direction vector is rotated 90 degrees clockwise and counterclockwise respectively to obtain the normal vectors of the two outward expansion directions and the unit normal vector. According to the unit normal vector and the preset outward expansion distance d, each flight segment P is i P i+1 Expand in two expansion directions to obtain the first expansion boundary A i A i+1 ', the second outer boundary B i B i+1 ';

[0009] Determine the two adjacent first expansion boundaries A i A i+1 ' and / or the second outward expansion boundary B i B i+1 'Is there an intersection? If so, calculate the coordinates of the intersection and use it as the new boundary point, and truncate the two extended boundaries; if not, connect the two adjacent initial boundary points of the two extended boundaries to generate a new extended boundary and obtain the final flight zone;

[0010] Uploading route data, wherein the route data includes a plurality of parallel routes within the flight band that are parallel to the initial route, and the plurality of parallel routes are connected end to end to obtain a target route.

[0011] Preferably, the determination of the two adjacent first outward expansion boundaries A i A i+1 ' and / or the second outer boundary B i B i+1 'Whether there is an intersection, specifically including:

[0012] A linear equation is used to calculate whether there is an intersection. The specific formula is as follows:

[0013] D=(x1-x2)*(y3-y4)-(y1-y2)*(x3-x4)

[0014] t = ((x1-x3)*(y3-y4)-(y1-y3)*(x3-x4)) / D

[0015] u = ((x1-x3)*(y1-y2)-(y1-y3)*(x1-x2)) / D

[0016] Among them, (x1, y1), (x2, y2) and (x3, y3), (x4, y4) are two adjacent first expansion boundaries A i A i+1 ' and / or the second outward expansion boundary B i B i+1 'The coordinates of the two boundary points;

[0017] When D=0, it is judged that there is no intersection;

[0018] When D≠0, and 0≤t≤1, 0≤u≤1, then it is determined that there is an intersection point, and the coordinates of the intersection point I (x, y) are:

[0019] x=x1+t*(x2-x1)

[0020] y=y1+t*(y2-y1).

[0021] Preferably, the uploaded route data includes a plurality of parallel routes within the flight zone that are parallel to the initial route, and the plurality of parallel routes are connected end to end to obtain a target route, including:

[0022] Cutting the flight strip to obtain a plurality of sub-areas;

[0023] The route data of each sub-area is uploaded, and the multiple parallel routes in each sub-area are connected end to end to obtain the target route of each sub-area.

[0024] Preferably, the plurality of sub-areas obtained by cutting the flight strip include:

[0025] Obtain the current battery power of the drone and the battery power consumed per kilometer under the current payload, and calculate the endurance range;

[0026] Calculating a recommended cutting length according to the endurance range and the number of parallel routes;

[0027] Based on the recommended cutting length, the flight strip is cut to obtain a plurality of sub-areas.

[0028] Preferably, the method further comprises:

[0029] Obtain the coordinates of the user's click point within the flight path;

[0030] Determine the sub-area to which the click point belongs, and upload the route data of the sub-area.

[0031] Preferably, determining the sub-region to which the click point belongs includes:

[0032] Extend the click point in any direction horizontally or vertically to obtain a ray equation;

[0033] According to the coordinates of each vertex of each sub-region, each side of each sub-region is expressed by a straight line equation;

[0034] Substitute the ray equation into the line equation to solve it. If there is a unique solution, then the ray and the edge have a unique intersection point.

[0035] The number N of intersections between the ray and the edge of each sub-region is counted. If N is an odd number, the click point is within the corresponding sub-region.

[0036] Preferably, determining the sub-region to which the click point belongs includes:

[0037] According to the coordinates of each vertex of each sub-region, the click point is connected with each vertex of each sub-region to obtain a plurality of triangular regions;

[0038] The sum of the areas of the multiple triangular regions is compared with the area of ​​each sub-region respectively. If they are equal, the click point is within the corresponding sub-region.

[0039] According to the second aspect of the present application, a UAV flight path generation and planning system is proposed, comprising:

[0040] The acquisition unit is configured to obtain each waypoint P in the initial route planned by the user in the two-dimensional coordinate system. i , get each flight segment P i P i+1 The direction vector of , where i∈[1, n-1], n is the number of waypoints;

[0041] The expansion unit is configured to i P i+1 The direction vector is rotated 90 degrees clockwise and counterclockwise respectively to obtain the normal vectors of the two outward expansion directions and the unit normal vector. According to the unit normal vector and the preset outward expansion distance d, each flight segment P is i P i+1 Expand in two expansion directions to obtain the first expansion boundary A i A i+1 ', the second outer boundary B i B i+1 ';

[0042] The flight strip generation unit is configured to determine the first two adjacent outer expansion boundaries A i A i+1 ' and / or the second outward expansion boundary B i B i+1 'Is there an intersection? If so, calculate the coordinates of the intersection and use it as the new boundary point, and truncate the two extended boundaries; if not, connect the two adjacent initial boundary points of the two extended boundaries to generate a new extended boundary and obtain the final flight zone;

[0043] The route planning unit is configured to upload route data, wherein the route data includes a plurality of parallel routes within the flight band that are parallel to the initial route, and the plurality of parallel routes are connected end to end to obtain a target route.

[0044] According to the third aspect of the present application, an electronic device is proposed, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the method for generating and planning a UAV flight path as provided in any embodiment of the first aspect above.

[0045] According to a fourth aspect of the present application, a computer-readable storage medium is proposed, on which a computer program is stored. When the program is executed by a processor, it implements the method for generating and planning a UAV flight path as provided in any embodiment of the first aspect above.

[0046] This application proposes a method, system, device, and storage medium for generating and planning UAV flight paths. By expanding the initial route through vector cross products and solving boundary intersections with linear equations, the ideal flight path is drawn. Compared with traditional methods that rely on calculating azimuths and angle classification, this method greatly reduces the amount of computation. Furthermore, the method relies only on a basic vector operation library and does not require calling the map platform's measurement interface, making it highly versatile. Furthermore, the flight path is divided into multiple sub-regions based on the UAV's endurance. The coordinates of the user's clicked point are used to determine the sub-region to which the clicked point belongs, enabling the function of uploading route data by region. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and, together with the description, serve to explain the principles of the present invention. Other embodiments and many of the expected advantages of the embodiments will be readily apparent as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with respect to each other. Like reference numerals designate corresponding similar parts.

[0048] Figure 1 This is a flow chart of a method for generating and planning a UAV flight path according to a specific embodiment of the present application;

[0049] Figure 2 is a schematic diagram of an initial route according to a specific embodiment of the present application;

[0050] Figure 3 is a schematic diagram of flight segment expansion according to a specific embodiment of the present application;

[0051] Figure 4 is a schematic diagram of generating a flight strip according to a specific embodiment of the present application;

[0052] Figure 5 is a schematic diagram of a flight strip according to a specific embodiment of the present application;

[0053] Figure 6 This is a schematic diagram of a route planning according to a specific embodiment of the present application;

[0054] Figure 7 is a schematic diagram of route planning according to another specific embodiment of the present application;

[0055] Figure 8 is a schematic diagram of route planning according to another specific embodiment of the present application;

[0056] Figure 9 This is a schematic diagram of determining the sub-region to which a click point belongs by using method 1 according to a specific embodiment of the present application;

[0057] Figure 10 This is a schematic diagram of determining the sub-region to which a click point belongs by using method 2 according to a specific embodiment of the present application;

[0058] Figure 11 This is a second schematic diagram of determining the sub-region to which a click point belongs by using method 2 according to a specific embodiment of the present application;

[0059] Figure 12 is a schematic diagram of a system for generating and planning a UAV flight path according to an embodiment of the present application;

[0060] Figure 13 is a schematic diagram of an electronic device according to a specific embodiment of the present application. DETAILED DESCRIPTION

[0061] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the objects, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with the accompanying drawings and Examples. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is merely to provide a better understanding of the present invention by illustrating examples of the present invention.

[0062] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, the elements defined by the phrase "comprising..." do not exclude the presence of additional identical elements in the process, method, article, or device comprising the elements.

[0063] This application proposes a method for generating and planning a UAV flight path. Figure 1 A flow chart of a method for generating and planning a UAV flight path according to a specific embodiment of the present application is shown. Figure 1 As shown, the method includes the following steps:

[0064] Step S101: Obtain each waypoint P in the initial route planned by the user in the two-dimensional coordinate system i , get each flight segment P i P i+1 The direction vector of , where i∈[1, n-1] and n is the number of waypoints.

[0065] Figure 2 A schematic diagram of an initial route according to a specific embodiment of the present application is shown. Figure 2 As shown, in a specific embodiment, taking waypoints n=3 as an example, namely P1, P2, and P3, there are flight segments P1P2 and P2P3. Taking flight segment P1P2 as an example, assuming that the coordinates of the two waypoints are P1(x1, y1) and P2(x2, y2), the direction vector components of flight segment P1P2 are dx=x2-x1, dy=y2-y1, and the length of flight segment P1P2 is .

[0066] Step S102: For each flight segment P i P i+1 The direction vector is rotated 90 degrees clockwise and counterclockwise respectively to obtain the normal vectors of the two outward expansion directions and the unit normal vector. According to the unit normal vector and the preset outward expansion distance d, each flight segment P i P i+1 Expand in two expansion directions to obtain the first expansion boundary A i A i+1 ', the second outer boundary B i B i+1 '.

[0067] Figure 3 FIG. 1 shows a schematic diagram of a flight segment expansion according to a specific embodiment of the present application, as shown in FIG. Figure 3 As shown in a specific embodiment, taking flight segment P1P2 as an example, rotating the direction vector of flight segment P1P2 90 degrees counterclockwise yields a normal vector with unit normal vector components of nx = -dy / length and ny = dx / length. If rotated 90 degrees clockwise, the unit normal vector components are nx = dy / length and ny = -dx / length. Assuming the preset expansion distance is d, multiplying the unit normal vector by the expansion distance yields the offsets nx = nx * d and ny = ny * d. By moving the two waypoints of flight segment P1P2 along the normal vector by the offset, the coordinates of the two endpoints of the first expansion boundary A1A2' / second expansion boundary B1B2' are obtained: (x1+nx, y1+ny) and (x2+nx, y2+ny).

[0068] Step S103: Determine the two adjacent first outward expansion boundaries A i A i+1 ' and / or the second outward expansion boundary B i B i+1 'Is there an intersection? If so, calculate the coordinates of the intersection and use it as the new boundary point, and truncate the two extended boundaries; if not, connect the two adjacent initial boundary points of the two extended boundaries to generate a new extended boundary to obtain the final flight path.

[0069] In a specific embodiment, a linear equation is used to calculate the two adjacent first outward expansion boundaries A. i A i+1 ' and / or the second outward expansion boundary B i B i+1 'Whether there is an intersection, the specific formula is as follows:

[0070] D=(x1-x2)*(y3-y4)-(y1-y2)*(x3-x4)

[0071] t = ((x1-x3)*(y3-y4)-(y1-y3)*(x3-x4)) / D

[0072] u =((x1-x3)*(y1-y2)-(y1-y3)*(x1-x2)) / D

[0073] Among them, (x1, y1), (x2, y2) and (x3, y3), (x4, y4) are two adjacent first expansion boundaries A i A i+1 ' and / or the second outward expansion boundary Bi B i+1 'The coordinates of the two boundary points;

[0074] When D=0, it is judged that there is no intersection;

[0075] When D≠0, and 0≤t≤1, 0≤u≤1, then it is determined that there is an intersection point, and the coordinates of the intersection point I (x, y) are:

[0076] x=x1+t*(x2-x1)

[0077] y=y1+t*(y2-y1)

[0078] Figure 4 FIG2 shows a schematic diagram of generating a flight strip according to a specific embodiment of the present application. Figure 5 A schematic diagram of a flight path according to a specific embodiment of the present application is shown in FIG. Figure 4 、 Figure 5 As shown, in a specific embodiment, the first outward expansion boundary A1A2' and the first outward expansion boundary A2A3' have an intersection, so the coordinates of the intersection I are calculated and used as the new boundary point. At the same time, the first outward expansion boundary A1A2' and the first outward expansion boundary A2A3' are truncated, that is, the first outward expansion boundary A1A2' becomes A1I, and the first outward expansion boundary A2A3' becomes IA3'. However, the second outward expansion boundary B1B2' and the second outward expansion boundary B2B3' do not have an intersection, so the two adjacent initial boundary points B2' and B2 of the second outward expansion boundary B1B2' and the second outward expansion boundary B2B3' are connected to generate a new outward expansion boundary B2'B2. Ultimately, all adjacent outward expansion boundary points are connected in pairs to draw an ideal flight strip.

[0079] Step S104: uploading route data, the route data including multiple parallel routes in the flight zone that are parallel to the initial route, and connecting the multiple parallel routes end to end to obtain a target route.

[0080] Figure 6 A schematic diagram of route planning according to a specific embodiment of the present application is shown. Figure 6 As shown, in a specific embodiment, after the flight strip is generated, the user uploads the route data and plans multiple parallel routes (dashed lines shown in the figure) parallel to the initial route (P1P2P3) within the flight strip. The target route can be obtained by connecting the multiple parallel routes end to end. The UAV flies back and forth within the flight strip according to the target route to perform mapping.

[0081] It should be noted that the generation logic of the parallel routes can be the same as the generation logic of the first outward expansion boundary and the second outward expansion boundary. There is no limitation here and no further description is given.

[0082] Figure 7FIG. 4 shows a schematic diagram of route planning according to another specific embodiment of the present application, as shown in FIG. Figure 7 As shown, in another specific embodiment, when the flight strip mapping area is too large and too long, in order to prevent the drone from being unable to complete the mapping in a single flight due to endurance issues, the flight strip can be cut into multiple sub-areas (①, ②, ③) according to a preset length, and then the route data of each sub-area is uploaded, and the multiple parallel routes in each sub-area are connected end to end to obtain the target route of each sub-area. The drone can then perform mapping in sequence according to the target route of each sub-area.

[0083] In this embodiment, a method for cutting a flight strip is provided as follows:

[0084] The drone's flight controller obtains the current battery level and the battery consumption per kilometer under the current payload. The range is calculated, and the range is divided by the number of parallel flight paths to determine the recommended cut length. The flight path is then divided according to the recommended cut length to create multiple sub-areas. When configuring flight parameters for the first time, the cut length calculated using this method is used by default.

[0085] Through the above method, compared with the traditional method of cutting the flight strip based on a preset length of a fixed value, this embodiment adjusts the recommended cutting length based on the actual endurance of the drone, thereby achieving maximum efficiency in mapping while ensuring that the drone can complete the mapping of a sub-area in a single flight.

[0086] Figure 8 FIG. 4 shows a schematic diagram of route planning according to another specific embodiment of the present application, as shown in FIG. Figure 8 As shown in the figure, in another specific embodiment, after the flight strip is divided into sub-regions, there is a need to upload route data by region. Therefore, this embodiment obtains the coordinates of the user's click point within the flight strip, determines the sub-region to which the click point belongs (sub-region ② is used as an example in the figure), and then uploads only the route data for this sub-region, achieving on-demand upload.

[0087] In this embodiment, two methods are provided for determining the sub-region to which the click point belongs, which will be described in detail below.

[0088] Method 1:

[0089] Figure 9 A schematic diagram showing a method for determining the sub-region to which a click point belongs according to a specific embodiment of the present application is shown in FIG. Figure 9 As shown, in a specific embodiment, the click point coordinates C (x, y) are extended along any direction in the horizontal or vertical direction. This embodiment takes the click point C (x, y) as an example of extending the ray in the horizontal right direction, and the extension distance is k. The ray equation is as follows:

[0090]

[0091] Through the previous steps, all the boundary points of the flight path are known, and the recommended cutting length of the sub-region is also known. That is, the cutting point is known, so the coordinates of each vertex in each sub-region are also known. The j-th edge of each sub-region can be expressed by a straight line equation, which is as follows:

[0092]

[0093] Among them, (x j ,y j )、(x j+1 ,y j+1 ) are the coordinates of the two vertices of the j-th edge of each subregion, j∈[1,m], m is the number of edges in each subregion, s∈[0,1].

[0094] Substitute the ray equation into the line equation and solve. If the ray intersects the edge of the subregion, there exists a unique solution s∈[0,1], k>0, and the intersection coordinates are I'(x+k,y). Then count the number of intersections N between the ray and the edge of each subregion. If N is an odd number, the clicked point is within the corresponding subregion; if N is an even number, the clicked point is outside the corresponding subregion.

[0095] like Figure 9 As shown, the extended ray of the click point C in the horizontal right direction has one intersection with sub-area ② and two intersections with sub-area ③, so it is determined that the click point C is in sub-area ②.

[0096] It should be noted that in special cases, if a ray passes through a vertex in a sub-region, it is necessary to determine whether the vertex is a vertex in the direction of the ray. If so, it is counted as an intersection point; otherwise, it is not counted.

[0097] Method 2:

[0098] Figure 10 One of the schematic diagrams showing how to determine the sub-region to which a click point belongs by using method 2 according to a specific embodiment of the present application is shown. Figure 11 The second schematic diagram shows how to determine the sub-region to which the click point belongs by using the second method according to a specific embodiment of the present application. Figure 10 、 Figure 11 As shown, in a specific embodiment, based on the known vertex coordinates of each sub-region, the click point is connected to each vertex of each sub-region to obtain multiple triangular regions. The sum of the areas of the multiple triangular regions is then compared with the area of ​​each sub-region. If the area of ​​a sub-region is equal to the sum of the areas of the multiple triangular regions, the click point is within the corresponding sub-region; otherwise, it is outside.

[0099] like Figure 10 As shown in , the sum of the areas of the multiple triangular areas obtained by connecting the click point C with each vertex of sub-area ② is exactly equal to the area of ​​sub-area ②, so it is determined that the click point C is within sub-area ②. Figure 11 As shown, the sum of the areas of the multiple triangular areas obtained by connecting the click point C with the vertices of the sub-area ① is greater than the area of ​​the sub-area ①, so it is determined that the click point C is outside the sub-area ①.

[0100] Through the above two methods, the sub-region to which the click point belongs can be calculated.

[0101] In summary, the method for generating and planning a UAV flight path provided by this application achieves the following effects:

[0102] This application uses vector cross products to expand the initial route and solves the intersection of the expanded boundaries using linear equations to draw the ideal flight path. Compared with traditional methods that calculate direction angles and angle classification, this greatly reduces the amount of calculation. At the same time, it only relies on the basic vector operation library and does not require calling the measurement interface of the map platform, which is highly versatile. The flight path is further divided into multiple sub-areas based on the drone's endurance. The coordinates of the user's click point are used to determine the sub-area to which the click point belongs, realizing the function of uploading route data by region.

[0103] According to the above-mentioned method for generating and planning a UAV flight path, based on the same inventive concept, this application also proposes a system for generating and planning a UAV flight path. Figure 12 A schematic diagram of a system for generating and planning a UAV flight path according to an embodiment of the present application is shown. Figure 12 As shown, the system includes:

[0104] The acquisition unit 201 is configured to acquire each waypoint P in the initial route planned by the user in the two-dimensional coordinate system. i , get each flight segment P i P i+1 The direction vector of , where i∈[1, n-1] and n is the number of waypoints.

[0105] The expansion unit 202 is configured to i P i+1 The direction vector is rotated 90 degrees clockwise and counterclockwise respectively to obtain the normal vectors of the two outward expansion directions and the unit normal vector. According to the unit normal vector and the preset outward expansion distance d, each flight segment P i P i+1 Expand in two expansion directions to obtain the first expansion boundary A i A i+1 ', the second outer boundary B i B i+1 '.

[0106] The flight strip generation unit 203 is configured to determine the first two adjacent outer expansion boundaries A i A i+1 ' and / or the second outward expansion boundary B i B i+1 'Is there an intersection? If so, calculate the coordinates of the intersection and use it as the new boundary point, and truncate the two extended boundaries; if not, connect the two adjacent initial boundary points of the two extended boundaries to generate a new extended boundary to obtain the final flight path.

[0107] The route planning unit 204 is configured to upload route data, where the route data includes multiple parallel routes within the flight band that are parallel to the initial route. The multiple parallel routes are connected end to end to obtain a target route.

[0108] According to the above-mentioned method for generating and planning a UAV flight path, based on the same inventive concept, the present application also proposes an electronic device.

[0109] Figure 13 A schematic diagram of an electronic device according to a specific embodiment of the present application is shown. Figure 13 As shown, the electronic device includes: one or more processors 301, memory 302, a bus 303, and a communication interface 304. The one or more processors 301, memory 302, and communication interface 304 are connected via bus 303. Memory 302 is used to store one or more programs. When the one or more programs are executed by the one or more processors 301, the electronic device implements the method for generating and planning a UAV flight path provided in any of the above-mentioned embodiments.

[0110] According to the above-mentioned method for generating and planning the UAV flight path, based on the same inventive concept, the present application also proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for generating and planning the UAV flight path provided by any of the above-mentioned embodiments is implemented.

[0111] In the embodiments of the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device / system / method embodiments described above are merely schematic. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0112] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0113] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.

[0115] Obviously, those skilled in the art can make various modifications and changes to the embodiments of the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and changes are within the scope of the claims of the present invention and their equivalents, the present invention is also intended to cover these modifications and changes. The word "comprising" does not exclude the presence of other elements or steps not listed in the claims. The simple fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage. Any reference signs in the claims should not be considered as limiting the scope.

Claims

1. A method for generating and planning a UAV flight path, characterized in that: include: Get each waypoint P in the initial route planned by the user in the two-dimensional coordinate system i , get each flight segment P i P i+1 The direction vector of , where i∈[1, n-1], n is the number of waypoints; For each flight segment P i P i+1 The direction vector is rotated 90 degrees clockwise and counterclockwise respectively to obtain the normal vectors of the two outward expansion directions and the unit normal vector. According to the unit normal vector and the preset outward expansion distance d, each flight segment P is i P i+1 Expand in two expansion directions to obtain the first expansion boundary A i A i+1 ', the second outer boundary B i B i+1 '; Determine the two adjacent first expansion boundaries A i A i+1 'Whether there is an intersection and / or two adjacent second expansion boundaries B i B i+1 'Is there an intersection? If so, calculate the coordinates of the intersection I and use it as the new boundary point, and truncate the two outer boundaries, that is, the first outer boundary A i A i+1 'Change to A i I, first outward expansion boundary A i+1 A i+2 'Change to IA i+2 ', and / or, the second outward expansion boundary B i B i+1 'Change to B i I, second outer boundary B i+1 B i+2 'Become IB i+2 '; If not, connect the two adjacent initial boundary points of the two expansion boundaries to generate a new expansion boundary to obtain the final flight path; Uploading route data, the route data including a plurality of parallel routes within the flight zone that are parallel to the initial route, wherein the plurality of parallel routes are connected end to end to obtain a target route; Wherein, the two adjacent first outward expansion boundaries A are judged i A i+1 'Whether there is an intersection and / or two adjacent second expansion boundaries B i B i+1 'Whether there is an intersection, specifically including: A linear equation is used to calculate whether there is an intersection. The specific formula is as follows: D=(x1-x2)*(y3-y4)-(y1-y2)*(x3-x4) t = ((x1-x3)*(y3-y4)-(y1-y3)*(x3-x4)) / D u = (x1-x3)*(y1-y2)-(y1-y3)*(x1-x2)) / D Among them, (x1, y1), (x2, y2) and (x3, y3), (x4, y4) are two adjacent first expansion boundaries A i A i+1 ' and / or two adjacent second outward expansion boundaries B i B i+1 'The coordinates of the two boundary points; When D=0, it is judged that there is no intersection; When D≠0, and 0≤t≤1 and 0≤u≤1, then it is determined that there is an intersection point, and the coordinates of the intersection point I (x, y) are: x=x1+t*(x2-x1) y=y1+t*(y2-y1).

2. The method according to claim 1, characterized in that The uploaded route data includes a plurality of parallel routes within the flight zone that are parallel to the initial route, and the plurality of parallel routes are connected end to end to obtain a target route, including: Cutting the flight strip to obtain a plurality of sub-areas; The route data of each sub-area is uploaded, and the multiple parallel routes in each sub-area are connected end to end to obtain the target route of each sub-area.

3. The method according to claim 2, characterized in that The strip is cut to obtain a plurality of sub-areas, including: Obtain the current battery power of the drone and the battery power consumed per kilometer under the current payload, and calculate the endurance range; Calculating a recommended cutting length according to the endurance range and the number of parallel routes; Based on the recommended cutting length, the flight strip is cut to obtain a plurality of sub-areas.

4. The method according to claim 2, characterized in that The method further comprises: Obtain the coordinates of the user's click point within the flight path; Determine the sub-area to which the click point belongs, and upload the route data of the sub-area.

5. The method according to claim 4, characterized in that The determining the sub-region to which the click point belongs includes: Extend the click point in any direction horizontally or vertically to obtain a ray equation; According to the coordinates of each vertex of each sub-region, each side of each sub-region is expressed by a straight line equation; Substitute the ray equation into the line equation to solve it. If there is a unique solution, then the ray and the edge have a unique intersection point. The number N of intersections between the ray and the edge of each sub-region is counted. If N is an odd number, the click point is within the corresponding sub-region.

6. The method according to claim 4, characterized in that The determining the sub-region to which the click point belongs includes: According to the coordinates of each vertex of each sub-region, the click point is connected with each vertex of each sub-region to obtain a plurality of triangular regions; The sum of the areas of the multiple triangular regions is compared with the area of ​​each sub-region respectively. If they are equal, the click point is within the corresponding sub-region.

7. A UAV flight path generation and planning system, characterized in that: include: The acquisition unit is configured to obtain each waypoint P in the initial route planned by the user in the two-dimensional coordinate system. i , get each flight segment P i P i+1 The direction vector of , where i∈[1, n-1], n is the number of waypoints; The expansion unit is configured to i P i+1 The direction vector is rotated 90 degrees clockwise and counterclockwise respectively to obtain the normal vectors of the two outward expansion directions and the unit normal vector. According to the unit normal vector and the preset outward expansion distance d, each flight segment P is i P i+1 Expand in two expansion directions to obtain the first expansion boundary A i A i+1 ', the second outer boundary B i B i+1 '; The flight strip generation unit is configured to determine the first two adjacent outer expansion boundaries A i A i+1 'Whether there is an intersection and / or two adjacent second expansion boundaries B i B i+1 'Is there an intersection? If so, calculate the coordinates of the intersection I and use it as the new boundary point, and truncate the two outer boundaries, that is, the first outer boundary A i A i+1 'Change to A i I, first outward expansion boundary A i+1 A i+2 'Change to IA i+2 ', and / or, the second outward expansion boundary B i B i+1 'Change to B i I, second outer boundary B i+1 B i+2 'Become IB i+2 '; If not, then connect the two adjacent initial boundary points of the two outer expansion boundaries to generate a new outer expansion boundary to obtain the final flight zone; wherein, the two adjacent first outer expansion boundaries A are determined i A i+1 'Whether there is an intersection and / or two adjacent second expansion boundaries B i B i+1 'Whether there is an intersection, specifically including: A linear equation is used to calculate whether there is an intersection. The specific formula is as follows: D=(x1-x2)*(y3-y4)-(y1-y2)*(x3-x4) t = ((x1-x3)*(y3-y4)-(y1-y3)*(x3-x4)) / D u = (x1-x3)*(y1-y2)-(y1-y3)*(x1-x2)) / D Among them, (x1, y1), (x2, y2) and (x3, y3), (x4, y4) are two adjacent first expansion boundaries A i A i+1 ' and / or two adjacent second outward expansion boundaries B i B i+1 'The coordinates of the two boundary points; When D=0, it is judged that there is no intersection; When D≠0, and 0≤t≤1 and 0≤u≤1, then it is determined that there is an intersection point, and the coordinates of the intersection point I (x, y) are: x=x1+t*(x2-x1) y=y1+t*(y2-y1); The route planning unit is configured to upload route data, wherein the route data includes a plurality of parallel routes within the flight band that are parallel to the initial route, and the plurality of parallel routes are connected end to end to obtain a target route.

8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Two-dimensional display method for patrol route in parallel line buffer area

    CN107154066A

  • Zonal area route planning method, device and equipment by unmanned aerial vehicle

    CN109765933A

  • Air route generation method and device, electronic equipment and storage medium

    CN111750858A