Relative position determination method and device, equipment and storage medium
By calculating the projection distance from the vehicle to the lane line and using vector computing to determine the vehicle position, the accuracy problem of determining the relative position between the vehicle and the lane in the prior art is solved, and the decision-making accuracy and driving safety of autonomous driving are improved.
Patent Information
- Application Number
- CN202411680625.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art has accuracy problems when determining the projection point of a vehicle to the lane. Especially when the projection point is located on the lane extension line, it is impossible to accurately determine whether the projection point falls in the lane, which affects the refined decisions of autonomous driving.
By obtaining the starting point coordinates, end point coordinates and vehicle coordinates of the lane line, the projection distance between the vehicle and the lane line is calculated, and the position of the vehicle relative to the lane is judged by vector calculation and angle cosine value, thereby accurately calculating the projection distance.
Improves the accuracy of determining the relative position between the vehicle and the lane, provides accurate data to support intelligent driving or vehicle navigation applications, and enhances driving safety.
Smart Images

Figure CN119502955A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of autonomous driving technology, and in particular to a relative position determination method, device, equipment and storage medium. Background Art
[0002] In the field of intelligent transportation systems, calculating the projection distance based on the projection point from the vehicle to the lane is one of the key technologies for determining the relative position of the vehicle and the lane. However, existing technical methods have some limitations in determining the projection point from the vehicle to the lane. For example, according to existing methods, when the projection point is located on the extension line of the lane, the projection distance from the vehicle to the lane can only be simply marked as "0" or as a line segment length. Based on the projection distance, it is impossible to accurately determine whether the projection point actually falls within the lane, resulting in the inability to accurately determine the relative position of the vehicle and the lane, which constitutes an obstacle to the realization of refined decision-making for autonomous driving.
[0003] Therefore, how to improve the accuracy of determining the relative position between the vehicle and the lane is a problem that needs to be solved urgently.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present application is to provide a relative position determination method, device, equipment and storage medium, aiming to solve the technical problem of how to improve the accuracy of relative position determination between a vehicle and a lane.
[0006] To achieve the above object, the present application provides a relative position determination method, the relative position determination method comprising:
[0007] Get the starting coordinates of the lane line, the end coordinates of the lane line and the vehicle coordinates;
[0008] The projection distance from the vehicle to the lane line is calculated according to the starting point coordinates of the lane line, the ending point coordinates of the lane line and the vehicle coordinates.
[0009] In one embodiment, the step of calculating the projection distance from the vehicle to the lane line according to the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates comprises:
[0010] Calculate a first vector from the starting point coordinates of the lane line to the vehicle coordinates according to the starting point coordinates of the lane line and the vehicle coordinates;
[0011] Calculate a lane line vector from the starting point coordinates of the lane line to the ending point coordinates of the lane line according to the starting point coordinates of the lane line and the ending point coordinates of the lane line;
[0012] Calculate a first angle cosine value according to the first vector and the lane line vector;
[0013] The projection distance from the vehicle to the lane line is calculated according to the cosine value of the first angle, the starting point coordinates of the lane line and the vehicle coordinates.
[0014] In one embodiment, the step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the first angle, the starting point coordinates of the lane line and the vehicle coordinates comprises:
[0015] If the cosine value of the first angle is less than zero, it is determined that the vehicle is located outside the starting point of the lane;
[0016] A projection distance from the vehicle to the lane is calculated based on the first vector and the lane line vector.
[0017] In one embodiment, the step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the first angle, the starting point coordinates of the lane line and the vehicle coordinates comprises:
[0018] If the cosine value of the first angle is greater than or equal to zero, it is determined that the vehicle is located inside the starting point of the lane;
[0019] The projection distance from the vehicle to the lane is calculated according to the starting point coordinates of the lane line, the vehicle coordinates and the cosine value of the first angle.
[0020] In one embodiment, the step of calculating the projection distance from the vehicle to the lane line according to the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates comprises:
[0021] Calculate a second vector from the end point coordinates of the lane line to the vehicle coordinates according to the end point coordinates of the lane line and the vehicle coordinates;
[0022] Calculate a cosine value of a second angle according to the second vector and the lane line vector;
[0023] The projection distance from the vehicle to the lane line is calculated according to the cosine value of the second angle, the end point coordinates of the lane line and the vehicle coordinates.
[0024] In one embodiment, the step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the second angle, the end point coordinates of the lane line and the vehicle coordinates comprises:
[0025] If the cosine value of the second angle is less than zero, it is determined that the vehicle is located outside the end point of the lane;
[0026] The projection distance from the vehicle to the lane is calculated according to the second vector and the lane line vector.
[0027] In one embodiment, the step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the second angle, the end point coordinates of the lane line and the vehicle coordinates comprises:
[0028] If the cosine value of the second angle is greater than or equal to zero, it is determined that the vehicle is located inside the end point of the lane;
[0029] The projection distance from the vehicle to the lane is calculated according to the starting point coordinates of the lane line, the vehicle coordinates and the cosine value of the first angle.
[0030] In addition, to achieve the above-mentioned purpose, the present application also provides a relative position determination device, the relative position determination device comprising:
[0031] An acquisition module, used to acquire the starting coordinates of the lane line, the ending coordinates of the lane line and the vehicle coordinates;
[0032] The distance calculation module is used to calculate the projection distance from the vehicle to the lane line according to the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates.
[0033] In addition, to achieve the above-mentioned purpose, the present application also proposes a relative position determination device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the relative position determination method described above.
[0034] In addition, to achieve the above-mentioned purpose, the present application also provides a storage medium, which is a computer-readable storage medium, and a program for implementing the relative position determination method is stored on the computer-readable storage medium. The program for implementing the relative position determination method is executed by a processor to implement the steps of the relative position determination method as described above.
[0035] The present application provides a relative position determination method. By acquiring lane coordinates and vehicle coordinates in real time, the present application can accurately calculate the projection distance from the vehicle to the lane, thereby improving the accuracy of determining the relative position of the vehicle and the lane, and providing accurate data support for applications such as intelligent driving or vehicle navigation.
[0036] In summary, the present application improves the accuracy of determining the relative position of the vehicle and the lane by accurately calculating the projection distance from the vehicle to the lane, provides accurate reference information for applications such as path planning of autonomous driving vehicles, and helps to improve driving safety. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0039] Figure 1 A schematic diagram of a flow chart provided for the first embodiment of the relative position determination method of the present application;
[0040] Figure 2 A schematic diagram of the relative position between a vehicle and a lane in the relative position determination method of the present application;
[0041] Figure 3 This is a schematic diagram of the module structure of the relative position determination device according to an embodiment of the present application;
[0042] Figure 4 Schematic diagram of the device structure of the hardware operating environment involved in the relative position determination method in the embodiment of the present application.
[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0046] The main solution of this application is: obtain the starting coordinates of the lane line, the end coordinates of the lane line and the vehicle coordinates; calculate the projection distance from the vehicle to the lane line based on the starting coordinates of the lane line, the end coordinates of the lane line and the vehicle coordinates.
[0047] In the field of intelligent transportation systems, calculating the projection distance based on the projection point from the vehicle to the lane is one of the key technologies for determining the relative position of the vehicle and the lane. However, existing technical methods have some limitations in determining the projection point from the vehicle to the lane. For example, according to existing methods, when the projection point is located on the extension line of the lane, the projection distance from the vehicle to the lane can only be simply marked as "0" or as a line segment length. Based on the projection distance, it is impossible to accurately determine whether the projection point actually falls within the lane, resulting in the inability to accurately determine the relative position of the vehicle and the lane, which constitutes an obstacle to the realization of refined decision-making for autonomous driving.
[0048] In addition, the existing calculation methods often involve complex mathematical operations and logical judgments when determining the projection distance from the vehicle to the lane when the projection point is located on the extension line of the lane. This not only increases the complexity of the calculation, but also affects the real-time performance and response speed of the system. In a high-speed and dynamic traffic environment, this delay may have a negative impact on the decision-making efficiency of autonomous driving. Therefore, how to improve the accuracy of determining the relative position of the vehicle and the lane is a problem that needs to be solved urgently.
[0049] This application improves the accuracy of determining the relative position of the vehicle and the lane by accurately calculating the projection distance from the vehicle to the lane, provides accurate reference information for applications such as path planning of autonomous driving vehicles, and helps to improve driving safety.
[0050] It should be noted that the execution subject of this embodiment can be a relative position determination system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a relative position determination device capable of realizing the above functions, etc., and this embodiment does not specifically limit this. The following takes the relative position determination system as the execution subject as an example to illustrate this embodiment and the following embodiments.
[0051] Based on this, the present application proposes a relative position determination method of the first embodiment, please refer to Figure 1 , the relative position determination method comprises steps S10 to S20:
[0052] Step S10, obtaining the starting coordinates of the lane line, the ending coordinates of the lane line and the vehicle coordinates;
[0053] It should be noted that a lane is defined by two or more points, such as the start and end of a lane; or in a specific lane scenario, such as an intersection or a turning intersection, several points can be selected to define the lane for the corresponding lane scenario. The coordinates of these points are used as lane coordinates and can be obtained through map data, GPS positioning or other sensors. The coordinates of the vehicle's current position can be achieved through the vehicle's GPS system, on-board sensors (such as lidar, cameras, etc.) or communication with other traffic infrastructure.
[0054] Step S20, calculating a projection distance from the vehicle to the lane line according to the starting point coordinates of the lane line, the ending point coordinates of the lane line and the vehicle coordinates.
[0055] It should be noted that based on the coordinates of the lane and the vehicle, the relative position of the vehicle with respect to the lane can be determined, including whether the vehicle is completely in the lane, partially in the lane, or outside the lane.
[0056] Further, refer to Figure 2 , through vector operations, the angle angle1 (angle 1) between the vehicle to the lane start vector and the lane start vector to the lane end vector and the angle angle2 (angle 2) between the vehicle to the lane end vector and the lane start vector to the lane end vector can be calculated. According to the size and positive and negative of the angle, it can be determined whether the vehicle is inside the lane, outside the lane start vector or outside the lane end vector.
[0057] In order to calculate the projection distance, it is first necessary to determine the projection point of the vehicle on the lane. The projection point is the closest point of the vehicle on the lane in a direction perpendicular to the lane, and the projection point is different depending on the position of the vehicle relative to the lane.
[0058] If the vehicle is inside or on the lane, the projection point of the vehicle relative to the lane is the point on the lane closest to the vehicle. In this case, the projection distance is the vertical distance from the vehicle to the edge of the lane. The projection distance can be obtained by calculating the relationship between the vehicle and the lane direction vector.
[0059] If the vehicle is outside the lane start point or lane end point, the projection point of the vehicle relative to the lane corresponds to the lane start point or lane end point, and the projection distance is the distance from the vehicle to the lane start point or the lane end point.
[0060] This embodiment provides a relative position determination method. By acquiring lane coordinates and vehicle coordinates in real time, this embodiment can accurately calculate the projection distance from the vehicle to the lane, thereby improving the accuracy of determining the relative position of the vehicle and the lane, and providing accurate data support for applications such as intelligent driving or vehicle navigation.
[0061] In summary, the present application improves the accuracy of determining the relative position of the vehicle and the lane by accurately calculating the projection distance from the vehicle to the lane, provides accurate reference information for applications such as path planning of autonomous driving vehicles, and helps to improve driving safety.
[0062] In a feasible implementation manner, the lane coordinates include the starting point coordinates of the lane line and the ending point coordinates of the lane line, and step S20 may include steps S201 to S204:
[0063] Step S201, calculating a first vector from the starting point coordinates of the lane line to the vehicle coordinates according to the starting point coordinates of the lane line and the vehicle coordinates;
[0064] Step S202, calculating a lane line vector from the starting point coordinates of the lane line to the ending point coordinates of the lane line according to the starting point coordinates of the lane line and the ending point coordinates of the lane line;
[0065] Step S203, calculating a first angle cosine value according to the first vector and the lane line vector;
[0066] Step S204: Calculate the projection distance from the vehicle to the lane line according to the cosine value of the first angle, the starting point coordinates of the lane line, and the vehicle coordinates.
[0067] It should be noted that, refer to Figure 2 , the starting coordinates of the lane line are marked as P2 (x1, y1), the end coordinates of the lane line are marked as P3 (x2, y2), and the vehicle coordinates are marked as P1 (p1, p2). The first vector from the starting coordinates of the lane line to the vehicle coordinates is (v1_x, v1_y) = (p1–x1, p2–y1), and the lane line vector from the starting coordinates of the lane line to the end coordinates of the lane line is (v2_x, v2_y) = (x2–x1, y2–y1).
[0068] Calculate the cosine value of the first angle formed between the first vector and the lane line vector (the direction is the vector direction), as shown in the following formula:
[0069]
[0070] If the cosine value of the first angle is less than zero, the vehicle is judged to be outside the starting point of the lane. If the cosine value of the first angle is greater than or equal to zero, the vehicle is judged to be inside the starting point of the lane. According to the different positions of the vehicle, the projection distance from the vehicle to the lane line can be calculated by combining the cosine value of the first angle, the starting point coordinates of the lane line and the vehicle coordinates.
[0071] In this embodiment, by using the vector method, since the vector calculation does not depend on the specific lane shape or direction, for any shape and direction of the lane, as long as the coordinates of the starting point and the end point can be determined, the cosine value of the direction angle of the vehicle relative to the lane can be accurately calculated, and then the projection distance from the vehicle to the lane line can be calculated, thereby reducing the calculation complexity and improving the accuracy of determining the relative position of the vehicle and the lane.
[0072] In a feasible implementation, step S204 may include steps S2041 to S2042:
[0073] Step S2041: if the cosine value of the first angle is less than zero, it is determined that the vehicle is located outside the starting point of the lane;
[0074] It should be noted that the cosine value of the angle between the first vector (the vector from the lane start point to the vehicle) and the lane line vector (the vector from the lane start point to the lane end point) is calculated based on the starting coordinates of the lane line, the vehicle coordinates, and the end coordinates of the lane line. When the cosine value of the first angle is less than zero, it means that the angle between the two vectors is greater than 90 degrees. Since the first vector points from the lane start point to the vehicle, and the lane line vector points from the lane start point to the lane end point, if the cosine value of the angle between the two vectors is less than zero, it means that the directions of the two vectors are opposite, and the vehicle is located outside the lane start point.
[0075] Step S2042: Calculate the projection distance from the vehicle to the lane according to the first vector and the lane line vector.
[0076] It should be noted that if the vehicle is outside the starting point of the lane, the projection point of the vehicle relative to the lane is the starting point of the lane, the starting coordinates of the lane line are P2 (x1, y1), the vehicle coordinates are P1 (p1, p2), and the projection distance is the distance from the vehicle to the starting point of the lane, that is:
[0077]
[0078] In addition, after the projection point is determined to be the starting point of the lane, the corresponding projection point mode can be set to facilitate classification, management or understanding of the projection point when making subsequent autonomous driving decisions.
[0079] In this implementation, the cosine value of the angle is used as the basis for judging the relative position of the lane and the vehicle, which simplifies the logical processing process and reduces the amount of calculation and error rate compared to complex geometric calculations or image recognition. By combining the starting coordinates of the lane line, the vehicle coordinates and the cosine value of the angle, the projection distance from the vehicle to the lane can be accurately calculated. As a quantitative indicator, the projection distance can intuitively reflect the relative position relationship between the vehicle and the lane, thereby improving the accuracy of determining the relative position of the vehicle and the lane, providing accurate data support for applications such as intelligent driving or vehicle navigation, and helping to improve driving safety.
[0080] In a feasible implementation, step S204 may include steps S2043 to S2044:
[0081] Step S2043: if the cosine value of the first angle is greater than or equal to zero, it is determined that the vehicle is located inside the starting point of the lane;
[0082] It should be noted that the cosine value of the angle between the first vector (the vector from the lane start point to the vehicle) and the lane line vector (the vector from the lane start point to the lane end point) is calculated based on the starting coordinates of the lane line, the vehicle coordinates, and the end coordinates of the lane line. When the cosine value of the first angle is greater than or equal to zero, it means that the angle between the two vectors is less than or equal to 90 degrees. Since the first vector points from the lane start point to the vehicle, and the lane line vector points from the lane start point to the lane end point, if the cosine value of the angle between the two vectors is greater than or equal to zero, it means that the directions of the two vectors are the same or similar, and the vehicle is located inside the lane start point.
[0083] Step S2044, calculating the projection distance from the vehicle to the lane according to the starting point coordinates of the lane line, the vehicle coordinates and the cosine value of the first angle.
[0084] It should be noted that if the vehicle is located inside the starting point of the lane, that is, the vehicle is inside or on the lane, the projection point of the vehicle relative to the lane is a point on the lane closest to the vehicle. At this time, the projection distance is the vertical distance from the vehicle to the edge of the lane. The starting coordinates of the lane are P2 (x1, y1), and the vehicle coordinates are P1 (p1, p2). The projection distance can be obtained by calculating the relationship between the vehicle and the lane vector, that is:
[0085]
[0086] In addition, after determining that the projection point is on the lane, the corresponding projection point mode can be set to classify, manage or understand the projection point when making subsequent autonomous driving decisions.
[0087] In this implementation, the cosine value of the angle is used as the basis for judging the relative position of the lane and the vehicle, which simplifies the logical processing process and reduces the amount of calculation and error rate compared to complex geometric calculations or image recognition. By combining the starting coordinates of the lane line, the vehicle coordinates and the cosine value of the angle, the projection distance from the vehicle to the lane can be accurately calculated. As a quantitative indicator, the projection distance can intuitively reflect the relative position relationship between the vehicle and the lane, thereby improving the accuracy of determining the relative position of the vehicle and the lane, providing accurate data support for applications such as intelligent driving or vehicle navigation, and helping to improve driving safety.
[0088] In a feasible implementation, step S20 may include steps S205 to S207:
[0089] Step S205, calculating a second vector from the end point coordinates of the lane line to the vehicle coordinates according to the end point coordinates of the lane line and the vehicle coordinates;
[0090] Step S206, calculating a second angle cosine value according to the second vector and the lane line vector;
[0091] Step S207: Calculate the projection distance from the vehicle to the lane line according to the cosine value of the second angle, the end point coordinates of the lane line, and the vehicle coordinates.
[0092] It should be noted that, refer to Figure 2 , the starting coordinate of the lane line is marked as P2 (x1, y1), the end coordinate of the lane line is marked as P3 (x2, y2), and the vehicle coordinate is marked as P1 (p1, p2). The second vector from the end coordinate of the lane line to the vehicle coordinate is (v3_x, v3_y) = (p1–x2, p2–y2), and the lane line vector from the starting coordinate of the lane line to the end coordinate of the lane line is (v2_x, v2_y) = (x2–x1, y2–y1).
[0093] Calculate the cosine value of the second angle formed between the second vector and the lane line vector (the direction is the vector direction), as shown in the following formula:
[0094]
[0095] When analyzing the second angle angle2 formed by the second vector and the lane line vector, for logical consistency, the complementary angle angle2' (angle 2') of angle2 can be used. Since the cosine function has symmetry, that is, cos(θ) = cos(π-θ), where θ is an angle and π is pi, cos_angle2' = cos_angle2, cos_angle2' can be used to more intuitively represent the relative position of the vehicle and the lane.
[0096] If the cosine value of the second angle is less than zero, it is determined that the vehicle is located outside the starting point of the lane. If the cosine value of the second angle is greater than or equal to zero, it is determined that the vehicle is located inside the starting point of the lane.
[0097] In this embodiment, by using the vector method, since the vector calculation does not depend on the specific lane shape or direction, for any shape and direction of the lane, as long as the coordinates of the starting point and the end point can be determined, the cosine value of the direction angle of the vehicle relative to the lane can be accurately calculated, thereby reducing the calculation complexity and improving the accuracy of determining the relative position of the vehicle and the lane.
[0098] In a feasible implementation manner, step S207 may include steps S2071 to S2072:
[0099] Step S2071: if the cosine value of the second angle is less than zero, it is determined that the vehicle is located outside the end point of the lane;
[0100] It should be noted that the cosine value of the angle between the second vector (the vector from the lane end point to the vehicle) and the lane line vector (the vector from the lane start point to the lane end point) is calculated based on the starting coordinates of the lane line, the vehicle coordinates, and the end coordinates of the lane line. When the cosine value of the second angle is less than zero, it means that the angle between the two vectors is greater than 90 degrees. Since the second vector points from the lane end point to the vehicle, and the lane line vector points from the lane start point to the lane end point, if the cosine value of the angle between the two vectors is less than zero, it means that the directions of the two vectors are opposite, and the vehicle is located outside the lane end point.
[0101] Step S2072: Calculate the projection distance from the vehicle to the lane based on the second vector and the lane line vector.
[0102] It should be noted that if the vehicle is outside the end of the lane, the projection point of the vehicle relative to the lane is the end of the lane, the end coordinates of the lane line are P3 (x2, y2), the vehicle coordinates are P1 (p1, p2), and the projection distance is the distance from the vehicle to the end of the lane, that is:
[0103]
[0104] In addition, after determining that the projection point is the end point of the lane, the corresponding projection point mode can be set to facilitate classification, management or understanding of the projection point when making subsequent autonomous driving decisions.
[0105] In this implementation, the cosine value of the angle is used as the basis for judging the relative position of the lane and the vehicle, which simplifies the logical processing process and reduces the amount of calculation and error rate compared to complex geometric calculations or image recognition. By combining the starting coordinates of the lane line, the vehicle coordinates and the cosine value of the angle, the projection distance from the vehicle to the lane can be accurately calculated. As a quantitative indicator, the projection distance can intuitively reflect the relative position relationship between the vehicle and the lane, thereby improving the accuracy of determining the relative position of the vehicle and the lane, providing accurate data support for applications such as intelligent driving or vehicle navigation, and helping to improve driving safety.
[0106] In a feasible implementation manner, step S207 may include steps S2073 to S2074:
[0107] Step S2073: if the cosine value of the second angle is greater than or equal to zero, it is determined that the vehicle is located inside the end of the lane;
[0108] It should be noted that the cosine value of the angle between the second vector (the vector from the lane end point to the vehicle) and the lane line vector (the vector from the lane start point to the lane end point) is calculated based on the starting coordinates of the lane line, the vehicle coordinates, and the end coordinates of the lane line. When the cosine value of the second angle is greater than or equal to zero, it means that the angle between the two vectors is less than or equal to 90 degrees. Since the second vector points from the lane end point to the vehicle, and the lane line vector points from the lane start point to the lane end point, if the cosine value of the angle between the two vectors is greater than or equal to zero, it means that the directions of the two vectors are the same or similar, and the vehicle is located inside the lane start point.
[0109] Step S2074, calculating the projection distance from the vehicle to the lane according to the starting point coordinates of the lane line, the vehicle coordinates and the cosine value of the first angle.
[0110] It should be noted that if the vehicle is located inside the starting point of the lane, that is, the vehicle is inside or on the lane, the projection point of the vehicle relative to the lane is a point on the lane closest to the vehicle. At this time, the projection distance is the vertical distance from the vehicle to the edge of the lane. The starting coordinates of the lane are P2 (x1, y1), and the vehicle coordinates are P1 (p1, p2). The projection distance can be obtained by calculating the relationship between the vehicle and the lane vector, that is:
[0111]
[0112] In addition, after determining that the projection point is on the lane, the corresponding projection point mode can be set to classify, manage or understand the projection point when making subsequent autonomous driving decisions.
[0113] In this implementation, the cosine value of the angle is used as the basis for judging the relative position of the lane and the vehicle, which simplifies the logical processing process and reduces the amount of calculation and error rate compared to complex geometric calculations or image recognition. By combining the starting coordinates of the lane line, the vehicle coordinates and the cosine value of the angle, the projection distance from the vehicle to the lane can be accurately calculated. As a quantitative indicator, the projection distance can intuitively reflect the relative position relationship between the vehicle and the lane, thereby improving the accuracy of determining the relative position of the vehicle and the lane, providing accurate data support for applications such as intelligent driving or vehicle navigation, and helping to improve driving safety.
[0114] The present application also provides a relative position determination device. Figure 3 , the relative position determining device comprises:
[0115] An acquisition module 10 is used to acquire the starting coordinates of the lane line, the ending coordinates of the lane line and the vehicle coordinates;
[0116] The distance calculation module 20 is used to calculate the projection distance from the vehicle to the lane line according to the starting coordinates of the lane line, the ending coordinates of the lane line and the vehicle coordinates.
[0117] The relative position determination device provided in the embodiment of the present application adopts the relative position determination method in the above embodiment, which can solve the technical problem of relative position determination. Compared with the prior art, the beneficial effects of the relative position determination device provided in the embodiment of the present application are the same as the beneficial effects of the relative position determination method provided in the above embodiment, and other technical features in the relative position determination device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0118] The present application provides a relative position determination device, which includes: at least one processor; and a memory communicatively connected to 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 so that the at least one processor can execute the relative position determination method in the above-mentioned embodiment one.
[0119] Reference below Figure 4, which shows a schematic diagram of the structure of a relative position determination device suitable for implementing the embodiments of the present application. The relative position determination device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The relative position determination device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0120] like Figure 4 As shown, the relative position determination device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the relative position determination device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the relative position determination device to communicate with other devices wirelessly or wired to exchange data. Although the relative position determination device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0121] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0122] The relative position determination device provided by the present application adopts the relative position determination method in the above embodiment, which can solve the technical problem of relative position determination. Compared with the prior art, the beneficial effects of the relative position determination device provided by the present application are the same as the beneficial effects of the relative position determination method provided by the above embodiment, and other technical features in the relative position determination device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0123] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0124] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0125] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the relative position determination method in the above-mentioned embodiment.
[0126] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0127] The computer-readable storage medium may be included in the relative position determination device; or may exist independently without being assembled into the relative position determination device.
[0128] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the relative position determination device, the relative position determination device: obtains the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates; calculates the projection distance from the vehicle to the lane line based on the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates.
[0129] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0131] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0132] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above relative position determination method, and can solve the technical problem of relative position determination. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the relative position determination method provided in the above embodiment, and will not be repeated here.
[0133] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A relative position determination method, characterized in that: The relative position determination method comprises: Get the starting coordinates of the lane line, the end coordinates of the lane line and the vehicle coordinates; The projection distance from the vehicle to the lane line is calculated according to the starting point coordinates of the lane line, the ending point coordinates of the lane line and the vehicle coordinates.
2. The method according to claim 1, characterized in that The step of calculating the projection distance from the vehicle to the lane line according to the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates comprises: Calculate a first vector from the starting point coordinates of the lane line to the vehicle coordinates according to the starting point coordinates of the lane line and the vehicle coordinates; Calculate a lane line vector from the starting point coordinates of the lane line to the ending point coordinates of the lane line according to the starting point coordinates of the lane line and the ending point coordinates of the lane line; Calculate a first angle cosine value according to the first vector and the lane line vector; The projection distance from the vehicle to the lane line is calculated according to the cosine value of the first angle, the starting point coordinates of the lane line and the vehicle coordinates.
3. The method according to claim 2, characterized in that The step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the first angle, the starting point coordinates of the lane line and the vehicle coordinates comprises: If the cosine value of the first angle is less than zero, it is determined that the vehicle is located outside the starting point of the lane; A projection distance from the vehicle to the lane is calculated based on the first vector and the lane line vector.
4. The method according to claim 2, characterized in that The step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the first angle, the starting point coordinates of the lane line and the vehicle coordinates comprises: If the cosine value of the first angle is greater than or equal to zero, it is determined that the vehicle is located inside the starting point of the lane; The projection distance from the vehicle to the lane is calculated according to the starting point coordinates of the lane line, the vehicle coordinates and the cosine value of the first angle.
5. The method according to claim 2, characterized in that The step of calculating the projection distance from the vehicle to the lane line according to the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates comprises: Calculate a second vector from the end point coordinates of the lane line to the vehicle coordinates according to the end point coordinates of the lane line and the vehicle coordinates; Calculate a cosine value of a second angle according to the second vector and the lane line vector; The projection distance from the vehicle to the lane line is calculated according to the cosine value of the second angle, the end point coordinates of the lane line and the vehicle coordinates.
6. The method according to claim 5, characterized in that The step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the second angle, the end point coordinates of the lane line and the vehicle coordinates comprises: If the cosine value of the second angle is less than zero, it is determined that the vehicle is located outside the end point of the lane; The projection distance from the vehicle to the lane is calculated according to the second vector and the lane line vector.
7. The method according to claim 5, characterized in that The step of calculating the projection distance from the vehicle to the lane line according to the cosine value of the second angle, the end point coordinates of the lane line and the vehicle coordinates comprises: If the cosine value of the second angle is greater than or equal to zero, it is determined that the vehicle is located inside the end point of the lane; The projection distance from the vehicle to the lane is calculated according to the starting point coordinates of the lane line, the vehicle coordinates and the cosine value of the first angle.
8. A relative position determination device, characterized in that: The relative position determining device comprises: An acquisition module, used to acquire the starting coordinates of the lane line, the ending coordinates of the lane line and the vehicle coordinates; The distance calculation module is used to calculate the projection distance from the vehicle to the lane line according to the starting point coordinates of the lane line, the end point coordinates of the lane line and the vehicle coordinates.
9. A relative position determination device, characterized in that: The relative position determination device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the relative position determination method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the relative position determination method according to any one of claims 1 to 7 are implemented.