Unmanned aerial vehicle flight route generation method and device facing waypoint file
By extracting information from waypoint files and generating waypoint sequences using SOM model or Q learning methods, the problem of manual route planning in the prior art is solved, and the automatic generation and efficient path planning of drone flight routes are realized.
Patent Information
- Application Number
- CN202411819376.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-11
AI Technical Summary
The existing drone flight route generation methods rely on manual marking of waypoints and planned routes, making it difficult to generate the shortest route when there are many waypoints, and lacks automatic generation capabilities.
By obtaining the latitude and longitude information in the waypoint file, converting it into three-dimensional spatial information, and generating waypoint sequences using the self-organized mapping neural network (SOM) model or Q-learning method, the drone flight route file is finally generated based on the waypoint sequence.
The automated generation of drone flight routes has been realized, the efficiency of route generation has been improved, the risks of manual intervention and errors have been reduced, and the path closer to the shortest route can be generated.
Smart Images

Figure CN119645075A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned aerial vehicles, and in particular to a method for generating a flight route of an unmanned aerial vehicle oriented to a waypoint file. Background Art
[0002] Currently, when generating a UAV flight route, you need to manually mark waypoints in the UAV application platform and configure the flight mission for each waypoint. Figure 1 As shown, Figure 1 A schematic diagram of the interface for generating relevant UAV flight routes. The UAV application platform provides map information through an interactive interface. Users mark waypoints one by one on the map and manually plan flight routes based on the marked waypoints to generate flight routes.
[0003] The process of manually generating routes depends entirely on the planner's experience. When the number of waypoints is small, the route generated by this method may still be the shortest route. Once the number of waypoints is large, it is impossible to manually plan a shortest route. Summary of the invention
[0004] The present invention provides a method for generating a flight route of an unmanned aerial vehicle (UAV) oriented to a waypoint file, so as to realize automatic generation of the flight route of the unmanned aerial vehicle (UAV).
[0005] A first aspect of the present invention provides a method for generating a UAV flight route oriented to a waypoint file, the method comprising:
[0006] Get the waypoint file including the waypoints to be flown by the drone.
[0007] Parse the waypoint file to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown.
[0008] The latitude and longitude information and the flight altitude information of the waypoint to be flown are converted into three-dimensional spatial information in a Cartesian coordinate system to obtain the three-dimensional spatial information of the waypoint to be flown.
[0009] According to the number of waypoints to be flown, a self-organizing map neural network SOM model is constructed, wherein the number of output neuron nodes in the competition layer of the self-organizing map neural network model is determined according to the number of waypoints to be flown, and each output neuron node is used to represent a three-dimensional spatial information.
[0010] The three-dimensional spatial information of a waypoint to be flown is randomly selected from the three-dimensional spatial information of the waypoints to be flown, and is input into the SOM model, so that each output neuron node of the SOM model outputs the three-dimensional spatial information for fitting the waypoint.
[0011] Determine the three-dimensional spatial information with the closest spatial distance to the three-dimensional spatial information of the currently input waypoint to be flown in the current output, and determine the output neuron node that outputs the three-dimensional spatial information with the closest spatial distance as the current winning neuron node,
[0012] Update the three-dimensional spatial information of the current winning neuron node and its neighboring neuron nodes,
[0013] Repeat the step of randomly selecting the three-dimensional space information of a waypoint to be flown from the three-dimensional space information of the waypoint to be flown until the three-dimensional space information currently outputted converges.
[0014] Extract the waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information.
[0015] Generate UAV flight route files based on the waypoint sequence.
[0016] As a possible implementation, the number of output neuron nodes is greater than or equal to the number of waypoints to be flown.
[0017] As a possible implementation manner, the number of input neuron nodes in the input layer of the self-organizing map neural network model is greater than or equal to the number of waypoints to be flown;
[0018] As a possible implementation, the method of making each output neuron node of the SOM model output three-dimensional spatial information for fitting a waypoint further includes:
[0019] According to the arrangement order of the output neuron nodes in the SOM model, the three-dimensional spatial information currently output by each output neuron node is combined into a current output matrix, and the row vector in the current output matrix is used to represent the three-dimensional spatial information currently output by the output neuron node corresponding to the row vector;
[0020] As a possible implementation, the updating of the three-dimensional spatial information of each neighboring neuron node of the current winning neuron node includes:
[0021] Based on the arrangement information of the current winning neuron node, a proximity weight between the current winning neuron node and its neighboring neuron nodes is determined, wherein the proximity weight is used to characterize the proximity degree of the arrangement distance between the current winning neuron node and its neighboring neuron nodes.
[0022] For each neighboring neuron node of the current winning neuron node, the three-dimensional space change of the neighboring neuron node is determined according to the current proximity weight of the neighboring neuron node, the current learning rate, and the spatial distance difference between the three-dimensional space of the currently input waypoint to be flown and the current three-dimensional space of the neighboring neuron node, and the current three-dimensional space information of the neighboring neuron node is updated according to the three-dimensional space change.
[0023] in,
[0024] The number of neighborhood neuron nodes is determined by the number of output neuron nodes.
[0025] The proximity weight decreases as the arrangement distance between the current winning neuron node and its neighboring neuron nodes increases;
[0026] As a possible implementation manner, the step of extracting a waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information includes:
[0027] Row vectors are extracted from the current output matrix, and the extracted row vectors are sorted according to the order of the rows in which the extracted row vectors are located in the current output matrix to obtain a waypoint sequence.
[0028] As a possible implementation, the number of the neighborhood neuron nodes and the proximity weight decrease as the number of iterations increases.
[0029] The obtaining of the waypoint file including the waypoints to be flown by the drone includes:
[0030] Obtaining a waypoint file from a drone application platform for providing drone services, wherein the waypoint file is a compressed file supporting a waypoint markup language;
[0031] The waypoint file is parsed to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown, including:
[0032] Decompress the waypoint file to obtain a decompressed file, wherein the decompressed file includes: a template file for editing flight waypoints, an execution file for defining UAV flight and load action instructions, and an auxiliary resource file for editing flight waypoints. The flight waypoints in the template file include take-off point and waypoint information, and the execution file only contains waypoint information but does not include take-off point information.
[0033] The template file is parsed using the extensible markup language document object model derived from Python to obtain a document object with a tree data structure for representing the waypoint file.
[0034] Get the take-off point latitude, longitude and altitude information from the take-off point element of the document object.
[0035] Get the latitude, longitude and altitude information of the waypoint from the location tag element of the document object.
[0036] As a possible implementation, extracting a row vector from the current output matrix includes:
[0037] According to each row vector in the current output matrix, determine the waypoint to be flown that the row vector fits, and extract the row vector that fits the waypoint to be flown;
[0038] The generation of the UAV flight route file based on the waypoint sequence includes:
[0039] Determine the take-off point from the waypoint sequence, take the take-off point as the first waypoint, reorder the waypoint sequence, and obtain a waypoint sequence with the take-off point as the first waypoint.
[0040] According to the waypoint sequence with the take-off point as the first waypoint, the position mark elements in the template file and the execution file for saving the waypoints are sorted, and the index sub-element of the position mark element is set, and the index sub-element is used to record the waypoint sequence information, and the flight tasks of each position mark element after interactive sorting make the flight tasks follow the position mark element, and the modified template file and execution file are obtained.
[0041] Compress the modified template file and execution file to obtain the UAV flight route file.
[0042] A second aspect of the present application provides a method for generating a UAV flight route for a waypoint file, the method comprising:
[0043] Get the waypoint file including the waypoints to be flown by the drone.
[0044] Parse the waypoint file to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown.
[0045] The latitude and longitude information and the flight altitude information of the waypoint to be flown are converted into three-dimensional spatial information in a Cartesian coordinate system to obtain the three-dimensional spatial information of the waypoint to be flown.
[0046] For each waypoint to be flown, a correspondence between all possible optional waypoints that may be used as the next waypoint when the waypoint to be flown is the currently selected waypoint and the expected return value is established to obtain the expected return correspondence relationship of the waypoint to be flown, wherein the currently selected waypoint corresponds to at least one optional waypoint, and each optional waypoint corresponds to a pre-fetched return value,
[0047] Initialize the pre-fetch return value in the corresponding relationship,
[0048] Mark all pending waypoints as unselected.
[0049] Set the take-off point in the waypoint to be flown as the currently selected waypoint.
[0050] According to the current pre-fetched return value in the expected return correspondence relationship of the currently selected waypoint, an optional waypoint in an unselected state is selected from the optional waypoints, and the selected waypoint is marked as a selected state.
[0051] Calculate the expected return estimate when the selected optional waypoint is the next currently selected waypoint, update the current pre-fetched return value with the expected return estimate, and use the selected optional waypoint as the currently selected waypoint,
[0052] Repeat the step of pre-fetching the current reward value in the expected reward correspondence relationship according to the currently selected waypoint until there are no optional waypoints, and obtain a waypoint sequence with the take-off point as the first waypoint.
[0053] Repeat the step of marking all waypoints to be flown as unselected until the number of cycles reaches a set threshold, and the optimal waypoint sequence is obtained.
[0054] Generate UAV flight route files based on the optimal waypoint sequence.
[0055] As a possible implementation, the calculation of the expected return estimate when the selected optional waypoint is the next currently selected waypoint includes:
[0056] Calculate the expected return estimate based on the current pre-fetched return value corresponding to the selected optional waypoint, the reward value of the selected optional waypoint, the maximum expected return estimate among the optional waypoints corresponding to the next currently selected waypoint when the selected optional waypoint is the selected optional waypoint, the learning rate, and the discount factor,
[0057] The reward value is determined according to the spatial distance between the currently selected waypoint and the selected optional waypoint;
[0058] As a possible implementation manner, selecting an unselected optional waypoint from the optional waypoints according to the current pre-fetched reward value in the expected reward correspondence relationship of the currently selected waypoint further includes:
[0059] According to the ε parameter in the ε greedy strategy, it is decided whether to explore the path or choose the currently known optimal path.
[0060] When the ε parameter is greater than the set parameter threshold, select the optional waypoint with the best expected return value and in the unselected state;
[0061] When the ε parameter is not greater than the set parameter threshold, an optional waypoint that is not selected is randomly selected.
[0062] As a possible implementation manner, the step of obtaining a waypoint file including waypoints to be flown by the drone includes:
[0063] Obtaining a waypoint file from a drone application platform for providing drone services, wherein the waypoint file is a compressed file supporting a waypoint markup language;
[0064] The waypoint file is parsed to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown, including:
[0065] Decompress the waypoint file to obtain a decompressed file, wherein the decompressed file includes: a template file for editing flight waypoints, an execution file for defining UAV flight and load action instructions, and an auxiliary resource file for editing flight waypoints. The flight waypoints in the template file include take-off point and waypoint information, and the execution file only contains waypoint information but does not include take-off point information.
[0066] The template file is parsed using the extensible markup language document object model derived from Python to obtain a document object with a tree data structure for representing the waypoint file.
[0067] Get the take-off point latitude, longitude and altitude information from the take-off point element of the document object.
[0068] Get the latitude, longitude and altitude information of the waypoint from the location tag element of the document object.
[0069] As a possible implementation, the generating of the UAV flight route file based on the optimal waypoint sequence includes:
[0070] According to the optimal waypoint sequence, the position marker elements in the template file and the execution file for saving the waypoints are sorted, and the index sub-element of the position marker element is set, and the index sub-element is used to record the waypoint sequence information, and the flight tasks of each position marker element after interactive sorting make the flight tasks follow the position marker element, and the modified template file and execution file are obtained.
[0071] Compress the modified template file and execution file to obtain the UAV flight route file.
[0072] The third aspect of the present application provides a device for generating a UAV flight route for a waypoint file, the device comprising:
[0073] The decoding module is used to obtain the waypoint file including the waypoint to be flown by the UAV, parse the waypoint file, obtain the latitude and longitude information and the flight altitude information of the waypoint to be flown, convert the latitude and longitude information and the flight altitude information of the waypoint to be flown into three-dimensional space information in a Cartesian coordinate system, and obtain the three-dimensional space information of the waypoint to be flown.
[0074] The route generation module is used to construct a self-organizing map neural network SOM model according to the number of waypoints to be flown, wherein the number of output neuron nodes in the competition layer of the self-organizing map neural network model is determined according to the number of waypoints to be flown, and each output neuron node is used to represent a three-dimensional spatial information.
[0075] The three-dimensional spatial information of a waypoint to be flown is randomly selected from the three-dimensional spatial information of the waypoints to be flown, and is input into the SOM model, so that each output neuron node of the SOM model outputs the three-dimensional spatial information for fitting the waypoint.
[0076] Determine the three-dimensional spatial information with the closest spatial distance to the three-dimensional spatial information of the currently input waypoint to be flown in the current output, and determine the output neuron node that outputs the three-dimensional spatial information with the closest spatial distance as the current winning neuron node,
[0077] Update the three-dimensional spatial information of the neighboring neuron nodes of the current winning neuron node,
[0078] Repeat the step of randomly selecting the three-dimensional space information of a waypoint to be flown from the three-dimensional space information of the waypoint to be flown until the three-dimensional space information currently outputted converges.
[0079] Extract the waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information.
[0080] The encoding module is used to generate the UAV flight route file based on the waypoint sequence.
[0081] A fourth aspect of the present application provides a device for generating a UAV flight route for a waypoint file, the device comprising:
[0082] The decoding module is used to obtain the waypoint file including the waypoint to be flown by the UAV, parse the waypoint file, obtain the latitude and longitude information and the flight altitude information of the waypoint to be flown, convert the latitude and longitude information and the flight altitude information of the waypoint to be flown into three-dimensional space information in a Cartesian coordinate system, and obtain the three-dimensional space information of the waypoint to be flown.
[0083] The route generation module is used to establish, for each waypoint to be flown, a correspondence between all optional waypoints that may be used as the next waypoint when the waypoint to be flown is the currently selected waypoint and the expected return value, and obtain the expected return correspondence relationship of the waypoint to be flown, wherein the currently selected waypoint corresponds to at least one optional waypoint, and each optional waypoint corresponds to a pre-fetched return value,
[0084] Initialize the pre-fetch return value in the corresponding relationship,
[0085] Mark all pending waypoints as unselected.
[0086] Set the take-off point in the waypoint to be flown as the currently selected waypoint.
[0087] According to the current pre-fetched return value in the expected return correspondence relationship of the currently selected waypoint, an optional waypoint in an unselected state is selected from the optional waypoints, and the selected waypoint is marked as a selected state.
[0088] Calculate the expected return estimate when the selected optional waypoint is the next currently selected waypoint, and use the expected return estimate to update the current pre-fetched return value, and use the selected optional waypoint as the currently selected waypoint,
[0089] Repeat the step of pre-fetching the current reward value in the expected reward correspondence relationship according to the currently selected waypoint until there are no optional waypoints, and obtain a waypoint sequence with the take-off point as the first waypoint.
[0090] Repeat the step of marking all waypoints to be flown as unselected until the number of cycles reaches a set threshold, and the optimal waypoint sequence is obtained.
[0091] The encoding module is used to generate the UAV flight route file based on the optimal waypoint sequence.
[0092] The method for generating a UAV flight route for a waypoint file provided in the present application extracts waypoint information from the waypoint file and converts it into three-dimensional spatial information in a Cartesian coordinate system, generates a waypoint sequence using a SOM model or in a Q-learning manner, and forms a route file based on the waypoint sequence, thereby solving the problems of time-consuming manual route generation and non-shortest routes, and improving the automation of route generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0093] Figure 1 A schematic diagram of the interface for generating relevant drone flight routes.
[0094] Figure 2 A flow chart of a method for generating a UAV flight route for a waypoint file according to an embodiment of the present application.
[0095] Figure 3 This is a schematic diagram of the file structure after the WPML waypoint file is decompressed in this embodiment.
[0096] Figure 4 This is a flow chart of using the SOM neural network model to generate a flight route in this embodiment.
[0097] Figure 5 A schematic diagram of a flow chart of generating a flight route by using a Q-learning method in this embodiment.
[0098] Figure 6 The fitted waypoint coordinates obtained by using the SOM model to optimize the route.
[0099] Figure 7 Schematic diagram of route optimization using the SOM model.
[0100] Figure 8 The waypoint coordinates obtained by route optimization using Q learning.
[0101] Fig. 9 Schematic diagram of route optimization using Q learning method.
[0102] Fig.10 Schematic diagram for optimization of manually planned routes.
[0103] Fig.11 It is a comparison chart of the route path and flight time before and after optimization.
[0104] Fig.12 A schematic diagram of a flow chart of a device for generating a UAV flight route for waypoint files according to an embodiment of the present application. DETAILED DESCRIPTION
[0105] In order to make the objectives, technical means and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings.
[0106] The applicant found that the drone application platform only supports manual flight route generation and cannot support automatic generation of drone flight routes. The reason is that, on the one hand, due to limited computing resources, it is difficult for the drone application platform to provide high-quality route generation algorithms. On the other hand, data used for drone flight route planning, such as waypoint information, task information to be performed at waypoints, etc., are stored in standard format files, and these data are difficult to extract from the files. On the other hand, drone flight route generation is essentially a traveling salesman problem (TSP). The traveling salesman problem (TSP) is a classic combinatorial generation problem, whose purpose is to find a shortest two-dimensional path so that each travel point is visited exactly once and eventually returns to the travel point at the time of departure. However, since the drone flight route is a three-dimensional space path, the related two-dimensional path generation method is not applicable to drone flight routes.
[0107] In view of this, the present application embodiment provides a method for generating a UAV flight route for a waypoint file. Figure 2 As shown, Figure 2 A flowchart of a method for generating a UAV flight route for a waypoint file according to an embodiment of the present application is shown. The method includes:
[0108] Step 201, obtaining a waypoint file including the waypoints to be flown by the drone,
[0109] As an example, a waypoint file is obtained from a drone application platform for providing drone services, wherein the waypoint file is a compressed file supporting a waypoint markup language.
[0110] Step 202: parse the waypoint file to obtain the waypoint information from the waypoint file, wherein the waypoint information includes latitude and longitude information and flight altitude information.
[0111] As an example, the waypoint file is decompressed to obtain a decompressed file, wherein the decompressed file includes: a template file for editing flight waypoints, an execution file for defining UAV flight and load action instructions, and an auxiliary resource file for editing flight waypoints. The flight waypoints in the template file include take-off point and waypoint information, and the execution file only contains waypoint information but does not include take-off point information.
[0112] The template file is parsed using the derived (python) extensible markup language document object model to obtain a document object with a tree data structure for representing the waypoint file.
[0113] Get the take-off point latitude, longitude and altitude information from the take-off point element of the document object.
[0114] Get the latitude, longitude and altitude information of the waypoint from the location tag element of the document object.
[0115] Step 203, converting the latitude and longitude information and the flight altitude information of the waypoint to be flown into three-dimensional space information in a Cartesian coordinate system to obtain the three-dimensional space information of the waypoint to be flown.
[0116] As an example, the longitude and latitude information in each waypoint information is converted into plane Cartesian coordinates, and the plane Cartesian coordinates and the flight altitude information are used as the three-dimensional space information of the waypoint.
[0117] Step 204, using a self-organizing map neural network (SOM) model or an expected reward learning method, TSP is solved for each waypoint information with three-dimensional spatial information to obtain a waypoint sequence.
[0118] in,
[0119] The SOM model is used to solve the TSP for each waypoint information with three-dimensional spatial information in the following way:
[0120] According to the number of waypoints to be flown, a self-organizing map neural network SOM model is constructed, wherein the number of output neuron nodes in the competition layer of the self-organizing map neural network model is determined according to the number of waypoints to be flown, and each output neuron node is used to represent a three-dimensional spatial information.
[0121] The three-dimensional spatial information of a waypoint to be flown is randomly selected from the three-dimensional spatial information of the waypoints to be flown, and is input into the SOM model, so that each output neuron node of the SOM model outputs the three-dimensional spatial information for fitting the waypoint.
[0122] Determine the three-dimensional spatial information with the closest spatial distance to the three-dimensional spatial information of the currently input waypoint to be flown in the current output, and determine the output neuron node that outputs the three-dimensional spatial information with the closest spatial distance as the current winning neuron node,
[0123] Update the three-dimensional spatial information of the neighboring neuron nodes of the current winning neuron node,
[0124] Repeat the step of randomly selecting the three-dimensional space information of a waypoint to be flown from the three-dimensional space information of the waypoint to be flown until the three-dimensional space information currently outputted converges.
[0125] Extract the waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information.
[0126] Generate UAV flight route files based on the waypoint sequence.
[0127] The expected return learning method is used to solve the TSP for each waypoint information with three-dimensional spatial information in the following way:
[0128] For each waypoint to be flown, a correspondence between all possible optional waypoints that may be used as the next waypoint when the waypoint to be flown is the currently selected waypoint and the expected return value is established to obtain the expected return correspondence relationship of the waypoint to be flown, wherein the currently selected waypoint corresponds to at least one optional waypoint, and each optional waypoint corresponds to a pre-fetched return value,
[0129] Initialize the pre-fetch return value in the corresponding relationship,
[0130] Mark all pending waypoints as unselected.
[0131] Set the take-off point in the waypoint to be flown as the currently selected waypoint.
[0132] According to the current pre-fetched return value in the expected return correspondence relationship of the currently selected waypoint, an optional waypoint in an unselected state is selected from the optional waypoints, and the selected waypoint is marked as a selected state.
[0133] Calculate the expected return estimate when the selected optional waypoint is the next currently selected waypoint, and use the expected return estimate to update the current pre-fetched return value, and use the selected optional waypoint as the currently selected waypoint,
[0134] Repeat the step of pre-fetching the current reward value in the expected reward correspondence relationship according to the currently selected waypoint until there are no optional waypoints, and obtain a waypoint sequence with the take-off point as the first waypoint.
[0135] Repeat the step of marking all waypoints to be flown as unselected until the number of cycles reaches a set threshold, and the optimal waypoint sequence is obtained.
[0136] Generate UAV flight route files based on the optimal waypoint sequence.
[0137] Step 205: Generate a UAV flight route file based on the waypoint sequence.
[0138] As an example, the location mark elements for saving waypoints in the template file and the execution file are sorted according to the waypoint sequence, and the index sub-element of the location mark element is set, and the index sub-element is used to record the waypoint sequence information, and the flight tasks of each location mark element after interactive sorting make the flight tasks follow the location mark element, and the modified template file and execution file are obtained.
[0139] Compress the modified template file and execution file to obtain the UAV flight route file.
[0140] The UAV flight route generation method for waypoint files provided in the embodiment of the present application improves the automation of UAV flight route generation and the efficiency of UAV flight route generation. It does not require relying on manual experience to select waypoints to be flown, nor does it require manual input and recording of latitude, longitude and altitude information and tasks for each waypoint, which greatly reduces human workload and the risk of errors.
[0141] To facilitate understanding of the embodiments of the present application, the waypoint file format standard of the waypoint markup language (WPML) is used as an example for explanation below. It should be understood that the embodiments of the present application are not limited to the waypoint file format itself, and may also be applicable to waypoint files in other formats.
[0142] The WPML waypoint file format standard is based on the definition of the markup language KML (Keyhole Markup Language). WPML waypoint files follow the archive requirements of the markup language compression (KMZ, Keyhole Markup Language Zipped). All waypoint files end with the suffix ".kmz" in the file name. In fact, they are archive files packaged in the ZIP format. After a standard waypoint file is decompressed, its file structure is as follows Figure 3 The decompressed standard waypoint files include: template files, execution files, and resource files, among which:
[0143] The template file is named template.kml. It is a predefined template that provides a convenient way for users to edit and plan routes. For example, when using the aerial photography template, there is no need to carefully draw the path of each route. Instead, you only need to define the mapping area and overlap rate, and then generate the drone execution path and action through DJI Pilot 2, DJI Flighthub 2 or other software.
[0144] The executable file is named waylines.wpml, which is used to define the flight and payload action instructions of the drone. These instructions are generated by DJI Pilot 2, DJI Flighthub 2 or other software by reading the template parameters in template.kml and combining them with the calculation of the path generation algorithm to finally generate the waylines.wpml file for execution.
[0145] The resource file is named res, which is a folder containing auxiliary resource files required for the route, such as reference target photos prepared in advance before starting precise reshooting.
[0146] In this embodiment, the WPML waypoint file of the waypoint to be flown is decompressed to obtain a template file and an execution file. The template file contains the information of the take-off point and all the waypoints, and the execution file only contains the information of the waypoints but not the take-off point. The template file is read and parsed using Python's extensible markup language document object model, such as the xml.dom package, to obtain a document object, which represents the tree data structure of the entire WPML waypoint file.
[0147] The Document object includes a Placemark element, which includes a Point sub-element and an Altitude sub-element. The longitude and latitude of the takeoff point and the altitude are obtained from the Takeoff Point element under the Placemark element; the longitude and latitude of the waypoint are obtained from the Point sub-element in the Placemark element, and the altitude of the waypoint is obtained from the Altitude sub-element in the Placemark element.
[0148] Next, the longitude and latitude of all waypoints are converted into plane Cartesian coordinates to obtain the information of the waypoints to be flown. For example, the Miller projection method is used for coordinate conversion. The origin of the plane Cartesian coordinates is taken as the take-off point. For each waypoint, the plane Cartesian coordinates of the waypoint and the height of the waypoint are used as the three-dimensional coordinates of the waypoint.
[0149] One way of this embodiment is to use a self-organizing map (SOM) neural network model to generate a flight route.
[0150] As an example, the SOM neural network model includes an input layer and a competition layer, wherein the input layer includes a plurality of input neuron nodes, and the competition layer is a one-dimensional linear array or a two-dimensional planar array composed of a plurality of output neuron nodes, and each input neuron node is connected to all output neuron nodes. The number of input neuron nodes and the number of output neuron nodes depend on the application requirements.
[0151] In this embodiment, the number of input neuron nodes and the number of output neuron nodes are determined according to the number of waypoints to be flown obtained. For example, when the number of waypoints to be flown obtained is n, the number of input neuron nodes and the number of output neuron nodes can be set to be greater than or equal to n. In this embodiment, the number of input neuron nodes and the number of output neuron nodes are the same, both are not m, for example, m=8n.
[0152] See also Figure 4 As shown, Figure 4 This is a flow chart of using the SOM neural network model to generate a flight route in this embodiment. It includes:
[0153] Step 401, construct an initial matrix to set the initial three-dimensional space coordinates corresponding to each output neuron node in the competition layer,
[0154] The matrix has m rows and 3 columns, each row is used to represent a three-dimensional space coordinate information, each column represents the x coordinate, y coordinate, and height coordinate in the three-dimensional space coordinate information, m is the number of output neuron nodes of the SOM neural network model, and each output neuron node corresponds to a row vector in the matrix, so that an output neuron node can represent a three-dimensional space information. Each row vector in the initial matrix can be determined according to the waypoint information to be flown, for example, the value is a random number near the waypoint information to be flown.
[0155] Step 402, select any waypoint information from the waypoint information to be flown and input it into the SOM neural network model. Each output neuron node of the SOM neural network model outputs a three-dimensional space coordinate information respectively. The three-dimensional space coordinate information output by all output neuron nodes can form a current output matrix according to the arrangement order of the output neuron nodes. The output matrix has m rows and 3 columns, each row is used to represent a three-dimensional space coordinate information, and each column represents the x coordinate, y coordinate, and height coordinate in the three-dimensional space coordinate information respectively.
[0156] Step 403, determining the winning neuron node.
[0157] Determine the three-dimensional spatial coordinates with the closest spatial distance to the current input waypoint in the current output matrix as the winning three-dimensional spatial coordinates, determine the output neuron node that outputs the winning three-dimensional spatial coordinate information according to the winning three-dimensional spatial coordinates, and use the output neuron node as the winning neuron node.
[0158] Calculate a Gaussian distribution array centered on the winning neuron node, which contains the proximity weight of each output neuron node. The proximity weight dimension is the total number of output neuron nodes × 1, which is used to characterize the proximity of the arrangement distance between the current winning neuron node and its neighboring neuron nodes; the proximity weight decreases as the arrangement distance between the output neuron node and the winning neuron node increases.
[0159] As an example, a Gaussian distribution array can be computed as follows:
[0160] For any output neuron node i, determine the arrangement position of the output neuron node i relative to the winning neuron node, expressed mathematically as:
[0161] Δi=|P v -P i |
[0162] Among them, P v is the index of the winning neuron node, which is used to represent the arrangement position of the winning neuron node. i is the index of the output neuron node i, which is used to characterize the arrangement position of the output neuron node i, Δi is the arrangement position of the output neuron node i relative to the winning neuron node, || represents the absolute value calculation,
[0163] The minimum value of the arrangement position of the output neuron node i relative to the winning neuron node and the difference between the total number of output neuron nodes and Δi is used as the arrangement distance between the output neuron node i and the winning neuron node, which is expressed as follows:
[0164] d i =min(Δi,m-Δi)
[0165] Among them, d i is the arrangement distance between the output neuron node i and the winning neuron node, and m is the total number of output neuron nodes;
[0166] calculate
[0167] The neighborhood radius and the exponential function associated with the arrangement distance between the output neuron node i and the winning neuron node are used to obtain the Gaussian distribution of the output neuron node i. The Gaussian distribution represents the proximity weight of the three-dimensional space coordinate point corresponding to the output neuron node i, which is expressed as follows:
[0168] Among them, output i is the Gaussian distribution of the output neural node i, d i is the arrangement distance between the output neuron node i and the winning neuron node. The neighborhood radius R is used to determine the number of output neuron nodes around the winning neuron node, that is, the number of neighborhood neuron nodes of the winning neuron node. For example, the neighborhood radius is m / 10, where m is the total number of output neuron nodes. When the neighborhood radius value m / 10 is less than or equal to 1, the neighborhood radius is set to 1. When the neighborhood radius value m / 10 is greater than 1, the neighborhood radius is set to the value of m / 10 rounded down.
[0169] Step 404, update the current three-dimensional space information of the current neighboring neuron nodes of the current winning neuron,
[0170] For each neighboring neuron node within the current neighborhood radius of the winning neuron node, the proximity weight, the current learning rate, and the difference between the current input waypoint and the current three-dimensional space coordinates corresponding to the neighboring neuron node are used to calculate the change in the three-dimensional space coordinate information corresponding to the neighboring neuron node, and the three-dimensional coordinate information of the neighboring neuron node is updated according to the change to perform one iteration.
[0171] As an example, the calculation of the change is expressed mathematically as follows:
[0172] ΔK r =output r ×α×(K s -K r )
[0173] Among them, ΔK r is the change in the three-dimensional space coordinate information corresponding to the neighborhood neuron node r, including the coordinates of x, y, and z, output r is the proximity weight of the neighboring neuron node r, α is the current learning rate, K s is the three-dimensional space coordinate information of the current input waypoint s, K r is the current three-dimensional space coordinate corresponding to the neighborhood neuron node r.
[0174] Step 405, after each iteration, the learning rate is decayed to serve as the learning rate for the next iteration. For example, after each iteration, the learning rate is multiplied by 0.9997 to reduce the change in the three-dimensional spatial coordinate information corresponding to the later output neuron nodes to ensure the convergence of the neural network model.
[0175] After each iteration, the neighborhood radius is also attenuated to serve as the neighborhood radius of the next iteration. For example, after each iteration, the neighborhood radius is multiplied by 0.9997 to gradually reduce the neighborhood radius, so that only the output neuron nodes that are closer to the winning neuron node are updated in the later stage to increase accuracy.
[0176] Steps 402 to 405 are repeatedly performed until the learning rate or the neighborhood radius decays to a set threshold, and the iteration is terminated.
[0177] Through iteration, the three-dimensional spatial coordinate information corresponding to the output neuron node gradually fits the waypoint information to be flown, and finally solves the TSP problem.
[0178] From the output matrix output by the SOM neural network model, extract the three-dimensional spatial information that fits the information of the waypoints to be flown, and determine the order of the extracted three-dimensional spatial information according to the order of the rows in the output matrix, and obtain the waypoint sequence of the waypoints to be flown, take the take-off point in the waypoint sequence as the first waypoint, sort the waypoints in the waypoint sequence in sequence until reaching the take-off point, and obtain the sequence with the take-off point as the first waypoint and the last waypoint as the flight route. For example, the waypoint sequence of the waypoints to be flown output by the SOM neural network model is AXDEFG, where D is the take-off point, and the flight route generated based on the waypoint sequence is: DEFGAXD.
[0179] Another method of the present application embodiment is to generate a flight route by Q learning. Figure 5 As shown, Figure 5 This is a flow chart of generating a flight route using Q learning in this embodiment. It includes:
[0180] Step 501, setting a reward calculation function for calculating a reward value and a take-off point, wherein the reward calculation function is related to a spatial distance between waypoints;
[0181] As an example, the reward calculation function is expressed mathematically as follows:
[0182]
[0183] Among them, R(s, a) represents the reward value, s represents the currently selected waypoint, a represents the optional waypoint, and x s ,y s 、z s is the three-dimensional coordinate of the currently selected waypoint s, x a ,y a 、z a are the 3D coordinates of the optional waypoint a.
[0184] To improve processing efficiency, for any two waypoints to be flown, the spatial distance between the two waypoints is calculated and stored. As an example, the spatial distance between any two waypoints is recorded in a matrix form. For the convenience of writing, the matrix is called a Q value matrix. Each row and column in the Q value matrix corresponds to a waypoint, and the elements in the matrix are used to represent the distance between the waypoint corresponding to the row where the element is located and the waypoint corresponding to the column where the element is located.
[0185] Step 502, set the ε value, learning rate α, and discount factor γ of the ε greedy strategy, and set the expected return initial value in the corresponding relationship used to characterize the expected return of selecting an optional waypoint when a currently selected waypoint is selected. For the convenience of writing, this corresponding relationship is called a Q table.
[0186] Since any of the waypoints to be flown may be the currently selected waypoint, and the remaining waypoints except the currently selected waypoint may be optional waypoints, the currently selected waypoint corresponds to multiple optional waypoints, and each optional waypoint corresponds to its expected return initial value. For example, if there are 10 waypoints to be flown, and any of them is the currently selected waypoint, then the number of optional waypoints is 9, and each corresponds to 9 expected return initial values.
[0187] Referring to Table 1, Table 1 is a Q table with 5 waypoints to be flown, where A1 to A5 respectively represent the 5 waypoints to be flown.
[0188] Table 1
[0189]
[0190] In this way, each waypoint in the waypoints to be flown has a corresponding relationship between an optional waypoint and an expected return value.
[0191] Step 503: start training to generate a path from the take-off point to the end point.
[0192] Step 5031, resetting the flag for recording the selected waypoints, that is, marking all waypoints as unselected so as not to be disturbed by the path generated last time.
[0193] Step 5032, taking the take-off point as the currently selected waypoint, and marking the currently selected waypoint as selected.
[0194] Step 5033, based on the expected return in the current Q table, use the ε parameter in the ε greedy strategy to decide whether to perform path exploration or select the currently known optimal path.
[0195] When the ε parameter is greater than the set parameter threshold, the currently known optimal path is selected.
[0196] In the process of selecting the currently known optimal path, according to the expected return in the current Q table, from the optional waypoints of the currently selected waypoint, the optional waypoint with the best expected return value and in an unselected state is selected as the current best waypoint, and the optional waypoint is marked as selected. According to the best expected return value, the reward value of the current best waypoint, the maximum expected return estimate among the optional waypoints in the unselected state when the current best waypoint is the next selected waypoint (i.e., the maximum expected return value), the learning rate α, and the discount factor γ, the expected return estimate is calculated to update the best expected return value, and the current best waypoint is used as the next currently selected waypoint to execute step 5034, wherein the reward value of the current best waypoint is determined according to the distance between the current best waypoint and the currently selected waypoint, and the distance between the current best waypoint and the currently selected waypoint can be obtained from the Q matrix.
[0197] When the ε parameter is not greater than the set parameter threshold, path exploration is performed.
[0198] During the path exploration process, an optional waypoint is randomly selected from the optional waypoints in the currently selected waypoint that are in an unselected state, and the optional waypoint is marked as selected. The expected return estimate is calculated based on the expected return value corresponding to the randomly selected optional waypoint in the current Q table, the reward value of the randomly selected optional waypoint, the maximum expected return estimate among the optional waypoints in the unselected state when the randomly selected optional waypoint is the next selected waypoint (i.e., the maximum expected return value), the learning rate α, and the discount factor γ, so as to update the current expected return value corresponding to the randomly selected optional waypoint in the current Q table, use the randomly selected optional waypoint as the next currently selected waypoint, and execute step 5034, wherein the reward value of the randomly selected optional waypoint is determined based on the distance between the randomly selected optional waypoint and the currently selected waypoint.
[0199] As an example, the mathematical expression for the expected return estimate is:
[0200] Q″(s,a)=Q(s,a)+α[R(s,a)+γmaxQ(s′,a′)-Q(s,a)]
[0201] Among them, Q″(s, a) represents the expected reward estimate for the currently selected waypoint s and the optional waypoint a, that is, the updated expected reward value, Q(s, a) represents the current expected reward value of the currently selected waypoint s and the optional waypoint a, R(s, a) is the reward value for the currently selected waypoint s and the optional waypoint a, and maxQ(s′, a′) represents the maximum expected reward value among the optional waypoint a′ in the unselected state in the next currently selected waypoint s′.
[0202] Step 5034, returning to step 5033, until there is no optional waypoint, to obtain a waypoint sequence with the take-off point as the first waypoint, and the last waypoint in the waypoint sequence as the end point.
[0203] Step 504, repeatedly executing step 503 to gradually optimize the expected reward value in the Q table. When the number of cycles reaches the set number threshold, the optimal waypoint sequence corresponding to the optimal path from the take-off point to the end point can be obtained.
[0204] In the above steps, the ε parameter is used to control the ratio of path exploration and selection of the currently known best path. ε is higher at the beginning of training, and path exploration is more likely. As training progresses, the ε value gradually decreases, and the currently known best path is more likely to be selected.
[0205] After the waypoint sequence is obtained, the obtained waypoint sequence is re-encoded to generate a WPML waypoint file. In the process of encoding and generating a new WPML waypoint file, the flight missions in the waypoints will also be modified accordingly in sequence to ensure that the flight mission of each waypoint remains unchanged.
[0206] Specifically, the template.kml file and the waylines.wpml file are modified according to the obtained waypoint sequence. Given that each waypoint information in the template.kml file and the waylines.wpml file is stored in a Placemark element, the sequence number information is stored in the index element under the Placemark element, and the number of waypoints is the number of Placemark elements. The Placemark elements are reordered according to the waypoint sequence, and the index element content is modified according to the waypoint sequence. Among them, since the index element numbering starts from 0 and the waypoint sequence numbering starts from 1, when modifying the index element content, the waypoint sequence numbering needs to be reduced by 1. During the data exchange process in the branch structure under the Placemark element, the flight mission of each waypoint will also be exchanged together, so that the waypoint is bound to its flight mission. After modifying the template.kml file and the waylines.wpml file, repackage the template.kml file and the waylines.wpml file into a WPML waypoint file with a ".kmz" suffix.
[0207] In order to demonstrate the effect of the three-dimensional TSP solution of this embodiment, the simulation experiment is as follows: 30 waypoints are randomly generated in a three-dimensional space of 1000m×1000m×1000m, and the route length solved by the three-dimensional TSP is compared with the route length planned manually. In order to describe the technical effect, an optimization rate is set to characterize the ratio between the route length before the three-dimensional TSP solution and the route length after the three-dimensional TSP solution. The optimization rate ranges from 0 to 1. The larger the optimization rate, the worse the optimization effect; the smaller the optimization rate, the better the optimization effect.
[0208] Random simulation experiment 1 uses the SOM model to optimize the route, and the coordinates of the 30 waypoints generated are as follows: Figure 6 The route length before optimization was 19602.35m, and the route length after optimization was 8745.80m, which was reduced by 10856.55m, and the optimization rate was 44.6%. The results of random simulation experiment 1 are shown in the figure below. Figure 7 As shown, the left is the route map before optimization, and the right is the route map after optimization.
[0209] Random simulation experiment 2 uses Q learning to optimize the route, and the coordinates of the 30 waypoints generated are as follows: Figure 8 The route length before optimization was 16795.33m, and the route length after optimization was 8826.29m, which was reduced by 7969.04m, and the optimization rate was 52.6%. The results of random simulation experiment 2 are shown in the figure below. Fig. 9 As shown, the left is the route map before optimization, and the right is the route map after optimization.
[0210] Through simulation experiments, it is found that the route length generated by using the SOM model is shorter, and the route can be generated faster using the Q learning method. Based on this, when a high route optimization rate is required, the SOM model is used to generate the route, and when the heading needs to be generated quickly, the Q learning method is used to generate the route.
[0211] The optimization example for manually planned routes is as follows. There are 11 waypoints to be flown. Fig.10 This is a diagram of the operating results of an embodiment of the present application, with the left diagram showing the route before optimization and the right diagram showing the route after optimization. Fig.11 This is a comparison chart of the route path and flight time before and after optimization. The left is the route map, route distance, and flight time before operation, and the right is the route map, route distance, and flight time after the program is implemented. The route length before optimization was 12150.9m, and the estimated execution time was 20 minutes and 32 seconds; the route length after optimization was 7595.3m, and the estimated execution time was 13 minutes and 21 seconds. The optimization rate was 62.5%, and the execution time was reduced by 7 minutes and 11 seconds.
[0212] See also Fig.12 As shown, Fig.12This is a flow chart of a device for generating a UAV flight route for a waypoint file according to an embodiment of the present application. The device includes:
[0213] The decoding module is used to obtain the waypoint file including the waypoint to be flown by the UAV, parse the waypoint file, obtain the latitude and longitude information and the flight altitude information of the waypoint to be flown, convert the latitude and longitude information and the flight altitude information of the waypoint to be flown into three-dimensional space information in a Cartesian coordinate system, and obtain the three-dimensional space information of the waypoint to be flown.
[0214] The route generation module is used to construct a self-organizing map neural network SOM model according to the number of waypoints to be flown, wherein the number of output neuron nodes in the competition layer of the self-organizing map neural network model is determined according to the number of waypoints to be flown, and each output neuron node is used to represent a three-dimensional spatial information.
[0215] The three-dimensional spatial information of a waypoint to be flown is randomly selected from the three-dimensional spatial information of the waypoints to be flown, and is input into the SOM model, so that each output neuron node of the SOM model outputs the three-dimensional spatial information for fitting the waypoint.
[0216] Determine the three-dimensional space information that is closest to the three-dimensional space information of the currently input waypoint to be flown in the current output, and determine the output neuron node that outputs the three-dimensional space information that is closest to the distance as the current winning neuron node,
[0217] Update the three-dimensional spatial information of the current winning neuron node and its neighboring neuron nodes,
[0218] Repeat the step of randomly selecting the three-dimensional space information of a waypoint to be flown from the three-dimensional space information of the waypoint to be flown until the three-dimensional space information currently outputted converges.
[0219] Extract the waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information.
[0220] The encoding module is used to generate the UAV flight route file based on the waypoint sequence.
[0221] As another embodiment,
[0222] The route generation module is used to establish, for each waypoint to be flown, a correspondence between all optional waypoints that may be used as the next waypoint when the waypoint to be flown is the currently selected waypoint and the expected return value, and obtain the expected return correspondence relationship of the waypoint to be flown, wherein the currently selected waypoint corresponds to at least one optional waypoint, and each optional waypoint corresponds to a pre-fetched return value,
[0223] Initialize the pre-fetch return value in the corresponding relationship,
[0224] Mark all pending waypoints as unselected.
[0225] Set the take-off point in the waypoint to be flown as the currently selected waypoint.
[0226] According to the current pre-fetched return value in the expected return correspondence relationship of the currently selected waypoint, an optional waypoint that is not marked as selected is selected from the optional waypoints, and the selected waypoint is marked as selected.
[0227] Calculate the expected return estimate when the selected optional waypoint is the next currently selected waypoint, and use the expected return estimate to update the current pre-fetched return value, and use the selected optional waypoint as the currently selected waypoint,
[0228] Repeat the step of pre-fetching the current reward value in the expected reward correspondence relationship according to the currently selected waypoint until there are no optional waypoints, and obtain a waypoint sequence with the take-off point as the first waypoint.
[0229] Repeat the step of marking all waypoints to be flown as unselected until the number of cycles reaches a set threshold, and the optimal waypoint sequence is obtained.
[0230] The encoding module is used to generate the UAV flight route file based on the optimal waypoint sequence.
[0231] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the method for generating a drone flight route for a waypoint file described in the embodiment of the present application are implemented.
[0232] As for the apparatus / network-side device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0233] In this article, 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 such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0234] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for generating a UAV flight route based on a waypoint file, characterized in that: The method includes: Get the waypoint file including the waypoints to be flown by the drone. Parse the waypoint file to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown. The latitude and longitude information and the flight altitude information of the waypoint to be flown are converted into three-dimensional spatial information in a Cartesian coordinate system to obtain the three-dimensional spatial information of the waypoint to be flown. According to the number of waypoints to be flown, a self-organizing map neural network SOM model is constructed, wherein the number of output neuron nodes in the competition layer of the self-organizing map neural network model is determined according to the number of waypoints to be flown, and each output neuron node is used to represent a three-dimensional spatial information. The three-dimensional spatial information of a waypoint to be flown is randomly selected from the three-dimensional spatial information of the waypoints to be flown, and is input into the SOM model, so that each output neuron node of the SOM model outputs the three-dimensional spatial information for fitting the waypoint. Determine the three-dimensional spatial information with the closest spatial distance to the three-dimensional spatial information of the currently input waypoint to be flown in the current output, and determine the output neuron node that outputs the three-dimensional spatial information with the closest spatial distance as the current winning neuron node, Update the three-dimensional spatial information of the neighboring neuron nodes of the current winning neuron node, Repeat the step of randomly selecting the three-dimensional space information of a waypoint to be flown from the three-dimensional space information of the waypoint to be flown until the three-dimensional space information currently outputted converges. Extract the waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information. Generate UAV flight route files based on the waypoint sequence.
2. The method for generating a UAV flight route according to claim 1, characterized in that: The number of output neuron nodes is greater than or equal to the number of waypoints to be flown. The number of input neuron nodes in the input layer of the self-organizing map neural network model is greater than or equal to the number of waypoints to be flown; The method of making each output neuron node of the SOM model output three-dimensional spatial information for fitting the waypoint further includes: According to the arrangement order of the output neuron nodes in the SOM model, the three-dimensional spatial information currently output by each output neuron node is combined into a current output matrix, and the row vector in the current output matrix is used to represent the three-dimensional spatial information currently output by the output neuron node corresponding to the row vector; The updating of the three-dimensional spatial information of each neighboring neuron node of the current winning neuron node includes: Based on the arrangement information of the current winning neuron node, a proximity weight between the current winning neuron node and its neighboring neuron nodes is determined, wherein the proximity weight is used to characterize the proximity degree of the arrangement distance between the current winning neuron node and its neighboring neuron nodes. For each neighboring neuron node of the current winning neuron node, the three-dimensional space change of the neighboring neuron node is determined according to the current proximity weight of the neighboring neuron node, the current learning rate, and the spatial distance difference between the three-dimensional space of the currently input waypoint to be flown and the current three-dimensional space of the neighboring neuron node, and the current three-dimensional space information of the neighboring neuron node is updated according to the three-dimensional space change. in, The number of neighborhood neuron nodes is determined by the number of output neuron nodes. The proximity weight decreases as the arrangement distance between the current winning neuron node and its neighboring neuron nodes increases; The step of extracting a waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information includes: Row vectors are extracted from the current output matrix, and the extracted row vectors are sorted according to the order of the rows in which the extracted row vectors are located in the current output matrix to obtain a waypoint sequence.
3. The method for generating a UAV flight route according to claim 2, characterized in that: The number of the neighborhood neuron nodes and the proximity weights decrease as the number of iterations increases. The obtaining of the waypoint file including the waypoints to be flown by the drone includes: Obtaining a waypoint file from a drone application platform for providing drone services, wherein the waypoint file is a compressed file supporting a waypoint markup language; The waypoint file is parsed to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown, including: Decompress the waypoint file to obtain a decompressed file, wherein the decompressed file includes: a template file for editing flight waypoints, an execution file for defining UAV flight and load action instructions, and an auxiliary resource file for editing flight waypoints. The flight waypoints in the template file include take-off point and waypoint information, and the execution file only contains waypoint information but does not include take-off point information. The template file is parsed using the extensible markup language document object model derived from Python to obtain a document object with a tree data structure for representing the waypoint file. Get the take-off point latitude, longitude and altitude information from the take-off point element of the document object. Get the latitude, longitude and altitude information of the waypoint from the location tag element of the document object.
4. The method for generating a UAV flight route according to claim 3, characterized in that: The step of extracting a row vector from the current output matrix includes: According to each row vector in the current output matrix, determine the waypoint to be flown that the row vector fits, and extract the row vector that fits the waypoint to be flown; The generation of the UAV flight route file based on the waypoint sequence includes: Determine the take-off point from the waypoint sequence, take the take-off point as the first waypoint, reorder the waypoint sequence, and obtain a waypoint sequence with the take-off point as the first waypoint. According to the waypoint sequence with the take-off point as the first waypoint, the position mark elements in the template file and the execution file for saving the waypoints are sorted, and the index sub-element of the position mark element is set, and the index sub-element is used to record the waypoint sequence information, and the flight tasks of each position mark element after interactive sorting make the flight tasks follow the position mark element, and the modified template file and execution file are obtained. Compress the modified template file and execution file to obtain the UAV flight route file.
5. A method for generating a UAV flight route based on a waypoint file, characterized in that: The method includes: Get the waypoint file including the waypoints to be flown by the drone. Parse the waypoint file to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown. The latitude and longitude information and the flight altitude information of the waypoint to be flown are converted into three-dimensional spatial information in a Cartesian coordinate system to obtain the three-dimensional spatial information of the waypoint to be flown. For each waypoint to be flown, a correspondence between all possible optional waypoints that may be used as the next waypoint when the waypoint to be flown is the currently selected waypoint and the expected return value is established to obtain the expected return correspondence relationship of the waypoint to be flown, wherein the currently selected waypoint corresponds to at least one optional waypoint, and each optional waypoint corresponds to a pre-fetched return value, Initialize the pre-fetch return value in the corresponding relationship, Mark all pending waypoints as unselected. Set the take-off point in the waypoint to be flown as the currently selected waypoint. According to the current pre-fetched return value in the expected return correspondence relationship of the currently selected waypoint, an optional waypoint in an unselected state is selected from the optional waypoints, and the selected waypoint is marked as a selected state. Calculate the expected return estimate when the selected optional waypoint is the next currently selected waypoint, update the current pre-fetched return value with the expected return estimate, and use the selected optional waypoint as the currently selected waypoint, Repeat the step of pre-fetching the current reward value in the expected reward correspondence relationship according to the currently selected waypoint until there are no optional waypoints, and obtain a waypoint sequence with the take-off point as the first waypoint. Repeat the step of marking all waypoints to be flown as unselected until the number of cycles reaches a set threshold, and the optimal waypoint sequence is obtained. Generate UAV flight route files based on the optimal waypoint sequence.
6. The method for generating a UAV flight route according to claim 5, characterized in that: The calculation of the expected return estimate when the selected optional waypoint is the next currently selected waypoint includes: Calculate the expected return estimate based on the current pre-fetched return value corresponding to the selected optional waypoint, the reward value of the selected optional waypoint, the maximum expected return estimate among the optional waypoints corresponding to the next currently selected waypoint when the selected optional waypoint is the selected optional waypoint, the learning rate, and the discount factor, The reward value is determined according to the spatial distance between the currently selected waypoint and the selected optional waypoint; The selecting an unselected optional waypoint from the optional waypoints according to the current pre-fetched reward value in the expected reward correspondence relationship of the currently selected waypoint further includes: According to the ε parameter in the ε greedy strategy, it is decided whether to explore the path or choose the currently known optimal path. When the ε parameter is greater than the set parameter threshold, select the optional waypoint with the best expected return value and in the unselected state; When the ε parameter is not greater than the set parameter threshold, an optional waypoint that is not selected is randomly selected.
7. The method for generating a UAV flight route according to claim 5, characterized in that: The obtaining of the waypoint file including the waypoints to be flown by the drone includes: Obtaining a waypoint file from a drone application platform for providing drone services, wherein the waypoint file is a compressed file supporting a waypoint markup language; The waypoint file is parsed to obtain the latitude and longitude information and flight altitude information of the waypoint to be flown, including: Decompress the waypoint file to obtain a decompressed file, wherein the decompressed file includes: a template file for editing flight waypoints, an execution file for defining UAV flight and load action instructions, and an auxiliary resource file for editing flight waypoints. The flight waypoints in the template file include take-off point and waypoint information, and the execution file only contains waypoint information but does not include take-off point information. The template file is parsed using the extensible markup language document object model derived from Python to obtain a document object with a tree data structure for representing the waypoint file. Get the take-off point latitude, longitude and altitude information from the take-off point element of the document object. Get the latitude, longitude and altitude information of the waypoint from the location tag element of the document object.
8. The method for generating a UAV flight route according to claim 5, characterized in that: The method of generating a UAV flight route file based on the optimal waypoint sequence includes: According to the optimal waypoint sequence, the position marker elements in the template file and the execution file for saving the waypoints are sorted, and the index sub-element of the position marker element is set, and the index sub-element is used to record the waypoint sequence information, and the flight tasks of each position marker element after interactive sorting make the flight tasks follow the position marker element, and the modified template file and execution file are obtained. Compress the modified template file and execution file to obtain the UAV flight route file.
9. A device for generating a UAV flight route based on a waypoint file, characterized in that: The decoding module is used to obtain the waypoint file including the waypoint to be flown by the UAV, parse the waypoint file, obtain the latitude and longitude information and the flight altitude information of the waypoint to be flown, convert the latitude and longitude information and the flight altitude information of the waypoint to be flown into three-dimensional space information in a Cartesian coordinate system, and obtain the three-dimensional space information of the waypoint to be flown. The route generation module is used to construct a self-organizing map neural network SOM model according to the number of waypoints to be flown, wherein the number of output neuron nodes in the competition layer of the self-organizing map neural network model is determined according to the number of waypoints to be flown, and each output neuron node is used to represent a three-dimensional spatial information. The three-dimensional spatial information of a waypoint to be flown is randomly selected from the three-dimensional spatial information of the waypoints to be flown, and is input into the SOM model, so that each output neuron node of the SOM model outputs the three-dimensional spatial information for fitting the waypoint. Determine the three-dimensional spatial information with the closest spatial distance to the three-dimensional spatial information of the currently input waypoint to be flown in the current output, and determine the output neuron node that outputs the three-dimensional spatial information with the closest spatial distance as the current winning neuron node, Update the three-dimensional spatial information of the neighboring neuron nodes of the current winning neuron node, Repeat the step of randomly selecting the three-dimensional space information of a waypoint to be flown from the three-dimensional space information of the waypoint to be flown until the three-dimensional space information currently outputted converges. Extract the waypoint sequence for fitting the waypoints to be flown from the currently output three-dimensional space information. The encoding module is used to generate the UAV flight route file based on the waypoint sequence.
10. A device for generating a flight route of a UAV based on a waypoint file, characterized in that: The device includes: The decoding module is used to obtain the waypoint file including the waypoint to be flown by the UAV, parse the waypoint file, obtain the latitude and longitude information and the flight altitude information of the waypoint to be flown, convert the latitude and longitude information and the flight altitude information of the waypoint to be flown into three-dimensional space information in a Cartesian coordinate system, and obtain the three-dimensional space information of the waypoint to be flown. The route generation module is used to establish, for each waypoint to be flown, a correspondence between all optional waypoints that may be used as the next waypoint when the waypoint to be flown is the currently selected waypoint and the expected return value, and obtain the expected return correspondence relationship of the waypoint to be flown, wherein the currently selected waypoint corresponds to at least one optional waypoint, and each optional waypoint corresponds to a pre-fetched return value, Initialize the pre-fetch return value in the corresponding relationship, Mark all pending waypoints as unselected. Set the take-off point in the waypoint to be flown as the currently selected waypoint. According to the current pre-fetched return value in the expected return correspondence relationship of the currently selected waypoint, an optional waypoint in an unselected state is selected from the optional waypoints, and the selected waypoint is marked as a selected state. Calculate the expected return estimate when the selected optional waypoint is the next currently selected waypoint, and use the expected return estimate to update the current pre-fetched return value, and use the selected optional waypoint as the currently selected waypoint, Repeat the step of pre-fetching the current reward value in the expected reward correspondence relationship according to the currently selected waypoint until there are no optional waypoints, and obtain a waypoint sequence with the take-off point as the first waypoint. Repeat the step of marking all waypoints to be flown as unselected until the number of cycles reaches a set threshold, and the optimal waypoint sequence is obtained. The encoding module is used to generate the UAV flight route file based on the optimal waypoint sequence.
Citation Information
Patent Citations
Airline planning method and device for surveying and mapping unmanned aerial vehicle
CN106774431A
Bio-inspired self-organizing mapping path planning method of autonomous underwater vehicle under ocean circulation
CN110095120A
Multi-unmanned aerial vehicle local route planning method and device based on improved Q-Learning
CN112712193A
Combined route planning and opportunistic searching in variable cost enviroments
US20200158526A1
Cited By
Hybrid method and system for constructing unmanned aerial vehicle route based on multiple preset routes
CN119882707A
A mixed - programming method and system for constructing an unmanned aerial vehicle route based on multiple preset routes
CN119882707B
Unmanned aerial vehicle flow measurement method, system and device based on twinborn scene and medium
CN120702429A