A method and device for generating a test route and an electronic device
By determining the projection of obstacle models in a virtual simulation platform, test routes covering different heights and orientations are automatically generated, solving the problem of low efficiency in generating test routes in virtual simulation platforms and realizing efficient generation of obstacle avoidance algorithm test cases.
Patent Information
- Application Number
- CN202511324060.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-09-17
Smart Images

Figure CN120832829B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of unmanned aerial vehicle simulation testing, in particular to a test flight path generation method and device and electronic equipment. BACKGROUND
[0002] Unmanned aerial vehicle technology is widely used in agriculture, aerial photography, logistics and other fields. In the operation process, the unmanned aerial vehicle usually needs to fly in a complex environment, avoid obstacles such as buildings, trees, towers and other obstacles in the environment, and complete the task. Therefore, the automatic obstacle avoidance capability of the unmanned aerial vehicle is one of its core technologies. The automatic obstacle avoidance of the unmanned aerial vehicle depends on the algorithm performance of the obstacle avoidance algorithm. Therefore, how to test the algorithm performance of the obstacle avoidance algorithm is crucial.
[0003] In order to test the algorithm performance of the obstacle avoidance algorithm, test cases need to be generated for the obstacle avoidance algorithm. The test cases are generated based on test flight paths. The test flight paths are generated by a virtual simulation test environment. The virtual simulation platform only provides a basic simulation environment. The test flight paths depend on manual design and drawing. The efficiency of generating the test flight paths is low. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a test flight path generation method, device and electronic equipment to improve the generation efficiency of the test flight path of the obstacle model in the virtual simulation test environment. The specific technical solutions are as follows:
[0005] In a first aspect, the embodiments of the present application provide a test flight path generation method, which comprises:
[0006] determining the projection of the target obstacle model to be tested on a horizontal plane;
[0007] determining a reference test flight path in which the aircraft collides with the target obstacle model based on the projection;
[0008] constructing a target test flight path in which the aircraft collides with the target obstacle model based on the reference test flight path, the preset flight path generation interval and the height of the target obstacle model.
[0009] Optionally, the step of determining the reference test flight path in which the aircraft collides with the target obstacle model based on the projection comprises:
[0010] determining a plurality of edge points on the edge of the projection;
[0011] generating a plurality of reference test flight paths in which the aircraft collides with the target obstacle model from different directions, taking each edge point as a starting point.
[0012] Optionally, the step of determining a plurality of edge points on the edge of the projection comprises:
[0013] generating a first number of first type rays along a radial direction of the circumscribed circle, starting from a center of the circumscribed circle of the projection;
[0014] determining a plurality of first type intersection points where the first type rays intersect with the edge of the target obstacle model;
[0015] determining the plurality of first type intersection points as a plurality of edge points.
[0016] Optionally, the step of generating a plurality of reference test flight paths where the aircraft collides with the target obstacle model from different directions, starting from each edge point, comprises:
[0017] generating a second number of second type rays as the plurality of reference test flight paths where the aircraft collides with the target obstacle model from different directions, starting from each edge point.
[0018] Optionally, the step of generating a second number of second type rays, starting from each edge point, comprises:
[0019] determining a straight line passing through each edge point and being perpendicular to the edge point;
[0020] constructing a second number of second type rays outside the target obstacle model, starting from the edge point, within a first area range formed by two first range boundary lines corresponding to the straight line on the plane where the projection is located, wherein the two first range boundary lines are respectively located on two sides of the straight line and have a first preset angle with the straight line.
[0021] Optionally, the step of generating a second number of second type rays, starting from each edge point, comprises:
[0022] constructing a second number of second type rays outside the target obstacle model, starting from the edge point on the first type ray, within a second area range formed by two second range boundary lines corresponding to the first type ray on the plane where the projection is located; wherein the two second range boundary lines are respectively located on two sides of the first type ray and have a second preset angle with the first type ray.
[0023] Optionally, the step of constructing a target test flight path where the aircraft collides with the target obstacle model based on the reference test flight paths, a preset flight path generation interval and a height of the target obstacle model, comprises:
[0024] determine a plurality of planes of the target obstacle model at different heights based on the height of the target obstacle model, wherein a spacing between two adjacent planes is the preset flight path generation spacing;
[0025] copy the reference test flight path to each plane to obtain a target test flight path in which the aircraft collides with the target obstacle model.
[0026] Optionally, the number of target obstacle models is a plurality; the method further comprises:
[0027] for each waypoint of each target test flight path, obtain a plurality of simulation images of the target obstacle model corresponding to the waypoint based on a preset waypoint pitch angle;
[0028] input the simulation images into a pre-trained obstacle avoidance model, and obtain a correspondence between image features and obstacle avoidance results of the obstacle avoidance model based on pre-learned simulation images, and output an obstacle avoidance result for each target obstacle model, wherein the obstacle avoidance result represents whether the aircraft collides with the target obstacle model based on inference of the simulation images by the obstacle avoidance model;
[0029] based on the obstacle avoidance results of the plurality of target obstacle models, statistics an obstacle avoidance success rate for various types of obstacle models;
[0030] in a case where there is an obstacle type with an obstacle avoidance success rate less than or equal to a preset threshold, update the obstacle avoidance model based on simulation images of the target obstacle model of the obstacle type.
[0031] In a second aspect, an embodiment of the present application provides a test flight path generation device, the device comprising:
[0032] a projection determination module configured to determine a projection of a target obstacle model to be tested on a horizontal plane;
[0033] a flight path determination module configured to determine a reference test flight path in which an aircraft collides with the target obstacle model based on the projection;
[0034] a flight path construction module configured to construct a target test flight path in which the aircraft collides with the target obstacle model based on the reference test flight path, a preset flight path generation spacing, and a height of the target obstacle model.
[0035] Optionally, the flight path determination module comprises:
[0036] an edge point determination sub-module configured to determine a plurality of edge points on an edge of the projection;
[0037] The route generation submodule is configured to generate, as a starting point, each edge point, a plurality of reference test routes in which the aircraft collides with the target obstacle model from different directions.
[0038] Optionally, the edge point determination submodule comprises:
[0039] The intersection determination unit is configured to generate, as a starting point, a first number of first type rays along a radial direction of the circumscribed circle of the projection; determine a plurality of first type intersection points at which the first type rays intersect with the edge of the target obstacle model; and determine the plurality of first type intersection points as a plurality of edge points.
[0040] Optionally, the route generation submodule comprises:
[0041] The ray generation unit is configured to generate, as a starting point, each edge point, a second number of second type rays as a plurality of reference test routes in which the aircraft collides with the target obstacle model from different directions.
[0042] Optionally, the ray generation unit comprises:
[0043] The first generation subunit is configured to determine a straight line that passes through each edge point and is perpendicular to the edge point; and construct, as a starting point, the edge point, a second number of second type rays outside the target obstacle model within a first area range formed by two first range boundary lines corresponding to the straight line on the plane on which the projection is located, wherein the two first range boundary lines are located on two sides of the straight line and have a first preset angle with the straight line.
[0044] Optionally, the ray generation unit comprises:
[0045] The second generation subunit is configured to construct, as a starting point, an edge point on the first type ray, a second number of second type rays outside the target obstacle model within a second area range formed by two second range boundary lines corresponding to the first type ray on the projection plane; wherein the two second range boundary lines are located on two sides of the first type ray and have a second preset angle with the first type ray.
[0046] Optionally, the route construction module comprises:
[0047] The plane determination submodule is configured to determine, based on a height of the target obstacle model, a plurality of planes at different heights of the target obstacle model, wherein an interval between two adjacent planes is the preset route generation interval.
[0048] a route copying submodule, configured to copy the reference test route to each plane to obtain a target test route in which the aircraft collides with a target obstacle model.
[0049] Optionally, the number of the target obstacle models is multiple; and the device further comprises:
[0050] a picture sampling module, configured to, for each waypoint of each target test route, acquire multiple simulation images of the target obstacle model corresponding to the waypoint based on a preset waypoint pitch angle;
[0051] an obstacle avoidance result acquisition module, configured to input the simulation images into a pre-trained obstacle avoidance model, and acquire a corresponding relationship between image features and obstacle avoidance results of the simulation images learned by the obstacle avoidance model in advance, and output an obstacle avoidance result for each target obstacle model, wherein the obstacle avoidance result represents whether the aircraft collides with the target obstacle model based on inference of the simulation images by the obstacle avoidance model;
[0052] a statistics module, configured to, based on the obstacle avoidance results of the multiple target obstacle models, statistically acquire an obstacle avoidance success rate for various types of obstacle models;
[0053] a model updating module, configured to, in a case where there is an obstacle type with an obstacle avoidance success rate less than or equal to a preset threshold, update the obstacle avoidance model based on simulation images of the target obstacle model of the obstacle type.
[0054] In a third aspect, an electronic device is provided, and the electronic device comprises:
[0055] a memory, configured to store a computer program;
[0056] a processor, configured to execute the program stored on the memory, and implement any of the methods described above.
[0057] In a fourth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement any of the methods described above.
[0058] In a fifth aspect, a computer program product containing instructions is provided, and when the computer program product is executed on a computer, the computer is caused to perform the method for generating a test route described above.
[0059] The embodiments of the present application have the following beneficial effects:
[0060] The technical scheme provided in the embodiments of the present application can determine the projection of the target obstacle model to be tested on a horizontal plane, determine a reference test flight path of the aircraft colliding with the target obstacle model based on the projection, and construct a target test flight path of the aircraft colliding with the target obstacle model based on the reference test flight path, a preset flight path generation interval, and the height of the target obstacle model. In this way, the target test flight path of the target obstacle model is generated by using the projection of the target obstacle model on the horizontal plane, which improves the generation efficiency of the test flight path compared with the manual design and drawing of the test flight path. Since it is necessary to test whether the aircraft collides with each target obstacle model at the outer boundary of the model in the collision scenario, the target obstacle model such as a building or a tower is perpendicular to the horizontal plane, the projection of each plane of the model at different heights is located within the projection of the outer contour, and the projection of the target obstacle model on the horizontal plane can represent the shape of the outer contour of the target obstacle model and the maximum size in the horizontal direction, the reference test flight path of the target obstacle model can represent the test flight path of each plane at different heights of the target obstacle model, and the test flight path of each plane can be directly constructed by using the reference test flight path according to the preset flight path generation interval, so that the target test flight path of the aircraft colliding with the target obstacle model can be quickly obtained, the flight path generation efficiency can be further improved, and the efficiency of the test case of the obstacle avoidance algorithm generated by using the test flight path can be improved. Of course, any product or method implemented according to the present application does not necessarily achieve all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.
[0062] Figure 1 A flowchart of the test flight path generation method provided in the embodiments of the present application;
[0063] FIG. 2(a) is a schematic diagram of a reference test flight path provided in the embodiments of the present application;
[0064] FIG. 2(b) is a schematic diagram of a target test flight path provided in the embodiments of the present application;
[0065] Figure 3 A flowchart of a specific implementation of step S102;
[0066] FIG. 4(a) is a schematic diagram of an edge point provided in the embodiments of the present application;
[0067] FIG. 4(b) is another schematic view of the edge point according to an embodiment of the present application;
[0068] FIG. 5(a) is a schematic view of the first type of ray according to an embodiment of the present application;
[0069] FIG. 5(b) is another schematic view of the edge point according to an embodiment of the present application;
[0070] Figure 6 FIG. 6 is a schematic view of the second type of ray according to an embodiment of the present application;
[0071] FIG. 7(a) is a schematic view of the first range boundary line according to an embodiment of the present application;
[0072] FIG. 7(b) is another schematic view of the benchmark test route according to an embodiment of the present application;
[0073] FIG. 7(c) is another schematic view of the benchmark test route according to an embodiment of the present application;
[0074] Figure 8 FIG. 8 is a schematic view of a generated instance of the test route according to an embodiment of the present application;
[0075] Figure 9 FIG. 9 is another flowchart of the method for generating the test route according to an embodiment of the present application;
[0076] Figure 10 FIG. 10 is a schematic view of a test route generation device according to an embodiment of the present application;
[0077] Figure 11 FIG. 11 is a schematic view of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0078] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art based on the present application are within the scope of protection of the present application.
[0079] In order to improve the generation efficiency of the test route, the embodiments of the present application provide a method, device, electronic device, computer readable storage medium and computer program product for generating a test route. First, a method for generating a test route according to an embodiment of the present application is introduced.
[0080] The test flight path generation method provided in the embodiments of the present application can be applied to any electronic device that can generate a test flight path. For example, a background server of an aircraft, a test device, etc., which are not specifically limited here. For the sake of clarity, the electronic device is referred to as an electronic device hereinafter.
[0081] As shown in Figure 1 A test flight path generation method, the method comprising:
[0082] S101: determining a projection of a target obstacle model to be tested on a horizontal plane.
[0083] S102: determining a reference test flight path of a collision between an aircraft and the target obstacle model based on the projection.
[0084] S103: constructing a target test flight path of a collision between the aircraft and the target obstacle model based on the reference test flight path, a preset flight path generation interval, and a height of the target obstacle model.
[0085] The technical solution provided in the embodiments of the present application generates a target test flight path of a target obstacle model by using a projection of the target obstacle model on a horizontal plane. Compared with the way of manually designing and drawing a test flight path, the generation efficiency of the test flight path is improved. Since the collision scenario is considered, it is necessary to test whether the aircraft collides with each target obstacle model at the outer boundary of the model. The target obstacle model, such as a building or a tower, is perpendicular to the horizontal plane. The projection of each plane of the model at different heights is located within the projection of the outer contour. Moreover, the projection of the target obstacle model on the horizontal plane can represent the shape of the outer contour of the target obstacle model and the maximum size in the horizontal direction. Therefore, the reference test flight path of the target obstacle model can be constructed on the projection, which can represent the test flight path of each plane at different heights of the target building model. Subsequently, the test flight path of each plane can be directly constructed by using the reference test flight path according to the preset flight path generation interval, the target test flight path of the collision between the aircraft and the target obstacle model can be quickly obtained, the flight path generation efficiency can be further improved, and the efficiency of the test case of the obstacle avoidance algorithm generated by using the test flight path can be improved.
[0086] Currently, the performance of an obstacle avoidance algorithm is tested in a real test environment by controlling an aircraft to fly along a preset test flight path, which is costly and risky. The performance of the obstacle avoidance algorithm is tested in a virtual simulation test environment, and test cases are generated based on a test flight path. Since the virtual simulation platform only provides a basic simulation environment, the test flight path needs to be manually designed and drawn for the obstacle model in the basic simulation environment, and then test cases are generated based on the test flight path. The test flight path generation efficiency is low. In order to improve the generation efficiency of the test flight path in the virtual simulation test environment, the electronic device can determine a target obstacle model to be tested in the virtual simulation test environment of the aircraft.
[0087] The target obstacle model to be tested can be one obstacle model in the virtual simulation test environment, for example, an obstacle model of a target obstacle type, and the target obstacle type can be a building, a car, a tower, etc. The target obstacle model can also be multiple obstacle models in the virtual simulation test environment, for example, all obstacle models in the virtual simulation test environment, and the user selects multiple obstacle models from the all obstacle models, etc. The number of target obstacle models is not limited herein.
[0088] In an implementation manner, the electronic device can regard each obstacle model in the virtual simulation test environment of the aircraft as a target obstacle model to be tested, and then construct a target test flight path for each target obstacle model. In another implementation manner, the electronic device can regard an obstacle model indicated by a selection operation of the user as a target obstacle model to be tested in response to the selection operation of the user.
[0089] Then, the electronic device can project the target obstacle model vertically downward, so as to determine the projection of the target obstacle model to be tested on a horizontal plane, that is, step S101 is performed.
[0090] Then, the electronic device can perform step S102, that is, determine a reference test flight path in which the aircraft collides with the target obstacle model based on the projection.
[0091] In a real collision scene, it is necessary to test whether the aircraft collides with each target obstacle model at the outer boundary of the model. The target obstacle model, such as a building or a tower, is perpendicular to the horizontal plane. The projection of each plane at different heights of the model is located within the projection of the outer contour. In addition, the projection of the target obstacle model on the horizontal plane can represent the shape of the outer contour of the target obstacle model and the maximum size in the horizontal direction. Therefore, in order to simplify the test flight path generation process and improve the generation efficiency of the test flight path, the electronic device can determine the reference test flight path of the aircraft colliding with the target obstacle model based on the projection of the target obstacle model.
[0092] Since the reference test flight path is a test flight path in which the aircraft collides with the target obstacle model on a plane of the horizontal plane, the aircraft can collide with the target obstacle model from each plane above the horizontal plane and each angle of each plane. Only constructing the reference test flight path of the aircraft colliding with the target obstacle model on the horizontal plane cannot well simulate various situations in which the aircraft collides with the target obstacle model.
[0093] Therefore, the electronic device can perform step S103 to construct a target test flight path of the aircraft colliding with the target obstacle model based on the reference test flight path, a preset flight path generation interval, and the height of the target obstacle model.
[0094] In order to construct a three-dimensional test flight path cluster of the aircraft colliding with the target obstacle model from each plane based on the determined reference test flight path of the aircraft colliding with the target obstacle model, a preset flight path generation interval can be set.
[0095] The electronic device can construct a test flight path of the aircraft colliding with the target obstacle model from each plane at different heights of the target obstacle model according to the preset flight path generation interval based on the reference test flight path and the height of the target obstacle model, to obtain a target test flight path of the aircraft colliding with the target obstacle model. Since the generated flight path is taken as a starting point, the target test flight path of the aircraft colliding with the target obstacle model can be referred to as a collision test flight path of the aircraft colliding with the target obstacle model.
[0096] For example, the target obstacle model is a building, and the electronic device determines a reference test flight path of the aircraft colliding with the building based on a projection of the building on a horizontal plane, as shown in FIG. 2(a). The electronic device constructs a target test flight path of the aircraft colliding with the building based on the reference test flight path, a height of the target obstacle model, and a preset flight path generation interval, as shown in FIG. 2(b). It can be seen that the target test flight path is a three-dimensional test flight path cluster of the aircraft colliding with the target obstacle model from various planes. The target test flight path covers multiple planes at different heights of the target obstacle model, and covers various directions such as a front surface, a side surface, and a corner of each plane.
[0097] In this way, by constructing the target test flight path of the aircraft colliding with the target obstacle model, the obtained target test flight path can meet various scenarios of the aircraft colliding with the target obstacle model, improve the adaptability of the scenarios to various scenarios, and accordingly, the test cases of the collision algorithm generated by using the target test flight path are test cases that comprehensively cover various collision scenarios, and the algorithm performance of the collision algorithm can be more accurately tested.
[0098] In addition, the electronic device can automatically generate test flight paths for each obstacle model in the virtual simulation test environment by using the above method, and quickly generate test flight paths covering various directions of each obstacle model. In this way, the time required for generating a large number of test flight paths is reduced from hours to minutes, and the flight path generation efficiency is greatly improved.
[0099] As an implementation manner, after the target test flight path of the aircraft colliding with the target obstacle model is generated, the generated target test flight path of the aircraft colliding with the target obstacle model can be stored in a current test flight path library, so as to create and manage test flight paths for different target obstacle models.
[0100] It can be seen that, in the embodiment, the target test flight path of the target obstacle model is generated by using the projection of the target obstacle model on the horizontal plane, which improves the generation efficiency of the test flight path compared with the manual design of the test flight path. Since the collision scene is considered, it is necessary to test whether the aircraft collides with each target obstacle model outside the model boundary. The target obstacle model, such as a building or a tower, is perpendicular to the horizontal plane, and the projection of each plane of the model at different heights is located within the projection of the outer contour. In addition, the projection of the target obstacle model on the horizontal plane can represent the shape of the outer contour of the target obstacle model and the maximum size in the horizontal direction. Therefore, the reference test flight path of the target obstacle model can be constructed on the projection, which can represent the test flight path of each plane of the target obstacle model at different heights. Subsequently, the test flight path of each plane can be directly constructed by using the reference test flight path according to the preset flight path generation interval, the aircraft colliding with the target obstacle model can be quickly obtained, and the flight path generation efficiency can be further improved, thereby improving the efficiency of the test case of the obstacle avoidance algorithm generated by using the test flight path.
[0101] As an implementation manner of the embodiment of the present application, as shown in Figure 3 The step S102, i.e., the step of determining the reference test flight path of the aircraft colliding with the target obstacle model based on the projection, can include:
[0102] S301: determining a plurality of edge points on the edge of the projection.
[0103] After determining the projection of the target obstacle model on the horizontal plane, the electronic device can determine a plurality of edge points of the projection of the target obstacle model on the horizontal plane.
[0104] Since the projection is the maximum contour of the target obstacle model on the horizontal plane, the plurality of edge points of the projection correspond to the edge points on the contour of the target obstacle model.
[0105] In an implementation manner, the electronic device can determine a plurality of edge points on the edge of the projection of the target obstacle model according to a preset edge point collection interval. For example, as shown in FIG. 4(a), a plurality of edge points 420 are determined on each edge of the projection 410 of the target obstacle model on the horizontal plane according to a preset edge point collection interval.
[0106] In an implementation manner, the electronic device can determine a plurality of landmark position points on the edge of the projection of the target obstacle model, wherein the landmark position points include corners, midpoints of each edge, etc., and each landmark position point is used as an edge point. For example, as shown in FIG. 4(b), the corners and midpoints of each edge on the projection 410 of the target obstacle model on the horizontal plane are used as a plurality of edge points 420.
[0107] S302: generating, as a starting point of each edge point, a plurality of benchmark test flight paths in which the aircraft collides with the target obstacle model from different directions.
[0108] Each edge point can be a collision point at which the aircraft collides with the target obstacle model, i.e., an end point of a test flight path in which the aircraft collides with the target obstacle model. Moreover, for each collision point, the aircraft can fly towards the target obstacle model from different directions and collide with the target obstacle model at the collision point.
[0109] Therefore, after determining the plurality of edge points, the electronic device can generate, as a starting point of each edge point, a plurality of benchmark test flight paths in which the aircraft collides with the target obstacle model from different directions.
[0110] In an implementation manner, the electronic device can construct a first circle with a preset position point inside the projection as a center, generate a first number of first type rays along a radial direction of the first circle, determine a plurality of first type intersection points at which the first type rays intersect with the edge of the target obstacle model, and obtain the plurality of edge points. The preset position point can be a center of the projection or an arbitrarily set position point, and accordingly, the first circle can be a circumscribed circle of the projection with the center of the projection as a center, or an arbitrary circle with the arbitrarily set position point as a center and an arbitrarily set radius as a radius, which is not limited herein.
[0111] As can be seen, in the embodiment, the electronic device can determine the plurality of edge points on the edge of the projection, and generate, as a starting point of each edge point, a plurality of benchmark test flight paths in which the aircraft collides with the target obstacle model from different directions. In this way, the electronic device can quickly and accurately generate the benchmark test flight paths in which the aircraft collides with the target obstacle model, improve the generation efficiency of the test flight paths, and the directions of the benchmark test flight paths can be different, thereby improving the adaptability of the benchmark test flight paths to the test scene.
[0112] As an implementation manner of the embodiment of the present application, the step S301, i.e., the step of determining the plurality of edge points on the edge of the projection, can include:
[0113] generating a first number of first type rays along a radial direction of a circumscribed circle of the projection, with a center of the circumscribed circle as a starting point;
[0114] determining a plurality of first type intersection points at which the first type rays intersect with the edge of the target obstacle model;
[0115] determining the plurality of first type intersection points as the plurality of edge points.
[0116] After determining the projection of the target obstacle model on the horizontal plane, the electronic device can determine the circumscribed circle of the projection.
[0117] It should be noted that in the case of the projection being circular, the center of the projection is the center of the circumscribed circle.
[0118] In this way, the electronic device can generate the first number of first type rays from the center of the circumscribed circle of the projection along the radial direction of the circumscribed circle of the projection.
[0119] The first number can be set according to the actual scene, for example, 8, 10, 50, 100, etc., which is not limited here.
[0120] In an implementation manner, the electronic device can determine each radius that divides the circumscribed circle into the first number of sectors with the same central angle, and for each radius, generate a first type ray from the center of the circumscribed circle of the projection along the direction of the radius of the circumscribed circle.
[0121] For example, as shown in FIG. 5(a), the projection 410 of the target obstacle model on the horizontal plane is determined, the circumscribed circle 520 of the projection and the center O of the circumscribed circle are determined, the radii that divide the circle into 8 sectors with a central angle of 45 degrees are determined, and 8 first type rays 530 are respectively generated from O along the direction of each radius.
[0122] In an implementation manner, the electronic device can determine each diameter that divides the circumscribed circle into the first number of sectors with the same central angle, and for each diameter, respectively generate a first type ray from the center of the circumscribed circle of the projection along the two different extensions of the diameter, so that the two first type rays generated based on the diameter are on the straight line where the diameter is located.
[0123] In an implementation manner, the electronic device can generate, from the center of the circumscribed circle of the projection, the first target number of first type rays along the radial direction of the circumscribed circle of the projection in a first area of the collision-prone area of the circumscribed circle of the projection indicated by the collision angle statistical data, and generate the second target number of first type rays along the radial direction of the circumscribed circle of the projection in other areas of the circumscribed circle except the first area, where the area range of the first area is smaller than the area range of the other areas, the first target number is greater than the second target number, and the sum of the first target number and the second target number is the first number.
[0124] After determining the first number of first type rays, the electronic device can determine a plurality of first type intersection points where the first type rays intersect the edge of the target obstacle model, and determine the plurality of first type intersection points as a plurality of edge points.
[0125] Since each first-type ray intersects the edge of the target obstacle model at a first-type intersection point, the electronic device can determine a first number of edge points on the edge of the projection.
[0126] For example, based on Figure 5(a), as shown in Figure 5(b), the electronic device can determine the first type intersection point 540 where each first type ray 530 intersects with the edge of the projection 410 of the target obstacle model on the horizontal plane, and take each first type intersection point 540 as an edge point to obtain 8 edge points.
[0127] As can be seen, in this embodiment, the electronic device can generate a first number of first-type rays along the radial direction of the circumcircle of the projection, starting from the center of the circumcircle. Multiple first-type intersection points are then determined where these rays intersect the edge of the target obstacle model, and these intersection points are identified as multiple edge points. In this way, the electronic device can quickly and accurately determine multiple edge points on the edge of the obstacle projection, and then use these determined edge points to generate a benchmark test route, thus improving the efficiency of test route generation.
[0128] As one embodiment of this application, step S302 above, namely, the step of generating multiple benchmark test routes for the aircraft to collide with the target obstacle model from different directions by taking each edge point as the starting point, may include:
[0129] Using each edge point as a starting point, a second number of second-type rays are generated, serving as multiple benchmark test routes for the aircraft to collide with the target obstacle model from different directions.
[0130] After determining multiple edge points on the edge of the projection, for each edge point, the electronic device can generate a second number of second-type rays starting from that edge point, thereby obtaining multiple benchmark test routes in which the aircraft collides with the target obstacle model from different directions.
[0131] The second quantity mentioned above can be set according to the actual needs of the scenario, such as 8, 10, 50, etc., and no specific limit is made here.
[0132] For example, such as Figure 6 As shown, for each edge point 420 on the edge of the projection 410 of the target obstacle model on the horizontal plane, the electronic device can generate 8 second-type rays 630 starting from the edge point 420. In this way, after generating 8 second-type rays 630 starting from each edge point, multiple benchmark test routes in which the aircraft collides with the target obstacle model from different directions can be obtained.
[0133] It can be seen that in this embodiment, the electronic device can take each edge point as a starting point to generate a second number of second type rays as a plurality of benchmark test flight lines of the aircraft colliding with the target obstacle model from different directions. In this way, the electronic device can quickly and accurately generate a plurality of benchmark test flight lines of the aircraft colliding with the target obstacle model from different directions, improve the generation efficiency of the benchmark test flight lines, and since the benchmark test flight lines of the aircraft colliding with the target obstacle model from different directions are generated, the generated test flight lines can cover various situations of the aircraft colliding with the target obstacle model, improve the scene adaptability, and then the generated benchmark test flight lines can be used to generate more comprehensive test cases of the collision algorithm.
[0134] As an implementation manner of the embodiment of the present application, the step of taking each edge point as a starting point to generate a second number of second type rays can include:
[0135] determining a straight line passing through each edge point and perpendicular to the edge point; and constructing a second number of second type rays outside the target obstacle model from the edge point within a first area range formed by two first range boundary lines corresponding to the straight line on the projection plane, where the two first range boundary lines are located on both sides of the straight line and have a first preset angle with the straight line.
[0136] After determining a plurality of edge points on the projected edge, the electronic device can determine a straight line passing through each edge point and perpendicular to the edge point, where the straight line perpendicular to the edge point is a tangent line at the edge point of the projected edge on which the edge point is located, that is, the determined straight line is a normal line of the projected edge corresponding to the edge point.
[0137] Further, the electronic device can determine two first range boundary lines on both sides of the straight line and having a first preset angle with the straight line on the projection plane.
[0138] The first preset angle can be set according to actual scene needs, for example, can be 45 degrees, 75 degrees, 90 degrees, etc., which is not limited here.
[0139] For example, as shown in FIG. 7(a), for an edge point 420 on the edge of the projection 410 of the target obstacle model on the horizontal plane, the electronic device can determine a straight line 730 passing through the edge point 420 and perpendicular to the edge point 420, and determine two first range boundary lines 740 having an angle α with the straight line on both sides of the straight line.
[0140] The first area range formed by the two first range boundary lines is an area range through which the aircraft can fly in different directions and collide with the target obstacle model.
[0141] The electronic device can construct, in the first area range, a second number of second type rays from the first type intersection points to the outside of the target obstacle model. Since the second type rays are generated based on the normal line corresponding to the edge point (i.e., the straight line determined to pass through each edge point and be perpendicular to the edge point), the second type rays can be generated in a normal derivation mode.
[0142] In an implementation, the electronic device can construct, in the first area range, a third target number of second type rays from the edge point to the outside of the target obstacle model according to the collision angle statistical data, the third target number of second type rays being located in a collision-prone range indicated by the collision angle statistical data; and construct a fourth target number of second type rays in the first area range except the collision-prone range, the collision-prone range having a smaller area range than the other area range, the third target number being greater than the fourth target number, and the sum of the third target number and the fourth target number being the second number.
[0143] In an implementation, the electronic device can determine that the first area range formed by the two first range boundary lines is a sector with a central angle of twice a first preset angle, and the electronic device can determine to divide the sector into the second number of second type rays of subsectors with the same central angle.
[0144] That is, the second number of second type rays divides the central angle of the first area range into the second number of angles.
[0145] For example, based on FIG. 5(b), the electronic device can generate 8 first type rays 530 from the center O of the circumscribed circle 520 of the projection 410 of the target obstacle model on the horizontal plane to the outside of the circumscribed circle 520 of the projection 410 of the target obstacle model on the horizontal plane, determine a plurality of first type intersection points 540 of the first type rays 530 and the edge of the target obstacle model, and obtain a plurality of edge points.
[0146] Further, on the basis of FIG. 5(b), as shown in FIG. 7(b), each edge point is sequentially traversed, when the edge point A is traversed, the electronic device can determine a straight line a passing through the edge point A and being perpendicular to the edge of the projection where the edge point A is located; in the first area range formed by the two first range boundary lines corresponding to the straight line on the projection plane, the two first range boundary lines coincide with the edge of the projection because the included angle between the two first range boundary lines and the straight line is 90 degrees, which is not shown in the figure. Two second rays 750 and 760 are constructed from the edge point A to the outside of the target obstacle model, where the second ray 750 is a ray extending in the C direction from the edge point A, and the second ray 760 is a ray extending in the D direction from the edge point A. After traversing each edge point, a plurality of reference test flight lines of the aircraft colliding with the target obstacle model from different directions are obtained, which are represented by solid lines in FIG. 7(b).
[0147] It can be seen that in the embodiment, the electronic device can determine a straight line passing through each edge point and being perpendicular to the edge point; in the first area range formed by the two first range boundary lines corresponding to the straight line on the projection plane, a second number of second rays are constructed from the first type intersection point to the outside of the target obstacle model. In this way, the electronic device can quickly and accurately construct the reference test flight lines of the aircraft colliding with the target obstacle model, thereby improving the generation efficiency of the test flight lines.
[0148] As an implementation manner of the embodiment of the present application, the step of generating a second number of second rays from each edge point as a starting point can include:
[0149] In the second area range formed by the two second range boundary lines corresponding to the first ray on the projection plane, a second number of second rays are constructed from the edge point on the first ray to the outside of the target obstacle model; wherein the two second range boundary lines corresponding to the first ray are respectively located on the two sides of the first ray, and the included angle with the first ray is a second preset angle.
[0150] After generating the first ray from the center of the circumscribed circle of the projection as a starting point along the radial direction of the circumscribed circle of the projection, the electronic device can determine two second range boundary lines respectively located on the two sides of the first ray and having a second preset angle with the first ray on the projection plane.
[0151] Wherein, the second preset angle can be set according to actual scene needs, for example, it can be 45 degrees, 75 degrees, 90 degrees, etc., which is not limited here.
[0152] In the second area range formed by the two second range boundary lines corresponding to the first type of rays, the electronic device can take the edge point on the first type of rays as a starting point to construct the second number of second type of rays outside the target obstacle model.
[0153] Since the second type of rays are generated based on the first type of rays, the second type of rays can be generated in a tangential diffusion mode.
[0154] In an implementation manner, the electronic device can construct the fifth target number of second type of rays outside the target obstacle model from the edge point as a starting point in the second area range located in the collision-prone range indicated by the collision angle statistical data; and construct the sixth target number of second type of rays in other area ranges in the second area range except the collision-prone range, where the area range of the collision-prone range is smaller than the area range of the other area ranges, the fifth target number is greater than the sixth target number, and the sum of the fifth target number and the sixth target number is the second number.
[0155] In an implementation manner, the electronic device can determine that the second area range formed by the two second range boundary lines is a sector area with a central angle of twice the second preset angle with the edge point as the center, and the electronic device can determine to divide the sector area into the second number of sub-sector areas with the same central angle with the edge point as the center.
[0156] For example, based on FIG. 5(b), the electronic device can take the center O of the circumscribed circle 520 of the projection 410 of the target obstacle model on the horizontal plane as a starting point, generate 8 first type of rays 530 along the radial direction of the circumscribed circle 520 of the projection 410 of the target obstacle model on the horizontal plane, determine a plurality of first type intersection points 540 of the first type of rays 530 and the edge of the target obstacle model, and obtain a plurality of edge points.
[0157] Further, based on FIG. 5(b), as shown in FIG. 7(c), each first type of ray is sequentially traversed, and when the first type of ray b is traversed, in the second area range formed by the two second range boundary lines corresponding to the first type of ray b on the projection plane, the electronic device takes the edge point E on the first type of ray b as a starting point to construct the second number of second type of rays 770 and 780 outside the target obstacle model, where the second type of ray 770 is a ray extending to the F direction with the edge point E as a starting point; and the second type of ray 780 is a ray extending to the G direction with the edge point E as a starting point. After traversing each edge point, a plurality of reference test flight lines of the aircraft colliding with the target obstacle model from different directions are obtained as shown by the solid lines in FIG. 7(c).
[0158] It can be seen that in the embodiment, the electronic device can construct, in the second area range formed by the two second range boundary lines corresponding to the first type of rays on the projection plane, the second type of rays outside the target obstacle model from the edge point on the first type of rays as the starting point. In this way, the electronic device can quickly and accurately construct the benchmark test flight path of the aircraft colliding with the target obstacle model, thereby improving the generation efficiency of the test flight path.
[0159] In an implementation manner, after obtaining the second type of rays of each edge point, the electronic device can recombine the second type of rays of each edge point according to a preset safety distance to obtain the benchmark test flight path of the aircraft colliding with the target obstacle model. The preset safety distance can be set according to actual needs, for example, 5 meters, 10 meters, etc., which is not limited here.
[0160] In an implementation manner, for the two ways of generating the second type of rays according to the normal derivative model and the diffusion mode, the electronic device can select according to the model characteristics of the target obstacle model to be tested in the virtual simulation test environment. In the case that the model characteristics of the target obstacle model are relatively clear, the electronic device can generate the second type of rays by using any one of the normal derivative model and the diffusion mode. In the case that the model characteristics of the target obstacle model are slightly blurred, in order to avoid the error of the determined normal line leading to a large error of the second type of rays generated by using the normal derivative model, the electronic device can generate the second type of rays by using the diffusion mode.
[0161] In an implementation manner, for each first type of ray, the electronic device can construct a circle with the first type of intersection point of the first type of ray and the edge of the target obstacle model as the center and a preset radius as the radius. The tangent line of the circle at the second type of intersection point of the circle and the edge of the target obstacle model is taken as the second type of ray to generate multiple benchmark test flight paths of the aircraft colliding with the target obstacle model from different directions.
[0162] In an implementation manner, for each first type of ray, the electronic device can construct a circle with the first type of intersection point of the first type of ray and the edge of the target obstacle model as the center and a preset radius as the radius. According to the arc path of the circle inside the projection plane, the arc path is equally divided into multiple arc segments. For each arc segment, the tangent line of the arc segment is generated as the second type of ray to generate multiple benchmark test flight paths of the aircraft colliding with the target obstacle model from different directions.
[0163] As an implementation manner of the embodiment of the present application, the step of generating the second type of rays from each edge point as the starting point can include:
[0164] determining a straight line passing through each edge point and being perpendicular to the edge point; constructing, in a first area range formed by two first range boundary lines corresponding to the straight line on a plane where the projection is located, a second number of second type rays from the edge point to outside of the target obstacle model, wherein the two first range boundary lines are located on two sides of the straight line respectively and have a first preset angle with the straight line;
[0165] constructing, in a second area range formed by two second range boundary lines corresponding to the first type ray on the projection plane, a second number of second type rays from the edge point on the first type ray to outside of the target obstacle model, wherein the first type ray is a ray generated from a center of the projection along a radial direction of a circumscribed circle of the projection, the two second range boundary lines are located on two sides of the first type ray respectively and have a second preset angle with the first type ray.
[0166] The electronic device can determine a straight line passing through each edge point and being perpendicular to an edge of the projection where the edge point is located; construct, in a first area range formed by two first range boundary lines corresponding to the straight line on a plane where the projection is located, a second number of second type rays from the edge point to outside of the target obstacle model, wherein the two first range boundary lines are located on two sides of the straight line respectively and have a first preset angle with the straight line.
[0167] and construct, in a second area range formed by two second range boundary lines corresponding to the first type ray on the projection plane, a second number of second type rays from the edge point on the first type ray to outside of the target obstacle model, wherein the first type ray is a ray generated from a center of the projection along a radial direction of a circumscribed circle of the projection, the two second range boundary lines are located on two sides of the first type ray respectively and have a second preset angle with the first type ray.
[0168] Since the generation methods of the two second number of second type rays have been described in detail above, they will not be described again here.
[0169] In addition, since the second type rays generated based on the two second type ray generation methods may overlap, after generating the second type rays using the two second type ray generation methods, the electronic device can investigate the generated second type rays, remove second type flight paths with the same flight direction and a distance between two flight paths less than a preset distance threshold, and obtain a reference test flight path in which the aircraft collides with the target obstacle model.
[0170] It can be seen that in this embodiment, for each edge point, the electronic device can generate the second type of ray corresponding to the edge point by using two generation modes of the second type of ray respectively, to obtain multiple reference test flight lines of the aircraft colliding with the target obstacle model from different directions. In this way, for each edge point, the electronic device can quickly and accurately generate the reference test flight line corresponding to the edge point, and the coverage of the generated reference test flight line is wider.
[0171] As an implementation manner of the embodiment of the present application, the step S103, i.e., the step of constructing the target test flight line of the aircraft colliding with the target obstacle model based on the reference test flight line, the preset flight line generation interval, and the height of the target obstacle model, can include:
[0172] determining multiple planes of the target obstacle model at different heights based on the height of the target obstacle model, wherein the interval between two adjacent planes is the preset flight line generation interval; and copying the reference test flight line to each plane to obtain the target test flight line of the aircraft colliding with the target obstacle model.
[0173] Since the reference test flight line of the aircraft colliding with the target obstacle model generated by the electronic device is a test flight line on the horizontal plane of projection, and the aircraft can collide with the planes of the target obstacle model at different heights when colliding with the target obstacle model.
[0174] The target obstacle model such as a building or a tower is perpendicular to the horizontal plane, the projections of the planes of the model at different heights are located within the projection of the outer contour, and the projection of the target obstacle model on the horizontal plane can represent the shape of the outer contour of the target obstacle model and the maximum size in the horizontal direction. Therefore, constructing the reference test flight line of the target obstacle model on the projection can represent the test flight lines of the planes of the target obstacle model at different heights, and the test flight lines of the planes can be directly constructed by using the reference test flight line according to the preset flight line generation interval subsequently.
[0175] Therefore, in order to generate the test flight lines of the aircraft colliding with the target obstacle model at different planes, the flight line generation interval can be preset, so that after the electronic device generates the reference test flight line of the aircraft colliding with the target obstacle model, the electronic device can determine the multiple planes of the target obstacle model at different heights for which the test flight lines of the aircraft colliding with the target obstacle model at different heights need to be generated based on the height of the target obstacle model, wherein the interval between two adjacent planes is the preset flight line generation interval.
[0176] Specifically, the electronic device can increase the flight line generation interval from a horizontal plane to which the previous flight line is generated upwards until the distance between the last plane and the height of the target obstacle model is less than the preset flight line generation interval, to obtain a plurality of planes.
[0177] The preset flight line generation interval can be set according to actual needs, for example, can be 5 meters, 10 meters, 20 meters, etc., which is not limited here.
[0178] For each plane, the electronic device can copy the benchmark test flight line to the plane to generate a flight line in which the aircraft collides with the target obstacle model on the plane, and after traversing each plane, a target test flight line in which the aircraft collides with the target obstacle model is obtained.
[0179] In an implementation manner, in order to enrich the test flight line, the electronic device can add different angles to each target test flight line to obtain a test flight line corresponding to each target test flight line at different angles, forming a more three-dimensional test flight line cluster.
[0180] In addition, in the case of including a plurality of obstacle models in the virtual simulation test environment, part of the test flight lines in the generated target test flight line in which the aircraft collides with the target obstacle model may have a penetration phenomenon with the obstacles around the target obstacle model, and this part of the test flight line needs to be excluded.
[0181] In order to exclude the test flight lines in the target test flight line that have a penetration phenomenon with other obstacles, flight line penetration detection can be performed on the target test flight line.
[0182] The flight line penetration detection of each test flight line is completed by performing bidirectional flight line detection on the preset starting point of the aircraft and the ending point (the starting point of the flight line) of the aircraft to determine whether the test flight line penetrates other obstacles from the preset starting point of the aircraft to the ending point of the aircraft.
[0183] For each test flight line, if the test flight line does not pass the flight line penetration detection, the test flight line is deleted; if the test flight line passes the flight line penetration detection, the test flight line is retained, so as to determine that the target test flight line of the aircraft along the target obstacle model only collides with the target obstacle model.
[0184] It can be seen that in this embodiment, the electronic device can determine multiple planes based on the height of the target obstacle model and the preset flight path generation interval, copy the reference test flight path to each plane to obtain a target test flight path in which the aircraft collides with the target obstacle model. In this way, by setting the preset flight path generation interval, the reference test flight path can be quickly and accurately copied to the planes at different heights of the target obstacle model to obtain a three-dimensional test flight path cluster of the target test flight path in which the aircraft collides with the target obstacle model.
[0185] To facilitate understanding of the above flight path generation method, the following describes the embodiment in conjunction with Figure 8 The target obstacle model is a building model, and in response to a new flight path instruction issued for the building, the electronic device can display a new flight path operation interface and the building model.
[0186] The user can set the flight path name to flight path 1, set the first-level segmentation parameter (first number) to 8, set the first-level radius (i.e., the radius of the circle used to generate the first type of ray) to 50 (m), set the second-level segmentation parameter (second number) to 4, set the number of flight path waypoints (1-100) to 20, set the flight path waypoint pitch angle (-90 < n < 90) to 3, set the front stop distance to 1 (m), set the upward detection distance (preset flight path generation interval) to 15 (>1 m), select the normal model from the normal model and the diffusion model in the second type of ray generation model, select the moving crosshair to the front of the surface, and perform a save or close operation.
[0187] In this way, the electronic device can generate 8 first type rays along the radial direction of the first circle with the center of the projection as the center and 50 meters as the radius based on the user settings, determine 8 first type intersection points of the first type rays and the edges of the building, and obtain 8 edge points.
[0188] A straight line passing through each edge point and perpendicular to the edge of the projection on which the edge point is located is determined. In the first area range formed by the two first range boundary lines corresponding to the straight line on the plane on which the projection is located, 4 second type rays are constructed from the edge point to the outside of the building to obtain a reference test flight path of the building.
[0189] Based on the height of the building and the preset flight path generation interval of 15 meters, multiple planes are determined, and the reference test flight path is copied to each plane to obtain a target test flight path in which the aircraft collides with the building.
[0190] The number of the target obstacle models is multiple.
[0191] As an implementation manner of the embodiment of the present application, as shown in Figure 9 the number of the target obstacle models is multiple.
[0192] The method for generating the test flight path provided by the embodiment of the present application can further include:
[0193] S901: For each flight point of each target test flight path, a plurality of simulation images of the target obstacle model corresponding to the flight point are obtained based on a preset flight point pitch angle, to obtain simulation images of the target obstacle model.
[0194] The electronic device can determine a plurality of flight points included in each target test flight path based on a preset number of flight points of each flight path.
[0195] The preset number of flight points of each flight path can be set according to actual scene needs, for example, 5, 10, 20, 50, etc., which is not limited here.
[0196] In an implementation manner, the electronic device can determine a plurality of flight points included in each target test flight path according to a preset building front stop distance, a preset starting point of the aircraft, and a preset number of flight points of each flight path, wherein each target test flight path at least includes a terminal flight point corresponding to the preset building front stop distance on the target test flight path, a starting flight point corresponding to the preset starting point of the aircraft, and various flight points between the starting flight point and the terminal flight point.
[0197] In an implementation manner, the electronic device can determine a plurality of flight points included in each target test flight path according to a preset building front stop distance, a preset number of flight points of each flight path, and a preset flight point spacing.
[0198] Further, for each flight point of each target test flight path, the electronic device can obtain a plurality of simulation images of the target obstacle model corresponding to the flight point according to a preset flight point pitch angle at the flight point.
[0199] That is, in the case where the preset flight point pitch angle includes a plurality of angles, for each flight point of each target test flight path, the electronic device generates simulation images of the target obstacle model of the plurality of angles corresponding to the flight point.
[0200] The simulation image corresponding to each waypoint is generated based on the device parameters of the image acquisition device of the aircraft, the imaging principle of the image acquisition device, the preset pitch angle of the waypoint, and the shape of the target obstacle model.
[0201] The simulation image of each waypoint can represent an image obtained by the image acquisition device of the aircraft according to the preset pitch angle of the waypoint when the aircraft flies to the waypoint along the target test flight path.
[0202] Specifically, the electronic device can import the target obstacle model including the target test flight path into the virtual simulation platform, set the simulation flight environment parameters according to the required test flight environment, and construct a simulation flight environment including the target obstacle model. The simulation flight environment parameters include weather type, lighting conditions, and other environmental parameters.
[0203] For each waypoint of each target test flight path, the electronic device can determine the current shape of the target obstacle model observed at the waypoint position according to the preset pitch angle of the waypoint according to the device parameters of the image acquisition device of the aircraft, and then generate a simulation image corresponding to the current shape of the target obstacle model according to the device parameters of the image acquisition device of the aircraft and the imaging principle of the image acquisition device, thereby obtaining the simulation image of the target obstacle model corresponding to the waypoint. The simulation image can be an RGB (RGB color mode) image.
[0204] For example, when the image acquisition device of the aircraft is a fisheye camera, for each waypoint, the electronic device can generate a fisheye RGB image corresponding to the current shape of the target obstacle model observed at the waypoint position according to the preset pitch angle of the waypoint according to the device parameters of the fisheye camera and the imaging principle of the image acquisition device, as the simulation image of the target obstacle model corresponding to the waypoint.
[0205] The plurality of simulation images of the target obstacle model corresponding to each waypoint generated by the electronic device are images of the target obstacle model respectively acquired by the image acquisition device of the aircraft according to the preset pitch angle of the waypoint when the aircraft flies to the waypoint.
[0206] After traversing each waypoint of each target test flight path, the electronic device can obtain the simulation image of the target obstacle model, i.e., the test case for collision algorithm testing.
[0207] In this way, by generating each waypoint included in each target test flight route, a plurality of simulation images of the target obstacle model corresponding to the waypoint are generated based on the preset waypoint pitch angle, the simulation images of the target obstacle model obtained can cover various regions of the target obstacle model, such as the outer wall of a building, a glass curtain wall, a balcony, a window, a roof, a column, etc.; and cover the features of the target obstacle model collected from various distances, such as the overall contour features of the target obstacle model collected from a long distance, the three-dimensional structural details (windows, edge lines) of the target obstacle model collected from a medium distance, and the surface texture (glass reflection, wall material, etc.) of the target obstacle model collected from a close distance, so as to obtain rich simulation images.
[0208] S902: input the simulation images into the pre-trained obstacle avoidance model, and obtain the corresponding relationship between the image features and the obstacle avoidance results of the simulation images learned by the obstacle avoidance model in advance, and output the obstacle avoidance results of each target obstacle model.
[0209] The obstacle avoidance result represents the inference of the simulation image based on the obstacle avoidance model, and whether the aircraft collides with the target obstacle model;
[0210] When the number of target obstacle models is multiple, after the electronic device obtains the simulation images of the multiple target obstacle models, the electronic device can input the simulation images of the multiple target obstacle models into the pre-trained obstacle avoidance model. In this way, the obstacle avoidance model extracts the image features of the simulation images, and infers the simulation images based on the corresponding relationship between the image features of the simulation images learned in advance and the obstacle avoidance results, to determine whether the aircraft collides with the target obstacle model, and obtain the obstacle avoidance results of each target obstacle model.
[0211] S903: based on the obstacle avoidance results of the multiple target obstacle models, statistics the obstacle avoidance success rates of various types of obstacle models.
[0212] The electronic device can obtain the obstacle avoidance success rates of various types of obstacle models based on the obstacle avoidance results of the multiple target obstacle models.
[0213] In an implementation manner, the electronic device can introduce a collision probability matrix, and generate a collision probability matrix for various types of obstacles based on the obstacle avoidance results of the multiple target obstacle models. Wherein, the row vector of the collision probability matrix is a flight route feature degree reflecting the properties of the flight route itself, such as the preset waypoint pitch angle, the number of planes copied when generating the test flight route, etc.; the column vector is a risk scene dimension reflecting the type of obstacle, such as a building, a crane, a tower, etc.; and the matrix element is the obstacle avoidance success rate P (collision | feature, risk) under the given row vector and column vector.
[0214] Exemplarily, in the case of different row vectors and column vectors, the simulation image input obstacle avoidance model of the target obstacle model to be tested in the virtual simulation test environment of the aircraft obtained is as shown in Table 1:
[0215] Table 1 Collision probability evaluation matrix
[0216]
[0217] wherein the original test flight line is a manually drawn test flight line; the 6-plane test flight line without pitch is the simulation image collected by copying the reference test flight line to the 6 planes of the target obstacle model without pitch angle based on the flight line test method by setting a larger preset flight line generation interval; the 12-plane test flight line with pitch y is the simulation image collected by copying the reference test flight line to the 12 planes of the target obstacle model with pitch angle y based on the flight line test method by setting a smaller preset flight line generation interval. The simulation images collected in the above three cases are respectively input into the obstacle avoidance model to obtain the collision probability evaluation matrix.
[0218] As can be seen from the above, by adjusting the flight line feature degree of the simulation image and detecting and optimizing the obstacle avoidance model using the simulation image, the undetected rate of the obstacle avoidance model to various types of obstacles can be reduced, and the obstacle avoidance success rate of the obstacle avoidance model to various types of obstacles can be improved.
[0219] S904: In the case where there is an obstacle type with an obstacle avoidance success rate less than or equal to a preset threshold, updating the obstacle avoidance model based on the simulation image of the target obstacle model of the obstacle type.
[0220] By counting the obstacle avoidance success rates of various types of obstacle models, in the case where there is an obstacle type with an obstacle avoidance success rate less than or equal to a preset threshold, the electronic device can update the obstacle avoidance model based on the simulation image of the target obstacle model of the obstacle type, and improve the reasoning ability of the obstacle avoidance model to the obstacle model of the obstacle type by updating and optimizing the obstacle avoidance model using the simulation image.
[0221] As described above, the simulation image corresponding to each waypoint is the image of the target obstacle model generated based on the device parameters of the image acquisition device of the aircraft, the imaging principle of the image acquisition device, the preset pitch angle of the waypoint, and the shape of the target obstacle model. In the case where there is an obstacle type with an obstacle avoidance success rate less than or equal to a preset threshold, the simulation image of the target obstacle model of the obstacle type can be used as a training sample, and the obstacle avoidance model can be updated and optimized using the training sample.
[0222] In an implementation manner, for the obstacle avoidance model to be trained, the electronic device can also take the simulation images of the plurality of target obstacle models as training samples and test samples respectively, train the obstacle avoidance model to be trained by using the test samples, so that the obstacle avoidance model to be trained learns the corresponding relationship between the image features and the obstacle avoidance results of the simulation images, test the trained obstacle avoidance model by using the test samples in the case where the number of iterations reaches a preset number, and obtain the trained obstacle avoidance model in the case where the output result of the obstacle avoidance model represents that the obstacle avoidance success rate of the obstacle avoidance model to the plurality of target obstacle models reaches a preset threshold.
[0223] It can be seen that, in the embodiment, the electronic device can determine a plurality of waypoints included in each target test flight path; for each waypoint of each target test flight path, a plurality of simulation images of the target obstacle model corresponding to the waypoint are generated based on a preset waypoint pitch angle, and the simulation images of the target obstacle model are obtained; the simulation images are input into the pre-trained obstacle avoidance model, and the obstacle avoidance model outputs the obstacle avoidance results for each target obstacle model based on the corresponding relationship between the image features and the obstacle avoidance results of the simulation images learned in advance, wherein the obstacle avoidance result represents whether the aircraft collides with the target obstacle model based on the inference of the obstacle avoidance model on the simulation images; the obstacle avoidance success rates for various types of obstacle models are counted based on the obstacle avoidance results of the plurality of target obstacle models; in the case where there is an obstacle type with an obstacle avoidance success rate less than a preset threshold, the simulation images of the target obstacle model of the obstacle type are used to update the obstacle avoidance model. By using the plurality of simulation images of the target obstacle model to test the obstacle avoidance model, the weak points of the obstacle avoidance model can be quantified, and the plurality of simulation images of the target obstacle model are used to update the obstacle avoidance model, thereby improving the model inference ability of the obstacle avoidance model.
[0224] It can be seen that, in the embodiment, the electronic device can determine a plurality of waypoints included in each target test flight path; for each waypoint of each target test flight path, a plurality of simulation images of the target obstacle model corresponding to the waypoint are generated based on a preset waypoint pitch angle, and the simulation images of the target obstacle model are obtained; the simulation images are input into the pre-trained obstacle avoidance model, and the obstacle avoidance model outputs the obstacle avoidance results for each target obstacle model based on the corresponding relationship between the image features and the obstacle avoidance results of the simulation images learned in advance, wherein the obstacle avoidance result represents whether the aircraft collides with the target obstacle model based on the inference of the obstacle avoidance model on the simulation images; the obstacle avoidance success rates for various types of obstacle models are counted based on the obstacle avoidance results of the plurality of target obstacle models; in the case where there is an obstacle type with an obstacle avoidance success rate less than a preset threshold, the simulation images of the target obstacle model of the obstacle type are used to update the obstacle avoidance model. By using the plurality of simulation images of the target obstacle model to test the obstacle avoidance model, the weak points of the obstacle avoidance model can be quantified, and the plurality of simulation images of the target obstacle model are used to update the obstacle avoidance model, thereby improving the model inference ability of the obstacle avoidance model.
[0225] Corresponding to the method for generating a test flight path, the present embodiment also provides a device for generating a test flight path.
[0226] As shown in Figure 10 a device for generating a test flight path, comprising:
[0227] A projection determination module 1001 is configured to determine the projection of a target obstacle model to be tested on a horizontal plane.
[0228] A flight path determination module 1002 is configured to determine a reference test flight path in which the aircraft collides with the target obstacle model based on the projection.
[0229] The route construction module 1003 is configured to construct a target test route of the aircraft colliding with the target obstacle model based on the benchmark test route, the preset route generation interval, and the height of the target obstacle model.
[0230] It can be seen that the technical scheme provided by the embodiment of the present application generates the target test route of the target obstacle model by using the projection of the target obstacle model on the horizontal plane, which improves the generation efficiency of the test route compared with the way of manually designing and drawing the test route. Since the collision scenario is considered, it is necessary to test whether the aircraft collides with each target obstacle model at the outer boundary of the model. The target obstacle model, such as a building or a tower, is perpendicular to the horizontal plane, and the projection of each plane of the model at different heights is located within the projection of the outer contour. Moreover, the projection of the target obstacle model on the horizontal plane can represent the shape of the outer contour of the target obstacle model and the maximum size in the horizontal direction. Therefore, the benchmark test route of the target obstacle model can be constructed on the projection, which can represent the test route of each plane at different heights of the target obstacle model. Subsequently, the benchmark test route can be used to directly construct the test route of each plane according to the preset route generation interval, so that the target test route of the aircraft colliding with the target obstacle model can be quickly obtained, which can further improve the route generation efficiency and the efficiency of the test case of the obstacle avoidance algorithm generated by using the test route.
[0231] As an implementation manner of the embodiment of the present application, the route determination module comprises:
[0232] The edge point determination sub-module is configured to determine a plurality of edge points on the edge of the target obstacle model based on the projection.
[0233] The route generation sub-module is configured to generate a plurality of benchmark test routes of the aircraft colliding with the target obstacle model from different directions by taking each edge point as a starting point.
[0234] As an implementation manner of the embodiment of the present application, the edge point determination sub-module comprises:
[0235] The intersection determination unit is configured to generate a first number of first-type rays along the radial direction of the circumscribed circle of the projection by taking the center of the circumscribed circle of the projection as a starting point; determine a plurality of first-type intersection points at which the first-type rays intersect with the edge of the target obstacle model; and determine the plurality of first-type intersection points as a plurality of edge points.
[0236] As an implementation manner of the embodiment of the present application, the route generation sub-module comprises:
[0237] a ray generating unit configured to generate, as a starting point of each edge point, a second number of second type rays as a plurality of reference test flight lines in which the aircraft collides with the target obstacle model from different directions.
[0238] In an embodiment of the present application, the ray generating unit comprises:
[0239] a ray generating sub-unit configured to determine a straight line passing through each edge point and being perpendicular to the edge point, and to construct, as a starting point of the edge point, a second number of second type rays outside the target obstacle model within a first area range formed by two first range boundary lines corresponding to the straight line on the projection plane, wherein the two first range boundary lines are located on two sides of the straight line respectively and have a first preset angle with the straight line.
[0240] Optionally, the ray generating unit comprises:
[0241] a second generating sub-unit configured to construct, as a starting point of an edge point on the first type ray, a second number of second type rays outside the target obstacle model within a second area range formed by two second range boundary lines corresponding to the first type ray on the projection plane, wherein the two second range boundary lines are located on two sides of the first type ray respectively and have a second preset angle with the first type ray.
[0242] In an embodiment of the present application, the flight line construction module comprises:
[0243] a plane determining sub-module configured to determine, based on a height of the target obstacle model, a plurality of planes at different heights of the target obstacle model, wherein an interval between two adjacent planes is the preset flight line generation interval;
[0244] a flight line copying sub-module configured to copy the reference test flight lines to each plane to obtain target test flight lines in which the aircraft collides with the target obstacle model.
[0245] In an embodiment of the present application, the number of target obstacle models is a plurality; and the device further comprises:
[0246] a picture sampling module configured to obtain, based on a preset flight point pitch angle, a plurality of simulation images of the target obstacle model corresponding to each flight point of each target test flight line;
[0247] The obstacle avoidance result acquisition module is used to input the simulated image into a pre-trained obstacle avoidance model, acquire the correspondence between the image features of the obstacle avoidance model based on the pre-learned simulated image and the obstacle avoidance result, and output the obstacle avoidance result for each target obstacle model. The obstacle avoidance result represents whether the aircraft collides with the target obstacle model based on the reasoning of the obstacle avoidance model on the simulated image.
[0248] The statistics module is used to calculate the obstacle avoidance success rate for various types of obstacle models based on the obstacle avoidance results of multiple target obstacle models.
[0249] The model update module is used to update the obstacle avoidance model based on the simulated image of the target obstacle model when there is an obstacle model with an obstacle avoidance success rate less than or equal to a preset threshold.
[0250] This application 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.
[0251] Memory 1103 is used to store computer programs;
[0252] When the processor 1101 executes the program stored in the memory 1103, it provides a method for generating a test route according to an embodiment of this application.
[0253] 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.
[0254] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0255] 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.
[0256] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0257] In another embodiment provided in the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the steps of any of the above-mentioned test route generation methods.
[0258] In another embodiment provided in the present application, a computer program product containing instructions is provided, and when the computer program product is executed on a computer, the computer is caused to execute the test route generation method in any of the above-mentioned embodiments.
[0259] In the above-mentioned embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of 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 application 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 computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available medium can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a semiconductor medium (for example, solid state disk (SSD)) and the like.
[0260] 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.
[0261] 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.
[0262] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method of generating a test flight path, characterized by, The method comprises: determining a projection of a target obstacle model to be tested on a horizontal plane; determining a reference test flight path of a flying object colliding with the target obstacle model based on the projection; constructing a target test flight path of the flying object colliding with the target obstacle model based on the reference test flight path, a preset flight path generation interval, and a height of the target obstacle model.
2. The method of claim 1, wherein, The step of determining the reference test flight path of the flying object colliding with the target obstacle model based on the projection comprises: determining a plurality of edge points on the edge of the projection; generating a plurality of reference test flight paths of the flying object colliding with the target obstacle model from different directions, with each edge point as a starting point.
3. The method of claim 2, wherein, The step of determining a plurality of edge points on the edge of the projection comprises: generating a first number of first type rays along the radial direction of the circumscribed circle of the projection, with the center of the circumscribed circle as a starting point; determining a plurality of first type intersection points of the first type rays intersecting with the edge of the target obstacle model; determining the plurality of first type intersection points as a plurality of edge points.
4. The method of claim 2, wherein, The step of generating a plurality of reference test flight paths of the flying object colliding with the target obstacle model from different directions, with each edge point as a starting point comprises: generating a second number of second type rays as a plurality of reference test flight paths of the flying object colliding with the target obstacle model from different directions, with each edge point as a starting point.
5. The method of claim 4, wherein, The step of generating a second number of second type rays with each edge point as a starting point comprises: determining a straight line passing through each edge point and being perpendicular to the edge point; constructing a second number of second type rays outside the target obstacle model, with the edge point as a starting point, within a first area range formed by two first range boundary lines corresponding to the straight line on the plane where the projection is located, wherein the two first range boundary lines are located on the two sides of the straight line and have a first preset angle with the straight line.
6. The method of claim 4, wherein, The step of generating a second number of second type rays with each edge point as a starting point comprises: constructing a second number of second type rays outside the target obstacle model, with the edge point on the first type ray as a starting point, within a second area range formed by two second range boundary lines corresponding to the first type ray on the projection plane, wherein the two second range boundary lines are located on the two sides of the first type ray and have a second preset angle with the first type ray.
7. The method according to any one of claims 1 to 6, characterized in that, The step of constructing the target test flight path of the flying object colliding with the target obstacle model based on the reference test flight path, the preset flight path generation interval, and the height of the target obstacle model comprises: determining a plurality of planes of the target obstacle model at different heights based on the height of the target obstacle model, wherein the interval between two adjacent planes is the preset flight path generation interval; copying the reference test flight path to each plane to obtain the target test flight path of the flying object colliding with the target obstacle model.
8. The method according to any one of claims 1 to 6, characterized in that, The number of the target obstacle models is multiple; the method further comprises: For each waypoint of each target test flight route, multiple simulation images of the target obstacle model corresponding to the waypoint are obtained based on a preset waypoint pitch angle; The simulation images are input into a pre-trained obstacle avoidance model, and a corresponding relationship between image features and obstacle avoidance results of the pre-learned simulation images is obtained based on the obstacle avoidance model, and an obstacle avoidance result of each target obstacle model is output, wherein the obstacle avoidance result represents whether the aircraft collides with the target obstacle model based on the inference of the simulation images by the obstacle avoidance model; Based on the obstacle avoidance results of multiple target obstacle models, the obstacle avoidance success rate for various types of obstacle models is counted; In the case where there is an obstacle type with an obstacle avoidance success rate less than or equal to a preset threshold, the simulation images of the target obstacle model of the obstacle type are used to update the obstacle avoidance model.
9. A test route generation device characterized by comprising: The device comprises: a projection determination module configured to determine a projection of a target obstacle model to be tested on a horizontal plane; a route determination module configured to determine a reference test flight route in which the aircraft collides with the target obstacle model based on the projection; a route construction module configured to construct a target test flight route in which the aircraft collides with the target obstacle model based on the reference test flight route, a preset flight route generation interval, and a height of the target obstacle model.
10. An electronic device, comprising: comprise: a memory configured to store a computer program; a processor configured to execute the program stored on the memory to implement the method of any one of claims 1-8.
Citation Information
Patent Citations
Air route planning method and device, server and computer readable storage medium
CN113945217A
Unmanned aerial vehicle flight route monitoring and checking system
CN116258982A