Method and device for determining yaw angle of trailer
By obtaining and fitting the trailer plane point cloud data, the yaw angle between the tractor and the trailer is calculated, which solves the problem of accurately obtaining angle data in the existing technology and improves the accuracy of path planning and transportation efficiency.
Patent Information
- Application Number
- CN202410727720.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-06
AI Technical Summary
It is difficult to accurately obtain the angle data between the tractor and the trailer with the existing technology, which affects the accuracy of path planning and transportation efficiency.
By obtaining the trailer plane point cloud data, the trailer plane straight line is fitted based on the coordinates in the horizontal and depth directions, and then the yaw angle between the tractor and the trailer is calculated. Random sampling consistency algorithm and least squares method are used to improve the fitting. accuracy.
The accuracy of the yaw angle between the tractor and the trailer is improved, and the accuracy of path planning and transportation efficiency are enhanced.
Smart Images

Figure CN118289009B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of autonomous driving technology, and in particular to a method and device for determining a yaw angle of a trailer. Background Art
[0002] In manufacturing companies, large trucks (consisting of a tractor and a trailer) are responsible for transportation within the factory. Complex road conditions and urgent delivery requirements for goods such as steel (which must reach other factories before the temperature drops for further processing) place high demands on the driver's driving skills and familiarity with the environment.
[0003] The application of autonomous driving technology and assisted driving technology relies on the already constructed map data information and artificial intelligence technology that makes decisions based on current road conditions to plan routes more efficiently, thereby improving transportation efficiency.
[0004] During the driving process, since large trucks are only powered by the tractor head, the trailer is connected to the tractor through a saddle, which is a hinged connection, so that the trailer can rotate relative to the tractor head in the horizontal plane. Therefore, the movement trajectory and current deflection state of the trailer cannot be directly determined by the tractor. Figure 1a As shown in , the angle α between the tractor ① and the trailer ② is crucial for path planning.
[0005] The angle between the tractor and the trailer refers to the angle between the center axis of the tractor and the center axis of the trailer, also known as the yaw angle of the trailer. Its accurate data is necessary for path planning. Therefore, how to accurately obtain the angle data between the tractor and the trailer is an urgent problem to be solved. Summary of the invention
[0006] In view of this, the present disclosure provides a method for determining the yaw angle of a trailer to solve the problem of how to accurately obtain the angle data between the tractor and the trailer.
[0007] In a first aspect, the present disclosure provides a method for determining the yaw angle of a trailer, the method comprising: acquiring plane point cloud data of the trailer for a current period, the three-dimensional coordinates of each point in the point cloud data representing a spatial position in the horizontal, vertical and depth directions of the acquisition device with the acquisition device as the origin; the acquisition device is set in a preset area on the rear wall of the tractor; based on the horizontal coordinates and depth coordinates in the plane point cloud data of the trailer, fitting a plane straight line of the trailer; based on the plane straight line of the trailer, generating a fitting yaw angle of the current period between the tractor and the trailer.
[0008] The method for determining the yaw angle of the trailer in the embodiment of the present disclosure obtains the three-dimensional coordinates of each point in the trailer plane point cloud data of the current period, then fits the trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data, and finally generates the fitted yaw angle of the current period between the tractor and the trailer based on the trailer plane straight line. In this process, since an accurate trailer plane straight line is fitted based on the trailer plane point cloud data, the fitted yaw angle of the current period is generated based on the mathematical transformation relationship between the trailer plane straight line and the fitted yaw angle, thereby improving the accuracy of the fitted yaw angle.
[0009] In some optional embodiments, the method further includes: determining a corrected yaw angle of the current period based on a fitted yaw angle of the current period and a collection deviation angle, wherein the collection deviation angle is determined based on the following steps: when an angle change value of the fitted yaw angle of a preset number of periods is less than a preset threshold, determining the collection deviation angle based on the fitted yaw angle of a preset number of periods.
[0010] The method for determining the yaw angle of the trailer in the present embodiment determines the acquisition deviation angle based on the fitted yaw angle of a preset number of cycles when the angle change value of the fitted yaw angle of a preset number of cycles is less than a preset threshold value. This means that when the fitted yaw angle changes little in multiple cycles, the trailer is in a straight-ahead state. At this time, the current fitted yaw angle is a fixed installation deviation, that is, the acquisition deviation angle. On this basis, the corrected yaw angle of the current cycle is determined based on the fitted yaw angle of the current cycle and the acquisition deviation angle, thereby improving the accuracy of the corrected yaw angle.
[0011] In some optional embodiments, a straight line of the trailer plane is fitted based on the horizontal coordinates and depth coordinates in the trailer plane point cloud data, including: during the initial fitting, the horizontal coordinates and depth coordinates of the trailer plane point cloud data in all vertical directions are used, and a random sampling consistency algorithm is used to fit the straight line of the trailer plane.
[0012] The method for determining the yaw angle of the trailer in this embodiment uses the horizontal coordinates and depth coordinates of the trailer plane point cloud data in all vertical directions during the initial fitting, and uses a random sampling consistency algorithm to fit the trailer plane straight line, so that the full point cloud data can be used to improve the accuracy of the fitting result. When fitting the data for the first time, the random sampling consistency algorithm is used to obtain the straight trailer plane line covering the most data through multiple cycles of iterations, taking into account the exclusion of wire beam interference in the laser point cloud data, thereby improving the accuracy of the fitted trailer plane line.
[0013] In some optional embodiments, a trailer plane straight line is fitted based on the horizontal coordinates and depth coordinates in the trailer plane point cloud data, including: when it is not the initial fitting and the corrected yaw angle of the previous cycle is less than a first preset angle, the horizontal coordinates and depth coordinates of all trailer plane point cloud data in the horizontal direction are obtained, and a random sampling consistency algorithm is used to fit all trailer plane point cloud data to generate a trailer plane straight line.
[0014] The method for determining the yaw angle of the trailer in this embodiment, when it is not the initial fitting and the corrected yaw angle of the previous cycle is less than the first preset angle, indicates that the yaw angle gradually increases but is less than the first preset angle at this time. At this time, the influence of the side wall data of the trailer is not considered. The horizontal coordinates and depth coordinates of all the trailer plane point cloud data in the horizontal direction can be obtained from the trailer plane point cloud data of the current cycle, and the random sampling consistency algorithm is used to fit the trailer plane straight line, so as to obtain a more accurate trailer plane straight line.
[0015] In some optional embodiments, fitting a straight line of the trailer plane based on the horizontal coordinates and the depth coordinates in the point cloud data of the trailer plane includes: fitting the straight line of the trailer plane based on the straight line corresponding to the Pearson correlation coefficient that meets the expected conditions in the following Pearson correlation coefficients: when it is not the initial fitting and the corrected yaw angle of the previous cycle is greater than the first preset angle and less than the second preset angle, starting from the horizontal extreme point of the trailer plane point cloud data recorded in the previous cycle in the current rotation direction, reversely intercepting a preset length as the current fitting range; fitting an initial straight line of the trailer plane based on the horizontal coordinates and the depth coordinates in the point cloud data of the current fitting range by using the least squares method, and determining the initial straight line of the trailer plane between the point cloud data of the current fitting range and the initial straight line of the trailer plane Pearson correlation coefficient; wherein, the preset length is the horizontal length of the trailer plane point cloud data during the initial fitting; move the preset distance to the left from the current fitting range to determine the left-shift fitting range; use the least squares method based on the horizontal coordinates and depth coordinates in the point cloud data of the left-shift fitting range to fit the left-shift trailer plane straight line, and determine the left-shift Pearson correlation coefficient between the point cloud data in the left-shift fitting range and the left-shift trailer plane straight line; move the preset distance to the right from the current fitting range to determine the right-shift fitting range; use the least squares method based on the horizontal coordinates and depth coordinates in the point cloud data of the right-shift fitting range to fit the right-shift trailer plane straight line, and determine the right-shift Pearson correlation coefficient between the point cloud data in the right-shift fitting range and the right-shift trailer plane straight line.
[0016] The method for determining the yaw angle of the trailer in this embodiment uses the fitting result of the least squares method and the Pearson correlation coefficient as the linearity to evaluate the quality of the fitting when the yaw angle is large and there is a probability that the side wall data of the trailer will appear in the point cloud data. The selected fitting range is moved left and right, and finally the trailer plane straight line corresponding to the fitting range with the best linearity is used as the trailer plane straight line for outputting the angle measurement result, thereby determining the appropriate fitting range and improving the accuracy of the fitting result.
[0017] In some optional embodiments, fitting a trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data includes: when it is not the initial fitting and the corrected yaw angle of the previous cycle is greater than the second preset angle, starting from the horizontal extreme point in the trailer plane point cloud data recorded in the previous cycle that is opposite to the current rotation direction, reversely intercepting the point cloud data of a first fixed length as the trailer plane data, and fitting the trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane data using the least squares method; wherein the first fixed length is the length of the trailer plane point cloud data in the horizontal direction during the initial fitting; based on the trailer plane straight line, generating the fitting yaw angle of the current cycle between the tractor and the trailer includes: based on the current trailer plane straight line , generate a first fitting yaw angle; from the trailer plane point cloud data, starting from the horizontal extreme point in the same direction as the current rotation direction, reversely intercept the second fixed length of point cloud data as the side wall plane data, and use the least squares method to fit the side wall plane straight line based on the horizontal coordinates and the depth coordinates in the side wall plane data; based on the side wall plane straight line, generate a second fitting yaw angle; based on the complementary angle of the first fitting yaw angle and the second fitting yaw angle, generate the fitting yaw angle of the current cycle between the tractor and the trailer; wherein the second fixed length is calculated and determined based on the field of view angle of the acquisition device and the distance between the acquisition device and the side wall of the trailer; wherein, when using the least squares method to fit the trailer plane straight line and the side wall plane straight line respectively, the Pearson correlation coefficient is used as the fitting constraint respectively.
[0018] In the method for determining the yaw angle of the trailer in this embodiment, when the angle is further increased, it may be possible to retain only the side wall plane data. Therefore, the fitting results of the trailer plane data and the side wall data can be calculated separately, and the fitting yaw angle can be determined. Specifically, when the angle deflection is large, the horizontal extreme point in the opposite direction of the current rotation direction is taken to reversely intercept the point cloud data of the first fixed length as the trailer plane data; the second fixed length between the horizontal extreme point in the current rotation direction and the selected trailer surface data is taken as the side wall plane data. This method optimizes the fitting range for the case where there are more side wall plane data, and determines the fitting trailer plane straight line and the side wall plane straight line, and determines the fitting yaw angle of the current cycle between the tractor and the trailer according to the complementary angle of the first fitting yaw angle and the second fitting yaw angle corresponding thereto, thereby improving the accuracy of the determined fitting yaw angle.
[0019] In some optional embodiments, based on the horizontal coordinates and depth coordinates in the trailer plane point cloud data, fitting the trailer plane straight line, including: performing area division in the vertical direction of the trailer plane point cloud data to obtain a point cloud area set; based on each point cloud area in the point cloud area set, fitting trailer area straight lines respectively to obtain a trailer area straight line set; based on the trailer plane straight line, generating a fitting yaw angle of the current cycle between the tractor and the trailer, including: based on each straight line in the trailer area straight line set, generating a corresponding regional fitting yaw angle to obtain a regional fitting yaw angle set; based on the regional fitting yaw angle set, determining the fitting yaw angle of the current cycle between the tractor and the trailer.
[0020] The method for determining the yaw angle of the trailer in this embodiment divides the plane point cloud data of the trailer into regions in the vertical direction, thereby refining the fitting results of each region and avoiding the data noise of individual regions from affecting the fitting results of the overall yaw angle, thereby improving the accuracy of the fitted yaw angle of the current period between the tractor and the trailer.
[0021] In some optional embodiments, the fitting yaw angle of the current cycle between the tractor and the trailer is determined based on the regional fitting yaw angle set, including any of the following items: taking the median value of each yaw angle in the regional fitting yaw angle set as the fitting yaw angle of the current cycle between the tractor and the trailer; taking the average value of each yaw angle in the regional fitting yaw angle set as the fitting yaw angle of the current cycle between the tractor and the trailer; taking the mode of each yaw angle in the regional fitting yaw angle set as the fitting yaw angle of the current cycle between the tractor and the trailer.
[0022] The method for determining the yaw angle of the trailer in this embodiment improves the accuracy of the determined fitting yaw angle by further defining how to determine the fitting yaw angle of the tractor and the trailer based on the regional fitting yaw angle set.
[0023] In some optional embodiments, determining the fitted yaw angle of the current cycle between the tractor and the trailer based on the regional fitted yaw angle set also includes: when the difference between the regional fitted yaw angle in the regional fitted yaw angle set and the corresponding regional fitted yaw angle of the previous cycle is greater than an angle difference threshold, determining that the regional fitted yaw angle is wrong; when all the regional fitted yaw angles in the regional fitted yaw angle set are wrong, determining the fitted yaw angle of the current cycle between the tractor and the trailer based on the average value of the fitted yaw angles of a predetermined number of cycles before the current cycle.
[0024] The method for determining the yaw angle of the trailer in this embodiment clarifies the contents of eliminating erroneous yaw angle data and correcting erroneous yaw angle data, thereby improving the accuracy of the determined fitting yaw angle of the current cycle between the tractor and the trailer.
[0025] In some optional embodiments, the fitted yaw angle of the current cycle between the tractor and the trailer is determined based on the average value of the fitted yaw angles of a preset number of cycles before the current cycle, including: performing mean smoothing processing on the average value of the fitted yaw angles of the preset number of cycles before the current cycle and the fitted yaw angle of the current cycle to obtain an updated fitted yaw angle of the current cycle between the tractor and the trailer.
[0026] The method for determining the yaw angle of the trailer in this embodiment clarifies the specific processing process of correcting erroneous yaw angle data, and further determines the accuracy of the fitted yaw angle of the current cycle between the tractor and the trailer.
[0027] In some optional embodiments, the collection device is set in a preset area of the wall opposite to the tractor and the trailer, including: the collection device is set at the center position of the rear wall of the tractor; the center position corresponds to the center of the rear wall in the horizontal direction and the vertical direction.
[0028] The method for determining the yaw angle of the trailer in this embodiment can obtain more concise and clear point cloud data by limiting the position of the acquisition device, thereby improving the accuracy of the subsequently determined fitting yaw angle of the current period between the tractor and the trailer.
[0029] In a second aspect, the present disclosure provides a device for determining the yaw angle of a trailer, the device comprising: an acquisition module for acquiring plane point cloud data of the trailer, the three-dimensional coordinates of each point in the point cloud data representing a spatial position in the horizontal, vertical and depth directions of the acquisition device with the acquisition device as the origin; the acquisition device is arranged in a preset area on the rear wall of the tractor; a fitting module for fitting a plane straight line of the trailer based on the horizontal coordinates and the depth coordinates in the plane point cloud data of the trailer; and a generation module for generating a current fitting yaw angle between the tractor and the trailer based on the plane straight line of the trailer.
[0030] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for determining the yaw angle of a trailer according to the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0031] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining the yaw angle of a trailer according to the first aspect or any corresponding embodiment thereof.
[0032] In a fifth aspect, the present disclosure provides a computer program product, including computer instructions, which are used to enable a computer to execute the method for determining the yaw angle of a trailer according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1a is a schematic diagram of the angle between the tractor and the trailer according to the background technology part of the embodiment of the present disclosure;
[0035] Figure 1b is a flow chart of a method for determining a yaw angle of a trailer according to an embodiment of the present disclosure;
[0036] Figure 1c is a front view of a collection device according to an embodiment of the present disclosure installed at the center of a rear wall surface opposite to a tractor and a trailer;
[0037] Figure 1d is a top view of a collection device according to an embodiment of the present disclosure installed at the center of a rear wall surface opposite to a tractor and a trailer;
[0038] Figure 2 is a flow chart of a method for fitting a straight line of a trailer plane based on trailer plane point cloud data according to an embodiment of the present disclosure;
[0039] Figure 3 is a flow chart of another method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0040] Figure 4is a flow chart of another method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0041] Figure 5 is a schematic diagram of a specific application scenario flow of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0042] Figure 6a is an exemplary schematic diagram of the installation position of a three-dimensional ranging sensor in another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0043] Figure 6b is an exemplary schematic diagram of the installation error of a three-dimensional ranging sensor in another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0044] Figure 6c is an exemplary schematic diagram of a single-loop iteration random sampling consistency algorithm for another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0045] Figure 6d is an exemplary schematic diagram of point cloud data of two planes in another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0046] Figure 6e is an exemplary schematic diagram of selecting a fitting range according to a fitting range at a previous moment in another specific application scenario of the method for determining a yaw angle of a trailer according to an embodiment of the present disclosure;
[0047] Figure 6f An exemplary schematic diagram of fitting data of a left-shift fitting range according to another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0048] Figure 6g An exemplary schematic diagram of fitting data of a right-shifted fitting range according to another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure;
[0049] Figure 6h An exemplary schematic diagram of fitting data of a trailer plane and a side wall plane according to another specific application scenario of the method for determining a yaw angle of a trailer according to an embodiment of the present disclosure;
[0050] Figure 7 is a structural block diagram of a device for determining a yaw angle of a trailer according to an embodiment of the present disclosure;
[0051] Figure 8 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0053] According to an embodiment of the present disclosure, an embodiment of a method for determining the yaw angle of a trailer is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0054] In this embodiment, a method for determining the yaw angle of a trailer is provided, which can be used in the above-mentioned computer system, such as a vehicle-mounted brain, a roadside device, a remote server, etc. Figure 1b is a flow chart of a method for determining the yaw angle of a trailer according to an embodiment of the present disclosure, such as Figure 1b As shown, the process includes the following steps:
[0055] Step S101, obtaining the plane point cloud data of the trailer in the current cycle.
[0056] Among them, the three-dimensional coordinates of each point in the point cloud data represent the spatial position in the horizontal, vertical and depth directions of the acquisition device with the acquisition device as the origin; the acquisition device is set in a preset area on the rear wall of the tractor.
[0057] The above-mentioned execution entity can obtain the plane point cloud data of the trailer in the current acquisition cycle. Specifically, a three-dimensional ranging sensor that can obtain point cloud data can be used to obtain the plane point cloud data of the trailer. For example, a depth camera, a binocular camera, a laser scanner, a structured light scanner, etc. can be used to obtain point cloud data. Specifically, the depth camera can use indirect time of flight (iToF) or direct time of flight (dToF) technology to obtain point cloud data. Although these sensors are based on different ranging and point cloud computing principles, the output point cloud data can be used for angle calculation.
[0058] It is understandable that invalid point cloud data may exist in the directly collected trailer plane point cloud data. For example, point cloud data of connecting wires of tractor and trailer are included. When acquiring the trailer plane point cloud data of the current cycle, these invalid point cloud data can be filtered out. The filtering method can adopt the method of filtering out invalid data in the existing technology or the technology to be developed in the future, such as using a filtering model to filter out invalid data to obtain point cloud data of the valid area or obtaining point cloud data of the valid area after manually filtering out invalid data, as the acquired trailer plane point cloud data of the current cycle, and perform subsequent fitting processing.
[0059] Step S102, fitting a straight line of the trailer plane based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data.
[0060] Among them, the horizontal coordinates and depth coordinates in the trailer plane point cloud data can be expressed as x-axis coordinates and z-axis coordinates. Based on the trailer plane point cloud data, a straight line in a two-dimensional plane can be fitted, and the straight line represents the projection of the trailer plane in the above-mentioned three-dimensional coordinate system in the two-dimensional coordinate system composed of the horizontal direction and the depth direction. The fitting method can be a method used for fitting straight lines in existing technologies or future technologies, and this application does not limit this. For example, the least squares method, random sampling consistency algorithm, function tools for fitting straight lines, etc. are used.
[0061] Step S103: generating a fitting yaw angle of the current cycle between the tractor and the trailer based on the trailer plane straight line.
[0062] Among them, there is a linear relationship between the trailer plane straight line and the fitting yaw angle of the current cycle between the tractor and the trailer. Since the three-dimensional coordinates of each point in the point cloud data represent the spatial position of the acquisition device as the origin, in the horizontal direction (such as the x-axis direction), vertical direction (such as the y-axis direction) and depth direction (such as the z-axis direction) of the acquisition device, the projection of the trailer plane straight line on the projection plane can be expressed as z=kx+b, so there is a fitting yaw angle arctan(k), thereby obtaining the fitting yaw angle of the current cycle between the tractor and the trailer.
[0063] The method for determining the yaw angle of a trailer provided in this embodiment obtains the three-dimensional coordinates of each point in the trailer plane point cloud data of the current period, then fits the trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data, and finally generates the fitted yaw angle of the current period between the tractor and the trailer based on the trailer plane straight line. In this process, an accurate trailer plane straight line is fitted based on the trailer plane point cloud data, and then the fitted yaw angle of the current period is generated based on the mathematical transformation relationship between the trailer plane straight line and the fitted yaw angle, thereby improving the accuracy of the fitted yaw angle.
[0064] In some optional implementations of the above embodiments, the above method for determining the yaw angle of the trailer may further include: step S104, determining the corrected yaw angle of the current period based on the fitted yaw angle of the current period and the collected deviation angle.
[0065] The acquisition deviation angle is determined based on the following steps: when the angle change value of the fitted yaw angle of a preset number of cycles is less than a preset threshold, the acquisition deviation angle is determined based on the fitted yaw angle of a preset number of cycles. Specifically, when the angle change value of the fitted yaw angle of a preset number of cycles is less than the threshold, it means that the trailer is in a straight-ahead state, and the current fitted yaw angle at this time is also a fixed installation deviation. In some examples, the fitted yaw angle of each cycle may also undergo slight changes, so the median, mean, mode or any one of the values of the fitted yaw angle of each cycle can be taken as the acquisition deviation angle.
[0066] It is understandable that in actual installation, due to the errors in manual installation and the errors in the fixing of the connection parts, the plane of the connection between the 3D ranging sensor and the tractor is not parallel to the plane of the tractor. Therefore, it is necessary to determine the acquisition deviation angle corresponding to these errors in order to correct the fitting yaw angle of the current cycle and obtain the corrected yaw angle, that is, the actual angle between the tractor and the trailer.
[0067] The method for determining the yaw angle of the trailer in the present embodiment determines the acquisition deviation angle based on the fitted yaw angle of a preset number of cycles when the angle change value of the fitted yaw angle of a preset number of cycles is less than a preset threshold value. This means that when the fitted yaw angle changes little in multiple cycles, the trailer is in a straight-ahead state. At this time, the current fitted yaw angle is a fixed installation deviation, that is, the acquisition deviation angle. On this basis, the corrected yaw angle of the current cycle is determined based on the fitted yaw angle of the current cycle and the acquisition deviation angle, thereby improving the accuracy of the corrected yaw angle.
[0068] In some optional implementations of the above embodiments, the collection equipment is arranged in a preset area of the wall opposite to the tractor and the trailer, including: the collection equipment is arranged at the center position of the rear wall of the tractor; the center position corresponds to the center of the rear wall in the horizontal and vertical directions.
[0069] By placing the acquisition device at the center of the rear wall of the tractor, it can be ensured that the data within the field of view of the three-dimensional point cloud data is as usable as possible. Figure 1c and Figure 1d , Figure 1c and Figure 1d The front view and top view respectively show the collecting device ③ installed at the center position of the rear wall opposite to the tractor ① and the trailer ②.
[0070] The method for determining the yaw angle of the trailer in this embodiment can obtain more concise and clear point cloud data by limiting the position of the acquisition device, thereby improving the accuracy of the subsequently determined fitting yaw angle of the current period between the tractor and the trailer.
[0071] On the basis of the above-mentioned embodiments, the present disclosure provides a method for fitting a straight line of a trailer plane based on the trailer plane point cloud data, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 2 is a flow chart of a method for fitting a straight line of a trailer plane based on trailer plane point cloud data according to an embodiment of the present disclosure, that is, for Figure 1b Flow chart of an optional implementation of step S102 in FIG. Figure 2 As shown, the process includes the following steps:
[0072] Step S201, during the initial fitting, the horizontal coordinates and the depth coordinates of the trailer plane point cloud data in all vertical directions are used to fit the trailer plane straight line using a random sampling consistency algorithm.
[0073] Among them, during the initial fitting, there may be a scenario of wire harness interference. If you want to get a relatively accurate fitting result in the presence of wire harness interference, you can consider using a random sampling consistency algorithm to avoid the influence of outlier interference data. Specifically, you can randomly select a part of the point cloud data as a sample, get the parameters of the fitting model based on the selected point cloud data, and then use the remaining point cloud data to verify whether the model is optimal, and find the optimal trailer plane straight line through multiple iterations.
[0074] The method for determining the yaw angle of the trailer in this embodiment uses the horizontal coordinates and depth coordinates of the trailer plane point cloud data in all vertical directions during the initial fitting, and uses a random sampling consistency algorithm to fit the trailer plane straight line, so that the full point cloud data can be used to improve the accuracy of the fitting result. When fitting the data for the first time, the random sampling consistency algorithm is used to obtain the straight trailer plane line covering the most data through multiple cycles of iterations, taking into account the exclusion of wire beam interference in the laser point cloud data, thereby improving the accuracy of the fitted trailer plane line.
[0075] Alternatively or additionally, the above-mentioned method for fitting a trailer plane straight line based on trailer plane point cloud data may include: step S202, when it is not the initial fitting and the corrected yaw angle of the previous cycle is less than a first preset angle, obtaining the horizontal coordinates and depth coordinates of all trailer plane point cloud data in the horizontal direction, and fitting the trailer plane straight line using a random sampling consistency algorithm.
[0076] Among them, the first preset angle can be an angle predetermined according to actual application scenarios or experience, which is an angle indicating that the point cloud data includes part of the trailer side wall data but does not need to consider the impact of the data on the fitting result. The first preset angle value is small. When the corrected yaw angle of the previous cycle is less than the first preset angle, the horizontal coordinates and depth coordinates of all the trailer plane point cloud data in the horizontal direction can be obtained, and the random sampling consistency algorithm is used to fit the trailer plane straight line.
[0077] It can be understood that as the corrected yaw angle increases, the point cloud data continues to increase in the horizontal direction. At this time, all the trailer plane point cloud data in the horizontal direction can be obtained for fitting.
[0078] The method for determining the yaw angle of the trailer in this embodiment, when it is not the initial fitting and the corrected yaw angle of the previous cycle is less than the first preset angle, indicates that the yaw angle gradually increases but is less than the first preset angle at this time. At this time, the influence of the side wall data of the trailer is not considered. The horizontal coordinates and depth coordinates of all the trailer plane point cloud data in the horizontal direction can be obtained from the trailer plane point cloud data of the current cycle, and the random sampling consistency algorithm is used to fit the trailer plane straight line, so as to obtain a more accurate trailer plane straight line.
[0079] Alternatively or additionally, the above-mentioned method for fitting a trailer plane straight line based on trailer plane point cloud data may include: step S203, fitting a trailer plane straight line based on a straight line corresponding to a Pearson correlation coefficient that meets the expected condition among the following Pearson correlation coefficients:
[0080] Step S2031, when it is not the initial fitting and the corrected yaw angle of the previous cycle is greater than the first preset angle and less than the second preset angle, starting from the horizontal extreme point of the trailer plane point cloud data recorded in the previous cycle in the current rotation direction, reversely intercept the preset length as the current fitting range.
[0081] The preset length is the horizontal length of the trailer plane point cloud data during the initial fitting. When the corrected yaw angle of the previous cycle is greater than the first preset angle and less than the second preset angle, it means that the yaw angle is large and there is a probability that the side wall data of the trailer will appear in the point cloud data, and it is necessary to intercept the appropriate current fitting range. For example, starting from the extreme point of the trailer plane point cloud data recorded in the previous cycle in the current rotation direction, the preset length can be intercepted in the reverse direction as the current fitting range.
[0082] Step S2032, using the least squares method to fit the initial trailer plane straight line based on the horizontal coordinates and the depth coordinates in the point cloud data of the current fitting range, and determine the initial Pearson correlation coefficient between the point cloud data of the current fitting range and the initial trailer plane straight line.
[0083] Among them, the horizontal coordinates and depth coordinates of the point cloud data in the current fitting range can be expressed as (x 1 , z 1 ), (x 2 , z 2 ), ..., (x n , z n ). Least squares method, linear model is z=kx+b, for point cloud data (x 1 ,z 1 ), (x 2 , z 2 ), ..., (x n , z n ), find k and b so that the sum of squared errors between the model predictions and the actual observations is minimized. For example, the optimal solution can be found by solving the normal equations or using matrix decomposition such as QR decomposition or Cholesky decomposition.
[0084] The Pearson correlation coefficient is a linear correlation coefficient used to measure the degree of linear correlation between the point cloud data of the current fitting range and the initial trailer plane straight line. Its value range is between -1 and 1, where 1 indicates a complete positive linear correlation, -1 indicates a complete negative linear correlation, and 0 indicates that there is no linear correlation between the two variables.
[0085] Step S2033, moving the current fitting range to the left by a preset distance to determine the left-shifted fitting range.
[0086] The preset examples may be determined according to the application scenario or the experience of the technicians, and this application does not limit this. In order to obtain the area with the best linearity, the current fitting range may be moved to the left to try to obtain a fitting result between more relevant point cloud data and the trailer plane straight line.
[0087] Step S2034, using the least squares method to fit the left-shifted trailer plane straight line based on the horizontal coordinates and the depth coordinates in the point cloud data in the left-shifted fitting range, and determine the left-shifted Pearson correlation coefficient between the point cloud data in the left-shifted fitting range and the left-shifted trailer plane straight line.
[0088] The fitting method and the calculation method of the Pearson correlation coefficient are the same as those in step S204 and will not be described in detail here.
[0089] Step S2035, moving rightward a preset distance from the current fitting range to determine the rightward fitting range.
[0090] In order to obtain the area with the best linearity, the current fitting range can be moved to the right to try to obtain a fitting result between more relevant point cloud data and the trailer plane straight line.
[0091] Step S2036, using the least squares method to fit the right-shifted trailer plane straight line based on the horizontal coordinates and depth coordinates in the point cloud data in the right-shifted fitting range, and determine the right-shifted Pearson correlation coefficient between the point cloud data in the right-shifted fitting range and the right-shifted trailer plane straight line.
[0092] The fitting method and the calculation method of the Pearson correlation coefficient are the same as those in step S204 and will not be described in detail here.
[0093] It can be understood that in step S203, the straight line of the trailer plane is fitted based on the straight line corresponding to the Pearson correlation coefficient that meets the expected conditions among the following Pearson correlation coefficients, that is, the straight line of the trailer plane is fitted based on the straight line corresponding to the Pearson correlation coefficient that meets the expected conditions among the initial Pearson correlation coefficient, the left-shifted Pearson correlation coefficient and the right-shifted Pearson correlation coefficient.
[0094] In a specific example, the initial Pearson correlation coefficient is greater than the coefficient threshold, indicating that the initial Pearson correlation coefficient correlation is close to 1. At this time, the initial trailer plane straight line can be used as the fitted trailer plane straight line.
[0095] In another specific example, the initial Pearson correlation coefficient is less than the coefficient threshold, and the left-shifted Pearson correlation coefficient is greater than the coefficient threshold, indicating that the left-shifted Pearson correlation coefficient correlation is close to 1. At this time, the left-shifted trailer plane straight line can be used as the fitted trailer plane straight line.
[0096] In another specific example, the initial Pearson correlation coefficient and the left-shifted Pearson correlation coefficient are less than the coefficient threshold, and the right-shifted Pearson correlation coefficient is greater than the coefficient threshold, indicating that the correlation of the right-shifted Pearson correlation coefficient is close to 1. At this time, the right-shifted trailer plane straight line can be used as the fitted trailer plane straight line.
[0097] In another specific example, the initial Pearson correlation coefficient, the left-shifted Pearson correlation coefficient, and the right-shifted Pearson correlation coefficient are all less than the coefficient threshold, and the straight line corresponding to the maximum value among the initial Pearson correlation coefficient, the left-shifted Pearson correlation coefficient, and the right-shifted Pearson correlation coefficient can be used as the fitted trailer plane straight line.
[0098] The method for determining the yaw angle of the trailer in this embodiment uses the fitting result of the least squares method and the Pearson correlation coefficient as the linearity to evaluate the quality of the fitting when the yaw angle is large and there is a probability that the side wall data of the trailer will appear in the point cloud data. The selected fitting range is moved left and right, and finally the trailer plane straight line corresponding to the Pearson correlation coefficient whose linearity meets the expected coefficient threshold is used as the trailer plane straight line for the output angle measurement result, thereby improving the accuracy of the fitting result based on the appropriate fitting range.
[0099] On the basis of the above embodiments, a method for determining the yaw angle of a trailer is provided in an embodiment of the present disclosure, which can be used in the above mobile terminals, such as mobile phones, tablet computers, etc. Figure 3 is a flow chart of another method for determining the yaw angle of a trailer according to an embodiment of the present disclosure. It can be understood that the Figure 3 The method for determining the yaw angle of the trailer in the flowchart in can be used as the above Figure 1b and / or Figure 2 The method for determining the yaw angle of the trailer is an alternative or supplement to the method, which is not limited in this application. Figure 3 As shown, the process includes the following steps:
[0100] Step S301, obtaining the plane point cloud data of the trailer in the current cycle.
[0101] The process of obtaining the plane point cloud data of the trailer in the current period is the same as the process of obtaining the plane point cloud data of the trailer in the current period in the above step S101, and will not be repeated here.
[0102] Step S302, when it is not the initial fitting and the corrected yaw angle of the previous cycle is greater than the second preset angle, starting from the horizontal extreme point in the trailer plane point cloud data recorded in the previous cycle that is opposite to the current rotation direction, reversely intercept the point cloud data of the first fixed length as the trailer plane data.
[0103] The second preset angle indicates the angle at which the sidewall plane data needs to be retained, which can be determined according to the application scenario or the experience of those skilled in the art, and this application does not limit this. The first fixed length is the length of the trailer plane point cloud data in the horizontal direction during the initial fitting.
[0104] Step S303, using the least square method to fit the trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane data.
[0105] Step S304: Generate a first fitting yaw angle based on the current trailer plane straight line.
[0106] Step S305 , from the trailer plane point cloud data, starting from the horizontal extreme point in the same direction as the current rotation direction recorded in the previous cycle, reversely intercept the point cloud data of a second fixed length as the side wall plane data.
[0107] The second fixed length is determined based on the field of view of the acquisition device and the distance between the acquisition device and the side wall of the trailer, so that correct angle data can be output when only the side wall plane data is retained.
[0108] Step S306 , fitting the sidewall plane straight line based on the horizontal coordinates and the depth coordinates in the sidewall plane data using the least square method.
[0109] Step S307: generating a second fitting yaw angle based on the sidewall plane straight line.
[0110] Step S308: generating a fitting yaw angle of a current cycle between the tractor and the trailer based on a complementary angle between the first fitting yaw angle and the second fitting yaw angle.
[0111] Among them, when the least square method is used to fit the trailer plane straight line and the side wall plane straight line respectively, the Pearson correlation coefficient is used as the fitting constraint.
[0112] In the method for determining the yaw angle of the trailer in this embodiment, when the angle is further increased, it may be possible to retain only the side wall plane data. Therefore, the fitting results of the trailer plane data and the side wall data can be calculated separately, and the fitting yaw angle can be determined. Specifically, when the angle deflection is large, the horizontal extreme point in the opposite direction of the current rotation direction is taken to reversely intercept the point cloud data of the first fixed length as the trailer plane data; the second fixed length between the horizontal extreme point in the current rotation direction and the selected trailer surface data is taken as the side wall plane data. This method optimizes the fitting range for the case where there are more side wall plane data, and determines the fitting trailer plane straight line and the side wall plane straight line, and determines the fitting yaw angle of the current cycle between the tractor and the trailer according to the complementary angle of the first fitting yaw angle and the second fitting yaw angle corresponding thereto, thereby improving the accuracy of the determined fitting yaw angle.
[0113] On the basis of the above-mentioned embodiments, the disclosed embodiments further provide a method for fitting a trailer plane straight line based on the trailer plane point cloud data, which can be used in the above-mentioned mobile terminals, such as mobile phones, tablet computers, etc. Figure 4 is a flow chart of another method for determining the yaw angle of a trailer according to an embodiment of the present disclosure. It can be understood that: Figure 4 The method for determining the yaw angle of the trailer in Figure 1b , Figure 2 and / or Figure 3 The present application does not limit the alternative or additional content of any one or combination of the above. Figure 4 As shown, the method comprises the following steps:
[0114] Step S401, obtaining the plane point cloud data of the trailer in the current cycle.
[0115] Step S402, performing region division in the vertical direction of the trailer plane point cloud data to obtain a point cloud region set.
[0116] Among them, the area division is performed in the vertical direction of the trailer plane point cloud data, that is, the area is layered in the y-axis direction to obtain multiple layers, each layer corresponds to a narrow and long point cloud area distributed in the horizontal direction, thereby obtaining a point cloud area set.
[0117] Step S403: based on each point cloud region in the point cloud region set, respectively fit the trailer region straight line to obtain the trailer region straight line set.
[0118] Step S404: Based on each straight line in the trailer region straight line set, a corresponding regional fitting yaw angle is generated to obtain a regional fitting yaw angle set.
[0119] Step S405: determining a fitting yaw angle of a current cycle between the tractor and the trailer based on the regional fitting yaw angle set.
[0120] Among them, based on the regional fitting yaw angle set, the fitting yaw angle of the current cycle between the tractor and the trailer is determined, which can be determined according to the requirements of the application scenario or the experience of the technicians. For example, after mathematically processing the distribution in the set, the fitting yaw angle representing the situation of the set is obtained as the fitting yaw angle of the current cycle between the tractor and the trailer.
[0121] In the above Figure 4 In some optional implementations of the illustrated embodiment, the above-mentioned step S405, determining the fitted yaw angle of the current cycle between the tractor and the trailer based on the regional fitted yaw angle set, may include any of the following items: using the median of each yaw angle in the regional fitted yaw angle set as the fitted yaw angle of the current cycle between the tractor and the trailer; using the average of each yaw angle in the regional fitted yaw angle set as the fitted yaw angle of the current cycle between the tractor and the trailer; using the mode of each yaw angle in the regional fitted yaw angle set as the fitted yaw angle of the current cycle between the tractor and the trailer.
[0122] The method for determining the yaw angle of the trailer in this embodiment improves the accuracy of the determined fitting yaw angle by further defining how to determine the fitting yaw angle of the tractor and the trailer based on the regional fitting yaw angle set.
[0123] In the above Figure 4In some optional implementations of the illustrated embodiment, the above-mentioned step S405, determining the fitted yaw angle of the current cycle between the tractor and the trailer based on the regional fitting yaw angle set, may include: when the difference between the regional fitting yaw angle in the regional fitting yaw angle set and the corresponding regional fitting yaw angle of the previous cycle is greater than the angle difference threshold, determining that the regional fitting yaw angle is wrong; when all the regional fitting yaw angles in the regional fitting yaw angle set are wrong, determining the fitted yaw angle of the current cycle between the tractor and the trailer based on the average value of the fitted yaw angles of a predetermined number of cycles before the current cycle.
[0124] The method for determining the yaw angle of the trailer in this embodiment clarifies the contents of eliminating erroneous yaw angle data and correcting erroneous yaw angle data, thereby improving the accuracy of the determined fitting yaw angle of the current cycle between the tractor and the trailer.
[0125] In some specific examples of the above optional implementation methods, determining the fitted yaw angle of the current cycle between the tractor and the trailer based on the average value of the fitted yaw angles of a preset number of cycles before the current cycle can include: performing mean smoothing on the average value of the fitted yaw angles of a preset number of cycles before the current cycle and the fitted yaw angle of the current cycle to obtain an updated fitted yaw angle of the current cycle between the tractor and the trailer.
[0126] The method for determining the yaw angle of the trailer in this embodiment clarifies the specific processing process of correcting erroneous yaw angle data, and further determines the accuracy of the fitted yaw angle of the current cycle between the tractor and the trailer.
[0127] In this embodiment, a method for determining the yaw angle of a trailer is provided, which can be used in the above-mentioned computer system, such as a vehicle-mounted brain, a roadside device, a remote server, etc. Figure 5 A schematic flow chart of a specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the process includes the following steps:
[0128] Step S1: reading point cloud data, that is, reading the initial point cloud data collected by the collection device.
[0129] Step S2: filtering out the abnormal point cloud distance points, that is, filtering out the points in the initial point cloud data that are abnormally far from the point cloud data of the trailer plane, and obtaining the valid point cloud data of the trailer plane in the current period.
[0130] Step S3: Create an xz hash table, that is, create a hash table corresponding to the trailer plane point cloud data.
[0131] Step S4: Determine whether it is initialized, that is, determine whether it is the first fitting. If so, execute step S5; if not, execute step S8.
[0132] Step S5: Determine whether the hash table has been traversed. If so, execute step S7; if not, execute step S6.
[0133] Step S6: Full-frame fitting of the current hash table, that is, using the horizontal coordinates and depth coordinates of the trailer plane point cloud data in all vertical directions, using a random sampling consistency algorithm to fit the trailer plane straight line, and executing step S5.
[0134] Step S7: Obtain the x-axis point cloud interval of the trailer plane, fit the trailer plane straight line and generate the fitting yaw angle, and jump to step S16. That is, obtain the horizontal coordinates and depth coordinates of all trailer plane point cloud data in the horizontal direction, use the random sampling consistency algorithm to fit the trailer plane straight line, and generate the fitting yaw angle of the current cycle between the tractor and the trailer based on the trailer plane straight line.
[0135] Step S8: Determine whether the hash table has been traversed. If so, jump to S11; if not, execute step 9.
[0136] Step S9: Determine whether the fitting interval has been traversed. If so, execute step 8; if not, execute step S10. In this case, when it is not the first fitting, start from the horizontal extreme point of the trailer plane point cloud data recorded in the previous cycle in the current rotation direction, and reversely intercept the preset length as the current fitting range (i.e., fitting interval);
[0137] Step S10: linear fitting, that is, fitting the initial trailer plane straight line based on the horizontal coordinates and the depth coordinates in the point cloud data of the current fitting range by using the least square method; then, executing step S9;
[0138] Step S11: Determine whether to shift the interval to the left, that is, determine the initial Pearson correlation coefficient between the point cloud data in the current fitting range and the initial trailer plane straight line, and determine whether the initial Pearson correlation coefficient does not meet the expected conditions. If so, execute step S12, if not, execute step S8.
[0139] Step S12: Determine whether to update the data, that is, move the preset distance to the left from the current fitting range to determine the left-shifted fitting range; use the least squares method to fit the left-shifted trailer plane straight line based on the horizontal coordinates and depth coordinates in the point cloud data in the left-shifted fitting range, and determine whether the left-shifted Pearson correlation coefficient between the point cloud data in the left-shifted fitting range and the left-shifted trailer plane straight line is better than the initial Pearson correlation coefficient. If so, execute step S14; if not, execute step S13.
[0140] Step S13: Determine whether to right-shift the interval, that is, move the preset distance to the right from the current fitting range to determine the right-shift fitting range; use the least squares method to fit the right-shifted trailer plane straight line based on the horizontal coordinates and depth coordinates in the point cloud data of the right-shifted fitting range, and determine whether the right-shifted Pearson correlation coefficient between the point cloud data in the right-shifted fitting range and the right-shifted trailer plane straight line is better than the initial Pearson correlation coefficient. If so, execute step S14, if not, execute step S8.
[0141] Step S14: Determine whether the result is valid, if so, execute step S16, if not, execute step S15. That is, determine whether the fitting yaw angle of the current cycle generated based on the trailer plane straight line is wrong: when there is no difference between the regional fitting yaw angle and the corresponding regional fitting yaw angle of the previous cycle in the regional fitting yaw angle set that is greater than the angle difference threshold, it is determined that the fitting yaw angle of the current cycle between the tractor and the trailer is correct, and step S16 is executed; when there is a difference between the regional fitting yaw angle and the corresponding regional fitting yaw angle of the previous cycle in the regional fitting yaw angle set that is greater than the angle difference threshold, it is determined that the regional fitting yaw angle is wrong, and step S15 is executed.
[0142] Step S15: predicting the angle, that is, when all the regional fitting yaw angles in the regional fitting yaw angle set are wrong, determining the fitting yaw angle of the current cycle between the tractor and the trailer based on the average value of the fitting yaw angles of a predetermined number of cycles before the current cycle. Thereafter, executing step S16.
[0143] Step S16: Return the final angle. That is, based on the fitted yaw angle of the current period and the collected deviation angle, determine the corrected yaw angle of the current period. Then, execute step S17.
[0144] Step S17: Determine whether there is only one fitting interval. If so, execute step S18; if not, execute step S23.
[0145] Step S18: Determine whether the angle is large, that is, determine whether it is not the initial fitting and the corrected yaw angle of the previous cycle is greater than the second preset angle. If so, execute step S19; if not, execute step S20.
[0146] Step S19: Determine whether to turn right, if so, execute step S21; if not, execute step S22.
[0147] Step S20: Initialize the algorithm, then execute step S25.
[0148] Step S21: Add right side wall data, that is, from the trailer plane point cloud data, starting from the horizontal extreme point in the same direction as the current rotation direction recorded in the previous cycle, reversely intercept the second fixed length of point cloud data as the side wall plane data, and use the least squares method to fit the side wall plane straight line based on the horizontal coordinates and depth coordinates in the side wall plane data; based on the side wall plane straight line, generate the second fitting yaw angle; based on the complementary angle of the first fitting yaw angle and the second fitting yaw angle, generate the fitting yaw angle of the current cycle between the tractor and the trailer. Then execute step S25.
[0149] Step S22: Add the left side wall data, that is, from the trailer plane point cloud data, starting from the horizontal extreme point in the same direction as the current rotation direction recorded in the previous cycle, reversely intercept the second fixed length of point cloud data as the side wall plane data, and use the least squares method to fit the side wall plane straight line based on the horizontal coordinates and depth coordinates in the side wall plane data; based on the side wall plane straight line, generate the second fitting yaw angle; based on the complementary angle of the first fitting yaw angle and the second fitting yaw angle, generate the fitting yaw angle of the current cycle between the tractor and the trailer. Then execute step S25.
[0150] Step S23: Determine whether the angle is small, if so, execute step S24, if not, execute step 25.
[0151] Step S24: Delete the trailer side wall data, and then execute step S25.
[0152] Step S25: record the current angle, and then execute step S26.
[0153] Step S26: Determine whether the length of the historical data exceeds the upper limit, if so, execute step S27, if not, execute step S28.
[0154] Step S27: Delete the oldest angle, and then execute step S28.
[0155] Step S28: Determine the rotation direction of the trailer, and then execute step S29.
[0156] Step S29: Update the mean data, that is, perform mean smoothing processing on the average value of the fitting yaw angles of a predetermined number of cycles before the current cycle and the fitting yaw angle of the current cycle to obtain the updated fitting yaw angle of the current cycle between the tractor and the trailer. Then, execute step S30.
[0157] Step S30: Output angle data.
[0158] As one or more specific application embodiments of the method for determining the yaw angle of a trailer according to the embodiment of the present disclosure, the following is combined with Figure 6a-6e , describe a specific application scenario.
[0159] In a specific example, Figure 6a As shown, Figure 6a The figure shows the derivation diagram of the angle calculation process of the three-dimensional ranging sensor. Figure 6a In the point cloud data, the installation position of the 3D ranging sensor is used as the origin of the coordinate system, with the x-axis being horizontal, the y-axis being vertical, and the z-axis being depth. The 3D coordinates (x, y, z) of each point describe the spatial position of the point relative to the sensor.
[0160] In the top view, the plane of the tractor can be simplified to the straight line AB, and the plane of the trailer can be simplified to the straight line CD. Correspondingly, the angle between the two is the angle α formed by their axes. By plane geometry conversion, it can be obtained that the angle β formed by the straight lines AB and CD is the same. Since the installation position of the three-dimensional ranging sensor is the intersection E of the straight line AB and the axis thereof, this position is the origin of the corresponding point cloud space coordinate system, so the linear function equation z=kx+b can be obtained according to the x and z data of the straight line CD, so α=β=atan(k) can be obtained, and the angle data between the tractor and the trailer can be obtained.
[0161] like Figure 6b As shown, Figure 6b The following is an exemplary schematic diagram showing the installation error of a 3D ranging sensor. During actual installation, due to the error of manual intervention and the error factor of the connection between the 3D ranging sensor and the tractor, the plane of the sensor is not parallel to the plane of the tractor. Figure 6b The middle straight line FG represents the front surface of the 3D ranging sensor, which forms an angle δ with the plane straight line AB of the tractor. The angle obtained according to the point cloud computing result is γ. In fact, the angle δ obtained at this time is different from the actual required angle α between the tractor and the trailer due to the aforementioned error, and the numerical difference is the angle δ converted by plane geometry, that is, α=γ±δ (± is related to the deflection direction at this time. If the positive and negative direction is determined, it can be rewritten as α=γ+δ).
[0162] When the 3D ranging sensor is installed and when the large truck turns, the angle δ between the 3D ranging sensor and the tractor is difficult to measure. However, due to the physical connection between the tractor and trailer of the large truck, after the tractor has driven in a straight line for a period of time, the trailer will also follow the tractor in a straight line, that is, the angle α between the tractor and the trailer is 0 at this time. Since the installation error and connection error of the 3D ranging sensor have been determined during installation, the angle δ between the 3D ranging sensor and the tractor is the same as the angle data γ obtained by function calculation, that is, δ=γ.
[0163] In actual application scenarios, due to factors such as the certain noise of the three-dimensional ranging sensor itself and the original design of the trailer plane, the ideal plane required for the above calculation does not exist. Therefore, it is necessary to find a plane that is as similar as possible to the obtained point cloud data for the next step of calculation, that is, linear fitting.
[0164] In the scenario where there is wire harness interference in front of the trailer, the random sampling consensus algorithm (Ransac) can be used to avoid wire harness interference and obtain a linear equation. The fitting algorithm finds the optimal function line through multiple loop iterations. Figure 6c The schematic diagram of the random sampling consistency of a single loop iteration is shown, where point A and point B are two random points on the xz coordinate system mapped to the point cloud returned by the three-dimensional ranging sensor, and the straight line AB and its corresponding function straight line are obtained by connecting these two points as the output result of this random sampling. By manually setting the tolerance range d, and counting the number of points whose Euclidean distance (shortest straight line distance) to the straight line is less than the set tolerance range d, as the basis for evaluating the fitting effect this time, multiple loop iterations are performed to obtain the straight line that can cover the most data and the optimal function straight line as the output of this fitting result.
[0165] As the large truck turns, the relative position between the tractor and the trailer will deflect. At this time, the point cloud data returned by the 3D ranging sensor will return the data of the trailer side wall plane in addition to the currently used trailer plane data, such as Figure 6d As shown, Figure 6d A schematic diagram showing point cloud data with two planes. Due to the physical form of the trailer itself, the angle between the trailer plane and the side wall plane is always a right angle, i.e. 90°, but it is difficult to determine based on the current data alone. Figure 6d Which straight line does the plane of the trailer correspond to, and it is difficult to find the intersection of the two planes. The present invention proposes a time-series-based solution for quickly separating different plane data. Considering that the field of view (FoV) of the three-dimensional ranging sensor cannot cover the entire trailer plane, when the angle between the tractor and the trailer is small, there is no need to consider the influence of the side wall plane data on the fitting result. All data on the x-axis can be directly used for fitting, and the value of the extreme value in the x-direction of the point cloud data at this time is recorded for the selection of the fitting range at the next moment (that is, the next cycle). When the output angle is large at this time, that is, there is a probability that the side wall plane data will appear, considering that the fitting result consistent with random sampling is random, the fitting result of the least squares method is used and the Pearson correlation coefficient is used as a linearity reference to evaluate the quality of the fitting at this time, and the selected area is moved left and right, and finally the angle measurement result is output consistently according to the area with the best linearity by random sampling.
[0166] Schematic diagram as Figure 6e , 6f , as shown in 6g, Figure 6eis an exemplary schematic diagram of selecting a fitting range according to a fitting range at a previous moment in another specific application scenario of the method for determining a yaw angle of a trailer according to an embodiment of the present disclosure; Figure 6f An exemplary schematic diagram of fitting data of a left-shift fitting range according to another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure; Figure 6g An exemplary schematic diagram of fitting data of a right-shifted fitting range according to another specific application scenario of the method for determining the yaw angle of a trailer according to an embodiment of the present disclosure.
[0167] in, Figure 6e Select the fitting range according to the last moment (that is, the last cycle), Figure 6f Shift the fitting range to the left, and the linearity will decrease. Figure 6g Shifting the fitting range to the right improves linearity.
[0168] In this way, the angle data calculation can be realized when both the trailer plane and the side wall data exist. When the angle is further increased, only the side wall data may be retained, so the concept of side wall data calculation is introduced. As mentioned above, it is difficult to accurately find the dividing point between the trailer plane and the side wall. Using the above method to filter the fitting range can only ensure that all data within the fitting range are trailer plane data, and some trailer plane data are still not taken into account.
[0169] When the angle deflection is large, a shorter fixed length between the extreme point of the x-axis in the current rotation direction and the selected trailer plane data is taken as the side wall data, such as Figure 6h As shown, Figure 6h An exemplary schematic diagram showing the fitting data of the trailer plane and the sidewall plane.
[0170] The data in the fitting range intercepted by lines 1 and 2 are the plane data of the trailer, corresponding to the fitting function line L1, and lines 3 and 4 are the sidewall data ranges with a fixed length according to the rotation direction of the trailer, corresponding to the fitting function line L2. The angle data calculated by L1 and L2 are approximately complementary (the sum of the two angles is 90°), so that the correct angle data can be output when only the sidewall data is retained.
[0171] It is understandable that in actual use, the vehicle does not turn at high speed, and no matter what kind of three-dimensional ranging sensor, the final output point cloud data has certain fluctuations, and the output results of the same data for random sampling also have certain fluctuations. In order to improve the feasibility and stability of the data, the following solutions can be adopted: 1. The data of the manually selected y-axis area is subdivided again. Each segment of the subdivided area data will produce an angle output after conditional judgment, and the median of all data is taken as the final output result; 2. Add angle difference judgment, that is, judge the difference between the output angle data at the current moment and the output angle at the previous moment. If the difference is too large, the current angle is considered inaccurate. If the output angles of all subdivided areas are inaccurate, the average value of the angle data calculated at recent moments is used as the output result; 3. The data is combined with the previous data to perform average smoothing to ensure that the data fluctuation is small.
[0172] In this embodiment, a device for determining the yaw angle of a trailer is also provided, and the device is used to implement the above-mentioned embodiments and preferred embodiments, which have been described and will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0173] This embodiment provides a device for determining the yaw angle of a trailer, such as Figure 7 As shown, the device comprises:
[0174] The acquisition module 701 is used to acquire the plane point cloud data of the trailer in the current cycle, wherein the three-dimensional coordinates of each point in the point cloud data represent the spatial position in the horizontal direction, vertical direction and depth direction of the acquisition device with the acquisition device as the origin; the acquisition device is set in a preset area of the rear wall of the tractor;
[0175] A fitting module 702 is used to fit a straight line of the trailer plane based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data;
[0176] The generating module 703 is used to generate a fitting yaw angle of the current cycle between the tractor and the trailer based on the trailer plane straight line.
[0177] In some optional embodiments, the device further comprises:
[0178] The determination module 704 is used to determine the corrected yaw angle of the current period based on the fitted yaw angle of the current period and the acquisition deviation angle, wherein the acquisition deviation angle is determined based on the following steps: when the angle change value of the fitted yaw angle of a preset number of periods is less than a preset threshold, the acquisition deviation angle is determined based on the fitted yaw angle of a preset number of periods.
[0179] In some optional embodiments, the fitting module is further used to: during the initial fitting, use the horizontal coordinates and depth coordinates of the trailer plane point cloud data in all vertical directions, and use a random sampling consistency algorithm to fit the trailer plane straight line.
[0180] In some optional embodiments, the fitting module is further used to: when it is not the initial fitting and the corrected yaw angle of the previous cycle is less than a first preset angle, obtain the horizontal coordinates and depth coordinates of all trailer plane point cloud data in the horizontal direction, and use a random sampling consistency algorithm to fit the trailer plane straight line.
[0181] In some optional embodiments, the fitting module is further used to: fit the trailer plane straight line based on the straight line corresponding to the Pearson correlation coefficient that meets the expected conditions among the following Pearson correlation coefficients: when it is not the initial fitting and the corrected yaw angle of the previous cycle is greater than the first preset angle and less than the second preset angle, starting from the horizontal extreme point of the trailer plane point cloud data recorded in the previous cycle in the current rotation direction, reversely intercept the preset length as the current fitting range; use the least squares method to fit the initial trailer plane straight line based on the horizontal coordinates and depth coordinates in the point cloud data of the current fitting range, and determine the initial Pearson correlation coefficient between the point cloud data of the current fitting range and the initial trailer plane straight line; wherein the preset length It is the horizontal length of the trailer plane point cloud data at the time of initial fitting; move the preset distance to the left from the current fitting range to determine the left-shift fitting range; use the least squares method based on the horizontal coordinates and depth coordinates in the point cloud data in the left-shift fitting range to fit the left-shift trailer plane straight line, and determine the left-shift Pearson correlation coefficient between the point cloud data in the left-shift fitting range and the left-shift trailer plane straight line; move the preset distance to the right from the current fitting range to determine the right-shift fitting range; use the least squares method based on the horizontal coordinates and depth coordinates in the point cloud data in the right-shift fitting range to fit the right-shift trailer plane straight line, and determine the right-shift Pearson correlation coefficient between the point cloud data in the right-shift fitting range and the right-shift trailer plane straight line.
[0182] In some optional embodiments, the fitting module is further used for: when it is not the initial fitting and the corrected yaw angle of the previous cycle is greater than a second preset angle, starting from the horizontal extreme point in the trailer plane point cloud data recorded in the previous cycle that is opposite to the current rotation direction, reversely intercepting the point cloud data of a first fixed length as the trailer plane data, and fitting the trailer plane straight line based on the horizontal coordinates and depth coordinates in the trailer plane data using the least squares method; wherein the first fixed length is the length of the trailer plane point cloud data in the horizontal direction during the initial fitting; the generation module is further used for: generating a first fitting yaw angle based on the current trailer plane straight line; from the trailer plane point cloud data, since the previous cycle record Starting from the horizontal extreme point in the same direction as the current rotation direction, the point cloud data of the second fixed length is intercepted in the reverse direction as the side wall plane data, and the side wall plane straight line is fitted based on the horizontal coordinates and the depth coordinates in the side wall plane data by the least squares method; based on the side wall plane straight line, a second fitting yaw angle is generated; based on the complementary angle of the first fitting yaw angle and the second fitting yaw angle, a fitting yaw angle of the current cycle between the tractor and the trailer is generated; wherein the second fixed length is calculated and determined based on the field of view angle of the acquisition device and the distance between the acquisition device and the side wall of the trailer; wherein, when the trailer plane straight line and the side wall plane straight line are respectively fitted by the least squares method, the Pearson correlation coefficient is respectively used as the fitting constraint.
[0183] In some optional embodiments, the fitting module is further used to: perform area division in the vertical direction of the trailer plane point cloud data to obtain a point cloud area set; based on each point cloud area in the point cloud area set, fit the trailer area straight lines respectively to obtain a trailer area straight line set; the generation module is further used to: based on each straight line in the trailer area straight line set, generate the corresponding regional fitting yaw angle to obtain a regional fitting yaw angle set; based on the regional fitting yaw angle set, determine the fitting yaw angle of the current cycle between the tractor and the trailer.
[0184] In some optional embodiments, the generation module determines the fitted yaw angle of the current cycle between the tractor and the trailer based on the regional fitted yaw angle set, including any of the following items: using the median of each yaw angle in the regional fitted yaw angle set as the fitted yaw angle of the current cycle between the tractor and the trailer; using the average of each yaw angle in the regional fitted yaw angle set as the fitted yaw angle of the current cycle between the tractor and the trailer; using the mode of each yaw angle in the regional fitted yaw angle set as the fitted yaw angle of the current cycle between the tractor and the trailer.
[0185] In some optional embodiments, the generation module determines the fitted yaw angle of the current cycle between the tractor and the trailer based on the regional fitted yaw angle set, and also includes: when the difference between the regional fitted yaw angle in the regional fitted yaw angle set and the corresponding regional fitted yaw angle of the previous cycle is greater than the angle difference threshold, determining that the regional fitted yaw angle is wrong; when all the regional fitted yaw angles in the regional fitted yaw angle set are wrong, determining the fitted yaw angle of the current cycle between the tractor and the trailer based on the average value of the fitted yaw angles of a predetermined number of cycles before the current cycle.
[0186] In some optional embodiments, the generation module determines the fitted yaw angle of the current cycle between the tractor and the trailer based on the average value of the fitted yaw angles of a preset number of cycles before the current cycle, including: performing mean smoothing processing on the average value of the fitted yaw angles of a preset number of cycles before the current cycle and the fitted yaw angle of the current cycle to obtain an updated fitted yaw angle of the current cycle between the tractor and the trailer.
[0187] In some optional embodiments, the acquisition device in the acquisition module is set in a preset area of the wall opposite to the tractor and the trailer, including: the acquisition device is set at the center position of the rear wall of the tractor; the center position corresponds to the center of the rear wall in the horizontal and vertical directions.
[0188] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0189] In this embodiment, a device for determining the yaw angle of a trailer is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0190] See also Figure 8 , Figure 81 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present disclosure, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0191] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0192] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0193] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0194] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0195] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.
[0196] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0197] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0198] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0199] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining the yaw angle of a trailer, It is characterized in that The method comprises: Acquire the plane point cloud data of the trailer in the current cycle, wherein the three-dimensional coordinates of each point in the point cloud data represent the spatial position in the horizontal direction, vertical direction and depth direction of the acquisition device with the acquisition device as the origin; the acquisition device is set in a preset area on the rear wall of the tractor; Fitting a trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data, including: performing region division in the vertical direction of the trailer plane point cloud data to obtain a point cloud region set; fitting trailer region straight lines based on each point cloud region in the point cloud region set to obtain a trailer region straight line set; Based on the trailer plane straight line, a fitting yaw angle of the current cycle between the tractor and the trailer is generated, including: based on each straight line in the trailer area straight line set, a corresponding regional fitting yaw angle is generated to obtain a regional fitting yaw angle set; based on the regional fitting yaw angle set, a fitting yaw angle of the current cycle between the tractor and the trailer is determined.
2. The method according to claim 1, It is characterized in that The method further comprises: Based on the fitted yaw angle of the current period and the acquisition deviation angle, a corrected yaw angle of the current period is determined, wherein the acquisition deviation angle is determined based on the following steps: when the angle change value of the fitted yaw angle of a preset number of periods is less than a preset threshold, the acquisition deviation angle is determined based on the fitted yaw angle of the preset number of periods.
3. The method according to claim 2, It is characterized in that The step of fitting a straight line of the trailer plane based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data comprises: During the initial fitting, the horizontal coordinates and depth coordinates of the trailer plane point cloud data in all vertical directions are used, and the random sampling consistency algorithm is used to fit the trailer plane straight line.
4. The method according to claim 2, It is characterized in that The step of fitting a straight line of the trailer plane based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data comprises: When it is not the initial fitting and the corrected yaw angle of the previous cycle is less than the first preset angle, the horizontal coordinates and the depth coordinates of all the trailer plane point cloud data in the horizontal direction are obtained, and the trailer plane straight line is fitted using a random sampling consistency algorithm.
5. The method according to claim 2, It is characterized in that The fitting of the trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data includes: fitting the trailer plane straight line based on the straight line corresponding to the Pearson correlation coefficient that meets the expected conditions among the following Pearson correlation coefficients: When it is not the first fitting and the corrected yaw angle of the previous cycle is greater than the first preset angle and less than the second preset angle, starting from the horizontal extreme point of the trailer plane point cloud data recorded in the previous cycle in the current rotation direction, reversely intercept the preset length as the current fitting range; the initial trailer plane straight line is fitted based on the horizontal coordinates and depth coordinates in the point cloud data of the current fitting range using the least squares method, and the initial Pearson correlation coefficient between the point cloud data of the current fitting range and the initial trailer plane straight line is determined; wherein the preset length is the length of the trailer plane point cloud data in the horizontal direction during the first fitting; Move a preset distance to the left from the current fitting range to determine the left-shift fitting range; use the least square method to fit the left-shift trailer plane straight line based on the horizontal coordinates and the depth coordinates in the point cloud data of the left-shift fitting range, and determine the left-shift Pearson correlation coefficient between the point cloud data in the left-shift fitting range and the left-shift trailer plane straight line; Move a preset distance to the right from the current fitting range to determine the right-shifted fitting range; use the least squares method to fit the right-shifted trailer plane straight line based on the horizontal coordinates and depth coordinates in the point cloud data of the right-shifted fitting range, and determine the right-shifted Pearson correlation coefficient between the point cloud data in the right-shifted fitting range and the right-shifted trailer plane straight line.
6. The method according to claim 2, It is characterized in that The step of fitting a straight line of the trailer plane based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data comprises: When it is not the first fitting and the corrected yaw angle of the previous cycle is greater than the second preset angle, starting from the horizontal extreme point in the trailer plane point cloud data recorded in the previous cycle that is opposite to the current rotation direction, reversely intercept the point cloud data of the first fixed length as the trailer plane data, and use the least squares method based on the horizontal coordinates and the depth coordinates in the trailer plane data to fit the trailer plane straight line; wherein the first fixed length is the length of the trailer plane point cloud data in the horizontal direction during the first fitting; The generating of the fitting yaw angle of the current cycle between the tractor and the trailer based on the trailer plane straight line comprises: Based on the current trailer plane straight line, a first fitting yaw angle is generated; from the trailer plane point cloud data, starting from the horizontal extreme point in the same direction as the current rotation direction recorded in the previous cycle, the point cloud data of the second fixed length is intercepted in the reverse direction as the side wall plane data, and the side wall plane straight line is fitted based on the horizontal coordinates and the depth coordinates in the side wall plane data using the least squares method; based on the side wall plane straight line, a second fitting yaw angle is generated; based on the complementary angle of the first fitting yaw angle and the second fitting yaw angle, a fitting yaw angle of the current cycle between the tractor and the trailer is generated; wherein the second fixed length is calculated and determined based on the field of view angle of the acquisition device and the distance between the acquisition device and the trailer side wall; Among them, when the least square method is used to fit the trailer plane straight line and the side wall plane straight line respectively, the Pearson correlation coefficient is used as the fitting constraint.
7. The method according to claim 1, It is characterized in that The determining of the fitted yaw angle of the current cycle between the tractor and the trailer based on the regional fitted yaw angle set includes any one of the following: The median value of each yaw angle in the set of regional fitting yaw angles is used as the fitting yaw angle of the current cycle between the tractor and the trailer; Taking the average value of each yaw angle in the regional fitting yaw angle set as the fitting yaw angle of the current cycle between the tractor and the trailer; The mode of each yaw angle in the regional fitting yaw angle set is used as the fitting yaw angle of the current cycle between the tractor and the trailer.
8. The method according to claim 7, It is characterized in that The step of determining the fitting yaw angle of the current cycle between the tractor and the trailer based on the regional fitting yaw angle set further includes: When the difference between a regional fitting yaw angle in the regional fitting yaw angle set and a corresponding regional fitting yaw angle of a previous cycle is greater than an angle difference threshold, determining that the regional fitting yaw angle is wrong; When all the regional fitting yaw angles in the regional fitting yaw angle set are wrong, a fitting yaw angle of the current cycle between the tractor and the trailer is determined based on an average value of the fitting yaw angles of a predetermined number of cycles before the current cycle.
9. The method according to claim 8, It is characterized in that The step of determining the fitting yaw angle of the current cycle between the tractor and the trailer based on an average value of the fitting yaw angles of a preset number of cycles before the current cycle comprises: Mean smoothing is performed on an average value of the fitting yaw angles of a predetermined number of cycles before the current cycle and the fitting yaw angle of the current cycle to obtain an updated fitting yaw angle of the current cycle between the tractor and the trailer.
10. The method according to claim 1, It is characterized in that The collection device is arranged on a preset area of the wall opposite to the tractor and the trailer, including: The collecting device is arranged at the center position of the rear wall of the tractor; the center position corresponds to the center of the rear wall in the horizontal direction and the vertical direction.
11. A device for determining the yaw angle of a trailer, It is characterized in that The device comprises: An acquisition module is used to acquire the plane point cloud data of the trailer in the current cycle, wherein the three-dimensional coordinates of each point in the point cloud data represent the spatial position in the horizontal direction, vertical direction and depth direction of the acquisition device with the acquisition device as the origin; the acquisition device is set in a preset area on the rear wall of the tractor; A fitting module is used to fit the trailer plane straight line based on the horizontal coordinates and the depth coordinates in the trailer plane point cloud data, including: performing area division in the vertical direction of the trailer plane point cloud data to obtain a point cloud area set; based on each point cloud area in the point cloud area set, fitting the trailer area straight line respectively to obtain the trailer area straight line set; A generation module is used to generate a fitting yaw angle of the current cycle between the tractor and the trailer based on the trailer plane straight line, including: generating a corresponding regional fitting yaw angle based on each straight line in the trailer regional straight line set to obtain a regional fitting yaw angle set; and determining the fitting yaw angle of the current cycle between the tractor and the trailer based on the regional fitting yaw angle set.
12. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for determining the yaw angle of a trailer according to any one of claims 1 to 10 by executing the computer instructions.
13. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for determining the yaw angle of a trailer according to any one of claims 1 to 10.
14. A computer program product, It is characterized in that The method comprises computer instructions for causing a computer to execute the method for determining the yaw angle of a trailer according to any one of claims 1 to 10.
