Path planning method and device for unmanned aerial vehicle

Through the UAV path planning method, polygons are generated, corrosion treatment and scanning line filling are carried out, and an undirected graph is established, which solves the problems of high costs, waste of resources and insufficient accuracy in the traditional method, and achieves efficient and accurate spray path planning.

CN119165872APending Publication Date: 2024-12-20MACAU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411249336.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Traditional drone spray path planning methods are costly, have serious waste of resources, insufficient accuracy, and drones are prone to collision and damage.

Method used

By obtaining the coordinate information of the spray area, generating polygons, performing corrosion treatment and scanning line filling, establishing an undirected graph, and using preset algorithms to determine the traversal path to realize intelligent path planning of the drone.

Benefits of technology

Improve operational accuracy and efficiency, reduce resource waste and drone damage, and reduce operational costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119165872A_ABST
    Figure CN119165872A_ABST
Patent Text Reader

Abstract

The invention discloses a path planning method and device for an unmanned aerial vehicle. The method comprises the steps that coordinate information of a spraying area of the unmanned aerial vehicle is acquired; generating a first polygon corresponding to the coordinate information according to the coordinate information; corroding the first polygon to obtain a second polygon; respectively calculating the distance L between the vertex of the second polygon and the edge corresponding to the vertex; determining the spraying scanning direction of the unmanned aerial vehicle according to the distance L; performing scanning line filling on the second polygon according to the scanning direction and the width of the coverage area of the unmanned aerial vehicle to obtain an undirected graph; and the traversal path of the undirected graph is determined as the spraying path of the unmanned aerial vehicle by using the preset algorithm, so that the intelligent degree of path planning is improved, and the accuracy and efficiency of operation are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of unmanned aerial vehicles (UAVs), and in particular to a path planning method and device for an unmanned aerial vehicle (UAV). Background Art

[0002] In the field of modern agriculture and plant protection, spraying drones have become an important operating tool. Traditional spraying drones usually use predetermined paths or manual control to operate, which has some disadvantages, such as low operating efficiency and waste of resources. With the continuous development of artificial intelligence and drone technology, intelligent coverage path planning methods have become a research hotspot, aiming to improve operating efficiency, reduce costs, and reduce resource waste.

[0003] At present, there are path planning methods in the relevant technology. A common technical solution is a path planning method based on sensor data and a predetermined algorithm. This method collects environmental information in real time by installing sensors on the spraying drone, and performs path planning in combination with a predetermined algorithm. However, this method usually requires a large number of sensors and complex algorithms to implement, and is difficult to adapt to complex and changing environments.

[0004] In addition, there is another method in the related art, which is a path planning method based on GPS positioning and map data. This method uses GPS to locate the position of the spraying drone and combines map data for path planning. However, this method has relatively high requirements on the accuracy of GPS signals and map data. In certain environments where the GPS signal is unstable or the map data is not accurate enough, the path planning accuracy is relatively poor. Therefore, this method has certain limitations in practical applications.

[0005] In summary, the main technical problems existing in the path planning method in the related art include:

[0006] 1. High cost: Traditional path planning methods may involve a large number of sensor devices and complex algorithms, which will increase the manufacturing and operating costs of spraying drones.

[0007] 2. Waste of resources: Since traditional methods cannot effectively plan the operation path, the spraying drone may repeat the spraying or miss the spraying during the operation, resulting in waste of resources.

[0008] 3. Insufficient accuracy: The path planning method based on GPS positioning and map data is limited by the stability of GPS signals and the accuracy of map data, which may lead to inaccurate operation paths and affect operation efficiency.

[0009] 4. Collision and loss of drones: Due to the imprecision of traditional operation methods, drones cannot fully cover the required area during the spraying process or they may fly away from the required area and collide with certain obstacles in order to achieve full coverage, causing a certain degree of loss to the drones.

[0010] Therefore, a new method is needed for path planning in the drone spraying area to improve the intelligence of path planning and ensure the accuracy and efficiency of the operation without increasing the number of sensors. Summary of the invention

[0011] The present invention aims to provide a path planning method and device for an unmanned aerial vehicle, which can solve the problem of inaccurate precision in related technologies.

[0012] According to one aspect of the present invention, a path planning method for an unmanned aerial vehicle is provided, comprising: obtaining coordinate information of a spraying area of ​​the unmanned aerial vehicle; generating a first polygon corresponding to the coordinate information according to the coordinate information; corroding the first polygon to obtain a second polygon; respectively calculating the distance L between the vertex of the second polygon and the edge corresponding to the vertex; determining a scanning direction of the spraying of the unmanned aerial vehicle according to the distance L; filling the second polygon with scan lines according to the scanning direction and the width of the coverage range of the unmanned aerial vehicle to obtain an undirected graph; and using a preset algorithm to determine that the traversal path of the undirected graph is the spraying path of the unmanned aerial vehicle.

[0013] Preferably, determining the scanning direction of the spraying of the drone according to the distance L includes: determining the point and the corresponding edge corresponding to the shortest distance in the distance L, the connection direction of the point and the corresponding edge corresponding to the shortest distance being the first direction; determining the scanning direction to be a second direction perpendicular to the first direction.

[0014] Preferably, using a preset algorithm to determine that the traversal path of the undirected graph is the spraying path of the drone includes: obtaining information on the vertices and corresponding edges of the undirected graph; establishing a CPC mathematical model of the coverage path of the undirected graph based on the information on the vertices and corresponding edges of the undirected graph and the starting and ending point coordinates of the undirected graph; using a COPT mathematical solver to obtain an edge set of the CPC mathematical model; and using a DFS algorithm to connect the edges in the edge set into a traversal path of the undirected graph.

[0015] Preferably, according to the information of the vertices and the corresponding edges of the undirected graph and the coordinates of the starting point and the end point of the undirected graph, establishing the CPC mathematical model composed of the coverage path of the undirected graph includes: determining the CPC mathematical model according to the following formula:

[0016] Wherein, formula (1) minimizes the total length of the selected edges, formula (2) ensures that the total number of edges connected to each vertex in the undirected graph is an even number, st is the abbreviation of subject to, indicating the constraint condition, where E(i) represents the number of edges connected to point i in the undirected graph, formula (3) and formula (4) respectively ensure a directed edge starting from the starting point and a directed edge ending at the end point, V represents the set of all points, x ij is a variable, w i is an auxiliary variable, w i The value range is a positive integer, C ij represents the Euclidean distance of the edge from point i to point j.

[0017] Preferably, the distance of the corrosion treatment is half the width of the UAV coverage area.

[0018] According to one aspect of the present invention, a path planning device for a spraying drone is provided, comprising: a first acquisition module for acquiring coordinate information of a spraying area of ​​the drone; a generation module for generating a first polygon corresponding to the coordinate information according to the coordinate information; an erosion module for eroding the first polygon to obtain a second polygon; a first calculation module for respectively calculating the distance L between the vertex of the second polygon and the edge corresponding to the vertex; a first determination module for determining a scanning direction for spraying of the drone according to the distance L; a scanning module for filling the second polygon with scan lines according to the scanning direction and the width of the coverage range of the drone to obtain an undirected graph; and a second determination module for using a preset algorithm to determine that the traversal path of the undirected graph is the spraying path of the drone.

[0019] Preferably, the first determination module includes: a third determination module, used to determine the point and the corresponding edge corresponding to the shortest distance in the distance L, and the connection direction of the point and the corresponding edge corresponding to the shortest distance is the first direction; a fourth determination module, used to determine the scanning direction as a second direction perpendicular to the first direction.

[0020] Preferably, the second determination module includes: a second acquisition module, used to obtain the information of the vertices and corresponding edges of the undirected graph; an establishment module, used to establish the coverage path composition CPC mathematical model of the undirected graph according to the information of the vertices and corresponding edges of the undirected graph and the starting point and end point coordinates of the undirected graph; a second calculation module, used to use the COPT mathematical solver to obtain the edge set of the CPC mathematical model; and a connection module, used to use the DFS algorithm to connect the edges in the edge set into a traversal path of the undirected graph.

[0021] Preferably, the establishment module determines the CPC mathematical model according to the following formula:

[0022] Wherein, formula (1) minimizes the total length of the selected edges, formula (2) ensures that the total number of edges connected to each vertex in the undirected graph is an even number, st is the abbreviation of subject to, indicating the constraint condition, where E(i) represents the number of edges connected to point i in the undirected graph, formula (3) and formula (4) respectively ensure a directed edge starting from the starting point and a directed edge ending at the end point, V represents the set of all points, x ij is a variable, w i is an auxiliary variable, the value range is a positive integer, C ij represents the Euclidean distance of the edge from point i to point j.

[0023] Preferably, the distance of the corrosion treatment is half the width of the coverage area of ​​the drone.

[0024] According to one aspect of the present invention, there is provided a drone, comprising:

[0025] a memory and a processor, the memory being coupled to the processor;

[0026] The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the path planning method for the drone as described above.

[0027] According to one aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program runs on a computer or a processor, the computer or the processor executes the path planning method for a drone as described above.

[0028] The present invention provides a path planning method and device for an unmanned aerial vehicle, the method comprising: determining a scanning path through the spraying range of the unmanned aerial vehicle, then establishing a mathematical model for finding an optimal path, and realizing intelligent planning of an operation path for the spraying unmanned aerial vehicle by calculating the optimal coverage path, realizing that by obtaining the coordinates of each vertex of a required spraying area, the operation path can be intelligently planned, the operation accuracy can be improved, and the purpose of saving resources and reducing costs can be achieved. At the same time, the required operation area can be covered with a shorter path and out-of-bounds collisions can be effectively avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0030] Figure 1is a flow chart of a path planning method for a drone according to an embodiment of the present invention;

[0031] Figure 2 is a preferred flow chart of a path planning method for a drone according to an embodiment of the present invention;

[0032] Figure 3 is a schematic diagram of a path planning method according to an embodiment of the present invention;

[0033] Figure 4 is a schematic diagram of the spraying range of a drone according to an embodiment of the present invention;

[0034] Figure 5 is a schematic diagram of the width of the spraying range of the drone according to an embodiment of the present invention;

[0035] Figure 6 4 is a structural block diagram of a path planning device for a UAV according to an embodiment of the present invention. DETAILED DESCRIPTION

[0036] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0037] This embodiment provides a path planning method for a drone. Figure 1 is a flow chart of a path planning method for a UAV according to an embodiment of the present invention. Figure 1 As shown, the reversible data embedding method includes the following steps S102 to S107.

[0038] According to one aspect of the present invention, a path planning method for an unmanned aerial vehicle is provided, comprising the following steps S101 to S107.

[0039] Step S101, obtaining coordinate information of the spraying area of ​​the drone.

[0040] Step S102: Generate a first polygon corresponding to the coordinate information according to the coordinate information.

[0041] Step S103, eroding the first polygon to obtain a second polygon.

[0042] Step S104, respectively calculating the distance L between the vertex of the second polygon and the edge corresponding to the vertex.

[0043] Step S105, determining the spraying scanning direction of the drone according to the distance L.

[0044] Step S106, filling the second polygon with scan lines according to the scanning direction and the width of the coverage area of ​​the drone to obtain an undirected graph.

[0045] Step S107, using a preset algorithm to determine that the traversal path of the undirected graph is the spraying path of the drone.

[0046] In the above embodiment, the method avoids the flight of the UAV in unnecessary areas and reduces the risk of collision by corroding the original polygonal area (the first polygon); at the same time, by selecting the shortest point-edge pair to determine the scanning direction, the total path length is reduced and the operation efficiency is improved; the optimal coverage path finally generated can efficiently complete the spraying task without adding sensors and GPS positioning equipment, thereby reducing resource waste and reducing operating costs.

[0047] In implementation, in order to improve scanning accuracy, step S105 can be performed in the following manner: determine the point and the corresponding edge corresponding to the shortest distance in the distance L, and the connection direction of the point and the corresponding edge corresponding to the shortest distance is the first direction; determine the scanning direction as a second direction perpendicular to the first direction.

[0048] As a preferred implementation, preferably, using a preset algorithm to determine that the traversal path of the undirected graph is the spraying path of the drone includes: obtaining information on the vertices and corresponding edges of the undirected graph; establishing a CPC mathematical model of the coverage path of the undirected graph based on the information on the vertices and corresponding edges of the undirected graph and the starting and ending point coordinates of the undirected graph; using a COPT mathematical solver to obtain an edge set of the CPC mathematical model; and using a DFS algorithm to connect the edges in the edge set into a traversal path of the undirected graph.

[0049] In this preferred embodiment, the CPC mathematical model is solved using the COPT solver, which can quickly obtain an accurate solution. The generated optimal coverage path minimizes the total path length of the spraying area, further improving the work efficiency and resource utilization. The paths are arranged by the depth-first search DFS algorithm, ensuring that the drone can efficiently cover all spraying areas in the shortest path, reducing flight time and energy consumption.

[0050] It should be noted that the coordinates of the starting point and the end point are dynamically set according to the shape of the spraying area and the mission requirements of the drone. By dynamically setting the starting point and the end point, it can flexibly adapt to the spraying areas of different shapes and mission requirements, and further optimize the applicability of path planning.

[0051] Preferably, according to the information of the vertices and the corresponding edges of the undirected graph and the coordinates of the starting point and the end point of the undirected graph, establishing the CPC mathematical model composed of the coverage path of the undirected graph includes: determining the CPC mathematical model according to the following formula:

[0052] Wherein, formula (1) minimizes the total length of the selected edges, formula (2) ensures that the total number of edges connected to each vertex in the undirected graph is an even number, st is the abbreviation of subject to, indicating the constraint condition, where E(i) represents the number of edges connected to point i in the undirected graph, formula (3) and formula (4) respectively ensure a directed edge starting from the starting point and a directed edge ending at the end point, V represents the set of all points, x ij is a variable, w i is an auxiliary variable, w i is a positive integer, C ij represents the Euclidean distance of the edge from point i to point j.

[0053] Through this preferred embodiment, by optimizing the undirected graph, the total number of edges connected to each vertex in the undirected graph is an even number, which ensures the minimization and connectivity of the final path, reduces unnecessary flight paths, and improves the accuracy of the spraying operation.

[0054] As a preferred embodiment, the distance of the etching process is half the width of the drone coverage area. In this preferred embodiment, the scanning line filling in the polygonal area after the etching process is adopted, and the distance of the etching process is half the width of the drone coverage area (for details, please refer to Figure 4 and Figure 5 ), ensuring the coverage integrity of the spraying area, while preventing the drone from flying out of the target area during the spraying process, reducing collisions and waste of resources.

[0055] It should be noted that the width of the spraying range can be dynamically adjusted according to the flight speed of the drone and the spraying dosage. By dynamically adjusting the width of the spraying range, it can adapt to the spraying needs under different operating conditions, improve the spraying accuracy and efficiency, and avoid overspraying or missed spraying.

[0056] Preferably, the entire process of path planning can be adjusted through the real-time feedback data of the drone to cope with environmental changes. By utilizing the real-time feedback data of the drone, path planning can flexibly cope with environmental changes and ensure the continuity and stability of the operation.

[0057] Preferably, the flight path of the spraying drone is optimized in real time through an integrated artificial intelligence module. By integrating the artificial intelligence module for path optimization, the intelligence level and operation efficiency of path planning are further improved, and manual intervention and operation complexity are reduced.

[0058] Example

[0059] This embodiment provides a path planning method for a drone, which is used for planning the coverage path of a spraying drone.

[0060] In this embodiment, the coordinate information of the required spraying area can be read first. Generally speaking, the scene requiring drone spraying is a polygonal area, and the length of 1 / 2 of the drone's spraying range can be used to erode the original polygonal area to obtain a new polygonal area.

[0061] Subsequent operations need to be performed on the new polygonal area to avoid collisions outside the required spraying area when the drone is performing spraying operations. Then find the point-edge pair with the shortest distance between the point-edge pairs. At this time, the scanning direction of the drone is set to the direction from the edge to the point in the point-edge pair. According to the spraying range of the drone, the scanning line is filled along the vertical line of the point-edge pair. At this time, the polygon will become an undirected graph filled with parallel lines of the edges in a series of point-edge pairs.

[0062] Finally, a CPC mathematical model is established based on the coordinates of each vertex and edge connection information of the undirected graph at this time, as well as the coordinates of the starting point and the end point. Because the mathematical problem at this time is a non-NP-hard problem (a non-NP-hard problem refers to a problem that can be solvable in polynomial time), in this embodiment, the COPT mathematical solver can be directly called to quickly obtain an exact solution, and the obtained solutions are arranged through a depth-first search algorithm to obtain an optimal coverage path.

[0063] The method flow of this embodiment can refer to Figure 3 ,like Figure 3 As shown, the following steps may be included:

[0064] (a) Erosion polygon.

[0065] (b) Calculate the distance between each set of points and the edge.

[0066] (c) Select the shortest point-to-side distance to determine the scanning direction.

[0067] (d) Filling scan lines.

[0068] (e) Add the starting point and the end point to form an undirected graph.

[0069] (f) Call the COPT mathematical solver to solve the CPC model and add the edges required to form the covering path.

[0070] (g) Use the DFS algorithm to connect all edges into a complete path.

[0071] When implementing this embodiment, the following method can be used: Figure 2 The process shown includes the following steps S201 to S207.

[0072] Step S201, obtaining the coordinate information of the required spraying area and generating a polygon.

[0073] Step S202, eroding the polygon.

[0074] Step S203, calculating the distances between all points of the eroded polygon and the edges.

[0075] Step S204, selecting the shortest point-to-point side as the scanning direction and filling the scanning line.

[0076] Step S205, adding a starting point and an end point to form an undirected graph.

[0077] Step S206, calling the solver to calculate the model.

[0078] Step S207: Use DFS to connect into a complete path.

[0079] It should be noted that the point-edge pairs in this application are illustrated as follows: each vertex of a polygon corresponds to an edge of the polygon with the longest vertical distance. At this time, the vertex and the corresponding edge form a set of point-edge pairs, and their vertical distance is defined as the point-edge pair distance.

[0080] The CPC mathematical model in the present application may include: a coverage path composition mathematical model.

[0081] It should be noted that the point-edge pairs in this application are illustrated by example: COPT solver: This mathematical model solver can be used to efficiently and stably solve linear programming, mixed integer programming, (mixed integer) second-order cone programming, semidefinite programming, (mixed integer) convex quadratic programming and (mixed integer) convex quadratic constrained programming problems.

[0082] It should be noted that the point-edge pairs in this application are illustrated as follows: Euler path: is a concept in graph theory, which refers to a path in a graph that passes through each edge exactly once. If such a path exists, it is called an Euler path. If the starting point and end point of an Euler path are the same, then the path is an Euler circuit.

[0083] Depth-first search (DFS): is an algorithm used to traverse or search tree and graph data structures. The DFS algorithm starts from a root node (in the case of a graph, choose an arbitrary node as the root node) and explores as deep as possible along each branch until it can no longer go further, then backtracks.

[0084] In this embodiment, the scanning direction may be determined and the scanning lines may be filled in the following manner.

[0085] In this embodiment, the spraying range of the spraying drone is generally presented in a rectangular shape, as shown below Figure 4 shown.

[0086] The spraying range of the spraying drone when operating along the flight path is a rectangle that continues to extend along the flight path, as shown below Figure 5 As shown in the figure, the width of the rectangle is the spraying range of the drone.

[0087] In this application, in order to avoid collision of drones with non-spraying areas and waste and pollution of spraying agents, the original polygon is first corroded, and the corrosion distance is half of the spraying range. Because the boundary of the corroded polygon will be planned into the final path, the corroded area will definitely be sprayed. Then the distance of each point-to-edge pair of the corroded polygon is calculated one by one and the shortest pair of point-to-edge pairs is selected. A line segment is made from the vertical direction from the edge to the point in the point-to-edge pair and selected as the scanning direction of the drone. Then, with this edge as the reference, a parallel line is made along the scanning direction with the width of the spraying range until the remaining length is less than the width of the spraying range, which completes the scanning line filling of the corroded polygon.

[0088] As a preferred implementation, in this embodiment, the CPC model can be constructed in the following manner.

[0089] When the scan line is completely filled, the set start and end points are added, and the polygon filled with the scan line is transformed into an undirected graph. At this time, the problem is transformed into a path problem starting from the start point, traversing all the edges in the undirected graph at least once, and finally reaching the end point. Because the final path should be an Euler path, the CPC model is designed based on the necessary and sufficient conditions of the Euler path to solve the edges that need to be added to make the final path shortest. The CPC model is as follows.

[0090]

[0091] Formula (1) minimizes the total length of the selected edges. Formula (2) ensures that the total number of edges connected to each vertex in the undirected graph is an even number. st is the abbreviation of subject to, which indicates the constraint condition. E(i) represents the number of edges connected to point i in the undirected graph. Formula (3) and Formula (4) respectively ensure a directed edge starting from the starting point and a directed edge ending at the end point. V represents the set of all points. x ij is a variable, w i is an auxiliary variable, w i The value range is a positive integer, C ij represents the Euclidean distance of the edge from point i to point j.

[0092] Because the model can be solved in polynomial time and is not an NP-hard problem, the COPT mathematical solver is directly called in this embodiment to quickly solve and obtain an accurate solution. The solution obtained is an edge set, and finally the DFS algorithm is used to connect the edges in the edge set into a complete path. The spraying drone can complete the spraying task of the required operation area along the path in the shortest path and prevent the drone from colliding in the non-operation area.

[0093] Based on the same inventive concept, the present application also provides a path planning device for a drone, such as Figure 6 As shown, the device includes: a first acquisition module 601, used to acquire the coordinate information of the spraying area of ​​the drone; a generation module 602, used to generate a first polygon corresponding to the coordinate information according to the coordinate information; an erosion module 603, used to erode the first polygon to obtain a second polygon; a first calculation module 604, used to respectively calculate the distance L between the vertex of the second polygon and the edge corresponding to the vertex; a first determination module 605, used to determine the scanning direction of the spraying of the drone according to the distance L; a scanning module 606, used to fill the second polygon with scan lines according to the scanning direction and the width of the coverage range of the drone to obtain an undirected graph; a second determination module 607, used to use a preset algorithm to determine that the traversal path of the undirected graph is the spraying path of the drone.

[0094] Preferably, the first determination module includes: a third determination module, used to determine the point and the corresponding edge corresponding to the shortest distance in the distance L, and the connection direction of the point and the corresponding edge corresponding to the shortest distance is the first direction; a fourth determination module, used to determine the scanning direction as a second direction perpendicular to the first direction.

[0095] Preferably, the second determination module includes: a second acquisition module, used to obtain the information of the vertices and corresponding edges of the undirected graph; an establishment module, used to establish the coverage path composition CPC mathematical model of the undirected graph according to the information of the vertices and corresponding edges of the undirected graph and the starting point and end point coordinates of the undirected graph; a second calculation module, used to use the COPT mathematical solver to obtain the edge set of the CPC mathematical model; and a connection module, used to use the DFS algorithm to connect the edges in the edge set into a traversal path of the undirected graph.

[0096] Preferably, the establishment module determines the CPC mathematical model according to the following formula:

[0097] Wherein, formula (1) minimizes the total length of the selected edges, formula (2) ensures that the total number of edges connected to each vertex in the undirected graph is an even number, where E(i) represents the number of edges connected to point i in the undirected graph, formula (3) and formula (4) respectively ensure a directed edge starting from the starting point and a directed edge ending at the end point, V represents the set of all points, x ij is a variable, w i is an auxiliary variable, C ij represents the Euclidean distance of the edge from point i to point j.

[0098] Preferably, the distance of the corrosion treatment is half the width of the coverage area of ​​the drone.

[0099] This embodiment also provides a drone, including: a memory and a processor, wherein the memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the above-mentioned drone path planning method.

[0100] This embodiment also provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the path planning method of the drone in the above-mentioned embodiment.

[0101] This embodiment also provides a computer program product, which includes computer instructions. When the computer instructions are executed by a computer or a processor, the computer executes the above-mentioned related steps to implement the path planning method of the drone in the above-mentioned embodiment.

[0102] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the methods in the above-mentioned method embodiments.

[0103] Among them, the drone, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0104] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0105] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, 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 devices or units, which can be electrical, mechanical or other forms.

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

[0107] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0108] Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above content is within the scope of the present application.

[0109] 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 readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (read only memory, referred to as ROM), random access memory (random access memory, referred to as RAM), disk or optical disk and other media that can store program code.

[0110] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0111] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in a hardware manner, or can be implemented by a processor executing a software instruction. The software instruction can be composed of corresponding software modules, and the software module can be stored in a random access memory (Random Access Memory, RAM), a flash memory, a read-only memory (Read Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disk (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.

[0112] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer-readable storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0113] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0114] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A path planning method for a UAV, It is characterized in that include: Get the coordinate information of the spraying area of ​​the drone; generating a first polygon corresponding to the coordinate information according to the coordinate information; Eroding the first polygon to obtain a second polygon; respectively calculating the distance L between the vertex of the second polygon and the edge corresponding to the vertex; Determine the spraying scanning direction of the drone according to the distance L; Performing scan line filling on the second polygon according to the scanning direction and the width of the coverage range of the drone to obtain an undirected graph; A preset algorithm is used to determine that the traversal path of the undirected graph is the spraying path of the drone.

2. The method according to claim 1, It is characterized in that Determining the spraying scanning direction of the drone according to the distance L includes: Determine a point and an edge corresponding to the shortest distance in the distance L, wherein the direction of a line connecting the point and the edge corresponding to the shortest distance is a first direction; The scanning direction is determined to be a second direction perpendicular to the first direction.

3. The method according to claim 1, It is characterized in that Determining the traversal path of the undirected graph as the spraying path of the drone using a preset algorithm includes: Obtain information about vertices and corresponding edges of the undirected graph; According to the information of the vertices and the corresponding edges of the undirected graph and the coordinates of the starting point and the end point of the undirected graph, a CPC mathematical model of the coverage path composition of the undirected graph is established; Using the Shanshu solver COPT to obtain the edge set of the CPC mathematical model; A depth-first search (DFS) algorithm is used to connect the edges in the edge set into a traversal path of the undirected graph.

4. The method according to claim 1, It is characterized in that According to the information of the vertices and the corresponding edges of the undirected graph and the coordinates of the starting point and the end point of the undirected graph, the CPC mathematical model of the coverage path composition of the undirected graph is established, including: The CPC mathematical model is determined according to the following formula: Wherein, formula (1) minimizes the total length of the selected edges, formula (2) ensures that the total number of edges connected to each vertex in the undirected graph is an even number, where E(i) represents the number of edges connected to point i in the undirected graph, formula (3) and formula (4) respectively ensure a directed edge starting from the starting point and a directed edge ending at the end point, V represents the set of all points, x ij is a variable, w i is an auxiliary variable, C ij represents the Euclidean distance of the edge from point i to point j.

5. The method according to any one of claims 1 to 4, It is characterized in that The distance of corrosion treatment is half the width of the drone’s coverage area.

6. A path planning device for a spraying drone, It is characterized in that include: The first acquisition module is used to obtain the coordinate information of the spraying area of ​​the drone; A generating module, configured to generate a first polygon corresponding to the coordinate information according to the coordinate information; An erosion module, used for eroding the first polygon to obtain a second polygon; A first calculation module, used for respectively calculating the distance L between the vertex of the second polygon and the edge corresponding to the vertex; A first determination module is used to determine the spraying scanning direction of the drone according to the distance L; A scanning module, configured to perform scan line filling on the second polygon according to the scanning direction and the width of the coverage range of the drone to obtain an undirected graph; The second determination module is used to use a preset algorithm to determine that the traversal path of the undirected graph is the spraying path of the drone.

7. The device according to claim 6, It is characterized in that The first determining module comprises: A third determining module is used to determine a point and an edge corresponding to the shortest distance in the distance L, wherein the direction of a line connecting the point and the edge corresponding to the shortest distance is a first direction; The fourth determining module is used to determine that the scanning direction is a second direction perpendicular to the first direction.

8. The device according to claim 6, It is characterized in that The second determining module comprises: A second acquisition module is used to obtain information about the vertices and corresponding edges of the undirected graph; Establishing a module, for establishing a CPC mathematical model of the coverage path composition of the undirected graph according to the information of the vertices and corresponding edges of the undirected graph and the coordinates of the starting point and the end point of the undirected graph; A second calculation module, used for obtaining an edge set of the CPC mathematical model using a COPT mathematical solver; A connection module is used to connect the edges in the edge set into a traversal path of the undirected graph using a DFS algorithm.

9. The device according to claim 8, It is characterized in that The establishment module determines the CPC mathematical model according to the following formula: Wherein, formula (1) minimizes the total length of the selected edges, formula (2) ensures that the total number of edges connected to each vertex in the undirected graph is an even number, st is the abbreviation of subject to, indicating the constraint condition, where E(i) represents the number of edges connected to point i in the undirected graph, formula (3) and formula (4) respectively ensure a directed edge starting from the starting point and a directed edge ending at the end point, V represents the set of all points, x ij is a variable, w i is an auxiliary variable, the value range is a positive integer, C ij represents the Euclidean distance of the edge from point i to point j.

10. The device according to any one of claims 6 to 9, It is characterized in that The distance of the corrosion treatment is half the width of the coverage area of ​​the drone.

11. A drone, It is characterized in that include: a memory and a processor, the memory being coupled to the processor; The memory stores program instructions, and when the program instructions are executed by the processor, the electronic device executes the path planning method for a spraying drone according to any one of claims 1 to 5.

12. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program runs on a computer or a processor, the computer or the processor executes the path planning method for a spraying drone according to any one of claims 1 to 5.