Edge collision detection method, device, computer equipment and storage medium
By determining the spatial position of the flying object and the three-dimensional model of the propeller in the target coordinate system and combining the structural parameters, the problem of collision detection error caused by the complexity of the flying object's shape is solved, accurate collision judgment between the flying object and the propeller is achieved, and the safety of aircraft design is improved.
Patent Information
- Application Number
- CN202111669151.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the existing technology, the collision detection results caused by the single assumption of the flying object shape have a large error compared with the actual situation, and it is impossible to accurately determine whether the flying object will collide with the aircraft propeller.
By establishing a target coordinate system, the spatial position of the flying object in the target coordinate system is obtained according to the direction vector of the central axis of the flying object. Combined with the discretized three-dimensional model of the propeller and the structural parameters of the flying object, it is determined whether the propeller and the flying object collide, taking into account the actual shape of the flying object and the physical structure of the propeller.
It achieves accurate collision detection between flying objects of different shapes and propellers, improving the safety of aircraft design and the accuracy of detection data.
Smart Images

Figure CN114329998B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of object collision, and in particular to an edge collision detection method, apparatus, computer equipment, and storage medium. Background Art
[0002] With the advancement of aerospace technology and the increasing popularity of aircraft, people are paying more and more attention to aircraft safety. Aircraft flying at low altitudes and high speeds are prone to collisions with other flying objects, causing damage and threatening flight safety. Collisions between other flying objects and aircraft primarily occur through collisions with the aircraft's propellers. Therefore, determining whether other flying objects will collide with an aircraft's propellers is a pressing issue.
[0003] In traditional technology, it is assumed that the shape of the flying object is a cylinder or a sphere to determine whether the flying object will collide with the propeller.
[0004] However, the traditional technology adopts a single shape structure of the flying object, while the actual shapes of flying objects are many, and the detection results of whether there is a collision vary greatly for different flying object shapes, so the collision detection results obtained have a large error from the actual situation. Summary of the Invention
[0005] Based on this, it is necessary to provide an edge collision detection method, device, computer equipment and storage medium that can determine whether flying objects of different shapes will collide with the propeller based on the actual shape of the flying object to address the above technical problems.
[0006] A method for edge collision detection includes: obtaining the spatial position of a flying object in a target coordinate system based on the direction vector of the central axis of the flying object; determining the spatial position of each scanning data point on the propeller surface in the target coordinate system based on a discretized three-dimensional model of the propeller; and determining whether the propeller collides with the flying object based on the spatial position of the flying object in the target coordinate system, the spatial position of each data scanning point in the target coordinate system, and the structural parameters of the flying object, wherein the structural parameters include at least the inscribed sphere radius and the circumscribed sphere radius of the flying object.
[0007] In one embodiment, determining whether the propeller and the flying object collide based on the motion equation, the spatial position of each of the data scanning points in the target coordinate system, and the structural parameters of the flying object includes: under preset conditions, obtaining relative position information between the center of mass of the flying object and each of the data scanning points according to the motion equation, the relative position information including a first relative difference in the X-axis direction, a second relative difference in the Y-axis direction, and a third relative difference in the Z-axis direction in the target coordinate system; and determining whether the propeller and the flying object collide based on each of the relative position information and the structural parameters of the flying object.
[0008] In one embodiment, determining whether the propeller and the flying object have collided based on the relative position information and the structural parameters of the flying object includes: if at least one of the first relative difference, the second relative difference, and the third relative difference corresponding to each scanning data point is greater than the circumscribed sphere radius of the flying object, then determining that the propeller and the flying object have not collided.
[0009] In one embodiment, determining whether the propeller and the flying object have collided based on the relative position information and the structural parameters of the flying object also includes: if each of the first relative differences, each of the second relative differences, and each of the third relative differences are less than or equal to the circumscribed sphere radius of the flying object, determining the distance between each scanning data point and the center of mass of the flying object based on each of the first relative differences, each of the second relative differences, and each of the third relative differences; if the distance between each of the scanning data points and the center of mass of the flying object is greater than the circumscribed sphere radius of the flying object, determining that the propeller and the flying object have not collided; if the distance between at least one of the scanning data points and the center of mass of the flying object is less than or equal to the inscribed sphere radius of the flying object, determining that the propeller and the flying object have collided.
[0010] In one embodiment, the structural parameters include the type of the flying object, and determining whether the propeller and the flying object collide based on the relative position information and the structural parameters of the flying object further includes: if the distance between at least one of the scanning data points and the center of mass of the flying object is less than or equal to the circumscribed sphere radius of the flying object, and the distance between each scanning data point and the center of mass of the flying object is greater than the inscribed sphere radius of the flying object, then determining whether the propeller and the flying object collide based on the relative position information and the type of the flying object.
[0011] In one embodiment, the type of the flying object includes at least one of a cuboid, a cylinder, an ellipsoid, and a capsule, and determining whether the propeller collides with the flying object based on the relative position information and the type of the flying object includes: if the type of the flying object is a cuboid, determining whether the propeller collides with the flying object based on the first relative difference, the second relative difference, the third relative difference, and the length, width, and height of the cuboid; if the type of the flying object is a cylinder, determining whether the propeller collides with the flying object based on the first relative difference, the second relative difference, the third relative difference, and the length, width, and height of the cuboid. , and the height of the cylinder and the diameter of the circular cross-section, determine whether the propeller collides with the flying object; if the type of the flying object is an ellipsoid, determine whether the propeller collides with the flying object according to each of the first relative differences, each of the second relative differences, each of the third relative differences, and the lengths of the major axis and the minor axis of the ellipsoid; if the type of the flying object is a capsule, determine whether the propeller collides with the flying object according to each of the first relative differences, each of the second relative differences, each of the third relative differences, and the height of the cylindrical part and the diameter of the hemispherical part in the capsule.
[0012] In one embodiment, obtaining the spatial position of the flying object in the target coordinate system based on the direction vector of the central axis of the flying object includes: obtaining the direction vector of the motion trajectory of the flying object, and determining the original coordinate system based on the direction vector of the motion trajectory, wherein the direction vector of the motion trajectory is parallel to the XOY plane in the original coordinate system; obtaining the direction vector of the central axis of the flying object in the original coordinate system; performing coordinate transformation on the original coordinate system according to the direction vector to obtain the target coordinate system, wherein the direction vector is parallel to the XOY plane and the X-axis in the target coordinate system; and determining the spatial position of the flying object in the target coordinate system based on the conversion information between the original coordinate system and the target coordinate system.
[0013] In one embodiment, the direction vector includes the X-axis direction vector, Y-axis direction vector, and Z-axis direction vector of the central axis of the flying object in the original coordinate system, and the coordinate transformation of the original coordinate system according to the direction vector to obtain the target coordinate system includes: determining a first rotation angle according to the Y-axis direction vector and the Z-axis direction vector; rotating the original coordinate system around the X-axis of the original coordinate system according to the first rotation angle to obtain a transition coordinate system; determining a second rotation angle according to the X-axis direction vector, the Y-axis direction vector, and the Z-axis direction vector; rotating the transition coordinate system around the Z-axis of the transition coordinate system according to the second rotation angle to obtain the target coordinate system.
[0014] In one embodiment, determining the spatial position of the flying object in the target coordinate system based on the conversion information between the original coordinate system and the target coordinate system includes: obtaining the motion equation of the flying object in the original coordinate system; determining the conversion information between the original coordinate system and the target coordinate system based on the first rotation angle and the second rotation angle; and determining the spatial position of the center of mass of the flying object in the target coordinate system based on the conversion information and the motion equation in the original coordinate system.
[0015] In one embodiment, the discretized three-dimensional model of the propeller is used to determine the spatial position of each of the scanned data points on the propeller surface in the target coordinate system, including: obtaining the spatial position of each of the scanned data points on the propeller surface in the original coordinate system; and determining the spatial position of each of the scanned data points in the target coordinate system based on the spatial position of each of the scanned data points in the original coordinate system and the conversion information.
[0016] An edge collision detection device, comprising:
[0017] The motion equation acquisition module is used to obtain the spatial position of the flying object in the target coordinate system based on the direction vector of the central axis of the flying object;
[0018] a position determination module, configured to determine the spatial position of each of the scanned data points on the propeller surface in the target coordinate system based on a discretized three-dimensional model of the propeller;
[0019] A collision determination module is used to determine whether the propeller collides with the flying object based on the motion equation, the spatial position of each data scanning point in the target coordinate system, and the structural parameters of the flying object, wherein the structural parameters include at least the inner sphere radius and the outer sphere radius of the flying object.
[0020] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented: obtaining the spatial position of the flying object in a target coordinate system based on the direction vector of the central axis of the flying object; determining the spatial position of each scanning data point on the propeller surface in the target coordinate system based on a discretized three-dimensional model of the propeller; and determining whether the propeller and the flying object collide based on the motion equation, the spatial position of each data scanning point in the target coordinate system, and the structural parameters of the flying object, wherein the structural parameters include at least the inscribed sphere radius and the circumscribed sphere radius of the flying object.
[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps: obtaining the spatial position of the flying object in a target coordinate system based on the direction vector of the central axis of the flying object; determining the spatial position of each scanning data point on the propeller surface in the target coordinate system based on a discretized three-dimensional model of the propeller; and determining whether the propeller collides with the flying object based on the motion equation, the spatial position of each data scanning point in the target coordinate system, and the structural parameters of the flying object, wherein the structural parameters include at least the inscribed sphere radius and the circumscribed sphere radius of the flying object.
[0022] The aforementioned edge collision detection method, apparatus, computer device, and storage medium first establish a target coordinate system based on the direction of the central axis of the flying object, so that the outer surface of the flying object is a regular geometric surface in the target coordinate system, significantly reducing the complexity of collision detection. The spatial position of the flying object's center of mass in the target coordinate system is then determined. The spatial position of each scanned data point on the propeller surface in the target coordinate system is then determined based on the discretized three-dimensional model of the propeller. The relative position between the flying object and each scanned data point is determined based on the flying object's equation of motion and the spatial position of each scanned data point. Combined with the flying object's structural parameters, it is then possible to determine whether the flying object has collided with the propeller. Establishing a target coordinate system significantly reduces the complexity of collision detection in this application. Furthermore, the actual physical structure of the flying object and the propeller is taken into account during the collision detection process, enabling targeted and accurate judgment of the collision between the flying object and the propeller based on the type of flying object. This enables precise detection of collisions between the flying object and the propeller edge, allowing researchers to obtain more accurate detection data, enabling more precise design of aircraft propellers and significantly improving the safety of the designed aircraft. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the conventional technology, the following briefly introduces the drawings required for use in the embodiments or the conventional technology descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a flow chart of an edge collision detection method in one embodiment;
[0025] Figure 2 is a schematic diagram of a rectangular parallelepiped in one embodiment;
[0026] Figure 3 is a schematic diagram of a cylinder in one embodiment;
[0027] Figure 4 is a schematic diagram of an ellipsoid in one embodiment;
[0028] Figure 5 is a schematic diagram of a capsule body in one embodiment;
[0029] Figure 6 is a schematic diagram of a propeller in one embodiment;
[0030] Figure 7 A schematic diagram of a ball connected inside and outside a rectangular parallelepiped in one embodiment;
[0031] Figure 8 A schematic diagram of a ball connected inside and outside a cylinder in one embodiment;
[0032] Figure 9 A schematic diagram of a sphere inside and outside an ellipsoid in one embodiment;
[0033] Figure 10 A schematic diagram of a ball connected to the outside of a capsule in one embodiment;
[0034] Figure 11 is a flow chart of a method for determining an equation of motion in one embodiment;
[0035] Figure 12 is a flow chart of a method for determining a motion equation in an original coordinate system in one embodiment;
[0036] Figure 13 is a schematic diagram of coordinate system rotation in one embodiment;
[0037] Figure 14 is a flow chart of a method for determining a target coordinate system in one embodiment;
[0038] Figure 15 A schematic diagram of coordinate system rotation in another embodiment;
[0039] Figure 16 A flowchart of a specific method for determining the spatial position of a flying object in a target coordinate system in one embodiment;
[0040] Figure 17 is a flow chart of a method for determining the position of a scanned data point in one embodiment;
[0041] Figure 18 is a flow chart of a method for determining whether a collision occurs in one embodiment;
[0042] Figure 19 is a flowchart of a method for collision detection in one embodiment;
[0043] Figure 20A flowchart of a method for collision detection in another embodiment;
[0044] Figure 21 is a structural diagram of an edge collision detection device in one embodiment;
[0045] Figure 22 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] To facilitate understanding of the present application, the present application will be described more fully below with reference to the accompanying drawings. The accompanying drawings provide embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to make the disclosure of the present application more thorough and comprehensive.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application pertains. The terms used herein in the specification of this application are for the purpose of describing specific embodiments only and are not intended to limit this application.
[0048] It will be understood that the terms "first", "second", etc. used in this application may be used to describe various elements in this document, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element.
[0049] When used herein, the singular forms "a", "an", and "the" may also include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" and the like specify the presence of stated features, integers, steps, operations, components, parts, or combinations thereof, but do not preclude the possibility of the presence or addition of one or more other features, integers, steps, operations, components, parts, or combinations thereof.
[0050] As mentioned in the background, existing propeller-to-flying-object collision detection methods suffer from significant discrepancies between detection results and actual conditions. The inventors discovered that this problem arises because existing methods fail to consider the actual shape of the flying object and the actual physical structure of the propeller.
[0051] Based on the above reasons, the present invention provides an edge collision detection method, device, computer equipment and storage medium that can determine whether flying objects of different shapes will collide with propellers based on the actual shape of the flying object.
[0052] In one embodiment, Figure 1 As shown, a method for edge collision detection is provided, the method comprising:
[0053] Step S100 , obtaining the spatial position of the flying object in the target coordinate system according to the direction vector of the central axis of the flying object.
[0054] Specifically, the central axis of the flying object is the symmetry axis of the flying object in a preset direction.
[0055] For example, Figure 2 As shown in , the central axis of the cuboid is the axis of symmetry along the length of the cuboid. Figure 3 As shown in , the central axis of the cylinder is the symmetry axis perpendicular to the circular cross section of the cylinder. Figure 4 As shown in , the central axis of the ellipsoid is the symmetry axis along the long axis of the ellipsoid. Figure 5 As shown, the central axis of the capsule body is a symmetry axis perpendicular to the circular cross section of the capsule body.
[0056] Step S120 : determining the spatial position of each scanning data point on the propeller surface in the target coordinate system based on the discretized three-dimensional model of the propeller.
[0057] Specifically, the intervals between the scanning data points are preset, and a preset propeller object is scanned by array scanning to obtain multiple scanning data points on the propeller surface, and a discrete three-dimensional model of the propeller is constructed based on the multiple scanning data points.
[0058] For example, the propeller three-dimensional model is as follows: Figure 6 As shown. Since the propeller rotates around the rotation axis, the rotation axis of the propeller is set as the X-axis to construct a spatial coordinate system. The X-axis coordinates of each scanning data point on the propeller surface are fixed. Therefore, the Y-axis data and Z-axis data in the spatial coordinate system can be mapped to the complex expression form of y+zi. Therefore, the coordinates of each scanning data point can be expressed as {x k ,y k +z k i}, where k represents the kth scan data point and i is an imaginary unit.
[0059] Step S140 , determining whether a collision occurs between the propeller and the flying object based on the spatial position of the flying object in the target coordinate system, the spatial position of each data scanning point in the target coordinate system, and the structural parameters of the flying object.
[0060] Specifically, the structural parameters of the flying object include the radius of the inscribed sphere and the radius of the circumscribed sphere, as well as the flying object type, which includes at least one of a cuboid, a cylinder, an ellipsoid, a capsule, and a sphere. Based on the spatial position of the flying object and the spatial positions of the data scan points in the target coordinate system, the relative position between each data scan point and the flying object can be determined. Based on the structural parameters and relative position of the flying object, it can be determined whether the flying object has collided with the propeller.
[0061] Specifically, different types of structural parameters include different types of flying objects and corresponding circumscribed sphere radius and inscribed sphere radius, for example, Figure 7 As shown, the ice sheet flying object can be equivalent to a cuboid. If the flying object is equivalent to a cuboid, the structural parameters include the length, width, and height of the cuboid. The diameter of the circumscribed sphere of the flying object is the square root of the length, width, and height of the cuboid, and the diameter of the inscribed sphere is the minimum value of the length, width, and height of the cuboid. For example, the radius of the circumscribed sphere is Where Δx is the length of the cuboid, Δy is the width of the cuboid, Δz is the height of the cuboid, and the radius of the inscribed sphere is the minimum of Δx / 2, Δy / 2, and Δz / 2.
[0062] like Figure 8 As shown, a bird flying object can be equivalent to a cylinder. The structural parameters include the height of the cylinder, the diameter of the cross section, the length of the shorter side of the rectangle formed by the cross section of the cylinder is the short diameter of the cylinder, and the length of the longer side of the rectangle is the long diameter of the cylinder. If the flying object is equivalent to a cylinder, the diameter of the circumscribed sphere of the flying object is the long diameter of the cylinder, and the diameter of the inscribed sphere is the short diameter of the cylinder. For example, the radius of the circumscribed sphere is Where h is the height of the cylinder, and d is the diameter of the cylinder's circular cross section. The radius of the inscribed sphere is the smaller of h / 2 and d / 2.
[0063] like Figure 9 As shown, a bird's flying object can be equivalent to an ellipsoid. Its structural parameters include the lengths of its major and minor axes. The minor axis of the ellipse formed by the ellipsoid's cross section is the ellipsoid's minor diameter, and the major axis of the ellipse is the ellipsoid's major diameter. If the flying object is equivalent to an ellipsoid, the diameter of its circumscribed sphere is the ellipsoid's major diameter, and the diameter of its inscribed sphere is the ellipsoid's minor diameter. For example, the radius of the circumscribed sphere is the larger of the semi-major and semi-minor axes. The radius of the inscribed sphere is the smaller of the semi-major and semi-minor axes.
[0064] like Figure 10 As shown, a bird flying object can be equivalent to a capsule, which can be divided into two hemispheres and a cylinder in the middle. The structural parameters include the diameter of the hemisphere and the height of the cylinder. The diameter of the hemisphere is the short diameter of the capsule, and the diameter of the hemisphere plus the height of the cylinder is the long diameter of the capsule. If the flying object is equivalent to a capsule, the diameter of the circumscribed sphere of the flying object is the long diameter of the capsule, and the diameter of the inscribed sphere is the short diameter of the capsule. For example, the radius of the circumscribed sphere is (h+d) / 2, and the radius of the inscribed sphere is d / 2. The capsule can be divided into two hemispheres and a cylinder in the middle. h is the height of the cylinder in the middle of the capsule, and d is the diameter of the hemispheres on both sides of the capsule.
[0065] If the flying object is approximately a sphere, and the structural parameters include the diameter of the sphere, then the diameter of the circumscribed sphere and the diameter of the inscribed sphere of the flying object are both the diameters of the circle formed by the cross section of the sphere.
[0066] In this embodiment, a target coordinate system is first established based on the direction of the object's central axis, ensuring that the object's outer surface is a regular geometric surface in the target coordinate system, significantly reducing the complexity of collision detection. The spatial position of the object's center of mass in the target coordinate system is then determined. The spatial position of each scanned data point on the propeller surface in the target coordinate system is then determined based on the discretized three-dimensional model of the propeller. Based on the spatial position of the object in the target coordinate system and the spatial position of each scanned data point, the relative position between the object and each scanned data point is determined. Combined with the object's structural parameters, it is then possible to determine whether the object has collided with the propeller. Establishing a target coordinate system in this application significantly reduces the complexity of collision detection. Furthermore, the collision detection process takes into account the actual physical structure of the object and the propeller, enabling targeted and accurate determination of collisions between the object and the propeller based on the type of object. This enables precise detection of collisions between the object and the propeller edge, enabling researchers to obtain more accurate detection data. This allows for more precise design of aircraft propellers, significantly improving the safety of the designed aircraft.
[0067] In one embodiment, Figure 11 As shown, step S100 includes:
[0068] Step S1100: Obtain the direction vector of the motion trajectory of the flying object, and determine the original coordinate system based on the direction vector of the motion trajectory.
[0069] Specifically, the direction vector of the motion trajectory is parallel to the XOY plane in the original coordinate system.
[0070] Specifically, let the direction vector of the motion trajectory be (fx, fy, fz), where fx is the initial motion trajectory direction vector of the flying object in the X-axis direction in the preset coordinate system, fy is the initial motion trajectory direction vector of the flying object in the Y-axis direction in the preset coordinate system, and fz is the initial motion trajectory direction vector of the flying object in the Z-axis direction in the preset coordinate system. Then, the rotation angle is determined based on the Y-axis direction vector and the Z-axis direction vector. The rotation angle is The preset coordinate system is rotated around the X-axis of the preset coordinate system according to the rotation angle to obtain the original coordinate system.
[0071] Specifically, the original coordinate system is a coordinate system in which the XOY plane is parallel to the direction vector of the aircraft's trajectory. The preset coordinate system is a preset coordinate system that can be a coordinate system in any state. The target coordinate system is a coordinate system in which both the XOY plane and the X-axis are parallel to the direction vector of the aircraft's central axis.
[0072] Step S1120, obtaining the direction vector of the central axis of the flying object in the original coordinate system.
[0073] Step S1140 , performing coordinate transformation on the original coordinate system according to the direction vector to obtain a target coordinate system.
[0074] Specifically, the direction vector is parallel to both the XOY plane and the X axis in the target coordinate system.
[0075] Specifically, by means of coordinate transformation, the original coordinate system is transformed into a target coordinate system in which the XOY plane and the X axis are parallel to the direction vector of the central axis of the flying object, which can simplify the complexity of subsequent collision detection and facilitate calculation.
[0076] Specifically, since the flying object has a spatial attitude angle (the spatial orientation of the central axis of the flying object) during the flight process of impact, its outer surface is a non-regular geometric surface (that is, the central axis of the flying object is not parallel to the x-axis), which will cause the surface equation of the outer surface of the flying object to be more complicated. Therefore, before conducting edge collision detection, the coordinate system can be rotated and transformed to be parallel to the central axis of the flying object, so that the outer surface of the flying object is a positive geometric surface in the transformed coordinate system, reducing the complexity of edge collision detection.
[0077] Step S1160: Determine the spatial position of the flying object in the target coordinate system based on the conversion information between the original coordinate system and the target coordinate system.
[0078] Specifically, the motion equation of the flying object in the original coordinate system is first obtained, and then the coordinates in the motion equation of the flying object in the original coordinate system are transformed accordingly based on the conversion information between the original coordinate system and the target coordinate system, so as to obtain the spatial position of the flying object in the target coordinate system.
[0079] In this embodiment, the original coordinate system is first determined according to the direction of the motion trajectory of the flying object, and then the original coordinate system is adjusted according to the direction of the central axis of the flying object to obtain the target coordinate system, so that the central axis of the flying object is parallel to the XOY plane and the X axis in the target coordinate system, and then the spatial position of the flying object is determined, thereby simplifying the calculation and greatly reducing the complexity of collision detection judgment.
[0080] In one embodiment, Figure 12 As shown, step S1100 includes:
[0081] Step S1200: Obtain the initial position of the flying object in a preset coordinate system and the motion trajectory direction vector of the flying object's center of mass in the preset coordinate system.
[0082] For example, let the motion trajectory direction vector be (fx, fy, fz), where fx is the initial motion trajectory direction vector of the flying object in the X-axis direction in the preset coordinate system, fy is the initial motion trajectory direction vector of the flying object in the Y-axis direction in the preset coordinate system, and fz is the initial motion trajectory direction vector of the flying object in the Z-axis direction in the preset coordinate system. Then, the rotation angle is determined according to the Y-axis direction vector and the Z-axis direction vector. The rotation angle is
[0083] Step S1220 , performing coordinate transformation on the preset coordinate system according to the direction vector of the motion trajectory to obtain an original coordinate system.
[0084] Specifically, the preset coordinate system is rotated around the X-axis of the preset coordinate system according to the rotation angle to obtain the original coordinate system.
[0085] Specifically, the motion trajectory direction vector is parallel to the XOY plane in the original coordinate system.
[0086] Step S1240: Determine the motion equation of the flying object in the original coordinate system based on the conversion information between the preset coordinate system and the original coordinate system.
[0087] For example, assuming that the initial position coordinates of the flying object in the preset coordinate system are (x1, y1, z1), and the initial direction vector is (fx, fy, fz), then the acute angle between the center of mass of the flying object and the X-axis of the preset coordinate system is Rotate the preset coordinate system around the X axis until the trajectory of the flying object is parallel to the XOY plane in the preset coordinate system, and obtain the original coordinate system. The rotation angle is
[0088] At this time, assume that the coordinates of the center of mass of the flying object in the original coordinate system are (x1, y0, z0), where: y0 = y1*cosβ + z1*sinβ, z0 = z1*cosβ - y1*sinβ.
[0089] Since the trajectory of the flying object is parallel to the XOY plane in the original coordinate system, the coordinates of the intersection of the trajectory of the flying object and the YOZ plane in the original coordinate system are (0, y0', z0), where y0' = y0 - x1*tanθ.
[0090] For example, the motion equation of the flying object in the original coordinate system is:
[0091] y=x*tanθ+y1*cosβ+z1*sinβ-x1*tanθ
[0092] z=z1*cosβ-y1*sinβ
[0093] Wherein, y is the coordinate of the flying material center on the Y axis in the original coordinate system, x is the coordinate of the flying material center on the X axis in the original coordinate system, z is the coordinate of the flying material center on the Z axis in the original coordinate system, y1 is the initial coordinate of the flying material center on the Y axis in the preset coordinate system, x1 is the initial coordinate of the flying material center on the X axis in the preset coordinate system, z1 is the initial coordinate of the flying material center on the Z axis in the preset coordinate system, θ is the acute angle between the initial motion trajectory of the flying object and the X axis in the preset coordinate system, β is the angle that the preset coordinate system needs to rotate around the X axis to make the trajectory of the flying object parallel to the XOY plane in the original coordinate system. Among them, fx is the initial motion trajectory direction vector of the flying object in the X-axis direction of the initial space coordinate system, fy is the initial motion trajectory direction vector of the flying object in the Y-axis direction of the initial space coordinate system, and fz is the initial motion trajectory direction vector of the flying object in the Z-axis direction of the initial space coordinate system.
[0094] For example, Figure 13 As shown, the preset coordinate system is first translated according to the trajectory direction vector so that the trajectory direction vector passes through the coordinate system origin. The translated coordinate system is then rotated according to the rotation angle so that the trajectory direction vector is parallel to the XOY plane. The coordinate system is then translated back in the opposite direction and distance to the previous translation to obtain the original coordinate system. The trajectory direction vector of the flying object is parallel to the XOY plane in the original coordinate system.
[0095] In this embodiment, the conversion information between the preset coordinate system and the original coordinate system is determined through the motion trajectory direction and initial position coordinates of the flying object, and the motion equation of the flying object in the original coordinate system is further constructed. Since the motion trajectory of the flying object is parallel to the XOY plane in the original coordinate system, the motion equation is relatively simplified and easy to calculate.
[0096] In one embodiment, the direction vector includes the X-axis direction vector, the Y-axis direction vector, and the Z-axis direction vector of the center axis of the flying object in the original coordinate system, such as Figure 14 As shown, step S1140 includes:
[0097] Step S1400: Determine a first rotation angle according to the Y-axis direction vector and the Z-axis direction vector.
[0098] Exemplarily, the first rotation angle is determined by the following formula:
[0099]
[0100] Among them, β1 is the first rotation angle, fzy is the component of the direction vector of the central axis of the flying object on the Y axis in the original coordinate system, and fz is the component of the direction vector of the central axis of the flying object on the Z axis in the original coordinate system.
[0101] Step S1420: Rotate the original coordinate system around the X-axis of the original coordinate system according to the first rotation angle to obtain a transition coordinate system.
[0102] Specifically, the XOY plane of the transition coordinate system is parallel to the direction vector.
[0103] Step S1440: Determine a second rotation angle according to the X-axis direction vector, the Y-axis direction vector, and the Z-axis direction vector.
[0104] Exemplarily, the second rotation angle is determined by the following formula:
[0105]
[0106] Among them, θ1 is the second rotation angle, that is, the acute angle between the direction vector and the X-axis of the original coordinate system, fzx is the component of the direction vector of the central axis of the aircraft on the X-axis in the original coordinate system, fzy is the component of the direction vector of the central axis of the aircraft on the Y-axis in the original coordinate system, and fzz is the component of the direction vector of the central axis of the aircraft on the Z-axis in the original coordinate system.
[0107] Step S1460: Rotate the transition coordinate system around the Z axis of the transition coordinate system according to the second rotation angle to obtain the target coordinate system.
[0108] Specifically, the XOY plane and the X axis of the target coordinate system are parallel to the direction vector of the central axis of the flying object.
[0109] For example, Figure 15 As shown in the figure, the original coordinate system is first translated according to the central axis direction vector so that the central axis direction vector passes through the coordinate system origin. The translated coordinate system is then rotated by a first rotation angle around the X axis and then by a second rotation angle around the Z axis. This results in a target coordinate system whose XOY plane and X axis are both parallel to the direction vector of the central axis of the flying object.
[0110] In this embodiment, the original coordinate system is adjusted according to the direction vector of the central axis of the flying object to obtain the target coordinate system. The XOY plane and X axis of the target coordinate system are parallel to the direction vector of the central axis of the flying object, thereby simplifying the motion equation of the flying object and facilitating calculation.
[0111] In one embodiment, Figure 16 As shown, step S1160 includes:
[0112] Step S1600: Obtain the motion equation of the flying object in the original coordinate system.
[0113] Step S1620: Determine the conversion information between the original coordinate system and the target coordinate system based on the first rotation angle and the second rotation angle.
[0114] Exemplarily, the conversion matrix of the conversion information between the original coordinate system and the target coordinate system is as follows. According to this conversion matrix, the conversion between the coordinates in the original coordinate system and the coordinates in the target coordinate system can be achieved:
[0115]
[0116] where, x1 is the coordinate on the X-axis of the target coordinate system, y1 is the coordinate on the Y-axis of the target coordinate system, z1 is the coordinate on the Z-axis of the target coordinate system, x is the coordinate on the X-axis of the original coordinate system, y is the coordinate on the Y-axis of the original coordinate system, z is the coordinate on the Z-axis of the original coordinate system, θ1 is the acute angle between the direction vector of the central axis of the flying object and the X-axis of the original coordinate system, and β1 is the angle of rotation of the original coordinate system around the X-axis.
[0117] Step S1640: Determine the spatial position of the flying object in the target coordinate system based on the conversion information and the motion equation in the original coordinate system.
[0118] Exemplarily, the motion equation of the flying object in the original coordinate system is as follows:
[0119]
[0120] where, Δl is a preset spatial step, Δl = λr, where 0 < λ < cosθ, θ is the acute angle between the initial motion trajectory of the flying object and the X-axis in the preset coordinate system, r is the radius of the inscribed sphere of the flying object, x n is the coordinate of the center of mass of the flying object on the X-axis of the original coordinate system at the nth step, y n is the coordinate of the center of mass of the flying object on the Y-axis of the original coordinate system at the nth step, z n is the coordinate of the center of mass of the flying object on the Z-axis of the original coordinate system at the nth step, x max is the height of the discretized three-dimensional model of the propeller, t ≤ [(x max +2R) / Δl], β is the angle of rotation required for the preset coordinate system to rotate around the X-axis to make the motion trajectory of the flying object parallel to the XOY plane in the original coordinate system, y1 is the initial coordinate of the flying material center on the Y axis in the preset coordinate system, x1 is the initial coordinate of the flying material center on the X axis in the preset coordinate system, z1 is the initial coordinate of the flying material center on the Z axis in the preset coordinate system, fx is the initial motion trajectory direction vector of the flying object in the X axis direction in the preset coordinate system, fy is the initial motion trajectory direction vector of the flying object in the Y axis direction in the preset coordinate system, and fz is the initial motion trajectory direction vector of the flying object in the Z axis direction in the preset coordinate system.
[0121] Since the maximum value of the coefficient n is t+1, and t≤[(x max +2R) / Δl], thus limiting the range of variation of the motion equation. R is the radius of the circumscribed circle of the flying object.
[0122] Then, through the transformation matrix, the coordinates of the flying object in the original coordinate system are transformed into the coordinates of the flying object in the target coordinate system:
[0123]
[0124] Among them, x n is the coordinate of the center of mass of the flying object on the X axis in the original coordinate system at the nth step, y n is the coordinate of the center of mass of the flying object on the Y axis in the original coordinate system at the nth step, z n is the coordinate of the center of mass of the flying object on the Z axis in the original coordinate system at the nth step, x n1 is the coordinate of the center of mass of the flying object on the X axis in the target coordinate system at the nth step, n1 is the coordinate of the center of mass of the flying object on the Y axis in the target coordinate system at the nth step, z n1 is the coordinate of the center of mass of the flying object on the Z axis in the target coordinate system at the nth step, β1 is the first rotation angle, and θ1 is the second rotation angle.
[0125] In this embodiment, through the conversion relationship between the original coordinate system and the target coordinate system, the motion equation of the flying object in the original coordinate system is converted into the spatial position in the target coordinate system, thereby determining the spatial position of the flying object in the target coordinate system. Since the motion equation takes into account the actual physical structure of the flying object and the propeller, it is closer to the actual situation.
[0126] In one embodiment, Figure 17 As shown, step S120 includes:
[0127] Step S1700: Obtain the spatial position of each scanning data point on the propeller surface in the original coordinate system.
[0128] Specifically, first obtain the angular velocity of the propeller rotation, the modulus and the first argument of the complex triangle formed by the coordinates of each scanning data point on the Y-axis and Z-axis of the target coordinate system. Then, determine the second argument corresponding to each scanning data point according to the first argument, the angular velocity, the radius of the spherical flying object, the speed of the spherical flying object relative to the propeller, and the direction vector of the movement trajectory. Next, determine the spatial positions of each scanning data point on the propeller surface according to the modulus and the second argument corresponding to each scanning data point.
[0129] Exemplarily, the coordinates of the scanning data points on the propeller surface can be expressed as (x k , y k + z k i), where x k is the coordinate of the k-th scanning data point on the X-axis of the original coordinate system, y k is the coordinate of the k-th scanning data point on the Y-axis of the original coordinate system, z k is the coordinate of the k-th scanning data point on the Z-axis of the original coordinate system, i is the imaginary unit, and the modulus of the complex triangle formed by the Y-axis coordinate and Z-axis coordinate of each scanning data point is |y k + z k i|, and the argument is
[0130] Exemplarily, the second argument corresponding to each scanning data point is determined by the following formula:
[0131] A kn = A k0 + nωΔt (n = 1, 2…, t + 1)
[0132] where A kn is the second argument of the k-th scanning data point at the n-th time step, A k0 is the first argument of the k-th scanning data point, ω is the angular velocity of the propeller rotation, and Δt is the preset time step. Among them, Δl is the preset space step, Δl = λr, where 0 < λ < cosθ, r is the radius of the inscribed sphere of the flying object, and v0 is the speed of the flying object relative to the propeller. Since the maximum value of the coefficient n is t + 1, and t ≤ [(x max + 2R) / Δl], x max is the height of the discretized three-dimensional model of the propeller, so the change range of the second argument is limited.
[0133] Exemplarily, the spatial positions of each scanning data point on the propeller surface are as follows:
[0134]
[0135] Among them, xkn is the coordinate of the k-th scanning data point of the propeller on the X axis in the original coordinate system at the n-th time step, y kn is the coordinate of the k-th scanning data point of the propeller on the Y axis in the original coordinate system at the n-th time step, z kn is the coordinate of the k-th scanning data point of the propeller on the Z axis in the original coordinate system at the n-th time step, x k is the coordinate of the kth scanning data point of the propeller on the X axis in the original coordinate system, M k0 M is the modulus of the complex triangle between the k-th scan data point and the origin of the original coordinate system and the X-axis of the original coordinate system. k0 =|y k +z k i|,y k is the coordinate of the kth scanning data point of the propeller on the Y axis in the original coordinate system, z k is the coordinate of the kth scanning data point of the propeller on the Z axis in the original coordinate system, i is the imaginary unit, A kn is the second argument corresponding to the kth scan data point, A kn =A k0 +nωΔt(n=1,2…,t+1), where ω is the angular velocity of the propeller, Δt is the preset time step, Among them, Δl is the preset time step, and v0 is the speed of the spherical flying object relative to the propeller.
[0136] Step S1720 : determining the spatial position of each scan data point in the target coordinate system according to the spatial position of each scan data point in the original coordinate system and the conversion information.
[0137] Specifically, the spatial position of each scan data point in the target coordinate system is determined based on the spatial position of each scan data point in the original coordinate system in combination with the transformation matrix.
[0138] For example, the spatial position of each scan data point in the target coordinate system is determined by the following formula:
[0139]
[0140] Among them, x kn is the coordinate of the k-th scanning data point of the propeller on the X axis in the original coordinate system at the n-th time step, y kn is the coordinate of the k-th scanning data point of the propeller on the Y axis in the original coordinate system at the n-th time step, z kn is the coordinate of the k-th scanning data point of the propeller on the Z axis in the original coordinate system at the n-th time step, xkn1 is the coordinate of the kth scanning data point of the propeller on the X axis in the target coordinate system at the nth time step, y kn1 is the coordinate of the k-th scanning data point of the propeller on the Y axis in the target coordinate system at the n-th time step, z kn1 is the coordinate of the k-th scanning data point of the propeller on the Z axis in the target coordinate system at the n-th time step, β1 is the first rotation angle, and θ1 is the second rotation angle.
[0141] In this embodiment, through the conversion relationship between the original coordinate system and the target coordinate system, the spatial position of each scanning data point in the original coordinate system is converted into the spatial position in the target coordinate system, thereby obtaining the spatial position of each scanning data point in the target coordinate system, which facilitates the collision detection operation with the motion equation of the flying object.
[0142] In one embodiment, Figure 18 As shown, step S140 includes:
[0143] Step S1800 : Under preset conditions, relative position information between the flying mass center and each data scanning point is obtained according to the motion equation.
[0144] Specifically, the relative position information includes, in the target coordinate system, a first relative difference in the X-axis direction, a second relative difference in the Y-axis direction, and a third relative difference in the Z-axis direction.
[0145] Specifically, the preset condition is that the number of steps corresponding to the current spatial step in the motion equation of the flying object and the current time step in the spatial position of each scanning data point is equal.
[0146] Exemplarily, the three relative differences are determined by the following formula:
[0147]
[0148] Where Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference, x n1 is the coordinate of the center of mass of the flying object on the X axis in the target coordinate system at the nth step, n1 is the coordinate of the center of mass of the flying object on the Y axis in the target coordinate system at the nth step, z n1 is the coordinate of the center of mass of the flying object on the Z axis in the target coordinate system at the nth step, x kn1 is the coordinate of the kth scanning data point of the propeller on the X axis in the target coordinate system at the nth time step, y kn1is the coordinate of the k-th scanning data point of the propeller on the Y axis in the target coordinate system at the n-th time step, z kn1 is the coordinate of the k-th scanning data point of the propeller on the Z axis in the target coordinate system at the n-th time step.
[0149] Step S1820: Determine whether the propeller collides with the flying object based on the relative position information and the structural parameters of the flying object.
[0150] Specifically, if at least one of the first relative difference, the second relative difference, and the third relative difference corresponding to each scanning data point is greater than the circumscribed sphere radius of the flying object, it is determined that the propeller and the flying object have not collided.
[0151] For example, Δx n1 >R or Δy n1 >R or Δz n1 >R, where R is the radius of the sphere surrounding the flying object, Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 If the value is the third relative difference, it is determined that the propeller and the flying object have not collided.
[0152] Exemplarily, if at least one of the first relative difference, the second relative difference, and the third relative difference corresponding to each scanning data point is greater than the circumscribed sphere radius of the flying object, it is determined that the propeller and the flying object have not collided, and the scanning data points whose first relative difference, the second relative difference, and the third relative difference are all less than or equal to the circumscribed sphere radius of the flying object are recorded as the first scanning data point set.
[0153] Exemplarily, the judgment in step S1820 can also be made based on the coordinates of the flying object's center of mass in the original coordinate system, the spatial position of each scanning data point, and the radius of the circumscribed sphere of the flying object.
[0154] In this embodiment, the likelihood of a collision between a flying object and a propeller is determined by comparing the coordinates of the flying object's center of mass and the coordinates of each scanned data point at the same moment in time, as well as the object's radius. Because the location of the flying object's center of mass is compared with the location of each scanned data point on the propeller surface, a collision determination is made based on the actual physical structure of the propeller and the actual physical structure (radius) of the flying object. This results in a more accurate and realistic result.
[0155] In one embodiment, Figure 19 As shown, step S1820 includes:
[0156] In step S1900, if each first relative difference, each second relative difference, and each third relative difference are less than or equal to the circumscribed sphere radius of the flying object, the distance between each scanning data point and the center of the flying object is determined based on each first relative difference, each second relative difference, and each third relative difference.
[0157] For example, the distance between each scan data point and the center of mass of the flight is Where Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference.
[0158] Exemplarily, the distance between the scan data point corresponding to each scan data point in the first scan data point set and the centroid of the flight mass is determined.
[0159] In step S1920, if the distance between each scanning data point and the center of the flying object is greater than the circumscribed sphere radius of the flying object, it is determined that the propeller and the flying object have not collided.
[0160] For example, if It is determined that the propeller and the spherical flying object have not collided. Where R is the radius of the sphere outside the flying object, Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference.
[0161] For example, if the distance between each scan data point in the first scan data point set and the centroid of the flying object is greater than the circumscribed sphere radius of the flying object, then it is determined that the propeller and the flying object have not collided. Points in the first scan data point set whose distance from the centroid of the flying object is less than or equal to the circumscribed sphere radius of the flying object are recorded as the second scan data point set.
[0162] Step S1940: If the distance between at least one scanning data point and the center of the flying object is less than or equal to the inscribed sphere radius of the flying object, it is determined that the propeller collides with the flying object.
[0163] For example, Then it is determined that the propeller collides with the spherical flying object. Where r is the radius of the sphere inside the flying object, Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference.
[0164] For example, if at least one of the distances between a scan data point in the second scan data point set and the center of mass of the flying object is less than or equal to the inscribed sphere radius of the flying object, then a collision between the propeller and the flying object is determined. Points in the second scan data point set whose distances from the center of mass of the flying object are greater than the inscribed sphere radius of the flying object are recorded as the third scan data point set.
[0165] For example, the determination in steps S1900-S1940 can also be made based on the coordinates of the center of mass of the flying object in the original coordinate system, the spatial positions of each scanned data point, and the inner and outer sphere radii of the flying object. This determination process does not need to be performed in the target coordinate system. Only when the type of flying object is needed to determine whether there is a collision, the spatial positions must be converted to the target coordinate system for determination.
[0166] In this embodiment, a further judgment is made as to whether the propeller and the flying object will collide. By comparing the distance between each scanning data point and the center of the flying object with the radius of the flying object, a more accurate judgment is made as to whether the flying object will collide with the propeller, thereby achieving more accurate collision detection judgment.
[0167] In one embodiment, the structural parameters include the type of the flying object, and step S1820 further includes:
[0168] In step S200, if the distance between at least one scanning data point and the center of mass of the flying object is less than or equal to the circumscribed sphere radius of the flying object, and the distance between each scanning data point and the center of mass of the flying object is greater than the inscribed sphere radius of the flying object, then determine whether the propeller and the flying object have collided based on the relative position information and the type of the flying object.
[0169] Exemplarily, it is only necessary to determine whether the propeller collides with the flying object based on the scanning data points in the third scanning data point set and the type of the flying object.
[0170] In this embodiment, when the distance between the scanning data point and the center of mass of the flying object is less than or equal to the circumscribed sphere radius of the flying object, and the distance between each scanning data point and the center of mass of the flying object is greater than the inscribed sphere radius of the flying object, it is impossible to determine whether the flying object has collided with the propeller based solely on the circumscribed sphere radius and the inscribed sphere radius of the flying object. In this case, further specific analysis is required based on the type of flying object.
[0171] In one embodiment, Figure 20 As shown, step S200 includes:
[0172] In step S2000 , if the flying object is a cuboid, determining whether the propeller collides with the flying object based on the first relative differences, the second relative differences, the third relative differences, and the length, width, and height of the cuboid is performed.
[0173] For example, if the flying object is an ice flake foreign body, then the flying object is approximately a cuboid, and whether the flying object collides with the propeller is determined according to the following formula:
[0174]
[0175]
[0176]
[0177] Where Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference, Δx is the length of the cuboid, Δy is the width of the cuboid, and Δz is the height of the cuboid.
[0178] If each scan data point of the propeller does not satisfy at least one of the above formulas, it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, it is determined that the flying object and the propeller have collided.
[0179] For example, if the scan data points in the third scan data point set do not satisfy at least one of the above formulas, then it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, then it is determined that the flying object and the propeller have collided.
[0180] Step S2020: If the flying object is a cylinder, determine whether the propeller collides with the flying object based on the first relative differences, the second relative differences, the third relative differences, the height of the cylinder, and the diameter of the circular cross section.
[0181] For example, if the flying object is a bird or foreign body, then the flying object is approximately cylindrical, and whether the flying object collides with the propeller is determined according to the following formula:
[0182]
[0183]
[0184] Where Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference, h is the height of the cylinder, and d is the diameter of the circular cross section of the cylinder.
[0185] If each scan data point of the propeller does not satisfy at least one of the above formulas, it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, it is determined that the flying object and the propeller have collided.
[0186] For example, if the scan data points in the third scan data point set do not satisfy at least one of the above formulas, then it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, then it is determined that the flying object and the propeller have collided.
[0187] Step S2040: If the type of the flying object is an ellipsoid, determine whether the propeller collides with the flying object based on the first relative differences, the second relative differences, the third relative differences, and the lengths of the major axis and the minor axis of the ellipsoid.
[0188] For example, if the flying object is a bird or foreign body, the flying object can also be approximated as an ellipsoid, and whether the flying object collides with the propeller is determined according to the following formula:
[0189]
[0190] Where Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference, a is the length of the major semi-axis of the ellipsoid, and b is the length of the minor semi-axis of the ellipsoid.
[0191] If every scanned data point of the propeller does not satisfy the above formula, it is determined that the flying object and the propeller have not collided. If at least one scanned data point of the propeller satisfies the above formula, it is determined that the flying object and the propeller have collided.
[0192] For example, if none of the scan data points in the third scan data point set satisfies the above formula, it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies the above formula, it is determined that the flying object and the propeller have collided.
[0193] Step S2060: If the flying object is a capsule, determine whether the propeller collides with the flying object based on the first relative differences, the second relative differences, the third relative differences, and the height of the cylindrical part and the diameter of the hemispherical part in the capsule.
[0194] For example, if the flying object is a bird or foreign body, the flying object can also be approximated as a capsule, and whether the flying object collides with the propeller is determined according to the following formula:
[0195]
[0196]
[0197] Where Δx n1 is the first relative difference, Δy n1 is the second relative difference, Δz n1 is the third relative difference, and the capsule body can be divided into hemispheres on both sides and a cylinder in the middle. h is the height of the cylinder in the middle of the capsule body, and d is the diameter of the hemispheres on both sides of the capsule body.
[0198] If each scan data point of the propeller does not satisfy at least one of the above formulas, it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, it is determined that the flying object and the propeller have collided.
[0199] For example, if none of the scan data points in the third scan data point set satisfies at least one of the above formulas, then it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, then it is determined that the flying object and the propeller have collided.
[0200] If the flying object is a bird, it can be approximated as a capsule. The following formula can be used to determine whether the flying object collides with the propeller:
[0201]
[0202]
[0203] Among them, x n1 is the coordinate of the center of mass of the flying object on the X axis in the target coordinate system at the nth step, n1 is the coordinate of the center of mass of the flying object on the Y axis in the target coordinate system at the nth step, z n1 is the coordinate of the center of mass of the flying object on the Z axis in the target coordinate system at the nth step, x kn1 is the coordinate of the kth scanning data point of the propeller on the X axis in the target coordinate system at the nth time step, y kn1 is the coordinate of the k-th scanning data point of the propeller on the Y axis in the target coordinate system at the n-th time step, z kn1 is the coordinate of the k-th scanning data point of the propeller on the Z axis in the target coordinate system at the n-th time step. The capsule can be divided into two hemispheres and a cylinder in the middle. h is the height of the cylinder in the middle of the capsule, and d is the diameter of the hemispheres on both sides of the capsule.
[0204] If each scan data point of the propeller does not satisfy at least one of the above formulas, it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, it is determined that the flying object and the propeller have collided.
[0205] For example, if none of the scan data points in the third scan data point set satisfies at least one of the above formulas, then it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, then it is determined that the flying object and the propeller have collided.
[0206] If the flying object is a bird, it can be approximated as a capsule. The following formula can be used to determine whether the flying object collides with the propeller:
[0207]
[0208]
[0209] Among them, x n1 is the coordinate of the center of mass of the flying object on the X axis in the target coordinate system at the nth step, n1 is the coordinate of the center of mass of the flying object on the Y axis in the target coordinate system at the nth step, z n1 is the coordinate of the center of mass of the flying object on the Z axis in the target coordinate system at the nth step, x kn1 is the coordinate of the kth scanning data point of the propeller on the X axis in the target coordinate system at the nth time step, y kn1 is the coordinate of the k-th scanning data point of the propeller on the Y axis in the target coordinate system at the n-th time step, z kn1 is the coordinate of the k-th scanning data point of the propeller on the Z axis in the target coordinate system at the n-th time step. The capsule can be divided into two hemispheres and a cylinder in the middle. h is the height of the cylinder in the middle of the capsule, and d is the diameter of the hemispheres on both sides of the capsule.
[0210] If each scan data point of the propeller does not satisfy at least one of the above formulas, it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, it is determined that the flying object and the propeller have collided.
[0211] For example, if none of the scan data points in the third scan data point set satisfies at least one of the above formulas, then it is determined that the flying object and the propeller have not collided. If at least one scan data point of the propeller satisfies all of the above formulas, then it is determined that the flying object and the propeller have collided.
[0212] Specifically, by screening the scanning data points, the scanning data points that do not need further judgment can be screened out in each judgment process, and further judgment can be performed only on the scanning data points that cannot be judged whether they collide. As the judgment progresses, the number of scanning data points that need to be judged becomes smaller and smaller, thereby greatly reducing the amount of calculation and improving the speed and efficiency of judgment.
[0213] It should be understood that although Figure 1 、 11 , 12, 14, Figure 16-20 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 、 11 , 12, 14, Figure 16-20 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The order of execution of these steps or stages is not necessarily one by one, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0214] In one embodiment, Figure 21 As shown, an edge collision detection device is provided, comprising: a motion equation acquisition module 901, a position determination module 902, and a collision determination module 903, wherein:
[0215] The motion equation acquisition module 901 is used to obtain the spatial position of the flying object in the target coordinate system according to the direction vector of the central axis of the flying object.
[0216] The position determination module 902 is configured to determine the spatial position of each of the scanned data points on the propeller surface in the target coordinate system based on the discretized three-dimensional model of the propeller.
[0217] The collision determination module 903 is used to determine whether the propeller collides with the flying object based on the motion equation, the spatial position of each data scanning point in the target coordinate system, and the structural parameters of the flying object, where the structural parameters include at least the inner sphere radius and the outer sphere radius of the flying object.
[0218] For the specific definition of the edge collision detection device, please refer to the definition of the edge collision detection method above, which will not be repeated here. The various modules in the above-mentioned collision detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0219] In one embodiment, a computer device is provided, wherein the internal structure of the computer device can be as follows: Figure 22 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements an edge collision detection method.
[0220] Those skilled in the art will understand that Figure 22 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0221] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0222] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0223] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0224] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0225] Throughout this specification, references to terms such as "some embodiments," "other embodiments," and "desired embodiments" indicate that a particular feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Although these terms are used interchangeably throughout this specification, they do not necessarily refer to the same embodiment or example.
[0226] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0227] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for edge collision detection, characterized in that: The method comprises: Obtaining the spatial position of the flying object in the target coordinate system according to the direction vector of the central axis of the flying object; Determining the spatial position of each scanned data point on the propeller surface in the target coordinate system based on the discretized three-dimensional model of the propeller; Obtain the coordinates of the center of mass of the flying object, the spatial position of each scanned data point on the propeller surface, and the radius of the inscribed sphere and the circumscribed sphere of the flying object in the original coordinate system; the original coordinate system is the coordinate system of the XOY plane and the direction vector of the flying object's motion trajectory; Under preset conditions, the first difference between the center of mass of the flying object and each scanning data point in the X-axis direction, the second difference in the Y-axis direction, and the third difference in the Z-axis direction are obtained according to the motion equation of the flying object in the original coordinate system; If at least one of the first difference values, the second difference values, and the third difference values is greater than the radius of the circumscribed sphere of the flying object, it is determined that the propeller and the flying object have not collided; If each first difference, each second difference, and each third difference are less than or equal to the radius of the circumscribed sphere of the flying object, then determining the distance between each scan data point and the centroid of the flying object based on each first difference, each second difference, and each third difference; If the distance between each scanning data point and the center of the flying object is greater than the radius of the circumscribed sphere of the flying object, it is determined that the propeller and the flying object have not collided; If the distance between at least one scan data point and the center of the flying object is less than or equal to the radius of the inscribed sphere of the flying object, it is determined that the propeller and the flying object have collided; If the distance between at least one scanning data point and the center of mass of the flying object is less than or equal to the circumscribed sphere radius of the flying object, and the distance between each scanning data point and the center of mass of the flying object is greater than the inscribed sphere radius of the flying object, then determine whether the propeller collides with the flying object based on the spatial position of the flying object in the target coordinate system, the spatial position of each scanning data point in the target coordinate system, and the structural parameters of the flying object, where the structural parameters include the type of the flying object.
2. The method according to claim 1, characterized in that The determining whether the propeller collides with the flying object according to the spatial position of the flying object in the target coordinate system, the spatial position of each of the scan data points in the target coordinate system, and the structural parameters of the flying object includes: Under preset conditions, relative position information between the flying mass center and each of the scanned data points is obtained according to the motion equation, the relative position information including a first relative difference in the X-axis direction, a second relative difference in the Y-axis direction, and a third relative difference in the Z-axis direction in the target coordinate system; Whether the propeller collides with the flying object is determined based on the relative position information and the structural parameters of the flying object.
3. The method according to claim 2, characterized in that The type of the flying object includes at least one of a cuboid, a cylinder, an ellipsoid, and a capsule. Determining whether the propeller collides with the flying object based on the relative position information and the type of the flying object includes: If the flying object is a cuboid, determining whether the propeller collides with the flying object based on the first relative differences, the second relative differences, the third relative differences, and the length, width, and height of the cuboid; If the flying object is a cylinder, determining whether the propeller collides with the flying object based on the first relative differences, the second relative differences, the third relative differences, and the height and the diameter of the circular cross-section of the cylinder; If the type of the flying object is an ellipsoid, determining whether the propeller collides with the flying object based on each of the first relative differences, each of the second relative differences, each of the third relative differences, and the lengths of the major axis and the minor axis of the ellipsoid; If the flying object is a capsule, determine whether the propeller collides with the flying object based on the first relative differences, the second relative differences, the third relative differences, and the height of the cylindrical part and the diameter of the hemispherical part in the capsule.
4. The method according to any one of claims 1 to 3, characterized in that The obtaining of the spatial position of the flying object in the target coordinate system according to the direction vector of the central axis of the flying object includes: Obtaining a direction vector of the motion trajectory of the flying object, and determining an original coordinate system according to the direction vector of the motion trajectory, wherein the direction vector of the motion trajectory is parallel to an XOY plane in the original coordinate system; Obtaining the direction vector of the central axis of the flying object in the original coordinate system; Performing coordinate transformation on the original coordinate system according to the direction vector to obtain a target coordinate system, wherein the direction vector is parallel to the XOY plane and the X axis in the target coordinate system; The spatial position of the flying object in the target coordinate system is determined based on the conversion information between the original coordinate system and the target coordinate system.
5. The method according to claim 4, characterized in that The direction vector includes an X-axis direction vector, a Y-axis direction vector, and a Z-axis direction vector of the central axis of the flying object in the original coordinate system, and performing coordinate transformation on the original coordinate system according to the direction vector to obtain a target coordinate system includes: Determine a first rotation angle according to the Y-axis direction vector and the Z-axis direction vector; Rotating the original coordinate system around the X-axis of the original coordinate system according to the first rotation angle to obtain a transition coordinate system; Determine a second rotation angle according to the X-axis direction vector, the Y-axis direction vector, and the Z-axis direction vector; The transition coordinate system is rotated around the Z axis of the transition coordinate system according to the second rotation angle to obtain a target coordinate system.
6. The method according to claim 5, characterized in that The determining the spatial position of the flying object in the target coordinate system according to the conversion information between the original coordinate system and the target coordinate system includes: Obtaining the motion equation of the flying object in the original coordinate system; determining, according to the first rotation angle and the second rotation angle, conversion information between the original coordinate system and the target coordinate system; The spatial position of the center of mass of the flying object in the target coordinate system is determined based on the conversion information and the motion equation in the original coordinate system.
7. The method according to claim 4, characterized in that Determining the spatial position of each of the scanned data points on the propeller surface in the target coordinate system based on the discretized three-dimensional model of the propeller includes: Obtaining the spatial position of each of the scanned data points on the propeller surface in the original coordinate system; The spatial position of each scan data point in the target coordinate system is determined according to the spatial position of each scan data point in the original coordinate system and the conversion information.
8. An edge collision detection device, characterized in that: The device comprises: The motion equation acquisition module is used to obtain the spatial position of the flying object in the target coordinate system based on the direction vector of the central axis of the flying object; a position determination module, configured to determine the spatial position of each scanned data point on the propeller surface in the target coordinate system based on a discretized three-dimensional model of the propeller; A collision determination module is used to obtain the coordinates of the center of mass of the flying object in the original coordinate system, the spatial position of each scanning data point on the propeller surface, the inner sphere radius and the outer sphere radius of the flying object; wherein the original coordinate system is the coordinate system of the direction vector of the XOY plane and the motion trajectory of the flying object; under preset conditions, the first difference in the X-axis direction, the second difference in the Y-axis direction and the third difference in the Z-axis direction between the center of mass of the flying object and each scanning data point are obtained according to the motion equation of the flying object in the original coordinate system; if at least one of the first difference, the second difference and the third difference is greater than the outer sphere radius of the flying object, it is determined that no collision occurs between the propeller and the flying object; if the first difference, the second difference and the third difference are all less than or equal to the outer sphere radius of the flying object, then according to the first difference, the second difference and the third difference The distance between each scanning data point and the center of mass of the flying object is determined by using a value; if the distance between each scanning data point and the center of mass of the flying object is greater than the circumscribed sphere radius of the flying object, it is determined that the propeller and the flying object have not collided; if the distance between at least one scanning data point and the center of mass of the flying object is less than or equal to the inscribed sphere radius of the flying object, it is determined that the propeller and the flying object have collided; if the distance between at least one scanning data point and the center of mass of the flying object is less than or equal to the circumscribed sphere radius of the flying object, and the distance between each scanning data point and the center of mass of the flying object is greater than the inscribed sphere radius of the flying object, then according to the motion equation, the spatial position of each scanning data point in the target coordinate system and the structural parameters of the flying object, it is determined whether the propeller and the flying object have collided, and the structural parameters include at least the inscribed sphere radius and the circumscribed sphere radius of the flying object.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.