A safe route generation method, device and electronic equipment
Patent Information
- Application Number
- CN202611104144.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-08-21
AI Technical Summary
若无人机需要执行的任务发生变化,则需要人工重新手动绘制任务航线,手动绘制任务航线的效率较低
[0020]由以上可见,应用本申请实施例提供的航线生成方案,获得点云数据和拓扑地图后,可以构建飞行空间模型,生成可达信息矩阵,生成距离矩阵,从而在获得目标航线的生成指令后,能够自行生成目标航线,全程无需人工参与,就算无人机需要执行的任务发生变化,无人机需要经过的目标航点发生变化,用户也只需重新下发生成指令即可重新生成航线,相比于现有的人工手动绘制任务航线,应用本申请实施例提供的航线生成方案,能够提高生成航线的生成效率。
Smart Images

Figure CN122611933A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent navigation technology, and in particular to a method, apparatus and electronic device for generating safe routes. Background Technology
[0002] Nowadays, the use of drones in large-scale operations is becoming increasingly widespread. Drones rely on mission routes to fly autonomously and reach target locations within the operational environment to perform their tasks. The mission route plays a crucial role in the successful execution of drone missions.
[0003] In existing technologies, mission routes are typically drawn manually by operators based on a map of the operational scenario and the tasks the drone needs to perform. If the tasks the drone needs to perform change, the mission routes must be manually redrawn, which is inefficient. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus, and electronic device for generating safe flight routes, thereby improving the efficiency of route generation. The specific technical solution is as follows:
[0005] In a first aspect, embodiments of this application provide a method for generating a safe flight route, the method comprising:
[0006] A dynamic flight space model is obtained to ensure the safe flight of the UAV in the operational scenario. The dynamic flight space model is constructed from point cloud data of obstacles in the operational scenario and a topological map of the operational scenario.
[0007] Generate an reachability information matrix containing reachability information between waypoints in the dynamic flight space model, wherein the reachability information between waypoints characterizes whether the UAV can safely reach between waypoints;
[0008] Based on the topology map and the generated reachability information matrix, a distance matrix is generated, which represents the distance between waypoints in the dynamic flight space model;
[0009] In response to the command to generate a target route, the target route that meets the route conditions is generated based on the target waypoints that the target route needs to pass through, the reachability information matrix, and the distance matrix.
[0010] Secondly, embodiments of this application provide a safe route generation apparatus, the apparatus comprising:
[0011] The model acquisition module is used to acquire a dynamic flight space model in which the UAV can fly safely in the operation scenario. The dynamic flight space model is constructed from point cloud data of obstacles in the operation scenario and the topology map of the operation scenario.
[0012] The matrix generation module is used to generate an reachability information matrix containing reachability information between waypoints in the dynamic flight space model, wherein the reachability information between waypoints characterizes whether the UAV can safely reach between waypoints;
[0013] The distance acquisition module is used to generate a distance matrix based on the topology map and the generated reachability information matrix, wherein the distance matrix represents the distance between waypoints in the dynamic flight space model;
[0014] The route generation module is used to respond to the generation command of the target route and generate the target route that meets the route conditions based on the target waypoints that the target route needs to pass through, the reachability information matrix and the distance matrix.
[0015] Thirdly, embodiments of this application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0016] Memory, used to store computer programs;
[0017] A processor, when executing a program stored in memory, implements the method described in the first aspect.
[0018] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the first aspect.
[0019] Beneficial effects of the embodiments of the present invention:
[0020] As can be seen from the above, by applying the route generation scheme provided in this application embodiment, after obtaining point cloud data and topology map, a flight space model can be constructed, a reachability information matrix can be generated, and a distance matrix can be generated. Thus, after obtaining the target route generation instruction, the target route can be generated automatically without human intervention. Even if the task to be performed by the UAV changes or the target waypoints that the UAV needs to pass through change, the user only needs to reissue the generation instruction to regenerate the route. Compared with the existing manual drawing of task routes, the route generation scheme provided in this application embodiment can improve the efficiency of route generation. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0022] Figure 1 A flowchart illustrating a safe route generation method provided in this application embodiment;
[0023] Figure 2 A topology map provided for embodiments of this application;
[0024] Figure 3 An reachability information matrix provided for embodiments of this application;
[0025] Figure 4 This is a schematic diagram of a first type of convex polyhedral structure provided in an embodiment of this application;
[0026] Figure 5 This is a partial schematic diagram of a flight space model provided in an embodiment of this application;
[0027] Figure 6 This is a schematic diagram of a cross-section of a second convex polyhedron structure provided in an embodiment of this application;
[0028] Figure 7 This is a schematic diagram of a third type of convex polyhedral structure provided in the embodiments of this application;
[0029] Figure 8 This is a schematic diagram of a fourth convex polyhedral structure cross-section provided in an embodiment of this application;
[0030] Figure 9 A schematic diagram of a processing flow for each first waypoint pair provided in an embodiment of this application;
[0031] Figure 10 This is a schematic diagram of the structure of a safe route generation device provided in an embodiment of this application;
[0032] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of the present invention.
[0034] The route generation scheme provided in this application relates to the field of UAV path planning and intelligent navigation technology. It can be applied to large and complex UAV operation scenarios. Based on the point cloud data of the operation scenario and known safe routes, it can generate the shortest and safest UAV flight route with any combination of waypoints, realizing autonomous planning and optimized control of the unmanned system.
[0035] For ease of description, the electronic device that executes the secure route generation scheme provided in the embodiments of this application will be referred to as a route generation device in the following text.
[0036] The following detailed description of the safe route generation method, apparatus, electronic device, and storage medium is provided through specific embodiments.
[0037] See Figure 1 , Figure 1 This is a flowchart illustrating a safe route generation method provided in an embodiment of this application. In this embodiment, the method includes the following steps S101-S104.
[0038] Step S101: Obtain a dynamic flight space model that allows the UAV to fly safely in the operational scenario.
[0039] The dynamic flight space model is constructed from point cloud data of obstacles in the operation scenario and topological map of the operation scenario.
[0040] Obstacles in the work scenario are entities that exist in the work scenario, such as buildings, trees, mountains, etc.
[0041] The topology map of the operation scenario contains nodes, edges between nodes and adjacent nodes, that is, it contains several nodes and edges connecting nodes. The nodes in the topology map represent waypoints in the operation scenario, and the edges represent the space where the drone can fly safely between nodes and adjacent nodes.
[0042] The nodes in the topology map have attribute information, such as altitude, attitude angle, etc. The altitude is the altitude of the waypoint corresponding to the node. The UAV needs to be at this altitude when it arrives at the waypoint. The attitude angle is the angle of attitude that the UAV needs to maintain when it arrives at and stabilizes at the waypoint.
[0043] See Figure 2 This shows a topology map of a work scenario. Figure 2 The topology map shown contains five nodes, 1-5. There is an edge between node 1 and node 2, between node 3 and node 4, and between node 3 and node 5. Taking node 1 and node 2 as an example, the edge between node 1 and node 2 indicates that there is space where the UAV can fly safely between the two waypoints represented by nodes 1 and 2.
[0044] Specifically, for drone operation scenarios, users can collect point cloud data of the operation scenario through lidar measurement technology, image acquisition equipment measurement technology, or SLAM (Simultaneous Localization and Mapping) technology. In addition, they can manually draw a topology map of the operation scenario and verify the rationality and safety of the drawn topology map. In this way, the flight path generation device can obtain the point cloud data collected by the user and the topology map drawn and verified by the user.
[0045] After obtaining point cloud data, a dynamic flight space model is constructed using the edges in the topology map as baselines to enable the drone to fly safely in the operational scenario.
[0046] The specific implementation method for constructing a dynamic flight space model can be found in subsequent embodiments, which will not be detailed here.
[0047] Step S102: Generate a reachability information matrix containing reachability information between waypoints in the dynamic flight space model.
[0048] Among them, reachability information represents whether the UAV can safely reach between waypoints. Therefore, the reachability information matrix of the UAV in the dynamic flight space model can be regarded as an information set containing the reachability information between every two waypoints.
[0049] The reachability information between two waypoints indicates whether these two waypoints are reachable, that is, whether the UAV can fly from either waypoint to the other waypoint. The information value of the reachability information can include two values, a and b. A reachability information value of a indicates that the two waypoints are reachable; a reachability information value of b indicates that the two waypoints are not reachable. For example, a = 1 indicates that the two waypoints are reachable, and b = 0 indicates that the two waypoints are not reachable.
[0050] In flight space models, both adjacent and non-adjacent waypoints possess reachability information, which can be expressed as a matrix. For example, see... Figure 3 The flight space model includes six waypoints: A, B, C, D, E, and F. The horizontal and vertical axes of the matrix are these six waypoints. The number of rows and columns of each element in the matrix corresponds to a waypoint, and the element value is the reachability information value of the two waypoints corresponding to the row and column numbers.
[0051] The specific implementation of determining the reachability information matrix can be found in subsequent embodiments, and will not be detailed here.
[0052] Step S103: Generate a distance matrix based on the topology map and the generated reachability information matrix.
[0053] The distance matrix represents the distance between waypoints in the dynamic flight space model and can be viewed as a set of distances that includes the distance between every two waypoints.
[0054] The specific implementation method for obtaining the distance between two waypoints can be found in subsequent embodiments, and will not be described in detail here.
[0055] Step S104: In response to the command to generate the target route, generate a target route that meets the route conditions based on the target waypoints, reachability information matrix and distance matrix that the target route needs to pass through.
[0056] Specifically, the generation command can carry the target waypoints that the target route needs to pass through. After receiving the generation command, the route generation device can parse out the target waypoints. There are usually multiple target waypoints. After parsing out the target waypoints, they can be sorted to determine the order in which the UAV passes through them. Based on the order of the target waypoints, the reachability information and distance between sequentially adjacent target waypoints are obtained. If there is at least one set of reachability information between sequentially adjacent target waypoints that indicates that they are not reachable, the target waypoints are re-sorted until all sequentially adjacent target waypoints are reachable. This generates a target route that controls the UAV's flight according to the order of the target waypoints and includes the distances between the waypoints.
[0057] When sorting the target waypoints, the sorting can be done according to pre-set rules or randomly.
[0058] For example, if the target route needs to pass through waypoints A, B, C, and D, and these waypoints are randomly sorted to obtain the order B, D, A, C, then the adjacent waypoints are: waypoint B and waypoint D, waypoint D and waypoint A, and waypoint A and waypoint C. The reachability information and distances of these adjacent waypoints are obtained. If the reachability information between waypoints A and C indicates that these two waypoints are unreachable, then the waypoints need to be re-sorted. The re-sorted order is assumed to be A, D, B, C. The reachability information and distances of the adjacent waypoints are then obtained again. If all adjacent waypoints are reachable, a target route can be generated where the UAV passes through waypoints A, D, B, and C in sequence, and the distances between adjacent waypoints are marked on this target route.
[0059] After generating the target route, the generated target route can be displayed for users to view interactively.
[0060] As can be seen from the above, by applying the route generation scheme provided in this application embodiment, after obtaining point cloud data and topology map, a flight space model can be constructed, a reachability information matrix can be generated, and a distance matrix can be generated. Thus, after obtaining the target route generation instruction, the target route can be generated automatically without human intervention. Even if the task to be performed by the UAV changes or the target waypoints that the UAV needs to pass through change, the user only needs to reissue the generation instruction to regenerate the route. Compared with the existing manual drawing of task routes, the route generation scheme provided in this application embodiment can improve the efficiency of route generation.
[0061] The point cloud data obtained in the route generation scheme provided in this application is obtained through manual measurement, and the topology map is obtained through manual drawing. Using point cloud data and topology map to generate routes can be considered as preserving the safety prior knowledge from the manual route design process, further ensuring the safety of the generated routes. Furthermore, this scheme obtains the reachability information and distance between any two waypoints. Therefore, regardless of how the target waypoints along the target route change, this scheme can generate the target route based on the obtained reachability information and distance. Thus, this scheme can flexibly respond to the needs of any combination of waypoints and generate routes passing through any waypoints.
[0062] Furthermore, the route generation scheme provided in this application does not limit the UAV platform and the type of task performed by the UAV, and supports the addition of functions such as real-time obstacle avoidance and dynamic obstacle updates in the future. It can be seen that the route generation scheme provided in this application can improve the scalability of the generated route.
[0063] In one embodiment of this application, when generating a target route in response to receiving a generation instruction, after determining the target waypoints that the target route needs to pass through, the permutations and combinations of these target waypoints can be exhaustively enumerated to obtain multiple combinations. For each combination, it is determined whether the target waypoints that are adjacent in the combination are reachable. If all are reachable, the length of the target route generated according to the combination is calculated.
[0064] After traversing each combination in the above manner, the shortest combination can be identified, and the target flight path can be generated based on this combination. This ensures that the generated target flight path is as short as possible, thereby improving the operational efficiency of the UAV and saving on its operating costs.
[0065] The following is a detailed explanation of the specific implementation method of constructing the dynamic flight space model in step S101 above.
[0066] In one embodiment of this application, the flight path generation device constructs a flight space model according to steps one through three:
[0067] Step 1: Determine the target size of the cross-section of the preset convex polyhedron based on the drone's body size and safety margin size.
[0068] To ensure that no part of the drone touches any obstacle during flight, the dimensions of the drone used in this step are those for when the drone is in flight. In particular, when the propellers rotate beyond the main body of the drone, the dimensions of the drone's body need to take into account the rotation area of the propellers that extends beyond the main body.
[0069] The aforementioned safety margin size is the maximum size by which the drone is allowed to deviate from the predetermined route when flying along the predetermined route.
[0070] The aforementioned convex polyhedron is a pre-defined structure, for example, it can be a structure with a cross-section in the shape of a rectangle, pentagon, hexagon, etc.
[0071] The following example, a convex polyhedron with a rectangular cross-section, illustrates how to determine the target dimensions.
[0072] The aforementioned drone's body dimensions can be its width and height in flight. The aforementioned safety margin dimensions can include a first length in the width direction and a second length in the height direction. For the width direction, safety margins need to be provided on both the left and right sides of the drone; therefore, the width of the convex polyhedral structure cross-section is not less than the drone's width plus twice the first length. For the height direction, safety margins need to be provided on both the top and bottom sides of the drone; therefore, the height of the convex polyhedral structure cross-section is not less than the drone's height plus twice the second length. For example... Figure 4 As shown, the solid rectangles represent drones, and the dashed rectangles represent cross-sections of convex polyhedral structures, or the dimensions of the cross-sections of convex polyhedral structures can be larger than the dimensions of the dashed rectangles.
[0073] The cross-section of the convex polyhedron structure can also be other shapes. The method for determining the target size of the convex polyhedron structure with other cross-section shapes is similar to the above method, and the embodiments of this application are not limited in this respect.
[0074] Step 2: Determine the boundary surfaces of each model corresponding to each edge in the topology map to obtain the initial flight space model composed of each model boundary surface.
[0075] Among them, the model boundary surface is a preset convex polyhedron structure, each face of the model boundary surface is parallel to its corresponding edge, and the size of the cross section of the model boundary surface is the target size.
[0076] Specifically, a three-dimensional space can be created based on the topology map, where the height and position of nodes, as well as the edges between nodes and the topology map, are defined. Figure 1To this end, for each side, in this three-dimensional space, the model corresponding to that side is a cylinder with a cross-section of the aforementioned convex polyhedral structure. This cylinder contains the side, and the side is parallel to the cylinder in the length direction. For example... Figure 5 As shown, the initial flight space model is illustrated when the cross-section of the convex polyhedron structure is rectangular, with the dashed line representing the side.
[0077] Furthermore, from a cross-sectional perspective, this edge is a point. For ease of understanding and description, this point will be referred to as the flight path point below. The flight path point can be located at the center of the cross-section of the convex polyhedron structure, or at other locations, such as... Figure 6 , Figure 7 As shown, Figure 6 The midline point is located at the center of the cross section of the rectangular convex polyhedron structure. Figure 7 The center line point is located at other positions within the rectangular convex polyhedral structure cross section.
[0078] Step 3: Based on the point cloud data, remove the obstacle areas in the operation scenario from the initial flight space model to obtain a dynamic flight space model in which the UAV can fly safely in the operation scenario.
[0079] Specifically, based on point cloud data, obstacle models can be added in the aforementioned three-dimensional space to determine the obstacle regions in the three-dimensional space. If the initial flight space model overlaps with the obstacle regions, the overlapping regions contained in the initial flight space model are removed to obtain the remaining part of the initial flight space model, which serves as the final dynamic flight space model.
[0080] As can be seen from the above, when generating flight paths using the scheme provided in the embodiments of this application, the target size is determined based on the body size and safety margin size, thereby obtaining an initial flight space model. This initial flight space model can be considered as the area where the UAV is allowed to fly without considering obstacles. Then, the obstacle area is removed from the initial flight space model, and the remaining area is the area in the operation scenario where the UAV is allowed to fly and will not touch the obstacles. Thus, generating flight paths using the dynamic flight space model obtained in this way can effectively ensure that the UAV will not collide with obstacles and ensure the safety of the UAV.
[0081] In one embodiment of this application, in step three above, the minimum bounding convex polyhedron of each obstacle in the operation scenario can be determined based on point cloud data, and the overlapping area between the initial flight space model and each minimum bounding convex polyhedron can be removed from the initial flight space model to obtain a dynamic flight space model in which the UAV can fly safely in the operation scenario.
[0082] Specifically, based on point cloud data, the convex hull algorithm can be used to determine the minimum enclosing convex polyhedron of each obstacle in the operation scene, detect the overlapping area between the initial flight space model and each minimum enclosing convex polyhedron, remove the overlapping area contained in the initial flight space model, and obtain the remaining initial flight space model as the dynamic flight space model.
[0083] This method can accurately obtain a dynamic flight space model, thereby generating flight paths based on the dynamic flight space model. This can improve the accuracy of the generated flight paths and avoid collisions between drones and obstacles when flying along the flight paths.
[0084] When performing step two above to determine the boundary surfaces of each model corresponding to each edge in the topology map, the faces of the convex polyhedron structure can also be determined in the following way, combining the target size, baseline, and environmental information of the area between waypoints.
[0085] In one embodiment of this application, when determining the model boundary surface corresponding to each side in the topology map, regional environmental information between two waypoints corresponding to the side can be obtained; the offset of the model boundary surface is determined according to the regional environmental information; and each face of the preset convex polyhedron structure parallel to the side is determined according to the target size and the offset, so as to obtain the model boundary surface corresponding to the side.
[0086] For the part of the model between two waypoints in the flight space model, the area where this part of the model is located is the safe zone for UAV flight. UAVs can fly from one waypoint to another in this area. This part of the model can also be regarded as a safe passage or safe corridor for UAVs to fly from one waypoint to another.
[0087] When a drone flies within a safe corridor, it actually flies along a planned route between two waypoints included in the corridor. This planned route is typically a straight line connecting the two waypoints. Furthermore, if a drone deviates from the planned route but remains within the safe corridor, it can correct its flight path and return to the planned route, continuing to fly along it. If the drone deviates significantly from the planned route and flies outside the safe corridor, it will trigger safety warning measures, such as hovering at its current position awaiting recovery, or triggering a return-to-home mechanism to return directly to the designated location.
[0088] One of the reasons that causes drones to deviate from their flight paths is the environmental information of the area between waypoints, including wind, electromagnetic interference, and so on. Therefore, when determining the faces of a convex polyhedron structure, the environmental information of the area between waypoints needs to be taken into account.
[0089] Taking the environmental information between waypoints as an example, without considering the environmental information between waypoints, the position of the route between two waypoints can be located in the exact middle of the safety corridor, such as... Figure 8As shown in section 1, the drone is flying normally along the flight path. However, in real-world scenarios, there may be wind in the area between waypoints. Taking a wind direction from the upper left to the lower right as an example, the wind may cause the drone to deviate from the flight path in the wind direction. In cases of high wind speed, the drone may easily fly out of the safe corridor, forcing it to abort its mission.
[0090] Therefore, in order to ensure that the drone stays within the safe corridor as much as possible, while keeping the route between waypoints unchanged, the faces of the convex polyhedron structure can be offset to provide more safety margin for the drone in the wind direction.
[0091] In the first method, the cross-sectional dimensions of the convex polyhedron structure can be kept constant, always at the target dimensions, while the convex polyhedron structure is offset along the wind direction, such as... Figure 8 As shown in section 2, the dashed line represents the outline of the convex polyhedron structure shown in section 1 without considering the influence of wind, and the solid line represents the outline of the convex polyhedron structure after offset.
[0092] In the second method, the outline of the convex polyhedron structure can be directly offset along the wind direction to increase the safety margin, such as... Figure 8 As shown in section 3, the dashed line represents the outline of the convex polyhedron structure shown in section 1, and the solid line represents the outline of the offset convex polyhedron structure.
[0093] In the third approach, wind direction and speed can be broken down into horizontal and vertical wind direction and speed, thereby increasing the safety margin in both the horizontal and vertical directions, such as... Figure 8 As shown in section 4, the dashed line represents the outline of the convex polyhedron structure shown in section 1, and the solid line represents the outline of the offset convex polyhedron structure.
[0094] The environmental information between waypoints may also include electromagnetic interference or other information, which is not limited in this embodiment. When the environmental information between waypoints also includes electromagnetic interference or other information, the method of offsetting the faces of the convex polyhedron structure is similar to the method of offsetting in the case of wind, and will not be repeated here.
[0095] The aforementioned inter-waypoint area environmental information can be obtained manually in advance. After the route generation equipment obtains the manually detected inter-waypoint area environmental information, when determining each face of the convex polyhedron structure, it determines the offset corresponding to the obtained inter-waypoint area environmental information according to the preset correspondence between environmental information and offset. Then, based on the offset, it performs offset according to any of the three methods mentioned above to obtain each face of the convex polyhedron structure.
[0096] As can be seen from the above, when generating flight paths using the scheme provided in this application, the flight space model avoids obstacles. The UAV will not collide with obstacles while flying within the flight space model. Therefore, by introducing a flight space model, it is possible to ensure that the UAV flies within a safe range, avoiding the risk of collisions and instability, thus significantly improving the safety of the UAV. Furthermore, the environmental information of the waypoint region is considered when determining each face of the convex polyhedron structure. This allows the UAV to overcome the influence of the waypoint region environment on its flight when flying through the waypoint region according to the final generated flight path, thereby improving the UAV's anti-interference capability and the reliability of the generated flight path.
[0097] The specific implementation of step S102 above, which determines the reachability information matrix, will be explained below.
[0098] In one embodiment of this application, the reachability information matrix is composed of reachability information between every two waypoints. Therefore, determining the reachability information matrix means determining the reachability information between every two waypoints.
[0099] When determining reachability information to characterize whether two waypoints are reachable, the first reachability information between adjacent waypoints is determined based on the topology map and dynamic flight space model. The waypoints in the operational scenario are traversed, and based on the currently traversed first auxiliary waypoint, a first waypoint pair containing two non-adjacent waypoints (excluding the first auxiliary waypoint) is determined. For each first waypoint pair, the second reachability information between the two waypoints in the pair is calculated based on the obtained reachability information. Thus, a reachability information matrix is generated based on all the obtained first and second reachability information.
[0100] Specifically, in the dynamic flight space model, any two waypoints can form a waypoint pair, and each waypoint pair has reachability information, representing whether the two waypoints in the waypoint pair are reachable. To determine the reachability information of all waypoint pairs, the route generation device can determine the reachability information between two waypoints in different ways based on whether the two waypoints are adjacent. Furthermore, it can first determine the reachability information between adjacent waypoints, and then determine the reachability information between non-adjacent waypoints.
[0101] Step 1: Determine the reachability information between adjacent waypoints
[0102] The route generation device can identify two waypoints represented by two nodes connected by each edge in the topology map as adjacent waypoints. For each pair of adjacent waypoints, it determines whether the line connecting the pair of adjacent waypoints intersects with the dynamic flight space model. If it does, the reachability between the pair of adjacent waypoints is determined to be unreachable; if it does not, the reachability between the pair of adjacent waypoints is determined to be reachable, and the adjacent waypoints are then considered adjacent reachable waypoints.
[0103] A dynamic flight space model is a model that can avoid obstacles. If a drone flies out of the area covered by the dynamic flight space model, it may collide with obstacles. Since drones usually fly along the lines connecting waypoints, if the lines connecting adjacent waypoints intersect with the dynamic flight space model, it means that the drone will fly out of the area covered by the dynamic flight space model when flying along the lines connecting adjacent waypoints, and may collide with obstacles. It can be seen that if the lines connecting adjacent waypoints intersect with the dynamic flight space model, the drone may not be able to safely fly from one waypoint to the other in that pair of adjacent waypoints, and thus the accessibility between the pair of adjacent waypoints is not accessible. Conversely, if the lines connecting adjacent waypoints do not intersect with the dynamic flight space model, then the accessibility between the pair of adjacent waypoints can be determined as accessible.
[0104] It is evident that by determining whether the line connecting adjacent waypoints intersects with the dynamic flight space model, the reachability between the pair of adjacent waypoints can be accurately determined. Thus, based on the determined reachability between adjacent waypoints, a flight route can be generated, which can improve the accuracy of the generated flight route.
[0105] Step 2: Determine reachability information between non-adjacent waypoints
[0106] In this step, the route generation device traverses each waypoint in the flight space model. Upon reaching a waypoint, it designates it as a first auxiliary waypoint. All waypoints except the first auxiliary waypoints are then paired to obtain multiple waypoint pairs. Pairs where the two waypoints are adjacent are discarded, leaving each remaining waypoint pair as a first waypoint pair. The second reachability information between the two waypoints in each first waypoint pair is then calculated. Once the second reachability information between the two waypoints in each first waypoint pair is obtained, the waypoint traversal is considered complete. The process then continues, traversing other waypoints until all waypoints have been traversed.
[0107] For example, in an aircraft space model, there are five waypoints A, B, C, D, and E. When traversing to waypoint A, waypoint A is used as the first auxiliary waypoint. The other four waypoints B, C, D, and E are paired to obtain six waypoint pairs. If waypoints B and D are adjacent waypoints, and waypoints D and E are adjacent waypoints, then two waypoint pairs need to be removed, resulting in four waypoint pairs as the four first waypoint pairs: (B, C), (B, E), (C, D), and (C, E). Then, the second reachability information between the two waypoints in these four first waypoint pairs is calculated. Obtaining the second reachability information between the two waypoints in these four first waypoint pairs indicates that waypoint A has been traversed. At this point, other waypoints, such as waypoint B, are traversed again, and waypoint B is used as the first auxiliary waypoint. The above operation is repeated until all five waypoints have been traversed, thus obtaining the reachability information between all non-adjacent waypoints.
[0108] In this scheme, the first reachability information between adjacent waypoints and the second reachability information between non-adjacent waypoints are determined. This also determines the reachability information between every two waypoints. The reachability information of the UAV in the dynamic flight space model is equivalent to the set of reachability information between every two waypoints. Therefore, by applying this scheme, the reachability information of the UAV can be accurately determined, and flight routes can be generated based on this reachability information, thereby improving the accuracy of the generated flight routes.
[0109] In one embodiment of this application, the second reachability information between the two waypoints included in each of the first waypoint pairs can be calculated as follows:
[0110] Based on the reachability information between each waypoint in the first waypoint pair and the first auxiliary waypoint, the reachability information between the two waypoints is calculated; if the second reachability information between the two waypoints has not been obtained, the calculated reachability information is determined as the second reachability information between the two waypoints; if the second reachability information between the two waypoints has been obtained, and the obtained second reachability information indicates unreachability while the calculated reachability information indicates reachability, the obtained second reachability information between the two waypoints is updated to the calculated reachability information.
[0111] Specifically, since the same first waypoint pair may occur when different waypoints are used as first auxiliary waypoints, for example, if the flight space model has four waypoints A, B, C, and D, and waypoint A is used as the first auxiliary waypoint, waypoints C and D can be combined into one waypoint pair. Similarly, if waypoint B is used as the first auxiliary waypoint, waypoints C and D can still be combined into one waypoint pair. Therefore, for each first waypoint pair, if the second reachability information between the two waypoints in the first waypoint pair has been obtained, different processing can be performed according to the second reachability information. If the second reachability information indicates that the two waypoints in the first waypoint pair are reachable, then other first waypoint pairs are processed directly. If the second reachability information indicates that the two waypoints in the first waypoint pair are not reachable or the second reachability information between the two waypoints in the first waypoint pair has not been obtained, then the reachability information between the two waypoints in the first waypoint pair and the first auxiliary waypoint can be obtained respectively.
[0112] If the reachability information between the two waypoints in the first waypoint and the first auxiliary waypoint is successfully obtained, and both of these reachability information indicate reachability, it is determined that the two waypoints in the first waypoint are reachable. At this time, if the second reachability information between the two waypoints in the first waypoint has been obtained before, and the second reachability information indicates unreachability, the reachability information between the two waypoints in the first waypoint can be updated to indicate reachability.
[0113] If the reachability information between the two waypoints in the first waypoint pair and the first auxiliary waypoint is successfully obtained, and at least one of the two reachability information indicates that the two waypoints in the first waypoint pair are unreachable, then the two waypoints in the first waypoint pair are determined to be unreachable.
[0114] If the reachability information between at least one waypoint in the first waypoint pair and the first auxiliary waypoint is not successfully obtained, the reachability information between the two waypoints in the first waypoint pair can be directly determined as information indicating unreachability.
[0115] In one embodiment of this application, see [link to embodiment]. Figure 9 The diagram illustrates the processing flow for each first waypoint pair, which includes the following steps S901-S906.
[0116] Step S901: Determine whether the second reachability information between the two waypoints in the first waypoint pair has been obtained. If yes, proceed to step S902; if no, proceed to step S903.
[0117] Step S902: If the second reachability information indicates that the two waypoints are reachable, then the processing of the first waypoint pair ends; if the second reachability information indicates that the two waypoints are not reachable, then step S903 is executed.
[0118] Step S903: Obtain reachability information between the two waypoints in the first waypoint pair and the first auxiliary waypoint. If the reachability information between at least one waypoint in the first waypoint pair and the first auxiliary waypoint is not successfully obtained, proceed to step S904. If the reachability information between the two waypoints in the first waypoint pair and the first auxiliary waypoint is successfully obtained, proceed to step S905.
[0119] Step S904: Obtain reachability information that indicates the unreachability between the two waypoints in the first waypoint pair.
[0120] Step S905: Detect whether both obtained reachability information represent reachability. If yes, proceed to step S906; otherwise, proceed to step S904.
[0121] Step S906: If the second reachability information has been obtained, update the second reachability information to represent the reachability between the two waypoints; if the second reachability information has not been obtained, obtain the reachability information representing the reachability between the two waypoints in the first waypoint pair.
[0122] As can be seen from the above, when generating flight routes using the scheme provided in the embodiments of this application, the first reachability information between adjacent reachable waypoints is determined, and the second reachability information between non-adjacent reachable waypoints is determined by traversing the waypoints. This can accurately determine the reachability information between all two waypoints in the flight space model, thereby generating flight routes based on the reachability information and improving the accuracy of the generated flight routes.
[0123] After each waypoint is traversed and designated as the first auxiliary waypoint, the second reachability information between the two waypoints in each first waypoint pair can be calculated in the manner provided in the following embodiments.
[0124] In one embodiment of this application, threads are allocated to the reachability calculation tasks corresponding to each first waypoint pair based on the number of first waypoint pairs, the number of threads, and the remaining resource information of each thread, so that each thread runs in parallel and each thread calculates the second reachability information between the two waypoints contained in each first waypoint pair based on the reachability information obtained when executing the task.
[0125] The reachability calculation task corresponding to the first waypoint pair is: to calculate the reachability information between the two waypoints in the first waypoint pair.
[0126] Specifically, the route generation device can have multiple threads for handling reachability calculation tasks. After determining the first auxiliary waypoint, the route generation device can pair other waypoints (excluding the first auxiliary waypoint) to obtain multiple first waypoint pairs. It then counts the number of first waypoint pairs and, based on the number of first waypoint pairs, the number of threads, and the remaining resource information of each thread, allocates threads to the reachability calculation tasks corresponding to each first waypoint pair. Threads with more remaining resources can be allocated more reachability calculation tasks, while threads with fewer remaining resources can be allocated fewer. After allocation, the threads run in parallel, allowing each thread to utilize its remaining resources to execute its assigned reachability calculation tasks.
[0127] As can be seen from the above, when generating routes using the scheme provided in the embodiments of this application, multiple threads can be run in parallel to execute multiple reachability calculation tasks in parallel, that is, to calculate the reachability information between two waypoints in multiple first waypoint pairs in parallel. This can significantly shorten the time spent calculating the reachability information between all two waypoints, thereby shortening the time spent generating routes and improving the efficiency of generating routes.
[0128] The specific implementation of generating the distance matrix in step S103 above is explained below.
[0129] In one embodiment of this application, a distance matrix can be generated based on a topology map and determined reachability information in the following manner:
[0130] Based on the topology map and the determined reachability information, the first distance between adjacent reachable waypoints is obtained. The waypoints in the operation scenario are traversed. Based on the currently traversed second auxiliary waypoint, a second waypoint pair containing two non-adjacent reachable waypoints other than the second auxiliary waypoint is determined. For each second waypoint pair, the second distance between the two waypoints contained in the second waypoint pair is calculated based on the obtained distance between waypoints. A distance matrix is generated based on all the obtained first and second distances.
[0131] Similar to calculating reachability information between two waypoints, the distance between two waypoints can also be calculated in different ways depending on whether they are adjacent. Furthermore, the distance is first calculated for adjacent and reachable waypoints (i.e., adjacent reachable waypoints), and then the distance is calculated for non-adjacent and reachable waypoints (i.e., non-adjacent reachable waypoints).
[0132] Step 1: Calculate the distance between two adjacent and reachable waypoints
[0133] Specifically, the route generation device can determine, based on the topology map, that two waypoints represented by two nodes connected by each edge in the topology map are adjacent waypoints. Since the reachability information between any two waypoints has been obtained in step S103 above, it can directly determine whether the reachability information between adjacent waypoints indicates reachability. If it does, then the adjacent waypoint is an adjacent reachable waypoint. Then, based on the positions of the two waypoints in the adjacent reachable waypoints on the topology map, the distance between the two waypoints is calculated. For example, the Euclidean distance between the two waypoints is calculated, or the route of the UAV flying between the two waypoints is planned and the route distance of the route is calculated, thereby obtaining the first distance between the adjacent reachable waypoints.
[0134] Step 2: Calculate the distance between two non-adjacent but reachable waypoints.
[0135] After calculating the first distance between all adjacent reachable waypoints, the route generation device iterates through each waypoint. For each waypoint encountered, it can be designated as a second auxiliary waypoint. All waypoints other than the second auxiliary waypoints are paired, and pairs of waypoints are eliminated, removing those that are adjacent or unreachable. The remaining waypoint pairs are the second waypoint pairs, meaning the two waypoints in a second waypoint pair are non-adjacent but reachable. The distance between the two waypoints in each second waypoint pair is then calculated. Once the distance between the two waypoints in each second waypoint pair is obtained, the traversal of that waypoint is complete. The process then continues, iterating through other waypoints until all waypoints have been traversed.
[0136] In this scheme, the distances between adjacent reachable waypoints and the distances between non-adjacent reachable waypoints are determined, thus determining the distance between any two reachable waypoints and generating a distance matrix. Therefore, by applying this scheme, the distance between any two reachable waypoints can be accurately determined, a distance matrix can be generated based on the distance between any two reachable waypoints, and then a route can be generated based on the distance matrix. This can generate routes that meet distance requirements, such as the shortest distance route, the longest distance route, and so on.
[0137] In one embodiment of this application, the distance between the two waypoints included in each of the above-mentioned second waypoint pairs can be calculated as follows:
[0138] If the distances between each waypoint in the second waypoint centering pair and the second auxiliary waypoint have been obtained, the distance between the two waypoints in the second waypoint centering pair is calculated based on the distances between each waypoint in the second waypoint centering pair and the second auxiliary waypoint. If the second distance between the two waypoints in the second waypoint centering pair has not been obtained, the calculated distance is determined as the second distance between the two waypoints in the second waypoint centering pair. If the second distance between the two waypoints in the second waypoint centering pair has been obtained and the second distance is greater than the calculated distance, the second distance between the two waypoints in the second waypoint centering pair is updated to the calculated distance.
[0139] Specifically, it can be handled in the following two ways:
[0140] In the first scenario: The distances between each waypoint and the second auxiliary waypoint have already been obtained.
[0141] In this case, the distances between each waypoint in the second waypoint centering and the second auxiliary waypoint can be added together, and the resulting distance is the distance between the two waypoints in the second waypoint centering.
[0142] Similar to the first waypoint pair, the distance between the two waypoints in the second waypoint pair may have already been calculated or obtained when other waypoints were used as second auxiliary waypoints. If the distance between the two waypoints in the second waypoint pair has been obtained, the obtained distance and the summed distance can be compared. If the obtained distance is greater than the summed distance, the distance between the two waypoints in the second waypoint pair is updated to the summed distance. If the distance between the two waypoints in the second waypoint pair has not been obtained, the summed distance can be used as the distance between the two waypoints in the second waypoint pair.
[0143] In the second scenario: the distance between at least one waypoint and the second auxiliary waypoint is not obtained.
[0144] In this case, the distance to other second waypoints is calculated directly.
[0145] As can be seen from the above, when generating a route using the scheme provided in the embodiments of this application, the first distance between adjacent reachable waypoints is determined, and the distance between non-adjacent reachable waypoints is determined by traversing the waypoints. This can accurately determine the distance between all two waypoints, thereby generating a route based on the distance between all two waypoints, and generating a route that meets the distance requirements.
[0146] After each waypoint is traversed as a second auxiliary waypoint, the second distance between the two waypoints can be calculated in the manner provided in the following embodiments.
[0147] In one embodiment of this application, threads are allocated to the distance calculation tasks corresponding to each second waypoint pair based on the number of second waypoint pairs, the number of threads, and the remaining resource information of each thread, so that each thread runs in parallel and calculates the distance between the two waypoints contained in each second waypoint pair based on the distances obtained when executing the distance calculation tasks.
[0148] The reachability calculation task corresponding to the second waypoint pair is: to calculate the distance between the two waypoints in the second waypoint pair.
[0149] The method for allocating threads for distance calculation tasks is the same as that for allocating threads for reachability calculation tasks, as described in the previous embodiments, and will not be repeated here. After allocation, the route generation device runs each thread in parallel, so that each thread can utilize its remaining resources to execute the allocated distance calculation task.
[0150] As can be seen from the above, when generating routes using the scheme provided in the embodiments of this application, multiple threads can be run in parallel to execute multiple distance calculation tasks in parallel, that is, to calculate the distance between two waypoints in multiple second waypoint pairs in parallel. This can significantly shorten the time spent calculating the distance between all two waypoints, thereby shortening the time spent generating routes and improving the efficiency of generating routes.
[0151] Corresponding to the aforementioned route generation method, this application also provides a safe route generation device.
[0152] In one embodiment of this application, see [link to embodiment]. Figure 10 A schematic diagram of a safe flight route generation device is provided. In this embodiment, the device includes:
[0153] The model acquisition module 1001 is used to acquire a dynamic flight space model in which the UAV can fly safely in the operation scenario. The dynamic flight space model is constructed from the point cloud data of obstacles in the operation scenario and the topology map of the operation scenario.
[0154] The matrix generation module 1002 is used to generate an reachability information matrix containing reachability information between waypoints in the dynamic flight space model, wherein the reachability information between waypoints characterizes whether the UAV can safely reach between waypoints;
[0155] The distance acquisition module 1003 is used to generate a distance matrix based on the topology map and the generated reachability information matrix, wherein the distance matrix represents the distance between waypoints in the dynamic flight space model;
[0156] The route generation module 1004 is used to generate a target route that meets the route conditions based on the target waypoints, reachability information matrix and distance matrix that the target route needs to pass through, in response to the generation instruction of the target route.
[0157] As can be seen from the above, by applying the route generation scheme provided in this application embodiment, after obtaining point cloud data and topology map, a flight space model can be constructed, a reachability information matrix can be generated, and a distance matrix can be generated. Thus, after obtaining the target route generation instruction, the target route can be generated automatically without human intervention. Even if the task to be performed by the UAV changes or the target waypoints that the UAV needs to pass through change, the user only needs to reissue the generation instruction to regenerate the route. Compared with the existing manual drawing of task routes, the route generation scheme provided in this application embodiment can improve the efficiency of route generation.
[0158] In one embodiment of this application, the model acquisition module 1001 includes:
[0159] The size determination submodule is used to determine the target size of the cross section of the preset convex polyhedron based on the UAV's body size and safety margin size;
[0160] The model acquisition submodule is used to determine the model boundary surfaces corresponding to each edge in the topology map, and to obtain an initial flight space model composed of each model boundary surface. The model boundary surface is a preset convex polyhedral structure, each face of the model boundary surface is parallel to its corresponding edge, and the size of the cross section of the model boundary surface is the target size.
[0161] The region exclusion submodule is used to exclude obstacle regions in the operation scenario from the initial flight space model based on the point cloud data, so as to obtain a dynamic flight space model in which the UAV can fly safely in the operation scenario.
[0162] As can be seen from the above, when generating flight paths using the scheme provided in the embodiments of this application, the target size is determined based on the aircraft size and safety margin size, thereby obtaining an initial flight space model. This initial flight space model can be considered as the area where the UAV is allowed to fly when there are no obstacles. Then, the obstacle area is removed from the initial flight space model, and the remaining area is the area in the operation scenario where the UAV is allowed to fly and will not touch the obstacle. Therefore, generating flight paths using the flight space model obtained in this way can effectively ensure that the UAV will not collide with the obstacle and ensure the safety of the UAV.
[0163] In one embodiment of this application, the model acquisition submodule is specifically used for:
[0164] Obtain the regional environmental information between the two waypoints corresponding to the edge, wherein the two waypoints corresponding to the edge are the waypoints represented by the two nodes connected by the edge;
[0165] Based on the regional environmental information, determine the offset of the model boundary surface;
[0166] Based on the target size and the offset, determine each face of the preset convex polyhedron structure parallel to the edge, and obtain the model boundary surface corresponding to the edge.
[0167] As can be seen from the above, when generating flight paths using the scheme provided in the embodiments of this application, the environmental information of the inter-waypoint area is considered when determining each face of the convex polyhedron structure. This enables the UAV to overcome the influence of the inter-waypoint area environment on the UAV's flight when flying through the inter-waypoint area according to the final generated flight path, thereby improving the UAV's anti-interference capability and the reliability of the generated flight path.
[0168] In one embodiment of this application, the region exclusion submodule is specifically used for:
[0169] Based on the point cloud data, determine the minimum bounding convex polyhedron of each obstacle in the work scenario;
[0170] By removing the overlapping regions between the initial flight space model and each minimum enclosing convex polyhedron from the initial flight space model, a dynamic flight space model in which the UAV can fly safely in the operational scenario is obtained.
[0171] This solution can accurately obtain the flight space model in this way, and then generate flight paths based on the flight space model, which can improve the accuracy of the generated flight paths and avoid collisions with obstacles when the UAV flies along the flight path.
[0172] In one embodiment of this application, the matrix generation module 1002 includes:
[0173] The information determination submodule is used to determine the first reachability information between adjacent waypoints based on the topology map and the dynamic flight space model.
[0174] The first traversal submodule is used to traverse the waypoints in the operation scenario. Based on the first auxiliary waypoint currently traversed, it determines a first waypoint pair containing two non-adjacent waypoints other than the first auxiliary waypoint. For each first waypoint pair, it calculates the second reachability information between the two waypoints contained in the first waypoint pair based on the obtained reachability information.
[0175] The reachability information matrix generation submodule is used to generate a reachability information matrix based on all the obtained first and second reachability information.
[0176] In this scheme, the first reachability information between adjacent waypoints and the second reachability information between non-adjacent waypoints are determined. This also determines the reachability information between every two waypoints. The reachability information of the UAV in the dynamic flight space model is equivalent to the set of reachability information between every two waypoints, i.e., the reachability information matrix. Therefore, by applying this scheme, the reachability information of the UAV can be accurately determined, and flight routes can be generated based on this reachability information, thereby improving the accuracy of the generated flight routes.
[0177] In one embodiment of this application, the first traversal submodule is specifically used for:
[0178] Each first waypoint pair is processed in the following manner:
[0179] Based on the reachability information between each waypoint in the first waypoint pair and the first auxiliary waypoint, calculate the reachability information between the two waypoints;
[0180] If the second reachability information between the two waypoints has not been obtained, the calculated reachability information is determined as the second reachability information between the two waypoints;
[0181] If the second reachability information between the two waypoints has already been obtained, and the obtained second reachability information indicates that the waypoints are unreachable while the calculated reachability information indicates that the waypoints are reachable, then the obtained second reachability information between the two waypoints will be updated to the calculated reachability information.
[0182] As can be seen from the above, when generating flight routes using the scheme provided in the embodiments of this application, the first reachability information between adjacent reachable waypoints is determined, and the second reachability information between non-adjacent reachable waypoints is determined by traversing the waypoints. This can accurately determine the reachability information between all two waypoints in the flight space model, thereby generating flight routes based on the reachability information and improving the accuracy of the generated flight routes.
[0183] In one embodiment of this application, the information determination submodule is specifically used for:
[0184] Based on each edge in the topology map, determine each pair of adjacent waypoints, wherein each pair of adjacent waypoints is two waypoints represented by two nodes connected by an edge;
[0185] For each pair of adjacent waypoints, determine whether the line connecting the pair of adjacent waypoints intersects with the dynamic flight space model. If it does, determine that the pair of adjacent waypoints is unreachable; if it does not, determine that the pair of adjacent waypoints is reachable.
[0186] This solution can accurately determine the reachability between adjacent waypoints by judging whether the line connecting adjacent waypoints intersects with the dynamic flight space model. Based on the determined reachability between adjacent waypoints, a route can be generated, which can improve the accuracy of the generated route.
[0187] In one embodiment of this application, the first traversal submodule is specifically used for:
[0188] Based on the number of first waypoint pairs, the number of threads, and the remaining resource information of each thread, threads are allocated to the reachability calculation tasks corresponding to each first waypoint pair so that each thread can run in parallel and calculate the second reachability information between the two waypoints contained in each first waypoint pair based on the reachability information obtained when executing the reachability calculation tasks.
[0189] As can be seen from the above, when generating routes using the scheme provided in the embodiments of this application, multiple threads can be run in parallel to execute multiple reachability calculation tasks in parallel, that is, to calculate the reachability information between two waypoints in multiple first waypoint pairs in parallel. This can significantly shorten the time spent calculating the reachability information between all two waypoints, thereby shortening the time spent generating routes and improving the efficiency of generating routes.
[0190] In one embodiment of this application, the distance acquisition module 1003 includes:
[0191] The distance acquisition submodule is used to obtain the first distance between adjacent reachable waypoints based on the topology map and the determined reachability information.
[0192] The second traversal submodule is used to traverse the waypoints in the operation scenario. Based on the currently traversed second auxiliary waypoint, it determines a second waypoint pair that includes two non-adjacent reachable waypoints other than the second auxiliary waypoint. For each second waypoint pair, it calculates the second distance between the two waypoints included in the second waypoint pair based on the obtained distance between waypoints.
[0193] The distance matrix generation submodule is used to generate a distance matrix based on all the obtained first and second distances.
[0194] This scheme determines the distance between adjacent reachable waypoints and the distance between non-adjacent reachable waypoints, thus determining the distance between any two reachable waypoints. Therefore, by applying this scheme, the distance between any two reachable waypoints can be accurately determined, and routes can be generated based on the distance between any two reachable waypoints. This allows for the generation of routes that meet distance requirements, such as the shortest distance route, the longest distance route, and so on.
[0195] In one embodiment of this application, the second traversal submodule is specifically used for:
[0196] Each second waypoint pair shall be processed in the following manner:
[0197] Given that the distance between each waypoint in the second waypoint centering system and the second auxiliary waypoint has been obtained, the distance between the two waypoints in the second waypoint centering system is calculated based on the distances between each waypoint in the second waypoint centering system and the second auxiliary waypoint.
[0198] If the second distance between the two waypoints is not obtained, the calculated distance will be determined as the second distance between the two waypoints.
[0199] If the second distance between the two waypoints in the second waypoint pair has been obtained and this second distance is greater than the calculated distance, then the second distance between the two waypoints in the second waypoint pair is updated to the calculated distance.
[0200] As can be seen from the above, when generating a route using the scheme provided in the embodiments of this application, the first distance between adjacent reachable waypoints is determined, and the distance between non-adjacent reachable waypoints is determined by traversing the waypoints. This can accurately determine the distance between all two waypoints, thereby generating a route based on the distance between all two waypoints, and generating a route that meets the distance requirements.
[0201] In one embodiment of this application, the second traversal submodule is specifically used for:
[0202] Based on the number of second waypoint pairs, the number of threads, and the remaining resource information of each thread, threads are allocated to the distance calculation tasks corresponding to each second waypoint pair so that each thread can run in parallel and calculate the distance between the two waypoints contained in each second waypoint pair based on the distances obtained when executing the distance calculation tasks.
[0203] As can be seen from the above, when generating routes using the scheme provided in the embodiments of this application, multiple threads can be run in parallel to execute multiple distance calculation tasks in parallel, that is, to calculate the distance between two waypoints in multiple second waypoint pairs in parallel. This can significantly shorten the time spent calculating the distance between all two waypoints, thereby shortening the time spent generating routes and improving the efficiency of generating routes.
[0204] This invention also provides an electronic device, such as... Figure 11 As shown, it includes a processor 1101, a communication interface 1102, a memory 1103, and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104.
[0205] Memory 1103 is used to store computer programs;
[0206] The processor 1101 is used to execute the program stored in the memory 1103 to implement any of the above-mentioned route generation methods.
[0207] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0208] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0209] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0210] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0211] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described route generation methods.
[0212] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the route generation methods described above.
[0213] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0214] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0215] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0216] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for generating safe flight routes, characterized in that, The method includes: A dynamic flight space model is obtained to ensure the safe flight of the UAV in the operational scenario. The dynamic flight space model is constructed from point cloud data of obstacles in the operational scenario and a topological map of the operational scenario. Generate an reachability information matrix containing reachability information between waypoints in the dynamic flight space model, wherein the reachability information between waypoints characterizes whether the UAV can safely reach between waypoints; Based on the topology map and the generated reachability information matrix, a distance matrix is generated, which represents the distance between waypoints in the dynamic flight space model; In response to the command to generate a target route, the target route that meets the route conditions is generated based on the target waypoints that the target route needs to pass through, the reachability information matrix, and the distance matrix.
2. The method according to claim 1, characterized in that, The process of obtaining a dynamic flight space model that allows the UAV to fly safely in the operational scenario includes: Based on the UAV's body dimensions and safety margin dimensions, determine the target dimensions of the pre-defined convex polyhedron's cross-section; The model boundary surfaces corresponding to each edge in the topology map are determined to obtain an initial flight space model composed of each model boundary surface. The model boundary surface is a preset convex polyhedron structure, each face of the model boundary surface is parallel to its corresponding edge, and the cross-sectional size of the model boundary surface is the target size. Based on the point cloud data, obstacle areas in the operational scenario are excluded from the initial flight space model to obtain a dynamic flight space model in which the UAV can fly safely in the operational scenario.
3. The method according to claim 2, characterized in that, Determining the model boundary surfaces corresponding to each edge in the topology map includes: Obtain the regional environmental information between the two waypoints corresponding to the edge, wherein the two waypoints corresponding to the edge represent the two nodes connected by the edge; Based on the regional environmental information, determine the offset of the model boundary surface; Based on the target size and the offset, determine each face of the preset convex polyhedron structure parallel to the edge, and obtain the model boundary surface corresponding to the edge.
4. The method according to claim 1, characterized in that, The generation of the reachability information matrix, which includes reachability information between waypoints in the dynamic flight space model, includes: Based on the topology map and the dynamic flight space model, the first reachability information between adjacent waypoints is determined; Traverse the waypoints in the operation scenario, and based on the first auxiliary waypoint currently traversed, determine a first waypoint pair that includes two non-adjacent waypoints other than the first auxiliary waypoint; For each first waypoint pair, calculate the second reachability information between the two waypoints contained in the first waypoint pair based on the obtained reachability information; Generate a reachability information matrix based on all the first and second reachability information obtained.
5. The method according to claim 4, characterized in that, For each first waypoint pair, the calculation of second reachability information between the two waypoints included in the first waypoint pair based on the obtained reachability information includes: Based on the reachability information between each waypoint in the first waypoint pair and the first auxiliary waypoint, calculate the reachability information between the two waypoints; If the second reachability information between the two waypoints has not been obtained, the calculated reachability information is determined as the second reachability information between the two waypoints; if the second reachability information between the two waypoints has been obtained, and the obtained second reachability information indicates unreachability while the calculated reachability information indicates reachability, the obtained second reachability information between the two waypoints is updated to the calculated reachability information. or Based on the number of first waypoint pairs, the number of threads, and the remaining resource information of each thread, threads are allocated to the reachability calculation tasks corresponding to each first waypoint pair so that each thread can run in parallel. Each thread calculates the second reachability information between the two waypoints contained in each first waypoint pair based on the reachability information obtained when executing the task.
6. The method according to claim 4, characterized in that, The step of determining the first reachability information between adjacent waypoints based on the topology map and the dynamic flight space model includes: Based on each edge in the topology map, determine each pair of adjacent waypoints, where each pair of adjacent waypoints represents two nodes connected by an edge; For each pair of adjacent waypoints, determine whether the line connecting the pair of adjacent waypoints intersects with the dynamic flight space model. If it does, determine that the pair of adjacent waypoints is unreachable; if it does not, determine that the pair of adjacent waypoints is reachable.
7. The method according to claim 1, characterized in that, The step of generating a distance matrix based on the topology map and the generated reachability information matrix includes: Based on the topology map and the determined reachability information, the first distance between adjacent reachable waypoints is obtained; Traverse the waypoints in the operation scenario, and based on the currently traversed second auxiliary waypoint, determine the second waypoint pair that includes two non-adjacent reachable waypoints other than the second auxiliary waypoint; For each pair of second waypoints, calculate the second distance between the two waypoints contained in the pair based on the already obtained distances between waypoints; Generate a distance matrix based on all the obtained first and second distances.
8. The method according to claim 7, characterized in that, For each second waypoint pair, calculating the second distance between the two waypoints contained in the second waypoint pair based on the obtained inter-waypoint distances includes: If the distances between each waypoint in the second waypoint centering pair and the second auxiliary waypoint have been obtained, then the distance between the two waypoints in the second waypoint centering pair is calculated based on the distances between each waypoint in the second waypoint centering pair and the second auxiliary waypoint. If the second distance between the two waypoints in the second waypoint centering pair has not been obtained, then the calculated distance is determined as the second distance between the two waypoints in the second waypoint centering pair. If the second distance between the two waypoints in the second waypoint centering pair has been obtained and the second distance is greater than the calculated distance, then the second distance between the two waypoints in the second waypoint centering pair is updated to the calculated distance. or Based on the number of second waypoint pairs, the number of threads, and the remaining resource information of each thread, threads are allocated to the distance calculation tasks corresponding to each second waypoint pair so that each thread can run in parallel, and each thread calculates the distance between the two waypoints contained in each second waypoint pair based on the distance obtained when executing the task.
9. A safe flight path generation device, characterized in that, The device includes: The model acquisition module is used to acquire a dynamic flight space model in which the UAV can fly safely in the operation scenario. The dynamic flight space model is constructed from point cloud data of obstacles in the operation scenario and the topology map of the operation scenario. The matrix generation module is used to generate an reachability information matrix containing reachability information between waypoints in the dynamic flight space model, wherein the reachability information between waypoints characterizes whether the UAV can safely reach between waypoints; The distance acquisition module is used to generate a distance matrix based on the topology map and the generated reachability information matrix, wherein the distance matrix represents the distance between waypoints in the dynamic flight space model; The route generation module is used to respond to the generation command of the target route and generate the target route that meets the route conditions based on the target waypoints that the target route needs to pass through, the reachability information matrix and the distance matrix.
10. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-8.