Methods and devices for detecting relative vehicle angles, electronic equipment, and storage media.
By installing a 3D lidar on the tractor to collect point cloud data and combining it with a Kalman filter algorithm, the problem of inaccurate detection of the relative angle between the tractor and trailer by the camera under adverse lighting and weather conditions was solved, achieving accurate detection under various conditions.
Patent Information
- Application Number
- CN202210157512.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-21
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-02-21
AI Technical Summary
Existing technology makes it difficult for cameras to accurately detect the relative angle between the tractor and trailer in poor lighting conditions or inclement weather.
Three-dimensional lidar installed on the left and right sides of the tractor is used to collect point cloud data of markers on the left and right sides of the trailer, identify target markers, calculate the relative angle based on the point cloud data, and optimize the detection results by combining Kalman filtering algorithm.
It enables accurate detection of the relative angle between the tractor and trailer under various weather conditions, improving the robustness and accuracy of the detection.
Smart Images

Figure CN114545359B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology, and in particular to a method and device for detecting the relative angle of a vehicle, an electronic device, and a storage medium. Background Technology
[0002] For some larger trucks, which consist of a tractor unit and a trailer connected by an articulation, a certain relative angle will appear between the tractor unit and the trailer when the tractor unit turns. Accurate detection of this relative angle is crucial for both assisted driving and autonomous driving systems.
[0003] Current methods for detecting the relative angle between a tractor and a trailer mainly involve installing a camera on the tractor, capturing images of fixed markers on the trailer, and then determining the relative angle between the tractor and the trailer based on the acquired image information.
[0004] However, because cameras are easily affected by external factors such as light and weather, in poor lighting conditions or in rainy or snowy weather, cameras may fail to accurately acquire image information of fixed markers, thus failing to effectively guarantee the detection of the accurate relative angle between the tractor and the trailer. Summary of the Invention
[0005] In view of the shortcomings of the prior art, this application provides a method and device for detecting the relative angle of vehicles, an electronic device, and a storage medium to solve the problem that the existing methods cannot effectively guarantee the accurate detection of the relative angle between the tractor and the trailer.
[0006] To achieve the above objectives, this application provides the following technical solution:
[0007] The first aspect of this application provides a method for detecting the relative angle of a vehicle, comprising:
[0008] Acquire point cloud data of two markers on the left and right sides of the trailer, currently collected by two 3D LiDARs installed on the left and right sides of the tractor.
[0009] The marker with the larger amount of point cloud data among the two markers is identified as the target marker;
[0010] Based on the point cloud data of the target markers, the current target angle information is determined; wherein, the current target angle information is the target angle information associated with the relative angle between the tractor and the trailer.
[0011] The relative angle between the tractor and the trailer is calculated based on the current target angle information.
[0012] Optionally, in the above-described method for detecting the relative angle of vehicles, the target angle information is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line; the target horizontal line is a horizontal line passing through the point of interest on the target marker and perpendicular to the axis of symmetry of the tractor.
[0013] The step of calculating the relative angle between the tractor and the trailer based on the current target angle information includes:
[0014] The difference between the calibrated target angle information corresponding to the target marker and the current target angle information is calculated to obtain the current relative angle between the tractor and the trailer; wherein, the calibrated target angle information corresponding to the target marker is the target angle information when the relative angle between the tractor and the trailer is zero.
[0015] Optionally, in the above-described method for detecting the relative angle of vehicles, acquiring the point cloud data of two markers on the left and right sides of the trailer currently collected by two three-dimensional lidars installed on the left and right sides of the tractor includes:
[0016] Acquire the point cloud data currently collected by the two three-dimensional lidars located on the left and right sides of the tractor;
[0017] The point cloud data of the tractor vehicle, which has been measured in advance, is removed from the current point cloud data of interest to obtain the point cloud data of the two markers; wherein, the current point cloud data of interest is the point cloud data of the currently collected point cloud data that is located in the preset region of interest.
[0018] Optionally, in the above-described method for detecting the relative angle of vehicles, determining the current target angle information based on the point cloud data of the target marker includes:
[0019] Calculate the distance between each point in the point cloud data of the target marker and the three-dimensional lidar on the same side of the target marker;
[0020] The point with the largest distance from the three-dimensional lidar on the same side as the target marker is determined as the point of interest detection on the target marker;
[0021] Based on the coordinates of the detection point of interest on the target marker and the coordinates of the articulation center of the trailer, the angle between the straight line connecting the current detection point of interest on the target marker to the articulation center of the trailer and the target horizontal line is calculated to obtain the current target angle information.
[0022] Optionally, in the above-described method for detecting the relative angle between vehicles, after calculating the relative angle between the tractor and the trailer based on the current target information, the method further includes:
[0023] The relative angle between the tractor and the trailer is filtered using the Kalman filter algorithm to obtain the optimized relative angle between the tractor and the trailer.
[0024] Optionally, in the above-described method for detecting the relative angle between vehicles, the step of using a Kalman filter algorithm to filter the relative angle between the tractor and the trailer to obtain an optimized relative angle between the tractor and the trailer includes:
[0025] Calculate the theoretical relative angle between the tractor and the trailer.
[0026] Based on the Kalman filter algorithm, the theoretical relative angle between the tractor and the trailer and the current relative angle between the tractor and the trailer are calculated together to obtain the optimized relative angle between the tractor and the trailer.
[0027] Optionally, in the above-described method for detecting the relative angle of vehicles, the step of using a Kalman filter algorithm to comprehensively calculate the theoretical relative angle between the tractor and the trailer, as well as the current relative angle between the tractor and the trailer, to obtain the optimized relative angle between the tractor and the trailer, includes:
[0028] The current error variance is predicted by using the error variance and process noise variance from the previous time step.
[0029] The current Kalman gain is calculated using the current error variance prediction, measurement noise variance, and measurement coefficients.
[0030] The angle difference is obtained by subtracting the product of the theoretical relative angle between the tractor and the trailer and the measurement coefficient from the current relative angle between the tractor and the trailer.
[0031] The optimized relative angle between the tractor and trailer is obtained by adding the theoretical relative angle between them to the product of the angle difference and the current Kalman gain.
[0032] A second aspect of this application provides a vehicle relative angle detection device, comprising:
[0033] The acquisition unit is used to acquire point cloud data of two markers on the left and right sides of the trailer, which are currently collected by two three-dimensional lidars installed on the left and right sides of the tractor.
[0034] The determining unit is used to determine the marker with the larger amount of point cloud data among the two markers as the target marker;
[0035] The target information calculation unit is used to determine the current target angle information based on the point cloud data of the target marker; wherein, the current target angle information is the target angle information associated with the current relative angle between the tractor and the trailer;
[0036] The relative angle calculation unit is used to calculate the relative angle between the tractor and the trailer based on the current target angle information.
[0037] Optionally, in the above-described vehicle relative angle detection device, the target angle information is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line; the target horizontal line is a horizontal line passing through the point of interest on the target marker and perpendicular to the axis of symmetry of the tractor.
[0038] The relative angle calculation unit includes:
[0039] The relative angle calculation subunit is used to calculate the difference between the calibration target angle information corresponding to the target marker and the current target angle information to obtain the current relative angle between the tractor and the trailer; wherein, the calibration target angle information corresponding to the target marker is the target angle information when the relative angle between the tractor and the trailer is zero.
[0040] Optionally, in the above-described vehicle relative angle detection device, the acquisition unit includes:
[0041] The acquisition subunit is used to acquire the point cloud data currently collected by the two three-dimensional lidars set on the left and right sides of the tractor.
[0042] The elimination unit is used to remove the pre-measured point cloud data of the tractor from the current point cloud data of interest to obtain point cloud data of the two markers; wherein, the current point cloud data of interest is the point cloud data of the currently collected point cloud data that is located in the preset region of interest.
[0043] Optionally, in the above-described vehicle relative angle detection device, the target angle calculation unit includes:
[0044] A distance calculation unit is used to calculate the distance between each point in the point cloud data of the target marker and the three-dimensional lidar on the same side of the target marker;
[0045] The detection point determination unit is used to determine the point with the largest distance from the three-dimensional lidar on the same side as the target marker as the detection point of interest on the target marker;
[0046] The target angle calculation subunit is used to calculate the angle between the straight line connecting the current target point of interest on the target marker and the hinge center of the trailer and the target horizontal line, based on the coordinates of the point of interest on the target marker and the coordinates of the hinge center of the trailer, to obtain the current target angle information.
[0047] Optionally, the above-mentioned vehicle relative angle detection device further includes:
[0048] The optimization unit is used to filter the relative angle between the tractor and the trailer using the Kalman filter algorithm to obtain the optimized relative angle between the tractor and the trailer.
[0049] Optionally, in the above-described vehicle relative angle detection device, the optimization unit includes:
[0050] Angle estimation unit calculates the theoretical relative angle between the tractor and the trailer.
[0051] The integrated calculation unit is used to perform integrated calculations on the theoretical relative angle between the tractor and the trailer and the current relative angle between the tractor and the trailer based on the Kalman filter algorithm, so as to obtain the optimized relative angle between the tractor and the trailer.
[0052] Optionally, in the above-mentioned vehicle relative angle detection device, the integrated computing unit includes:
[0053] The error prediction unit is used to calculate the current error variance prediction value using the error variance and process noise variance of the previous time step.
[0054] The gain calculation unit is used to calculate the current Kalman gain using the current error variance prediction value, measurement noise variance, and measurement coefficients.
[0055] The difference calculation unit is used to calculate the current relative angle between the tractor and the trailer by subtracting the product of the current theoretical relative angle between the tractor and the trailer and the measurement coefficient, and obtain the angle difference.
[0056] The optimized angle calculation unit is used to add the theoretical relative angle between the tractor and the trailer to the product of the angle difference and the current Kalman gain to obtain the optimized relative angle between the tractor and the trailer.
[0057] A third aspect of this application provides an electronic device, comprising:
[0058] Memory and processor;
[0059] The memory is used to store programs;
[0060] The processor is used to execute the program, which, when executed, is specifically used to implement the vehicle relative angle detection method as described in any of the above.
[0061] A fourth aspect of this application provides a computer storage medium for storing a computer program, which, when executed, implements the vehicle relative angle detection method as described in any of the preceding claims.
[0062] This application provides a method for detecting the relative angle of vehicles. It utilizes point cloud data collected from two markers on the left and right sides of the trailer by two 3D LiDAR sensors installed on both sides of the tractor, eliminating the need for cameras. The marker with the larger point cloud data is then identified as the target marker, and its current target angle is determined based on its point cloud data. Finally, the relative angle between the tractor and trailer is calculated based on this target angle information. Thus, based on the point cloud data collected by the 3D LiDAR, the relative angle between the tractor and trailer is detected. Since 3D LiDAR is less affected by external factors such as light and weather, the accuracy of the detection results can be effectively guaranteed. Attached Figure Description
[0063] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0064] Figure 1 A flowchart illustrating a method for detecting the relative angle of a vehicle provided in an embodiment of this application;
[0065] Figure 2 A schematic diagram showing the positions of a tractor and a trailer provided in an embodiment of this application;
[0066] Figure 3 A flowchart illustrating a method for acquiring point cloud data of two markers, provided in an embodiment of this application;
[0067] Figure 4 A schematic diagram of a region of interest provided in an embodiment of this application;
[0068] Figure 5A schematic diagram illustrating the positions of the tractor and trailer when a vehicle is turning, provided as an embodiment of this application;
[0069] Figure 6 A flowchart illustrating a method for calculating the current target angle provided in this application embodiment;
[0070] Figure 7 A flowchart illustrating a method for filtering relative angles provided in this application embodiment;
[0071] Figure 8 A flowchart of a method for comprehensively calculating theoretical relative angles and relative angles using a Kalman filter algorithm, provided in this application embodiment;
[0072] Figure 9 A vehicle relative angle detection device provided in an embodiment of this application;
[0073] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0074] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0075] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0076] This application provides a method for detecting the relative angle of a vehicle, such as... Figure 1 As shown, it includes the following steps:
[0077] S101. Acquire point cloud data of two markers on the left and right sides of the trailer, which are currently collected by two three-dimensional lidars installed on the left and right sides of the tractor.
[0078] It should be noted that in this embodiment, a three-dimensional LiDAR is installed on each of the left and right sides of the truck's tractor. See details for further information. Figure 2 As shown, a 3D LiDAR is installed on the far left and far right of the front of the tractor unit, and typically, the two 3D LiDARs can be positioned on the same horizontal plane. The two 3D LiDARs are used to scan the markers on the left and right sides of the trailer itself, thereby acquiring point cloud data of the two markers.
[0079] Because the scanning range of a 3D LiDAR is 360 degrees, it can effectively scan the markers. Furthermore, LiDAR is not easily affected by light and weather, which can ensure the accuracy of the measurement data and thus the robustness of the detection results.
[0080] Optionally, the three-dimensional lidar in this embodiment can be a mechanical lidar. If the driverless truck already has three-dimensional lidar installed on both sides of the tractor unit, then additional installation is unnecessary.
[0081] See also Figure 2 The markings are also located on the left and right sides of the trailer, and are usually on the same horizontal line. Alternatively, the markings can be crash blocks or side panels on the trailer.
[0082] It should be noted that when the vehicle is traveling straight or approaching straight, the left-side 3D LiDAR can scan the markers on the left, and the right-side 3D LiDAR can also scan the markers on the right. However, when the vehicle turns left, only the left-side 3D LiDAR can scan the markers on the left, and in this case, the point cloud data for the right marker is empty. Similarly, when the vehicle turns right, only the right-side 3D LiDAR can scan the markers on the right, and in this case, the point cloud data for the left marker is empty.
[0083] Optionally, in another embodiment of this application, one specific implementation of step S102 is as follows: Figure 3 As shown, it includes:
[0084] S301. Obtain the point cloud data currently collected by the two three-dimensional lidars set on the left and right sides of the tractor.
[0085] It should be noted that the scanning range of the 3D LiDAR is 360 degrees, that is, it can scan the point cloud data of objects within 360 degrees. However, only the point cloud data on the marker is needed later. Therefore, after executing step S301, step S302 needs to be executed.
[0086] S302. Remove the pre-measured point cloud data of the tractor from the current point cloud data of interest to obtain the point cloud data of the two markers.
[0087] The point cloud data of current interest refers to the cloud data within the preset region of interest from the currently acquired point cloud data. In other words, point cloud data that is simultaneously located within the preset region of interest and on two markers on both sides of the trailer are identified as the point cloud data of the two markers.
[0088] It should be noted that, in this embodiment, the point cloud data of the markers is determined by setting a region of interest (ROI). The ROI can be a rectangle, a circle, etc. Figure 4 As shown, the ROI is a ring shape. Point cloud data of markers located within the ROI are extracted from the currently collected point cloud data and used as the current point cloud data of interest. The radii R and r of the two circles within the ROI can be calibrated by measuring the vehicle. According to... Figure 4 As can be seen, for the region of interest, the 3D LiDAR can collect point cloud data of the tractor unit and the two markers. However, due to the occlusion of the markers, the point cloud data of the trailer cannot be collected. Since the 3D LiDAR is fixedly mounted on the tractor unit, the point cloud data collected from the tractor unit is fixed and can be pre-calibrated. Because the relative position between the markers and the 3D LiDAR changes with the relative position of the tractor unit and the trailer, it needs to be processed in step S302.
[0089] S102. The marker with the larger amount of point cloud data among the two markers is identified as the target marker.
[0090] It should be noted that when the vehicle is not traveling in a perfectly straight line, i.e., when the tractor and trailer are not on the same straight line, the relative angle between the tractor and trailer will cause the point cloud data of the markers collected by the two 3D LiDARs to be different. In fact, when the vehicle turns at a large angle, i.e., when the relative angle between the tractor and trailer is large, the point cloud data of the markers collected by the 3D LiDAR on the side opposite to the turning direction will be zero. Therefore, by comparing the amount of point cloud data of the two markers, it is possible to determine whether the vehicle is turning left or right, and thus determine the relative angle between the tractor and trailer.
[0091] For example, such as Figure 5As shown, when the vehicle turns right, the 3D LiDAR on the right side obviously cannot scan the marker on the right side of the trailer, so the point cloud data of the marker on the right side is zero. Therefore, the marker on the left side is identified as the current target marker, and then the relative angle between the tractor and the trailer can be calculated when the vehicle turns left.
[0092] It should also be noted that if the point cloud data of the two markers are of the same size, it means that the vehicle is traveling in a straight line and the tractor and trailer are on the same straight line, so the relative angle between the tractor and trailer is zero.
[0093] S103. Based on the point cloud data of the target markers, determine the current target angle information.
[0094] The current target angle information refers to the target angle information associated with the current relative angle between the tractor and the trailer. It should be noted that the target angle information refers to information related to the relative angle between the tractor and the trailer, and is not necessarily an angle itself. The target angle information changes as the current relative angle between the tractor and the trailer changes, and a corresponding relative angle between the tractor and the trailer can be calculated based on the target angle information at each time point. Therefore, step S104 can be executed after step S103.
[0095] S104. Calculate the relative angle between the tractor and trailer based on the current target angle information.
[0096] Optionally, the correlation expression between the relative angle between the tractor and the trailer and the target angle information can be determined in advance. Then, after obtaining the current target angle information, the current target angle information can be substituted into the correlation expression for calculation to obtain the current relative angle between the tractor and the trailer.
[0097] Optionally, in another embodiment of this application, the target angle information is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line. Therefore, in this embodiment, the current target angle information is the current target angle. The target horizontal line is a horizontal line passing through the point of interest on the target marker and perpendicular to the axis of symmetry of the tractor.
[0098] It should be noted that the angles involved in the embodiments of this application refer to angles on a two-dimensional plane, that is, angles on a top view.
[0099] Here, the point of interest (POI) on the target marker refers to a fixed point on the marker used for detection. For example, such as Figure 5As shown, when the vehicle turns left, the target marker is the marker on the left. Therefore, the detection point of interest (POI) on the target marker is the point on the left marker that is farthest from the 3D LiDAR on the left. The angle between the straight line connecting the POI on the current target marker to the hinge center of the trailer and the target horizontal line is the current target angle. Figure 5 In this context, angle γ represents the current target angle.
[0100] It should also be noted that, because the relative position of the marker and the tractor is constantly changing, the relative position of the detection point of interest on the target marker and the tractor is also constantly changing, and therefore the position of the target horizontal line will also change accordingly.
[0101] Optionally, such as Figure 6 As shown, one embodiment of step S103 includes:
[0102] S601. Calculate the distance between each point in the point cloud data of the target marker and the 3D LiDAR on the same side of the target marker.
[0103] It should be noted that the point cloud data of the target marker includes the coordinates of multiple points on the scanned target marker, while the 3D LiDAR is fixed, that is, the coordinates of the 3D LiDAR are also fixed. Therefore, based on the coordinates of each point and the coordinates of the 3D LiDAR, the distance between each point and the 3D LiDAR can be calculated.
[0104] S602. The point with the largest distance from the 3D LiDAR on the same side as the target marker is determined as the point of interest on the target marker.
[0105] Since the point with the greatest distance from the 3D LiDAR on the same side as the target marker is fixed, in this embodiment, the point with the greatest distance from the 3D LiDAR on the same side as the target marker is determined as the detection point of interest (POI) on the target marker. Of course, other methods can also be used to determine the POI on the target marker. For example, the point cloud data of the target detection area can be fitted, and the POI can be identified by combining the properties of the target marker. However, the computational load for determining the POI in step S602 is relatively small.
[0106] S603. Based on the coordinates of the detection point of interest on the target marker and the coordinates of the articulation center of the trailer, calculate the angle between the straight line connecting the current detection point of interest on the target marker to the articulation center of the trailer and the target horizontal line to obtain the current target angle information.
[0107] Specifically, such as Figure 5As shown, since the hinge center is fixed, that is, the coordinates of the hinge center are determined, the distance between the two can be calculated based on the coordinates of the detection point of interest on the target marker and the coordinates of the hinge center of the trailer. The distance from the detection point of interest on the target marker to the perpendicular line of the target horizontal line can be determined based on the coordinates of the detection point of interest on the target marker. Therefore, the current target angle can be calculated by using trigonometric functions.
[0108] In this application embodiment, the specific implementation of step S104 includes:
[0109] The difference between the calibrated target angle information corresponding to the target marker and the current target angle information is calculated to obtain the current relative angle between the tractor and the trailer.
[0110] The calibration target angle information corresponding to the target marker is the numerical value of the target angle information when the relative angle between the tractor and the trailer is zero, i.e., the calibration target angle information is the calibration target angle. Since in this embodiment, the target angle information is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line, the calibration target angle corresponding to the target marker is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line when the relative angle between the tractor and the trailer is zero, i.e., when the vehicle is in a straightened state.
[0111] Optionally, with the vehicle aligned, the angle between the straight line connecting the points of interest on the two markers to the hinge center of the trailer and the target horizontal line can be calculated beforehand to obtain the calibration target angle information corresponding to the two markers. For example, Figure 5 The angles α and β are shown.
[0112] like Figure 5 As shown, the relative angle between the tractor and the trailer is; according to the principle that the sum of the interior angles of a triangle is 180 degrees, we can obtain:
[0113] α+δ+θ+90°=γ+θ+δ+θ+90°
[0114] Therefore, the relative angle between the tractor and the trailer is:
[0115] θ=α-γ
[0116] Therefore, by calculating the difference between the current target angle and the calibrated target angle corresponding to the target marker, the relative angle between the tractor and the trailer can be obtained. Specifically, calculating the difference between the current target angle and the calibrated target angle corresponding to the target marker, that is, calculating the change in the target angle, is because the calibrated target angle corresponding to the target marker is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line when the relative angle between the tractor and the trailer is zero. Therefore, the change in the target angle is the current relative angle between the tractor and the trailer.
[0117] In the above method, the articulation center is used as the reference for calculation. Alternatively, the same principle can be used to directly use the three-dimensional lidar coordinates to calculate the relative angle between the tractor and the trailer.
[0118] Optionally, the target angle information can also be the geometric distance between the detection point of interest on the target marker and the 3D LiDAR on the same side. Since this distance is related to the current relative angle between the tractor and the trailer, a correlation expression between this distance and the relative angle between the tractor and the trailer can be pre-fitted. Then, the geometric distance between the detection point of interest on the target marker and the 3D LiDAR on the same side is calculated in step S103. In step S104, the calculated distance is substituted into the correlation expression to obtain the current relative angle between the tractor and the trailer.
[0119] The markers are placed on the trailer, while the 3D LiDAR is placed on the tractor unit. Therefore, their relative positions are constantly changing, requiring consideration of more factors in the calculation. Consequently, the error is larger compared to calculations using the articulation center as a reference. Furthermore, the relationship between the fitted distance and the relative angle between the tractor and trailer relies heavily on the accuracy of the fit, resulting in relatively lower precision. Testing also revealed that using… Figure 5 The method described above offers the highest accuracy. Of course, these are just two options; other methods can also be used.
[0120] Optionally, considering the possibility of certain errors during the calculation process, and in order to provide robustness for the final output, in another embodiment of this application, after executing step S104, the following is further performed:
[0121] The Kalman filter algorithm is used to filter the relative angle between the tractor and the trailer to obtain the optimized relative angle between them.
[0122] Specifically, the Kalman filter algorithm is used to filter the relative angle between the tractor and trailer to obtain the optimized relative angle between them, such as... Figure 7 As shown, it includes:
[0123] S701. Calculate the theoretical relative angle between the tractor and the trailer.
[0124] Optionally, the relative angle between the tractor and trailer at the next moment can be theoretically estimated based on the relative angle between the tractor and trailer at the previous moment and vehicle dynamics, that is, the theoretical relative angle between the tractor and trailer at the current moment can be estimated.
[0125] S702. Based on the Kalman filter algorithm, the theoretical relative angle between the current tractor and trailer and the current relative angle between the current tractor and trailer are comprehensively calculated to obtain the optimized relative angle between the current tractor and trailer.
[0126] Since the estimated values are not necessarily completely accurate and may contain errors, it is necessary to comprehensively consider both the theoretical relative angle between the tractor and the trailer and the current relative angle between the tractor and the trailer. Therefore, in this embodiment of the application, it is also necessary to use the Kalman filter algorithm to perform comprehensive calculations on the theoretical relative angle between the tractor and the trailer and the current relative angle between the tractor and the trailer to obtain the optimized relative angle between the tractor and the trailer.
[0127] Optionally, one specific implementation of step S702 is as follows: Figure 8 As shown, it includes:
[0128] S801. Calculate the current error variance prediction value using the error variance and process noise variance from the previous time step.
[0129] According to the Kalman filter algorithm, the Kalman filter prediction process in this embodiment can be expressed as follows:
[0130] θ i+1,pre =A·f(v i ,θ i )
[0131] P pre =A·P·A T +Q
[0132] Where, θ i+1,pre Let θ be the theoretical relative angle between the tractor and the trailer at time i+1. i Let v be the relative angle between the tractor and the trailer at time i; i Let be the vehicle speed at time i; P represents the predicted error variance at time i, and the initial value of the predicted error variance can be set according to the actual working conditions; P pre This represents the predicted error variance at time i+1, i.e., the current predicted error variance; A is the transfer coefficient, specifically 1; Q is the process noise variance.
[0133] Therefore, based on the formula above, we can obtain the theoretical relative angle between the tractor and the trailer, the current theoretical relative angle between the tractor and the trailer, and the current predicted value of the error variance.
[0134] S802. Calculate the current Kalman gain using the current error variance prediction value, measurement noise variance, and measurement coefficients.
[0135] According to the Kalman filter algorithm, the formula for calculating the Kalman gain during the Kalman filter update process can be expressed as:
[0136] K = P pre ·H T ·(H·P pre ·H T +R) -1
[0137] Wherein, the measurement coefficient H is 1, and R represents the measurement noise variance, that is, the variance of the measurement noise of the lidar.
[0138] Therefore, by inputting the current predicted error variance, measurement noise variance, and measurement coefficients into the formula above, the current Kalman gain can be calculated.
[0139] S803. Calculate the current relative angle between the tractor and trailer, and subtract the product of the theoretical relative angle between the tractor and trailer and the measurement coefficient to obtain the angle difference.
[0140] According to the Kalman filter algorithm, the optimized relative angle between the tractor and trailer at time i+1 during the Kalman filter update process can be expressed as:
[0141] θ i+1,filter =θ i+1,pre +K(θ i+1,det -H·θ i+1,pre )
[0142] Where, θ i+1,filter Let θ be the optimal relative angle between the tractor and trailer at time i+1. i+1,det θ represents the relative angle between the tractor and trailer at time i+1, i.e., the current relative angle calculated in step S104; i+1,pre Let be the theoretical relative angle between the tractor and the trailer at time i+1; K is the Kalman gain; and H is the measurement coefficient.
[0143] Therefore, it is necessary to first calculate the current relative angle between the tractor and the trailer, and then subtract the product of the theoretical relative angle between the tractor and the trailer and the measurement coefficient to obtain the angle difference. Then, step S804 is executed to obtain the optimized relative angle between the tractor and the trailer at the current moment.
[0144] S804. Add the theoretical relative angle between the current tractor and trailer to the product of the angle difference and the current Kalman gain to obtain the optimized relative angle between the current tractor and trailer.
[0145] It should be noted that after obtaining the optimized relative angle between the tractor and trailer, the error variance needs to be updated for subsequent calculations. The specific update formula can be:
[0146] P=(1-K·H)P pre
[0147] This application provides a vehicle relative angle detection method that uses point cloud data of two markers on the left and right sides of the trailer, collected by two 3D LiDARs installed on the left and right sides of the tractor, instead of using a camera. The marker with the larger point cloud data is then identified as the target marker, and the current target angle information is determined based on the point cloud data of the target marker. Finally, the relative angle between the tractor and trailer is calculated based on the current target angle information. Thus, based on the point cloud data collected by the 3D LiDAR, the relative angle between the tractor and trailer is detected. Since the 3D LiDAR is less affected by external factors such as light and weather, the accuracy of the detection results can be effectively guaranteed.
[0148] Another embodiment of this application provides a vehicle relative angle detection device, such as... Figure 9 As shown, it includes:
[0149] The acquisition unit 901 is used to acquire point cloud data of two markers on the left and right sides of the trailer, which are currently collected by two three-dimensional lidars installed on the left and right sides of the tractor.
[0150] The determining unit 902 is used to determine the marker with larger point cloud data volume among two markers as the target marker.
[0151] The target information calculation unit 903 is used to determine the current target angle information based on the point cloud data of the target markers.
[0152] Among them, the current target angle information is the target angle information associated with the current relative angle between the tractor and the trailer.
[0153] The relative angle calculation unit 904 is used to calculate the relative angle between the tractor and the trailer based on the current target angle information.
[0154] Optionally, in another embodiment of the vehicle relative angle detection device provided in this application, the target angle information is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line. The target horizontal line is a horizontal line passing through the point of interest on the target marker and perpendicular to the axis of symmetry of the tractor.
[0155] The relative angle calculation unit in this embodiment includes:
[0156] The relative angle calculation subunit is used to calculate the difference between the calibration target angle information corresponding to the target marker and the current target angle information to obtain the current relative angle between the tractor and the trailer.
[0157] Among them, the calibration target angle information corresponding to the target marker is the value of the target angle information when the relative angle between the tractor and the trailer is zero.
[0158] Optionally, in another embodiment of the vehicle relative angle detection device provided in this application, the acquisition unit includes:
[0159] The acquisition subunit is used to acquire the point cloud data currently collected by the two three-dimensional lidars set on the left and right sides of the tractor.
[0160] The elimination unit is used to remove the pre-determined point cloud data of the tractor from the current point cloud data of interest, so as to obtain the point cloud data of the two markers.
[0161] Among them, the point cloud data of current interest is the point cloud data that is located in the preset region of interest among the currently collected point cloud data.
[0162] Optionally, in another embodiment of the vehicle relative angle detection device provided in this application, the target angle calculation unit includes:
[0163] The distance calculation unit is used to calculate the distance between each point in the point cloud data of the target marker and the 3D LiDAR on the same side of the target marker.
[0164] The detection point determination unit is used to determine the point with the largest distance from the three-dimensional lidar on the same side as the target marker as the detection point of interest on the target marker.
[0165] The target angle calculation subunit is used to calculate the angle between the straight line connecting the current target target point of interest to the trailer's articulation center and the target horizontal line, based on the coordinates of the point of interest on the target marker and the coordinates of the trailer's articulation center, thus obtaining the current target angle information.
[0166] Optionally, in another embodiment of the vehicle relative angle detection device provided in this application, the device further includes:
[0167] The optimization unit is used to filter the relative angle between the current tractor and trailer using the Kalman filter algorithm to obtain the optimized relative angle between the current tractor and trailer.
[0168] Optionally, in another embodiment of the vehicle relative angle detection device provided in this application, the optimization unit includes:
[0169] Angle estimation unit is used to calculate the theoretical relative angle between the tractor and trailer.
[0170] The integrated calculation unit is used to perform integrated calculations on the theoretical relative angle between the current tractor and trailer, as well as the current relative angle between the tractor and trailer, based on the Kalman filter algorithm, to obtain the optimized relative angle between the current tractor and trailer.
[0171] Optionally, in another embodiment of the vehicle relative angle detection device provided in this application, the comprehensive calculation unit includes:
[0172] The error prediction unit is used to calculate the current error variance prediction value using the error variance and process noise variance of the previous time step.
[0173] The gain calculation unit is used to calculate the current Kalman gain using the current error variance prediction value, measurement noise variance, and measurement coefficients.
[0174] The difference calculation unit is used to calculate the current relative angle between the tractor and the trailer by subtracting the product of the theoretical relative angle between the tractor and the trailer and the measurement coefficient, and obtain the angle difference.
[0175] The optimized angle calculation unit is used to add the theoretical relative angle between the current tractor and trailer to the product of the angle difference and the current Kalman gain to obtain the optimized relative angle between the current tractor and trailer.
[0176] It should be noted that the specific working process of each unit provided in the above embodiments of this application can be referred to the corresponding steps in the above method embodiments, and will not be repeated here.
[0177] Another embodiment of this application provides an electronic device, such as... Figure 10 As shown, it includes:
[0178] Memory 1001 and processor 1002.
[0179] The memory 1001 is used to store the program.
[0180] The processor 1002 is used to execute a program, and when the program is executed, it is specifically used to implement the vehicle relative angle detection method provided in any of the above embodiments.
[0181] Another embodiment of this application provides a computer storage medium for storing a computer program, which, when executed, implements the vehicle relative angle detection method provided in any of the above embodiments.
[0182] Computer storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0183] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0184] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting the relative angle of a vehicle, characterized in that, include: Acquire point cloud data of two markers on the left and right sides of the trailer, currently collected by two 3D LiDARs installed on the left and right sides of the tractor. The marker with the larger amount of point cloud data among the two markers is identified as the target marker; Based on the point cloud data of the target marker, the current target angle information is determined; wherein, the current target angle information is the target angle information associated with the relative angle between the tractor and the trailer; the target angle information is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line; the target horizontal line is a horizontal line passing through the point of interest on the target marker and perpendicular to the axis of symmetry of the tractor; Calculate the relative angle between the tractor and the trailer based on the current target angle information; The step of calculating the relative angle between the tractor and the trailer based on the current target angle information includes: The difference between the calibrated target angle information corresponding to the target marker and the current target angle information is calculated to obtain the current relative angle between the tractor and the trailer; wherein, the calibrated target angle information corresponding to the target marker is the target angle information when the relative angle between the tractor and the trailer is zero.
2. The method according to claim 1, characterized in that, The acquisition of point cloud data of two markers on the left and right sides of the trailer, currently collected by two three-dimensional lidars installed on the left and right sides of the tractor, includes: Acquire the point cloud data currently collected by the two three-dimensional lidars located on the left and right sides of the tractor; The point cloud data of the tractor vehicle, which has been measured in advance, is removed from the current point cloud data of interest to obtain the point cloud data of the two markers; wherein, the current point cloud data of interest is the point cloud data of the currently collected point cloud data that is located in the preset region of interest.
3. The method according to claim 1, characterized in that, The determination of the current target angle information based on the point cloud data of the target markers includes: Calculate the distance between each point in the point cloud data of the target marker and the three-dimensional lidar on the same side of the target marker; The point with the largest distance from the three-dimensional lidar on the same side as the target marker is determined as the point of interest detection on the target marker; Based on the coordinates of the detection point of interest on the target marker and the coordinates of the articulation center of the trailer, the angle between the straight line connecting the current detection point of interest on the target marker to the articulation center of the trailer and the target horizontal line is calculated to obtain the current target angle information.
4. The method according to claim 1, characterized in that, After calculating the relative angle between the tractor and the trailer based on the current target angle information, the method further includes: The relative angle between the tractor and the trailer is filtered using the Kalman filter algorithm to obtain the optimized relative angle between the tractor and the trailer.
5. The method according to claim 4, characterized in that, The step of using the Kalman filter algorithm to filter the relative angle between the tractor and the trailer to obtain an optimized relative angle between them includes: Calculate the theoretical relative angle between the tractor and the trailer. Based on the Kalman filter algorithm, the theoretical relative angle between the tractor and the trailer and the current relative angle between the tractor and the trailer are calculated together to obtain the optimized relative angle between the tractor and the trailer.
6. The method according to claim 5, characterized in that, The method utilizes the Kalman filter algorithm to comprehensively calculate the theoretical relative angle between the tractor and the trailer, as well as the current relative angle between them, to obtain the optimized relative angle between the tractor and the trailer. This includes: The current error variance is predicted by using the error variance and process noise variance from the previous time step. The current Kalman gain is calculated using the current error variance prediction, measurement noise variance, and measurement coefficients. The angle difference is obtained by subtracting the product of the theoretical relative angle between the tractor and the trailer and the measurement coefficient from the current relative angle between the tractor and the trailer. The optimized relative angle between the tractor and trailer is obtained by adding the theoretical relative angle between them to the product of the angle difference and the current Kalman gain.
7. A device for detecting the relative angle of a vehicle, characterized in that, include: The acquisition unit is used to acquire point cloud data of two markers on the left and right sides of the trailer, which are currently collected by two three-dimensional lidars installed on the left and right sides of the tractor. The determining unit is used to determine the marker with the larger amount of point cloud data among the two markers as the target marker; The target information calculation unit is used to determine the current target angle information based on the point cloud data of the target marker; wherein, the current target angle information is the target angle information associated with the relative angle between the tractor and the trailer; the target angle information is the angle between the straight line connecting the point of interest on the target marker to the hinge center of the trailer and the target horizontal line; the target horizontal line is a horizontal line passing through the point of interest on the target marker and perpendicular to the axis of symmetry of the tractor; A relative angle calculation unit is used to calculate the relative angle between the tractor and the trailer based on the current target angle information; The relative angle calculation unit includes: The relative angle calculation subunit is used to calculate the difference between the calibration target angle information corresponding to the target marker and the current target angle information to obtain the current relative angle between the tractor and the trailer; wherein, the calibration target angle information corresponding to the target marker is the target angle information when the relative angle between the tractor and the trailer is zero.
8. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program, which, when executed, is specifically used to implement the vehicle relative angle detection method as described in any one of claims 1 to 6.
9. A computer storage medium, characterized in that, Used to store a computer program, which, when executed, is used to implement the vehicle relative angle detection method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Trailer included angle measuring method and device, and vehicle
CN111366938A
Attitude estimation method and device and electronic equipment
CN112362055A