Collision detection method, device, equipment, storage medium and automatic driving vehicle
By expanding the shape of obstacles and detecting the intersection of line segments, the accuracy of collision detection in the Frenet coordinate system on complex roads is solved, thus improving the safety of autonomous driving.
Patent Information
- Application Number
- CN202310105654.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-30
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-01-30
AI Technical Summary
Existing collision detection based on the Frenet coordinate system is not accurate enough on roads with large curvature or unstructured roads, which affects the safety of autonomous driving.
By acquiring the shapes of the main vehicle and obstacles, performing expansion processing, and detecting the line segment intersection relationship between the main vehicle shape and the expanded obstacle shape, the collision relationship is determined, avoiding dependence on specific reference lines.
It improves the accuracy of collision detection, ensures a safe distance between the vehicle and obstacles, and enhances the safety of autonomous driving.
Smart Images

Figure CN116215517B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to the technical field of automatic driving, planning control and the like, and more particularly to a collision detection method and device, equipment, storage medium and automatic driving vehicle. BACKGROUND
[0002] Ensuring the safety of automatic driving has always been the core of automatic driving technology, and collision detection technology can significantly improve the safety of automatic driving.
[0003] In the related art, the position coordinates of a host vehicle and an obstacle in a frenet coordinate system can be obtained, and based on the position coordinates of the host vehicle and the obstacle in the frenet coordinate system, whether the host vehicle collides with the obstacle is detected. SUMMARY
[0004] The present disclosure provides a collision detection method, device, equipment, storage medium and automatic driving vehicle.
[0005] According to an aspect of the present disclosure, a collision detection method is provided, comprising: obtaining a host vehicle shape and an obstacle shape, the host vehicle shape comprising a plurality of line segments; performing inflation processing on the obstacle shape to obtain an inflated shape, the inflated shape comprising a plurality of line segments; for a first line segment and a second line segment, detecting an intersection relationship between the first line segment and the second line segment, the first line segment being any one of the line segments in the host vehicle shape, and the second line segment being any one of the line segments in the inflated shape; and determining a collision relationship between the host vehicle and the obstacle based on the intersection relationship.
[0006] According to another aspect of the present disclosure, a collision detection device is provided, comprising: an acquisition module configured to obtain a host vehicle shape and an obstacle shape, the host vehicle shape comprising a plurality of line segments; an inflation module configured to perform inflation processing on the obstacle shape to obtain an inflated shape, the inflated shape comprising a plurality of line segments; a detection module configured to, for a first line segment and a second line segment, detect an intersection relationship between the first line segment and the second line segment, the first line segment being any one of the line segments in the host vehicle shape, and the second line segment being any one of the line segments in the inflated shape; and a determination module configured to determine a collision relationship between the host vehicle and the obstacle based on the intersection relationship.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of the aspects described above.
[0008] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method according to any one of the aspects above.
[0009] According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of the aspects above.
[0010] According to another aspect of the present disclosure, there is provided an autonomous vehicle comprising the electronic device according to any one of the aspects above.
[0011] According to the technical solution of the present disclosure, the accuracy of collision detection can be improved.
[0012] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0013] The accompanying drawings are used to better understand the present solution and do not constitute a limitation on the present disclosure. Among them:
[0014] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure;
[0015] Figure 2 is a schematic diagram of an application scenario according to an embodiment of the present disclosure;
[0016] Figure 3 is a schematic diagram according to the second embodiment of the present disclosure;
[0017] Figure 4 is a schematic diagram of the shape of the obstacle before and after inflation according to an embodiment of the present disclosure;
[0018] Figure 5 is a schematic diagram of the relationship between the target position point and an inflated position point according to an embodiment of the present disclosure;
[0019] Figure 6 is a schematic diagram of two inflation methods according to an embodiment of the present disclosure;
[0020] Figure 7 is a schematic diagram of the relationship between the target position point and two inflated position points according to an embodiment of the present disclosure;
[0021] Figure 8 is a schematic diagram of different intersection relationships between two line segments according to an embodiment of the present disclosure;
[0022] Figure 9 is a schematic diagram of different intersection relationships between two parallel line segments according to an embodiment of the present disclosure;
[0023] Figure 10 is a schematic diagram according to a third embodiment of the present disclosure;
[0024] Figure 11 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0025] Figure 12 is a schematic diagram of an electronic device for implementing a collision detection method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, and should be considered as merely exemplary. Thus, those skilled in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, for the sake of brevity and clarity, descriptions of well-known functions and constructions are omitted from the following description.
[0027] In the frenet coordinate system, a reference line (denoted by T ref ) can be an arbitrary curve, and is generally defined as the center line of a lane. Assuming that the coordinates of an autonomous vehicle in a global coordinate system (or Cartesian coordinate system) are (x, y), a projection is made from the position (x, y) of the vehicle to the reference line, and the projection point is F. The distance between the projection point F and the position (x, y) of the vehicle is the lateral displacement d, and the curve distance from the starting point of the reference line to the projection point F is the longitudinal displacement s. The coordinates of the autonomous vehicle in the frenet coordinate system are described by (s, d).
[0028] In related technologies, collision detection can be performed based on the position coordinates of the host vehicle and the position coordinates of the obstacle in the frenet coordinate system. For example, under the same longitudinal displacement s0, the lateral displacement of the host vehicle is d1, and the lateral displacement of the obstacle is d2. If the absolute value of d1-d2 is less than a preset value, it indicates that the host vehicle collides with the obstacle, otherwise no collision occurs.
[0029] However, in some scenarios, such as a road with large curvature or an unstructured road, the accuracy of the above collision detection based on the position coordinates in the frenet coordinate system is insufficient.
[0030] To improve the accuracy of collision detection, the present disclosure provides the following embodiments.
[0031] Figure 1is a schematic diagram according to a first embodiment of the present disclosure, and the embodiment provides a collision detection method, which comprises:
[0032] 101. Obtain a host vehicle shape and an obstacle shape, the host vehicle shape comprising a plurality of line segments.
[0033] 102. Perform inflation processing on the obstacle shape to obtain an inflated shape, the inflated shape comprising a plurality of line segments.
[0034] 103. For a first line segment and a second line segment, detect an intersection relationship between the first line segment and the second line segment, the first line segment being any line segment in the host vehicle shape, and the second line segment being any line segment in the inflated shape.
[0035] 104. Determine a collision relationship between the host vehicle and the obstacle based on the intersection relationship.
[0036] The host vehicle refers to a vehicle to be detected for collision, and in an automatic driving scenario, the host vehicle refers to an automatic driving vehicle.
[0037] The obstacle refers to various static or dynamic obstacles in the environment around the host vehicle, such as pedestrians, other vehicles, infrastructure on the road, etc.
[0038] In the driving process of the automatic driving vehicle, the automatic driving system can detect the host vehicle shape and the obstacle shape. The host vehicle shape refers to the shape of the outer contour (or boundary) of the host vehicle, which is generally rectangular. The obstacle shape refers to the shape of the outer contour of the obstacle, which is generally a polygon. Specifically, when detecting the shape, the automatic driving system can detect the position points on the corresponding outer contour, connect two adjacent position points to form a line segment, and multiple line segments form a rectangular or polygonal shape.
[0039] Both the host vehicle shape and the obstacle shape can be considered as a series of line segments. Taking the rectangular host vehicle shape as an example, the host vehicle shape comprises four line segments. If the obstacle shape is a pentagon, the obstacle shape comprises five line segments.
[0040] For the obstacle, the obstacle shape can be inflated to obtain an inflated shape, which is also a polygon and comprises a plurality of line segments.
[0041] The first line segment is any line segment in the host vehicle shape, i.e., a line segment formed by any two adjacent position points on the host vehicle shape.
[0042] The second line segment is any line segment in the inflated shape, i.e., a line segment formed by any two adjacent position points on the inflated shape.
[0043] After the first line segment and the second line segment are obtained, an intersection relationship of the first line segment and the second line segment can be detected, and a collision relationship between the host vehicle and the obstacle is determined based on the relationship.
[0044] If the first line segment and the second line segment do not intersect, it is determined that the host vehicle does not collide with the obstacle; or if the first line segment and the second line segment intersect, it is determined that the host vehicle collides with the obstacle. That is, if any line segment in the shape of the host vehicle does not intersect any line segment in the expanded shape of the obstacle, it is determined that the host vehicle does not collide with the obstacle; or if at least one line segment in the shape of the host vehicle intersects at least one line segment in the expanded shape of the obstacle, it is determined that the host vehicle collides with the obstacle.
[0045] In this embodiment, the collision relationship between the host vehicle and the obstacle is determined based on the intersection relationship of the first line segment corresponding to the shape of the host vehicle and the second line segment corresponding to the shape of the obstacle. Since the projection to a specific reference line is not required, the limitation of the specific reference line is avoided, thereby improving the accuracy of collision detection. In addition, by performing the expansion processing on the shape of the obstacle, a certain space distance can be reserved for the boundary of the obstacle, thereby ensuring the safety of the host vehicle driving.
[0046] In order to better understand the embodiments of the present disclosure, the application scenarios of the embodiments of the present disclosure are described. The embodiments can be applied to an automatic driving scene.
[0047] The automatic driving function of the automatic driving vehicle can be realized by an automatic driving system. The automatic driving level realized by the automatic driving system can be divided into L0-L5 levels. Among them, L0 level driving represents no automatic driving, i.e., traditional manual driving by a driver; L1 level driving, also known as assisted driving, includes basic functions such as constant speed cruise, automatic parking, and lane keeping; L2 level driving, also known as semi-automatic driving, includes automatic assistance driving and hazard prediction braking functions; L3 level driving, also known as conditional automatic driving, can realize complete automatic driving on normal road sections, but still needs manual assistance braking in some emergency situations; L4 level driving belongs to high-level automatic driving, and the overall braking performance and reaction capability of the vehicle have reached a relatively high level. The driver does not need to manually control the vehicle, and the vehicle runs smoothly and smoothly; L5 level automatic driving can realize unconditional full automatic driving technology, and does not need to worry about road conditions and weather in any situation, and realizes full automatic driving.
[0048] As shown in FIG. 1, the automatic driving vehicle 100 is provided with a plurality of sensors 110, a perception system 120, a planning system 130, a control system 140, and a communication system 150. Figure 2As shown, the core modules of the autonomous driving system 200 include: a high-definition map (HD map) 201, a localization system 202, a perception system 203, a prediction system 204, a global navigation system 205, a planning system 206, and a control module 207.
[0049] Among them, the high-definition map 201, also known as an autonomous driving map or a high-resolution map, is a new map data paradigm for autonomous vehicles. The absolute position accuracy of the high-definition map is close to 1m, and the relative position accuracy is in the centimeter level, which can reach 10-20cm.
[0050] The localization system 202 can provide high-precision (centimeter-level) positioning services based on positioning devices and high-definition maps. The positioning devices include one or more of the Global Positioning System (GPS), Global Navigation Satellite System (GNSS), and Inertial Navigation System (INS).
[0051] The perception system 203 provides comprehensive environmental perception services for autonomous vehicles. Specifically, it can include cameras, lidar, millimeter wave radar, ultrasonic radar, and other devices.
[0052] The prediction system 204 takes the data of the perception system as input, extracts the historical motion parameters of the vehicle and / or obstacles, and combines Kalman filtering, neural networks, and other means to infer the future motion trajectory of the vehicle and / or obstacles. The predicted motion trajectory can be provided to the planning system.
[0053] The global navigation system 205 is used to obtain the optimal global navigation path that meets the performance evaluation indicators based on the initial position and target position of the vehicle, combined with the road network topology, through a global path search algorithm.
[0054] The planning system 206 mainly provides vehicle obstacle avoidance, lane changing decision, path planning, and speed planning services.
[0055] The control system 207 is used to perform longitudinal and lateral tracking control based on the driving trajectory provided by the decision planning system.
[0056] The control system 207 can specifically control the chassis system of the vehicle to perform steering, acceleration, braking, etc. through a Controller Area Network (CAN) bus.
[0057] The collision detection method of the embodiment can be performed by a planning system, the perception system can obtain the host vehicle shape and the obstacle shape, and the planning system performs collision detection based on the host vehicle shape and the obstacle shape obtained by the perception system.
[0058] In combination with the above application scenarios, the present disclosure further provides a collision detection method.
[0059] Figure 3 is a schematic diagram according to the second embodiment of the present disclosure, and the present embodiment provides a collision detection method, which comprises:
[0060] 301, obtaining a host vehicle shape and an obstacle shape, the host vehicle shape comprising a plurality of line segments.
[0061] The host vehicle shape and the obstacle shape can be detected by a perception system, and the perception system can send the detected host vehicle shape and obstacle shape to a planning system, and the planning system performs collision detection based on the above host vehicle shape and obstacle shape.
[0062] Taking the host vehicle shape as an example, the perception system can detect a series of position points on the outer contour of the host vehicle, and two adjacent position points can form a line segment, and these line segments are sequentially connected to form the host vehicle shape. Therefore, the host vehicle shape and the obstacle shape both comprise a plurality of line segments.
[0063] 302, performing inflation processing on the obstacle shape to obtain an inflated shape, the inflated shape comprising a plurality of line segments.
[0064] The obstacle shape is usually a polygon, and the inflation processing can be performed on the shape in a similar equidistant manner.
[0065] The polygon can be described by a point set.
[0066] The original shape Polygon of the obstacle can be expressed as:
[0067] Polygon={p1,p2,...,p n}
[0068] The inflated shape Polygon' of the obstacle can be expressed as:
[0069] Polygon'={p1′,p'2,...,p' n}
[0070] wherein p1, p2,...,p n and p1', p2',...,p n are position points arranged in a certain order (e.g., counterclockwise order) on the original shape and the expanded shape of the obstacle respectively, n is the number of the position points, and is a positive integer.
[0071] When similar equidistant expansion is performed, the expanded line segment p' i p' i+1 is at a distance equal to the expansion width buffer from the original line segment p i p i+1 . This can be expressed by the formula: dist(p' i p' i+1 , p i p i+1 ) = buffer, i = 1, 2,...,n, where p n+1 = p1, p' n+1 = p'1, and dist represents the distance between line segments.
[0072] The expansion width buffer can be set according to actual needs. In addition, different expansion widths buffer can be set for different obstacles.
[0073] The expanded polygon is similar to the original polygon, as shown in FIG. 2, where the inner polygon represents the shape (original shape) of the obstacle, and the outer polygon represents the expanded shape. Figure 4
[0074] The specific expansion process can include:
[0075] For a target position point on the shape of the obstacle, a first expansion distance is determined based on a preset expansion width and an included angle between two adjacent line segments corresponding to the target position point;
[0076] If the first expansion distance is less than or equal to a preset value, it is determined that the target position point corresponds to one expanded position point, and a position deviation of the one expanded position point relative to the target position point is determined based on the first expansion distance;
[0077] If the first expansion distance is greater than the preset value, it is determined that the target position point corresponds to two expanded position points, a second expansion distance is determined based on the expansion width, and a position deviation of each expanded position point relative to the target position point is determined based on the second expansion distance.
[0078] The target position point refers to any position point on the shape of the obstacle, which can be represented by p i , i = 1, 2,...,n.
[0079] The expansion width can be represented by a buffer, which is a preset value.
[0080] For target location point p i The two adjacent line segments are represented by p. i p i+1 and p i p i-1 express.
[0081] The first expansion distance is denoted by D1, and the second expansion distance is denoted by D2.
[0082] refer to Figure 5 The Cartesian coordinate system is selected. In this embodiment, the Cartesian coordinate system is a global coordinate system. The origin of the coordinate system is selected as a preset point on the map. The coordinates of the point are represented by (x, y). The positive directions of x and y are usually selected as the east and north directions of the map.
[0083] In Cartesian coordinates, the formula for calculating the first expansion distance D1 is:
[0084]
[0085] γ=π-α / 2
[0086] α=∠2-∠1
[0087] The default value can be selected as a multiple of the buffer, such as selecting 2 times the buffer.
[0088] If D1 is less than or equal to 2 * buffer, then the target location point is determined to correspond to an expanded location point, such as... Figure 5 As shown, the formula for calculating the positional deviation of a point after expansion is:
[0089] Δx=D1*cosβ
[0090] Δy=D1*sinβ
[0091] β=∠2-α / 2
[0092] Where ∠2 is the line segment p i p i+1 corresponding vector The angle relative to the positive x-axis, ∠1 is the line segment p. i p i-1 corresponding vector The vector angles mentioned above, relative to the positive x-axis, fall within the range of [-180, 180]. Δx and Δy are the positional deviations of the expanded point along the x-axis and y-axis, respectively. The remaining parameters are intermediate values in the calculation, and * indicates multiplication.
[0093] Similarity-based dilatation ensures that each edge of the dilatated polygon is equidistant from its corresponding edge before dilatation, and that the shape remains consistent. However, under certain circumstances, such as when α approaches 0 or 2π (i.e., the angle between two adjacent edges of the polygon is very small), sinγ will also approach 0, and D1 will approach infinity. In such cases, similarity-based dilatation is not suitable.
[0094] In this situation, instead of pursuing similar equidistant dilation, new vertices (position points on the expanded shape) are added to make the dilation result more reasonable. For example, as... Figure 6 As shown, although the expanded polygon shape is no longer similar to the original shape and the number of vertices has increased, the expansion result is more in line with actual needs.
[0095] Specifically, if D1 is greater than 2 * buffer, such as Figure 7 As shown, the target location point corresponds to two expanded location points, and the second expansion distance D2 is determined. The formulas for calculating the second expansion distance D2 and the positional deviation between the two expanded location points are:
[0096]
[0097] The positional deviation of one of the two expanded positions is:
[0098] Δx1=D2*cos(β-η)
[0099] Δy1=D2*sin(β-η)
[0100] The positional deviation of the other of the two expanded position points is:
[0101] Δx² = D² * cos(β + η)
[0102] Δy2=D2*sin(β+η)
[0103] β=∠2-α / 2
[0104] η=(π / 2-γ) / 2
[0105] α=∠2-∠1
[0106] γ=π-α / 2
[0107] Where ∠2 is the line segment p i p i+1 corresponding vector The angle relative to the positive x-axis, ∠1 is the line segment p. i p i-1 corresponding vector The vector angle described above is located in the range of [-180, 180] with respect to the angle of the positive direction of the x-axis. Δx1, Δy1 and Δx2, Δy2 are respectively the position deviations of each position point after inflation in the x-axis direction and the y-axis direction, and the remaining parameters are intermediate quantities of the operation, * represents multiplication operation.
[0108] Through the above processing, the inflated shape of the obstacle can be obtained.
[0109] In this embodiment, based on the relationship between the first inflation distance and the preset value, the target position point is inflated into one position point or two position points, and a more actual inflation shape of the obstacle can be obtained.
[0110] After obtaining the main vehicle shape and the inflated shape of the obstacle, the intersection relationship between the first line segment (any line segment in the main vehicle shape) and the second line segment (any line segment in the inflated shape) can be detected, and then based on the intersection relationship, whether the main vehicle collides with the obstacle can be detected.
[0111] For the intersection relationship of the first line segment and the second line segment, the position relationship between the end point and the line segment can be detected. That is, it can include:
[0112] 303、For the target line segment, the position relationship between the two end points of the non-target line segment and the target line segment is detected; and based on the position relationship, the intersection relationship between the first line segment and the second line segment is determined.
[0113] Among them, the target line segment is any one of the first line segment and the second line segment, and the non-target line segment is another line segment in the first line segment and the second line segment except the target line segment.
[0114] Suppose the first line segment is represented by line segment AB, and the second line segment is represented by line segment CD, then one of them can be selected as the target line segment. Assuming that the target line segment is selected as the first line segment (i.e. line segment AB), the non-target line segment is the second line segment (i.e. line segment CD).
[0115] Correspondingly, the position relationship between the two end points (i.e. end point C and end point D) of the non-target line segment and the target line segment can be detected, and the position relationship includes: whether the end point C and the end point D are located on the same side of the target line segment (line segment AB).
[0116] Further, the intersection relationship between the line segments can be determined based on the above position relationship. If the position relationship is that the two end points of the non-target line segment are located on the same side of the target line segment, it is determined that the intersection relationship is that the first line segment and the second line segment do not intersect. On the contrary, if the two end points of the non-target line segment are not located on the same side of the target line segment, the intersection relationship between the line segments can be further judged.
[0117] Specifically, referring to Figure 8 As shown in Figure 8 (a), if both the end point C and the end point D are located on the same side of the line segment AB, it is determined that the line segment AB does not intersect with the line segment CD. Or,
[0118] As shown in Figure 8 (b), for the line segment CD, if both the end point A and the end point B are located on the same side of the line segment CD, it is determined that the line segment AB does not intersect with the line segment CD. Or,
[0119] As shown in Figure 8 (c), if the end point C and the end point D are not located on the same side of the line segment AB (for example, located on both sides of the line segment AB), and the end point A and the end point B are not located on the same side of the line segment CD (for example, located on both sides of the line segment CD), it is determined that the line segment AB intersects with the line segment CD.
[0120] That is, for two line segments (a first line segment and a second line segment), if both the two end points of at least one of the two line segments are located on the same side of the other line segment, the two line segments do not intersect, otherwise, if the two end points of any one of the two line segments are located on both sides of the other line segment, the two line segments intersect.
[0121] In this embodiment, the intersection relationship between line segments can be determined based on the positional relationship between the two end points of a non-target line segment and a target line segment, and the intersection relationship between line segments can be converted into the positional relationship between the two end points of a line segment and another line segment, thereby facilitating the calculation of the intersection relationship.
[0122] Further, if the two end points of any one line segment are located on the same side of the other line segment, it can be determined that the two line segments do not intersect, thereby improving the calculation efficiency.
[0123] In some embodiments, the detection of the positional relationship between the two end points of the non-target line segment and the target line segment comprises:
[0124] For a first end point, a first vector, a second vector and a third vector are constructed; wherein the first vector is a vector of the first end point pointing to a second end point, the second vector is a vector of the first end point pointing to a third end point, and the third vector is a vector of the first end point pointing to a fourth end point, the first end point and the second end point being two end points of the target line segment, and the third end point and the fourth end point being two end points of the non-target line segment;
[0125] A first cross product value of the first vector and the second vector is determined, and a second cross product value of the first vector and the third vector is determined;
[0126] If the product of the first cross product value and the second cross product value is greater than 0, it is determined that the position relationship is that both endpoints of the non-target line segment are located on the same side of the target line segment.
[0127] wherein, let and be two-dimensional vectors, the cross product value between the two vectors satisfies the following conditions:
[0128]
[0129]
[0130] wherein, × represents the cross product operation.
[0131] Based on the above cross product relationship between vectors, the orientation of a point and a vector can be determined, i.e., whether the point is on the left side (counterclockwise direction) or the right side (clockwise direction) of the vector.
[0132] Using the above principle, it can be determined whether the two endpoints of the non-target line segment are located on the same side of the target line segment.
[0133] wherein, taking the target line segment as line segment AB and the non-target line segment as line segment CD as an example, assuming that the first endpoint is endpoint B, then the first vector is the second vector is and the third vector is
[0134] If the following conditions are met, it indicates that endpoint C and endpoint D are located on the same side of line segment AB:
[0135]
[0136] Taking as an example, the calculation formula of the cross product value is:
[0137]
[0138] Taking (A x -B x ) and (C y -B y ) as an example, A x represents the horizontal coordinate (x-axis coordinate) of endpoint A, B x represents the horizontal coordinate of endpoint B, C x represents the vertical coordinate (y-axis coordinate) of endpoint C, and B y represents the vertical coordinate of endpoint B. The rest of the parameters are similar.
[0139] The perception system of the autonomous vehicle can obtain the coordinates of the position points on the host vehicle shape, i.e., the horizontal and vertical coordinates of endpoint A (Ax A y ) and the horizontal and vertical coordinates of endpoint B (B x ,B y ). The perception system can also obtain the coordinates of the position points on the expanded shape according to the position deviation during the expansion process. Taking endpoint C as an example, endpoint C is a position point on the expanded shape, and the corresponding position point on the original shape (i.e., the shape of the obstacle) is C0. The perception system can obtain the horizontal and vertical coordinates of point C0(C0 x ,C0 y ). Assuming that the position deviation of point C relative to point C0during the expansion process is (Δx, Δy), the horizontal and vertical coordinates of endpoint C are (C x ,C y ) = (C0 x + Δx, C0 y + Δy).
[0140] After obtaining the horizontal and vertical coordinates of the relevant points, the cross product value described above can be obtained based on the horizontal and vertical coordinates of the relevant points. It can be understood that these coordinates refer to coordinates in a Cartesian coordinate system.
[0141] If the cross product relationship between the vectors satisfies the condition described above that it is greater than 0, it can be determined that both endpoints of the non-target line segment are located on the same side of the target line segment.
[0142] In addition, if the product of the first cross product value and the second cross product value is less than 0, it can be determined that both endpoints of the non-target line segment are located on the two sides of the target line segment.
[0143] In this embodiment, based on the cross product relationship between the vectors, it can be efficiently determined whether the two endpoints are located on the same side of the line segment.
[0144] Furthermore, if the two endpoints of at least one of the two line segments are located on the same side of the other line segment, it can be determined that the two line segments are not intersecting. If the two endpoints of any one of the two line segments are located on the two sides of the other line segment, it can be determined that the two line segments are intersecting.
[0145] In addition, for the case where the product of the first cross product value and the second cross product value is equal to 0, it indicates that the line segment AB and the line segment CD are parallel. In the parallel case, they can be intersecting or not intersecting, as shown in Figure 9 (a) is not intersecting, and as shown in Figure 9 (b) is intersecting.
[0146] Therefore, in the case where the two line segments are parallel, other conditions can also be combined to determine whether the line segments intersect.
[0147] Specifically, this may include: if the product of the first cross product value and the second cross product value is equal to 0, determining that the positional relationship is that the non-target line segment is parallel to the target line segment; if the positional relationship is parallel, determining a first projection value of the second vector onto the first vector, and determining a second projection value of the third vector onto the first vector; if at least one of the first projection value and the second projection value is within a preset range, determining that the first line segment and the second line segment intersect; wherein, the preset range is a range greater than or equal to 0 and less than or equal to the length of the first vector.
[0148] Taking line segment AB as an example, we can determine whether endpoints C and D fall within the range of line segment AB. If either endpoint C or D falls within the range of line segment AB, then the two segments intersect. Non-intersection means that neither endpoint of any line segment falls within the range of the other. For example, if neither endpoint C nor D falls within the range of line segment AB, and neither endpoint A nor B falls within the range of line segment CD, then line segments AB and CD are non-intersecting.
[0149] To determine whether a certain endpoint (such as endpoint C or endpoint D) falls within the range of line segment AB, the projection method can be used.
[0150] Taking determining whether endpoint C falls within the range of line segment AB as an example, we can calculate... Towards The projection value (first projection value), if the projection value is located at Within the range, It is a vector If the length of the projection is such that endpoint C falls within the range of line segment AB, then it indicates that endpoint C falls within the range of line segment AB; otherwise, if the projection value is located within the range of line segment AB... Outside the range, it indicates that endpoint C does not fall within the range of line segment AB.
[0151] The formula for calculating the first projection value is: It is located in Values within the range.
[0152] in, It is a vector The length of θ is the vector. with vector The included angle, length, and included angle can be calculated from the position coordinates of the relevant points.
[0153] In this embodiment, when the cross product between vectors is equal to 0, the intersection relationship between line segments is further determined based on the projection value, which can improve the accuracy of the intersection relationship.
[0154] 304. Based on the intersection relationship, determine the collision relationship between the main vehicle and the obstacle.
[0155] wherein, if no line segment in the host vehicle shape intersects with any line segment in the expanded obstacle shape, it is determined that the host vehicle does not collide with the obstacle; or if at least one line segment in the host vehicle shape intersects with at least one line segment in the expanded obstacle shape, it is determined that the host vehicle collides with the obstacle.
[0156] Figure 10 is a schematic diagram according to a third embodiment of the present disclosure, and the embodiment provides a collision detection apparatus, which comprises an acquisition module 1001, an expansion module 1002, a detection module 1003, and a determination module 1004.
[0157] The acquisition module 1001 is configured to acquire a host vehicle shape and an obstacle shape, the host vehicle shape comprising a plurality of line segments; the expansion module 1002 is configured to perform expansion processing on the obstacle shape to obtain an expanded obstacle shape, the expanded obstacle shape comprising a plurality of line segments; the detection module 1003 is configured to detect, for a first line segment and a second line segment, an intersection relationship between the first line segment and the second line segment, the first line segment being any line segment in the host vehicle shape, and the second line segment being any line segment in the expanded obstacle shape; and the determination module 1004 is configured to determine, based on the intersection relationship, a collision relationship between the host vehicle and the obstacle.
[0158] In the embodiment, the collision relationship between the host vehicle and the obstacle is determined based on the intersection relationship between the first line segment corresponding to the host vehicle shape and the second line segment corresponding to the obstacle shape, and since projection to a specific reference line is not required, the limitation of the specific reference line is avoided, thereby improving the accuracy of collision detection; in addition, by performing expansion processing on the obstacle shape, a certain space distance can be reserved for the boundary of the obstacle, thereby ensuring the safety of the host vehicle.
[0159] In some embodiments, the detection module 1003 is further configured to, for a target line segment, detect a positional relationship between two end points of a non-target line segment and the target line segment; and determine, based on the positional relationship, the intersection relationship between the first line segment and the second line segment; wherein the target line segment is any one of the first line segment and the second line segment, and the non-target line segment is the other line segment of the first line segment and the second line segment except the target line segment.
[0160] In the embodiment, the intersection relationship between the line segments can be determined based on the positional relationship between the two end points of the non-target line segment and the target line segment, and the intersection relationship between the line segments can be converted into the positional relationship between the two end points of a line segment and another line segment, thereby facilitating the calculation of the intersection relationship.
[0161] In some embodiments, the detection module 1003 is further configured to determine that the position relationship is that both end points of the non-target line segment are on the same side of the target line segment, and determine that the intersection relationship is that the first line segment and the second line segment do not intersect.
[0162] In this embodiment, if both end points of any line segment are on the same side of another line segment, it can be determined that the two line segments do not intersect, thereby improving the calculation efficiency.
[0163] In some embodiments, the detection module 1003 is further configured to, for a first end point, construct a first vector, a second vector and a third vector, wherein the first vector is a vector of the first end point pointing to a second end point, the second vector is a vector of the first end point pointing to a third end point, and the third vector is a vector of the first end point pointing to a fourth end point, the first end point and the second end point being two end points of the target line segment, and the third end point and the fourth end point being two end points of the non-target line segment; determine a first cross product value of the first vector and the second vector, and a second cross product value of the first vector and the third vector; and determine that the position relationship is that both end points of the non-target line segment are on the same side of the target line segment if the product of the first cross product value and the second cross product value is greater than 0.
[0164] In this embodiment, based on the cross product relationship between vectors, it can be efficiently determined whether two end points are on the same side of a line segment.
[0165] In some embodiments, the detection module 1003 is further configured to determine that the position relationship is that the non-target line segment and the target line segment are parallel if the product of the first cross product value and the second cross product value is equal to 0; and the determination module 1004 is further configured to, if the position relationship is parallel, determine a first projection value of the second vector on the first vector, and determine a second projection value of the third vector on the first vector; and determine that the first line segment and the second line segment intersect if at least one of the first projection value and the second projection value is within a preset range, wherein the preset range is a range greater than or equal to 0 and less than or equal to the length of the first vector.
[0166] In this embodiment, when the cross product between vectors is equal to 0, the intersection relationship between line segments is further determined based on the projection value, which can improve the accuracy of the intersection relationship.
[0167] It can be understood that the same or similar content in different embodiments in the embodiments of the present disclosure can be mutually referred to.
[0168] It can be understood that "first", "second" and the like in the embodiments of the present disclosure are only used for distinction, and do not represent the importance level, time sequence and the like.
[0169] In the technical solutions of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information comply with relevant laws and regulations and do not violate public order and good customs.
[0170] According to an embodiment of the present disclosure, as shown in Figure 11 The present disclosure also provides an autonomous vehicle 1100, which comprises an electronic device 1101. The description of the electronic device 1101 can refer to the subsequent embodiments.
[0171] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0172] Figure 12 A schematic block diagram of an example electronic device 1200 that can be used to implement embodiments of the present disclosure is shown. The electronic device 1200 is intended to represent various forms of digital computers, such as laptops, desktops, tablets, servers, blades, mainframes, and other appropriate computers. The electronic device 1200 can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present disclosure described and / or claimed in this document.
[0173] As shown in Figure 12 The electronic device 1200 includes a computing unit 1201 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 1202 or a computer program loaded from a storage unit 12012 into a random access memory (RAM) 1203. Various programs and data required for the operation of the electronic device 1200 can also be stored in the RAM 1203. The computing unit 1201, the ROM 1202, and the RAM 1203 are connected to each other through a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0174] Various components in the electronic device 1200 are connected to the I / O interface 1205, including an input unit 1206, such as a keyboard, a mouse, etc., an output unit 1207, such as various types of displays, a speaker, etc., a storage unit 1208, such as a magnetic disk, an optical disk, etc., and a communication unit 1209, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1209 allows the electronic device 1200 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0175] The computing unit 1201 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 1201 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1201 performs various methods and processes described above, such as the collision detection method. For example, in some embodiments, the collision detection method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 1208. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 1200 via the ROM 1202 and / or the communication unit 1209. When the computer program is loaded onto the RAM 1203 and executed by the computing unit 1201, one or more steps of the collision detection method described above can be performed. Alternatively, in other embodiments, the computing unit 1201 can be configured to perform the collision detection method by any other suitable means, such as by means of firmware.
[0176] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0177] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable logic device to produce a machine, such that the program code, when executed by the processor or controller, enables the functional operations specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0178] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0179] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0180] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0181] The computer system can include clients and servers. This relationship can be. remote, where each server is stored on a remote computer from a client. The clients and the servers can be connected through a communication network. The relationship can be a client-server relationship over a network. Servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are a host product in the cloud computing service system. The servers can be servers of a distributed system, or servers combined with a blockchain.
[0182] It should be understood that the various forms of flow shown above can be reordered, steps added or removed. For example, the steps described in the present disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions of the present disclosure can be achieved, which are not limited herein.
[0183] The above detailed description does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A collision detection method, comprising: obtaining a host vehicle shape and an obstacle shape, the host vehicle shape and the obstacle shape each comprising a plurality of line segments; performing inflation processing on the obstacle shape to obtain an inflated shape, the inflated shape comprising a plurality of line segments; for a target position point on the obstacle shape, if a first inflation distance is less than or equal to a preset value, the target position point corresponds to one inflated position point, if the first inflation distance is greater than the preset value, the target position point corresponds to two inflated position points, the first inflation distance being determined based on a preset inflation width and an included angle of adjacent two line segments corresponding to the target position point; for a first line segment and a second line segment, detecting an intersection relationship between the first line segment and the second line segment, the first line segment being any one of the line segments in the host vehicle shape, the second line segment being any one of the line segments in the inflated shape; based on the intersection relationship, determining a collision relationship between the host vehicle and the obstacle, comprising: if the first line segment and the second line segment are not intersected, determining that the host vehicle and the obstacle do not collide; or, if the first line segment and the second line segment are intersected, determining that the host vehicle and the obstacle collide. The detection of the intersection relationship between the first line segment and the second line segment comprises:
2. The method of claim 1, wherein, for a target line segment, detecting a position relationship between two end points of a non-target line segment and the target line segment; based on the position relationship, determining the intersection relationship between the first line segment and the second line segment; wherein the target line segment is any one of the first line segment and the second line segment, and the non-target line segment is another line segment except the target line segment among the first line segment and the second line segment. The determination of the intersection relationship between the first line segment and the second line segment based on the position relationship comprises:
3. The method of claim 2, wherein, if the position relationship is that the two end points of the non-target line segment are located on the same side of the target line segment, determining that the intersection relationship is that the first line segment and the second line segment are not intersected. The detection of the position relationship between the two end points of the non-target line segment and the target line segment comprises:
4. The method of claim 2, wherein, for a first end point, constructing a first vector, a second vector and a third vector; wherein the first vector is a vector of the first end point pointing to a second end point, the second vector is a vector of the first end point pointing to a third end point, and the third vector is a vector of the first end point pointing to a fourth end point, the first end point and the second end point being two end points of the target line segment, and the third end point and the fourth end point being two end points of the non-target line segment; determining a first cross product value of the first vector and the second vector, and a second cross product value of the first vector and the third vector; if a product of the first cross product value and the second cross product value is greater than 0, determining that the position relationship is that the two end points of the non-target line segment are located on the same side of the target line segment. 5.The method of claim 4, wherein the detection of the position relationship between the two end points of the non-target line segment and the target line segment further comprises: determining that the position relation is that the non-target line segment is parallel to the target line segment, if a product of the first cross product value and the second cross product value is equal to 0; Correspondingly, the determining, based on the position relation, of the intersection relation between the first line segment and the second line segment comprises: if the position relation is parallel, determining a first projection value of the second vector onto the first vector, and determining a second projection value of the third vector onto the first vector; if at least one of the first projection value and the second projection value is within a preset range, determining that the first line segment and the second line segment are intersected; wherein the preset range is a range greater than or equal to 0 and less than or equal to a length of the first vector.
6. The method according to any one of claims 1 to 5, wherein, The inflation processing of the shape of the obstacle comprises: for a target position point on the shape of the obstacle, determining a first inflation distance based on a preset inflation width and an included angle of two adjacent line segments corresponding to the target position point; if the first inflation distance is less than or equal to a preset value, determining that the target position point corresponds to one inflated position point, and determining a position deviation of the one inflated position point relative to the target position point based on the first inflation distance; or, if the first inflation distance is greater than the preset value, determining that the target position point corresponds to two inflated position points, determining a second inflation distance based on the inflation width, and determining a position deviation of each inflated position point relative to the target position point based on the second inflation distance.
7. A collision detection apparatus, comprising: an acquisition module configured to acquire a host vehicle shape and an obstacle shape, the host vehicle shape and the obstacle shape each comprising a plurality of line segments; an inflation module configured to perform inflation processing on the obstacle shape to obtain an inflated shape, the inflated shape comprising a plurality of line segments; for a target position point on the obstacle shape, if a first inflation distance is less than or equal to a preset value, the target position point corresponds to one inflated position point, and if the first inflation distance is greater than the preset value, the target position point corresponds to two inflated position points, the first inflation distance being determined based on a preset inflation width and an included angle of two adjacent line segments corresponding to the target position point; a detection module configured to, for a first line segment and a second line segment, detect an intersection relation between the first line segment and the second line segment, the first line segment being any one of the line segments in the host vehicle shape, and the second line segment being any one of the line segments in the inflated shape; a determination module configured to determine a collision relation between a host vehicle and an obstacle based on the intersection relation, comprising: if the first line segment and the second line segment are both not intersected, determining that the host vehicle and the obstacle do not collide; or, if the first line segment and the second line segment are intersected, determining that the host vehicle and the obstacle collide. The detection module is further configured to:
8. The apparatus of claim 7, wherein, for a target line segment, detect a position relation of two end points of a non-target line segment relative to the target line segment; determine the intersection relation between the first line segment and the second line segment based on the position relation; The target line segment is any one of the first line segment and the second line segment, and the non-target line segment is the other line segment of the first line segment and the second line segment except the target line segment.
9. The apparatus of claim 8, wherein, The detection module is further configured to: If the position relationship is that both end points of the non-target line segment are located on the same side of the target line segment, it is determined that the intersection relationship is that the first line segment and the second line segment are not intersected.
10. The apparatus of claim 8, wherein, The detection module is further configured to: For the first end point, a first vector, a second vector and a third vector are constructed, wherein the first vector is a vector of the first end point pointing to the second end point, the second vector is a vector of the first end point pointing to the third end point, and the third vector is a vector of the first end point pointing to the fourth end point, the first end point and the second end point being two end points of the target line segment, and the third end point and the fourth end point being two end points of the non-target line segment; A first cross product value of the first vector and the second vector and a second cross product value of the first vector and the third vector are determined; If the product of the first cross product value and the second cross product value is greater than 0, it is determined that the position relationship is that both end points of the non-target line segment are located on the same side of the target line segment.
11. The apparatus of claim 10, wherein The detection module is further configured to: if the product of the first cross product value and the second cross product value is equal to 0, it is determined that the position relationship is that the non-target line segment is parallel to the target line segment. Correspondingly, the determination module is further configured to: If the position relationship is parallel, a first projection value of the second vector on the first vector and a second projection value of the third vector on the first vector are determined; If at least one of the first projection value and the second projection value is within a preset range, it is determined that the first line segment and the second line segment are intersected, wherein the preset range is a range greater than or equal to 0 and less than or equal to the length of the first vector.
12. The apparatus of any one of claims 7-11, wherein, The expansion module is further configured to: For a target position point on the shape of the obstacle, based on a preset expansion width and an included angle of two adjacent line segments corresponding to the target position point, a first expansion distance is determined; If the first expansion distance is less than or equal to a preset value, it is determined that the target position point corresponds to one expanded position point, and a position deviation of the one expanded position point relative to the target position point is determined based on the first expansion distance; or If the first expansion distance is greater than a preset value, it is determined that the target position point corresponds to two expanded position points, a second expansion distance is determined based on the expansion width, and a position deviation of each expanded position point relative to the target position point is determined based on the second expansion distance.
13. An electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-6.
16. An autonomous vehicle, comprising: The electronic device of claim 13.
Citation Information
Patent Citations
Automatic parking path obstacle collision detection method, device and system
CN107672588A
Preventive safety device for vehicle
JP1995065294A