Automatic parking collision detection method and system

By using the K-d tree model and body coordinate system in the automatic parking system, the problems of low resolution of obstacle grid detection and complex calculation in the prior art are solved, and high-precision collision detection and path safety improvement are achieved.

CN119734683APending Publication Date: 2025-04-01SAIC GM WULING AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411636444.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the existing automatic parking system, collision detection is performed by detecting obstacle grids, with low resolution, inaccurate grid description, complex calculations, and low applicability.

Method used

The K-d tree model is used to combine the body coordinate system. By obtaining the parking path point and converting it into the body coordinate system, the center point of the body is calculated and the obstacle point closest to the center point is obtained through the K-d tree, a bicycle safety envelope is built to determine whether it collides with the obstacle point.

Benefits of technology

High-precision obstacle detection is realized, avoiding the problem of low grid resolution, simplifying the calculation process, and improving path safety and collision detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119734683A_ABST
    Figure CN119734683A_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic parking collision detection method and system, the method comprising obtaining the vehicle body surrounding environment information; constructing a K‑d tree model based on the environment information and the coordinate system; obtaining the parking path point, converting the parking path point into a vehicle body coordinate system output; calculating the vehicle body center point of each parking path point, and obtaining the obstacle point closest to the center point through the K‑d tree; constructing a self-vehicle safety envelope at each parking path point, and judging whether a collision occurs with the nearest obstacle point through the vector method. The present invention avoids the recognition problem of low grid resolution by constructing a vehicle body coordinate system and a K‑d tree model, can obtain obstacle points with high precision, the collision detection result is more accurate, the path safety is higher, and the vector method is simple to calculate, which improves the efficiency and real-time performance of collision detection; it has versatility and can also be applied to other functions that require collision detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of collision detection, and in particular to an automatic parking collision detection method and system. Background Art

[0002] Driven by factors such as user demand, policy support, and technological development, the automatic parking system has become the focus of extensive research. As an autonomous driving system, it mainly consists of four modules: vehicle positioning, environmental perception, path planning, and vehicle control, to achieve the needs of the vehicle automatically driving into the parking space along a trajectory that meets driving specifications, meets kinematic constraints, and is safe and collision-free.

[0003] In order to meet the requirements of safety and collision-free, the collision detection module is indispensable in the path planning and parking process. In the commonly used parking path planning method-search method, collision detection is currently performed by detecting obstacle grids, but due to the influence of resolution, the use of occupation grids to describe the vehicle body is not very accurate, and the vehicle body occupation area must be calculated for each path point, which is complex in calculation and has low applicability. Therefore, there is an urgent need for a high-precision, simple-to-calculate collision detection method that can replace the grid method. Summary of the invention

[0004] In view of the above existing problems, the present invention is proposed.

[0005] Therefore, the present invention provides an automatic parking collision detection method and system to solve the problems of low resolution, inaccurate grid description of the vehicle body, complex calculation and low applicability in the current collision detection by detecting obstacle grids.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides an automatic parking collision detection method, comprising: acquiring vehicle body surrounding environment information;

[0008] Constructing a Kd tree model based on the environmental information and the coordinate system;

[0009] Acquire parking path points, and convert the parking path points into a vehicle body coordinate system for output;

[0010] Calculate the center point of the vehicle body at each parking path point, and obtain the obstacle point closest to the center point through the Kd tree;

[0011] A safety envelope of the vehicle is constructed at each parking path point to determine whether it collides with the nearest obstacle point.

[0012] As a preferred solution of the automatic parking collision detection method of the present invention, wherein: constructing a Kd tree model based on the environmental information and the coordinate system includes:

[0013] Take any point in the environment information as the root node;

[0014] Select the x dimension of the coordinate system as the partition dimension;

[0015] Sort the environmental information points according to the selected dimension, and use the median as the dividing point to divide the information points into two subsets;

[0016] Recursively construct a Kd tree for each subset, exchanging the partitioning dimension each time it recurses;

[0017] When the number of information points is less than or equal to the set threshold, the recursion stops and the current node is used as a leaf node to form a Kd tree model.

[0018] As a preferred solution of the automatic parking collision detection method of the present invention, the step of obtaining parking path points includes:

[0019] When a parking space is locked, a parking path is obtained by searching based on a grid map;

[0020] Outputs the parking route as parking route points in a raster map coordinate system.

[0021] As a preferred solution of the automatic parking collision detection method of the present invention, wherein: converting the parking path point into a vehicle body coordinate system comprises:

[0022] The vehicle body coordinate system is established with the vehicle's forward direction as the positive direction of the x-axis and the driver's left side as the positive direction of the y-axis;

[0023] When the parking function is turned on, a global coordinate system is formed based on the vehicle body coordinate system;

[0024] When the parking action is performed based on the parking path points, the calculation is performed through the vehicle body coordinate system.

[0025] As a preferred solution of the automatic parking collision detection method of the present invention, wherein: calculating the center point of the vehicle body at each parking path point, and obtaining the obstacle point closest to the center point through the Kd tree, includes:

[0026] Set the first variable to store the nearest neighbor point found so far, and initialize the nearest neighbor point as the root node;

[0027] Set the second variable to store the minimum distance from the center point of the vehicle to the first variable, and initialize it to the distance from the center point of the vehicle to the root node;

[0028] Starting from the root node, recursively search for the nearest neighbor point in the Kd tree. At each node, compare the distance between the center point of the vehicle and the current point, and update the first variable and the second variable.

[0029] At each node, determine whether the center point of the vehicle is the dividing line between the two subsets of data. If so, search the subset area on the other side.

[0030] After the recursion is completed, the point stored in the first variable is the obstacle point closest to the center point of the vehicle.

[0031] As a preferred solution of the automatic parking collision detection method of the present invention, wherein: constructing a vehicle safety envelope at each parking path point includes:

[0032] Reserve safe parking distance;

[0033] Get the four corner points of the vehicle, connect them in the same direction to form four edge vectors, which are used to describe the safety envelope of the vehicle.

[0034] As a preferred solution of the automatic parking collision detection method of the present invention, the step of determining whether a collision occurs includes:

[0035] The starting point of each edge vector is connected to the nearest obstacle point to form an obstacle vector;

[0036] Each vector is cross-producted with the obstacle vector in turn to obtain different numerical results;

[0037] Based on the numerical results, it is determined that the nearest obstacle point is located on the specific orientation side of the edge vector;

[0038] If the nearest obstacle point is located on the same specific orientation side of all edge vectors and is within the safety envelope, a collision is determined to have occurred;

[0039] If the nearest obstacle point is located on a specific orientation side of any edge vector but is different from the other edge vectors, then no collision occurs.

[0040] In a second aspect, the present invention provides an automatic parking collision detection system, comprising:

[0041] An acquisition module is used to acquire the surrounding environment information of the vehicle body;

[0042] A construction module, used to construct a Kd tree model based on the environmental information and the coordinate system;

[0043] A conversion module, used for acquiring parking path points and converting the parking path points into a vehicle body coordinate system output;

[0044] The calculation module is used to calculate the center point of the vehicle body at each parking path point and obtain the obstacle point closest to the center point through the Kd tree;

[0045] The judgment module is used to construct a safety envelope of the vehicle at each parking path point and determine whether a collision occurs with the nearest obstacle point.

[0046] In a third aspect, the present invention provides a computing device, comprising:

[0047] Memory and processor;

[0048] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the automatic parking collision detection method are implemented.

[0049] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the automatic parking collision detection method.

[0050] Compared with the prior art, the present invention has the following beneficial effects: the present invention avoids the recognition problem of low grid resolution by constructing a vehicle body coordinate system and a Kd tree model, and the two are combined. It can obtain obstacle points with high precision, and use polygons formed by corner point coordinates to describe the vehicle body posture more accurately, which is not affected by grid resolution. The collision detection result is more accurate, the path safety is higher, and the vector method is simple to calculate, which improves the efficiency and real-time performance of collision detection. It has high versatility. In addition to being used in the path planning stage and parking process, it can also be applied to other functions that require collision detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0052] Figure 1 A schematic diagram of the overall process logic of an automatic parking collision detection method according to an embodiment of the present invention;

[0053] Figure 2 A schematic diagram of a traditional grid obstacle collision detection in an automatic parking collision detection method according to an embodiment of the present invention;

[0054] Figure 3 A schematic diagram of a Kd tree construction process in an automatic parking collision detection method according to an embodiment of the present invention;

[0055] Figure 4 A schematic diagram of grid coordinate system transformation in an automatic parking collision detection method according to an embodiment of the present invention;

[0056] Figure 5A schematic diagram of the transformation between the global coordinate system and the vehicle body coordinate system in the automatic parking collision detection method according to an embodiment of the present invention;

[0057] Figure 6 A schematic diagram of a Kd tree nearest neighbor search process in an automatic parking collision detection method according to an embodiment of the present invention;

[0058] Figure 7 A schematic diagram of a safety envelope in an automatic parking collision detection method according to an embodiment of the present invention;

[0059] Figure 8 A schematic diagram of vector cross multiplication in an automatic parking collision detection method according to an embodiment of the present invention;

[0060] Fig. 9 A schematic diagram of a vector method judgment scenario in an automatic parking collision detection method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0061] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.

[0062] Example 1

[0063] Reference Figure 1-Figure 9 , as an embodiment of the present invention, provides an automatic parking collision detection method, comprising:

[0064] S100: Acquiring vehicle body surrounding environment information;

[0065] S200: constructing a Kd tree model based on environmental information and a coordinate system;

[0066] S300: Acquire parking path points, and convert the parking path points into a vehicle body coordinate system for output;

[0067] S400: Calculate the center point of the vehicle body at each parking path point, and obtain the obstacle point closest to the center point through the Kd tree;

[0068] S500: Construct a safety envelope of the vehicle at each parking path point to determine whether a collision occurs with the nearest obstacle point.

[0069] It should be noted that currently, the method of detecting obstacle grids is used for collision detection, such as Figure 2As shown in the figure, this method relies on dividing the vehicle and its surroundings into a series of grid cells, namely: grids. However, due to the limitation of grid resolution, there is a certain error in using the occupancy grid to depict the actual outline of the vehicle. Specifically, when the resolution is insufficient, the shape of the vehicle body may be overly simplified or distorted, resulting in an inaccurate reflection of the actual physical size and position of the vehicle. Usually in this framework, in order to ensure that the vehicle does not collide with any obstacles during driving, the grid area occupied by the vehicle body must be recalculated for each planning point on the path, which not only increases the computational burden of the algorithm and makes the whole process quite complicated, but may also lead to a decrease in real-time performance, especially when fast response is required in dynamic environments.

[0070] The above scheme uses the Kd number model combined with the safety envelope to search and judge points. Compared with the fixed-resolution rasterization method, the construction of the Kd number model can dynamically adjust the query range according to the actual obstacle distribution, and provides a more intuitive and effective collision detection mechanism through the safety envelope.

[0071] In one embodiment, the vehicle body surrounding environment information in the above step S100 may include: image information acquired by a camera, sonar information acquired by an ultrasonic radar, etc.;

[0072] In another embodiment, the vehicle body surrounding environment information in the above step S100 may also include: point cloud information obtained by millimeter wave radar, laser radar or heat source obtained by infrared sensor, brightness and darkness information obtained by light sensor.

[0073] The above implementation steps can acquire and identify environmental obstacles including but not limited to pedestrians, vehicles and other targets.

[0074] In the embodiments of the present application, Figure 3 As shown, in the above step S200, a Kd tree model is constructed based on the environmental information and the coordinate system, including the following sub-steps A1-A5:

[0075] A1: Take any point in the environment information as the root node;

[0076] A2: Select the x dimension of the coordinate system as the partition dimension;

[0077] A3: Sort the environmental information points according to the selected dimension and use the median as the dividing point to divide the information points into two subsets;

[0078] A4: Recursively construct a Kd tree for each subset, exchanging the partitioning dimension each time;

[0079] A5: When the number of information points is less than or equal to the set threshold, stop the recursion and use the current node as a leaf node to form a Kd tree model.

[0080] Specifically, the two subsets are generally divided into left and right parts; the threshold value can be set to 1 or adjusted according to actual needs.

[0081] In the embodiments of the present application, Figure 4 As shown, the acquisition of parking path points in the above step S300 includes the following steps B1-B2:

[0082] B1: When a parking space is locked, a parking path is obtained by searching based on a grid map;

[0083] B2: Output the parking path as parking path points in the raster map coordinate system.

[0084] In the embodiments of the present application, Figure 5 As shown, the above step S300 converts the parking path point into the vehicle body coordinate system, including the following steps C1-C3:

[0085] C1: The vehicle body coordinate system is established with the vehicle's forward direction as the positive direction of the x-axis and the driver's left side as the positive direction of the y-axis;

[0086] C2: When the parking function is turned on, a global coordinate system is formed based on the vehicle body coordinate system;

[0087] C3: Based on the parking path points, when performing parking actions, calculations are performed through the vehicle body coordinate system.

[0088] In another embodiment of the present application, Figure 4-5 As shown, in the above step S300, the specific operation sequence of obtaining the parking path point and converting the parking path point into the vehicle body coordinate system can also be:

[0089] C1: The vehicle body coordinate system is established with the vehicle's forward direction as the positive direction of the x-axis and the driver's left side as the positive direction of the y-axis;

[0090] C2: When the parking function is turned on, a global coordinate system is formed based on the vehicle body coordinate system;

[0091] B1: When a parking space is locked, a parking path is obtained by searching based on a grid map;

[0092] B2: Output the parking path as parking path points in the raster map coordinate system.

[0093] C3: Based on the parking path points, when performing parking actions, calculations are performed through the vehicle body coordinate system.

[0094] It should be noted that the above scheme can simplify subsequent calculations by converting the three types of coordinates in different usage scenarios. After the parking path points are converted to the vehicle body coordinate system, all subsequent calculations can be performed in this local coordinate system. At the same time, the position and posture of the vehicle body coordinate system relative to the vehicle are fixed, so the movement of the vehicle can be controlled more accurately and the cumulative error introduced by coordinate conversion can be reduced.

[0095] In the embodiments of the present application, Figure 6 As shown, the above step S400 calculates the center point of the vehicle body at each parking path point, and obtains the obstacle point closest to the center point through the Kd tree, including the following steps D1-D5:

[0096] D1: Set the first variable best to store the nearest neighbor point found so far, and initialize the nearest neighbor point as the root node;

[0097] D2: Set the second variable best_dist to store the minimum distance from the center point of the vehicle to the first variable best, and initialize it to the distance from the center point of the vehicle to the root node;

[0098] D3: Starting from the root node, recursively search for the nearest neighbor point in the Kd tree. At each node, compare the distance between the center point of the vehicle and the current point, and update the first variable best and the second variable best_dist;

[0099] D4: At each node, determine whether the center point of the vehicle is the dividing line between the two subsets of data. If so, search the subset area on the other side;

[0100] D5: After the recursion ends, the point stored in the first variable best is the obstacle point closest to the center point of the vehicle.

[0101] It should be noted that after constructing the Kd tree model, for any given vehicle center point, the nearest obstacle point can be quickly found without traversing all grids in the entire environment; each time the path point is updated, there is no need to recalculate the grid area occupied by the vehicle body, but to search directly on the existing Kd tree structure to avoid repeated calculations, and as the path point changes, only the changed part needs to be focused on, reducing the overall calculation complexity; at the same time, the Kd tree is based on point cloud data rather than a fixed grid size, which can more easily handle vehicles of different sizes and shapes; if new sensor data needs to be added or the coordinate system needs to be changed, the Kd tree model is also relatively easy to adjust.

[0102] In the embodiment of the present application, the step S500 of constructing a vehicle safety envelope at each parking path point includes the following steps:

[0103] E1: Reserve safe parking distance;

[0104] E2: Get the four corner points of the vehicle, connect them in the same direction to form four edge vectors, which are used to describe the safety envelope of the vehicle.

[0105] Specifically, the reserved parking safety distance can be 0.3m / 0.45m / 0.6m, etc., which needs to be calibrated and set based on comprehensive consideration of the ultrasonic radar accuracy of the vehicle, the vehicle control accuracy, the user's driving style, etc.

[0106] In another embodiment of the present application, the construction of the vehicle safety envelope in the above step S500 can also be carried out through a geometric construction method, namely, a convex hull; specifically, a convex hull can be constructed through the four corner points of the vehicle and other key points (such as sensor positions) to form a safety boundary.

[0107] In another embodiment of the present application, the vehicle safety envelope constructed in the above step S500 can also be a minimum circumscribed rectangle or an axis-aligned rectangle, that is, a bounding box; specifically, a rectangle or a cube can be defined to enclose the object for fast collision detection.

[0108] In the embodiment of the present application, determining whether a collision occurs with the nearest obstacle point in the above step S500 includes the following steps F1-F5:

[0109] F1: The starting point of each edge vector is connected to the nearest obstacle point to form an obstacle vector;

[0110] F2: Each vector is cross-multiplied with the obstacle vector in turn to obtain different numerical results;

[0111] F3: Based on the numerical results, it is determined that the nearest obstacle point is located on the specific azimuth side of the edge vector;

[0112] F4: If the nearest obstacle point is located on the same specific orientation side of all edge vectors and is within the safety envelope, a collision is determined;

[0113] F5: If the nearest obstacle point is located on the specific orientation side of any edge vector and is different from the other edge vectors, no collision occurs.

[0114] For example, Figure 7 As shown in the figure, the safety envelope of the vehicle consists of four edge vectors AB, BC, CD, and DA. The specific steps of using the vector method to determine whether the nearest obstacle point is in the safety envelope of the vehicle are as follows:

[0115] F1: The starting point of each edge vector is connected to the nearest obstacle point P to form obstacle vectors AP, BP, CP, and DP;

[0116] F2: If Figure 8As shown, the four edge vectors are cross-producted with the obstacle vector in turn to determine whether the nearest obstacle point is on the left or right side of the vector;

[0117] For example: AB·AP=r;

[0118] F3: Based on the numerical results, it is determined that the nearest obstacle point is located on the specific azimuth side of the edge vector;

[0119] For example: if r>0, point P is on the left side of vector AB; if r=0, point P is on vector AB; if r<0, point P is on the right side of vector AB;

[0120] F4: If the nearest obstacle point is located on the same specific orientation side of all edge vectors and is within the safety envelope, a collision is determined;

[0121] F5: If the nearest obstacle point is located on the specific orientation side of any edge vector and is different from the other edge vectors, no collision occurs.

[0122] For example: Fig. 9 As shown in the left figure, if the four cross product values ​​r are all less than 0 and are within the safety envelope, it is considered a collision.

[0123] For example: Fig. 9 As shown in the right figure, BC·BP=r<0, point P is on the left side of vector BC, and the other three cross product values ​​r are all greater than 0, so no collision occurs.

[0124] In another embodiment of the present application, the shape of the vehicle can be better described by adding additional vectors, or the vector length can be adjusted to accommodate different safety distance requirements.

[0125] In another embodiment of the present application, the vector method can be extended to three-dimensional space, and the three-dimensional boundary of the vehicle is represented by a three-dimensional vector, which is suitable for collision detection in a three-dimensional environment.

[0126] It should be noted that the vector method is simple to calculate and improves the efficiency and real-time performance of collision detection. It is highly versatile and can handle various special situations, such as irregularly shaped vehicles or obstacles. Even in complex environments, potential collision risks can be effectively identified through appropriate vector combinations and logical judgments. Vectors can be easily combined with data from different sensors (such as lidar, millimeter-wave radar, etc.), so in addition to being used in the path planning stage and parking process, they can also be applied to other functions that require collision detection.

[0127] The above is a schematic scheme of an automatic parking collision detection method of this embodiment. It should be noted that the technical scheme of the automatic parking collision detection system and the technical scheme of the automatic parking collision detection method described above are of the same concept, and the details of the technical scheme of the automatic parking collision detection system not described in detail in this embodiment can all be referred to the description of the technical scheme of the automatic parking collision detection method described above.

[0128] This embodiment also provides a system for an automatic parking collision detection method, including:

[0129] An acquisition module is used to acquire the surrounding environment information of the vehicle body;

[0130] A construction module is used to construct a Kd tree model based on environmental information and coordinate system;

[0131] A conversion module is used to obtain parking path points and convert the parking path points into a vehicle body coordinate system output;

[0132] The calculation module is used to calculate the center point of the vehicle body at each parking path point and obtain the obstacle point closest to the center point through the Kd tree;

[0133] The judgment module is used to construct a safety envelope of the vehicle at each parking path point and determine whether a collision with the nearest obstacle point occurs through the vector method.

[0134] This embodiment also provides a computing device suitable for automatic parking collision detection, including: a memory and a processor; the memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions to implement the automatic parking collision detection method proposed in the above embodiment.

[0135] This embodiment further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the automatic parking collision detection method proposed in the above embodiment is implemented.

[0136] The storage medium proposed in this embodiment and the method for realizing automatic parking collision detection proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0137] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ReadOnly, Memory, ROM), random access memory (Random Access Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.

[0138] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. An automatic parking collision detection method, characterized in that: include: Obtaining information about the vehicle's surroundings; Constructing a Kd tree model based on the environmental information and the coordinate system; Acquire parking path points, and convert the parking path points into a vehicle body coordinate system for output; Calculate the center point of the vehicle body at each parking path point, and obtain the obstacle point closest to the center point through the Kd tree; A safety envelope of the vehicle is constructed at each parking path point to determine whether it collides with the nearest obstacle point.

2. The automatic parking collision detection method according to claim 1, characterized in that: Constructing a Kd tree model based on the environmental information and the coordinate system includes: Take any point in the environment information as the root node; Select the x dimension of the coordinate system as the partition dimension; Sort the environmental information points according to the selected dimension, and use the median as the dividing point to divide the information points into two subsets; Recursively construct a Kd tree for each subset, exchanging the partitioning dimension each time it recurses; When the number of information points is less than or equal to the set threshold, the recursion stops and the current node is used as a leaf node to form a Kd tree model.

3. The automatic parking collision detection method according to claim 1 or 2, characterized in that: Get parking waypoints, including: When a parking space is locked, a parking path is obtained by searching based on a grid map; Outputs the parking route as parking route points in a raster map coordinate system.

4. The automatic parking collision detection method according to claim 3, characterized in that: Converting the parking path point into a vehicle body coordinate system includes: The vehicle body coordinate system is established with the vehicle's forward direction as the positive direction of the x-axis and the driver's left side as the positive direction of the y-axis; When the parking function is turned on, a global coordinate system is formed based on the vehicle body coordinate system; When the parking action is performed based on the parking path points, the calculation is performed through the vehicle body coordinate system.

5. The automatic parking collision detection method according to claim 4, characterized in that: Calculate the center point of the vehicle body at each parking path point, and obtain the obstacle point closest to the center point through the Kd tree, including: Set the first variable to store the nearest neighbor point found so far, and initialize the nearest neighbor point as the root node; Set the second variable to store the minimum distance from the center point of the vehicle to the first variable, and initialize it to the distance from the center point of the vehicle to the root node; Starting from the root node, recursively search for the nearest neighbor point in the Kd tree. At each node, compare the distance between the center point of the vehicle and the current point, and update the first variable and the second variable. At each node, determine whether the center point of the vehicle is the dividing line between the two subsets of data. If so, search the subset area on the other side. After the recursion is completed, the point stored in the first variable is the obstacle point closest to the center point of the vehicle.

6. The automatic parking collision detection method according to claim 5, characterized in that: Construct an ego vehicle safety envelope at each parking path point, including: Reserve safe parking distance; Get the four corner points of the vehicle, connect them in the same direction to form four edge vectors, which are used to describe the safety envelope of the vehicle.

7. The automatic parking collision detection method according to claim 6, characterized in that: Determine whether a collision occurs, including: The starting point of each edge vector is connected to the nearest obstacle point to form an obstacle vector; Each vector is cross-producted with the obstacle vector in turn to obtain different numerical results; Based on the numerical results, it is determined that the nearest obstacle point is located on the specific orientation side of the edge vector; If the nearest obstacle point is located on the same specific orientation side of all edge vectors and is within the safety envelope, a collision is determined to have occurred; If the nearest obstacle point is located on a specific orientation side of any edge vector but is different from the other edge vectors, then no collision occurs.

8. A system applied to the automatic parking collision detection method according to any one of claims 1 to 7, characterized in that: include: An acquisition module is used to acquire the surrounding environment information of the vehicle body; A construction module, used to construct a Kd tree model based on the environmental information and the coordinate system; A conversion module, used for acquiring parking path points and converting the parking path points into a vehicle body coordinate system output; The calculation module is used to calculate the center point of the vehicle body at each parking path point and obtain the obstacle point closest to the center point through the Kd tree; The judgment module is used to construct a safety envelope of the vehicle at each parking path point and determine whether a collision occurs with the nearest obstacle point.

9. An electronic device, comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the automatic parking collision detection method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the automatic parking collision detection method according to any one of claims 1 to 7.