A method for detecting towing angle of a tractor, electronic equipment and storage medium
Point cloud data is acquired through lidar and combined with Kalman filtering technology, the problem of traditional drag angle detection relying on hardware sensors is solved, and accurate and stable angle detection in port autonomous driving is achieved, reducing system complexity and cost.
Patent Information
- Application Number
- CN202411565419.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-11-05
AI Technical Summary
In port autonomous driving, traditional towing angle detection methods rely on additional hardware sensors, increasing system complexity and cost, and may fail in extreme weather conditions, affecting detection accuracy.
The point cloud data is obtained by using lidar on the tractor, and the drag angle is determined through plane detection and Kalman filtering technology, which avoids dependence on additional hardware sensors and reduces detection complexity and cost.
Accurate and stable drag angle detection in different scenarios is achieved, the accuracy and reliability of the detection is improved, and it is suitable for different vehicle models and scenario needs.
Smart Images

Figure CN119068444B_ABST
Abstract
Description
Background Art
[0002] In port autonomous driving, unmanned container trucks with tractors and trailers are one of the main models. In order to ensure transportation efficiency and driving safety, accurately measuring the angle of the trailer is an urgent problem to be solved. Traditional trailer angle detection methods mostly rely on additional hardware sensors installed on the trailer, such as inclinometers, accelerometers, etc., but these hardware sensors increase the complexity and cost of the system. In addition, these hardware devices may malfunction under extreme weather conditions, which in turn affects the accuracy of the detection results.
[0003] Therefore, how to accurately measure the towing angle without relying on additional external hardware sensors in unmanned port operations is an urgent problem that needs to be solved.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a method for detecting a towing angle of a tractor, an electronic device and a storage medium, which can at least to some extent overcome the problem of poor accuracy of towing angle detection in related technologies.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a method for detecting a towing angle of a tractor is provided, comprising:
[0008] Obtain point cloud data through the laser radar on the tractor;
[0009] Performing plane detection according to the point cloud data, determining a target plane that meets a preset angle condition, and removing the ground point cloud according to the target plane;
[0010] Acquire a preset edge point of the trailer at an initial position, wherein the initial position is a position where the rotation angle of the trailer relative to the tractor is 0 degrees;
[0011] Determine the region of interest according to the preset edge points and the preset expansion parameters;
[0012] Searching for regional point cloud data corresponding to the trailer through the region of interest, and obtaining the edge of the target trailer according to the regional point cloud data;
[0013] Obtaining a target candidate frame and a first detection angle corresponding to the target candidate frame according to the target dragging edge;
[0014] Acquire a current predicted angle through Kalman filtering, and acquire a second detection angle through detection through the region of interest based on the current predicted angle;
[0015] A towing angle is determined according to the first detection angle and the second detection angle.
[0016] In one embodiment of the present disclosure, performing plane detection according to the point cloud data, determining a target plane that meets a preset angle condition, and removing the ground point cloud according to the target plane includes:
[0017] Acquire a first point cloud below a first preset height according to the point cloud data;
[0018] Performing plane fitting using the RANSAC algorithm according to the first point cloud to obtain a first plane;
[0019] According to the current angle between the normal vector of the first plane and the preset vector, selecting a second plane whose current angle satisfies a first preset angle range;
[0020] Selecting the second plane having the largest number of point clouds exceeding a preset number as the target plane;
[0021] A ground point cloud is acquired according to the target plane, and the ground point cloud is removed.
[0022] In one embodiment of the present disclosure, it also includes:
[0023] Obtaining a tracking normal vector corresponding to the first plane at a preset tracking frame number;
[0024] Determining a tracking angle between the tracking normal vector and the preset vector;
[0025] Determine the tracking angle mean and the tracking angle variance according to the tracking angle calculation;
[0026] The first preset angle range is updated according to the tracking angle mean and the tracking angle variance.
[0027] In one embodiment of the present disclosure, it also includes:
[0028] If the target plane that meets the preset angle condition is not obtained, the point cloud below the second preset height is removed.
[0029] In one embodiment of the present disclosure, determining the region of interest according to the preset edge points and the preset extension parameters includes:
[0030] Determine the towing area according to the preset edge point, wherein the preset edge point is located at the edge position of the towing;
[0031] The region of interest is obtained by expanding outward from the dragging region according to the preset expansion parameters.
[0032] In one embodiment of the present disclosure, searching for regional point cloud data corresponding to the trailer through the region of interest, and obtaining the target trailer edge according to the regional point cloud data, includes:
[0033] The region of interest is rotated and searched with the rotation axis as the center according to a first preset angle granularity to obtain regional point cloud data;
[0034] Obtaining a current edge point corresponding to the preset edge point after rotation;
[0035] Determine a towing edge line according to the current edge point;
[0036] Obtaining a trailer edge point cloud according to the regional point cloud data and the trailer edge line;
[0037] Obtaining the number of edge point clouds corresponding to the trailer edge point cloud, and determining whether the number of edge point clouds meets a corresponding dynamic threshold of the number, wherein the dynamic threshold of the number is set to have different values based on the laser beam within different angle ranges;
[0038] Obtaining the farthest distance of the towing edge point cloud, and determining whether the farthest distance meets a distance threshold;
[0039] Obtaining the point cloud density corresponding to the towing edge line, and determining whether the point cloud density meets a density threshold;
[0040] The target towing edge is screened, wherein the number of the towing edge point clouds satisfies the dynamic number threshold, the farthest distance satisfies the distance threshold, and the point cloud density satisfies the density threshold.
[0041] In one embodiment of the present disclosure, obtaining a target candidate frame and a first detection angle corresponding to the target candidate frame according to the target dragging edge includes:
[0042] Determine a candidate drag frame according to the target drag edge;
[0043] Filter the towing candidate box with the largest number of point clouds as the target candidate box;
[0044] The first detection angle is determined according to the target candidate frame.
[0045] In one embodiment of the present disclosure, the step of acquiring the current predicted angle by using a Kalman filter, and acquiring the second detection angle by performing detection through the region of interest based on the current predicted angle includes:
[0046] Get the drag angle of the previous frame;
[0047] Perform Kalman filtering according to the towing angle of the previous frame to obtain the current predicted angle;
[0048] According to the current prediction angle, the region of interest is searched within a second preset angle range according to a second preset angle granularity to obtain a current candidate frame;
[0049] Filter the point clouds in the current candidate frame that are higher than a third preset height to obtain candidate point clouds;
[0050] According to the preset height weight threshold, determine the number of candidate point clouds corresponding to the current candidate frame;
[0051] Determine a final candidate frame according to the number of candidate point clouds;
[0052] The corresponding second detection angle is determined according to the final candidate frame.
[0053] According to another aspect of the present disclosure, there is provided an electronic device, including:
[0054] Processor; and
[0055] A memory, configured to store executable instructions of the processor;
[0056] Wherein, the processor is configured to execute any one of the above-mentioned methods for detecting the towing angle of the tractor by executing the executable instructions.
[0057] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting the towing angle of a tractor described in any one of the above is implemented.
[0058] The embodiment of the present disclosure provides a method for detecting the towing angle of a tractor, which obtains point cloud data through a laser radar on the tractor; performs plane detection based on the point cloud data, determines a target plane that meets the preset angle condition, and removes the ground point cloud based on the target plane; obtains a preset edge point of the towing at the initial position, wherein the initial position is a position where the rotation angle of the towing relative to the tractor is 0 degrees; determines an area of interest based on the preset edge point and preset extended parameters; searches for regional point cloud data corresponding to the towing through the area of interest, and obtains the target towing edge based on the regional point cloud data; obtains a target candidate frame and a first detection angle corresponding to the target candidate frame based on the target towing edge; obtains the current predicted angle through Kalman filtering, and obtains a second detection angle through the area of interest based on the current predicted angle; and determines the towing angle based on the first detection angle and the second detection angle. A method for detecting the towing angle of a tractor based on laser radar data is proposed, which does not require additional hardware sensors and reduces the complexity and cost of detection. It can be applied to angle detection requirements in different scenarios, and uses the area of interest for search and detection to improve the accuracy and stability of towing detection.
[0059] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0061] Figure 1 A schematic flow chart of a method for detecting a towing angle of a tractor vehicle in one embodiment of the present disclosure is shown;
[0062] Figure 2 A schematic diagram of a tractor and trailer scene in one embodiment of the present disclosure is shown;
[0063] Figure 3 A schematic diagram of a tractor and trailer scene in one embodiment of the present disclosure is shown;
[0064] Figure 4 A structural block diagram of a computer device in one embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0065] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0066] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0067] The solution provided by this application is to accurately measure the angle of the trailer in the unmanned container truck of the tractor and its trailer combination in the automatic driving of the port in order to ensure the transportation efficiency and driving safety. For the sake of easy understanding, the terms involved in this application are first explained below.
[0068] The Kalman filter is an efficient recursive filter that only needs the current measurement value and the estimated value at the previous moment to predict and update the state of the target. Its core idea is to combine prediction and measurement to obtain a more accurate estimate.
[0069] Region of Interest (ROI) is a concept used to focus on a specific area in image processing, computer vision, and data analysis. ROI is the area in an image or dataset that the user wants to focus on. It can be a rectangle, circle, polygon, or other arbitrary shape, and is usually used to reduce the amount of processing computation and improve efficiency.
[0070] The solution provided in the embodiment of the present application relates to how to accurately measure the towing angle of the tractor, which is specifically described by the following embodiment:
[0071] Reference Figure 1 As shown, in one embodiment, a method for detecting a towing angle of a tractor is provided, comprising:
[0072] S101, acquiring point cloud data through the laser radar on the tractor;
[0073] Combination Figure 2As shown, a laser radar R is installed on the tractor A, through which point cloud data of the trailer B can be collected. The laser radar R can be installed on the left and right sides of the middle and rear part of the tractor A. Optionally, two laser radars R are installed at the edge positions on both sides behind the cab of the tractor. The installation height is close to the trailer height. It is required that the laser can sense and obtain the relevant point cloud information of the trailer. Optionally, the laser beam of the laser radar can select 32 lines or more for better effect.
[0074] S102, performing plane detection according to the point cloud data, determining a target plane that meets a preset angle condition, and removing the ground point cloud according to the target plane;
[0075] Specifically, whether the ground point cloud can be effectively removed has a significant impact on the subsequent trailer detection, so it is necessary to first perform plane detection and then remove the ground point cloud.
[0076] In a specific example, step S102 includes:
[0077] Acquire a first point cloud below a first preset height according to the point cloud data;
[0078] Specifically, a first point cloud below a first preset height is preselected for ground point cloud detection. The first preset height can be set according to actual conditions, for example, the first preset height is set to 0.7m, and a point cloud below 0.7m in the point cloud data is selected as the first point cloud.
[0079] Performing plane fitting using the RANSAC algorithm according to the first point cloud to obtain a first plane;
[0080] Specifically, the RANSAC algorithm is used to fit the plane, and the number of point clouds whose distance from the first point cloud to the random plane is within 0.2m can be obtained. The random plane with the largest number of point clouds is screened to obtain the plane equation, and the plane equation corresponds to the first plane.
[0081] According to the current angle between the normal vector of the first plane and the preset vector, selecting a second plane whose current angle satisfies a first preset angle range;
[0082] Specifically, the angle between the plane normal vector of the first plane and a preset vector is constrained. Optionally, the preset vector is a vector (0,0,1). The current angle between the normal vector and the vector (0,0,1) is obtained. The range of the current angle is constrained. The plane whose current angle satisfies the first preset angle range is a reliable detection result, and the corresponding second plane is obtained.
[0083] Among them, the first preset angle range can be set with an initial value based on experience, and can be dynamically adjusted based on actual implementation later, as illustrated by the following specific examples.
[0084] Selecting the second plane having the largest number of point clouds exceeding a preset number as the target plane;
[0085] Specifically, further screening is performed in the second plane, and the number of point clouds in the plane needs to reach a preset number, for example, more than a preset number of 1000 points. When the number exceeds the preset number, the plane with the largest number of point clouds is selected as the target plane. The detected target plane is more reliable and stable.
[0086] A ground point cloud is acquired according to the target plane, and the ground point cloud is removed.
[0087] Subsequently, the ground point cloud can be removed according to the target plane to achieve more accurate ground point cloud removal and improve the accuracy of subsequent detection.
[0088] In another optional example, if the target plane satisfying the preset angle condition is not obtained, the point cloud below the second preset height is removed.
[0089] The second preset height can be preset. For example, the second preset height is selected as 0.3m, and the point cloud below 0.3m is directly removed as the ground point cloud.
[0090] Among them, the value of the first preset angle range can be set to less than 5 degrees, but this judgment is effective only if the first plane obtained is relatively flat. If the obtained first plane has a certain slope, the above-mentioned value judgment of less than 5 degrees is easy to fail. Therefore, this embodiment proposes a dynamic monitoring scheme for the normal vector, which can effectively solve the situation where the plane has a slope.
[0091] In a specific example, obtaining a tracking normal vector corresponding to the first plane at a preset tracking frame number;
[0092] Specifically, a tracking window with a preset tracking frame number of 300 frames is set to track 300 frames of point cloud data of the laser radar, and a plane fitting is performed based on the 300 frames of point cloud data to obtain the corresponding first plane and the tracking normal vector corresponding to the first plane.
[0093] Determining a tracking angle between the tracking normal vector and the preset vector;
[0094] Specifically, the angle between the tracking normal vector and the vector (0,0,1) is the tracking angle. When the plane inclination is relatively stable, the angle fluctuation value of the tracking angle is basically not large.
[0095] Determine the tracking angle mean and the tracking angle variance according to the tracking angle calculation;
[0096] Specifically, the tracking may be performed in a cycle of 50 rounds, and a tracking angle mean mean_angle of the tracking angle value may be calculated, and a tracking angle variance std_angle may be calculated at the same time.
[0097] The first preset angle range is updated according to the tracking angle mean and the tracking angle variance.
[0098] Specifically, the first preset angle range may be adjusted according to the tracking angle mean and the tracking angle variance. If the current angle is within the range of [mean_angle-std_angle, mean_angle+std_angle], it is considered that the currently detected plane is relatively reliable.
[0099] The first preset angle range is further adjusted. If the current angle value is less than 5 degrees, the detection result is considered reliable and the threshold is maintained. The minimum threshold is maintained at 5 degrees, and the value range of the first preset angle range is less than 5 degrees. If the current angle is greater than 5 degrees and less than 15 degrees, the minimum threshold is adjusted to mean_angle+2std_angle, and the value range of the first preset angle range can be adjusted to be less than (mean_angle+2std_angle) to adapt to the situation where the plane has a certain inclination. If it exceeds 15 degrees, the plane detection is considered to be invalid, and the plane is no longer used as a valid detection result. By adjusting the minimum threshold and the first preset angle range, the system can more flexibly cope with ground with different slopes. When the ground is slightly tilted, dynamic adjustment can allow larger angle fluctuations without easily excluding potentially valid target planes.
[0100] S103, obtaining a preset edge point of the trailer at an initial position, wherein the initial position is a position where the rotation angle of the trailer relative to the tractor is 0 degrees;
[0101] Combination Figure 3 As shown, four preset edge points p0, p1, p2, and p3 are defined when the trailer is at 0 degrees. For example, in the trailer body coordinate system, the trailer is 2.6 meters wide and 13 meters long. The center of the rotation axis M is located at 0.5 meters in the body coordinate system, and the length from the rotation axis to the near end of the trailer edge is 0.5 meters. Then the four preset edge points are p0 (1, 1.3), p1 (1, -1.3), p2 (-12, -1.3), and p3 (-12, 1.3).
[0102] S104, determining a region of interest according to the preset edge points and preset extension parameters;
[0103] Among them, the region of interest (ROI) is often used in tasks such as target detection, object recognition, and image segmentation. This embodiment uses the region of interest to process the ROI instead of the entire point cloud data, which can significantly reduce the amount of calculation and speed up the processing. According to actual application requirements, the extended parameters are preset to customize the ROI to adapt to the trailer detection of this embodiment.
[0104] Specifically, step S104 includes:
[0105] Determine the towing area according to the preset edge point, wherein the preset edge point is located at the edge position of the towing;
[0106] The region of interest is obtained by expanding outward from the dragging region according to the preset expansion parameters.
[0107] Specifically, define the ROI region preset expansion parameters x_roi_expand and y_roi_expand to determine the region of interest. For example, set x_roi_expand = 0.5m, y_roi_expand = 1m. Then the expanded region of interest positions are p0_roi (1.5, 2.3), p1_roi (1.5, -2.3), p2_roi (-12.5, -2.3), p3_roi (-12.5, 2.3). Figure 3 The region of interest ROI is shown. The rectangular area formed by the region of interest surrounds the towed rectangular area.
[0108] S105, searching for regional point cloud data corresponding to the trailer through the region of interest, and obtaining a target trailer edge according to the regional point cloud data;
[0109] Specifically, the region of interest obtained above can be used to search the point cloud of the trailer, with the rotation axis as the rotation center, such as Figure 2 The state shown is that the rotation angle is 0 degrees, and the search angle is from -90 degrees to 90 degrees, with the left side of the rotation axis as negative in the direction of the tractor. The entire search range is 180 degrees.
[0110] In a specific example, step S105 includes:
[0111] The region of interest is rotated and searched with the rotation axis as the center according to a first preset angle granularity to obtain regional point cloud data;
[0112] Specifically, with the axis as the rotation center, the first angle granularity is set to dtheta = 0.5×M_PI / 180 for the region of interest, and the search accuracy is 0.5 degrees. In the range from -90 degrees to 90 degrees, the number of loops is loop_number = ceil((M_PI / 2.0 - dtheta) / dtheta). The points that fall into the rectangular area of the rotated region of interest are regional point cloud data.
[0113] Obtaining a current edge point corresponding to the preset edge point after rotation;
[0114] Specifically, the four preset edge points p0, p1, p2, and p3 of the drag are rotated synchronously to obtain four current edge points p0_rotated, p1_rotated, p2_rotated, and p3_rotated after rotation.
[0115] Determine a towing edge line according to the current edge point;
[0116] Specifically, the current edge point p0_rotated and the current edge point p3_rotated constitute the dragging edge line line1, and the current edge point p1_rotated and the current edge point p2_rotated constitute the dragging edge line line2.
[0117] Obtaining a trailer edge point cloud according to the regional point cloud data and the trailer edge line;
[0118] Specifically, a distance threshold distance_threshold = 0.1m is predefined to determine whether the regional point cloud belongs to the edge of the trailer. The distances from the point cloud in the regional point cloud data to the trailer edge lines line1 and line2 are directly calculated. If the distance is less than the distance threshold distance_threshold, it is considered to be a trailer edge point.
[0119] Obtaining the number of edge point clouds corresponding to the trailer edge point cloud, and determining whether the number of edge point clouds meets a corresponding dynamic threshold of the number, wherein the dynamic threshold of the number is set to have different values based on the laser beam within different angle ranges;
[0120] Specifically, the number of towing edge point clouds on the towing edge lines line1 and line2 is determined, and a dynamic threshold value is set. The value of the dynamic threshold value is related to the selected laser beam, that is, it changes with the angle and can be set according to experience. For example, based on 32 laser lines, the number threshold is set to 30 for 0-20 degrees, 60 for 20-60 degrees, and 75 for 60-90 degrees. According to the angle corresponding to the laser beam, if the angle corresponding to the region of interest is 30 degrees at this time, then if the number of point clouds is less than 60, it is considered insufficient to constitute the target towing edge.
[0121] Obtaining the farthest distance of the towing edge point cloud, and determining whether the farthest distance meets a distance threshold;
[0122] Specifically, the distance threshold is set according to the trailer length. The ideal value is the same as the trailer length, but in reality, the laser cannot completely illuminate all the edges of the trailer, so it is usually set to be less than the trailer length. Based on the trailer edge point cloud on the trailer edge line, the farthest and closest points of the trailer edge point cloud, i.e., the farthest distance, are counted, and the distance between the two end points is calculated. If the distance is less than the distance threshold of 8m, it is considered insufficient to constitute the target trailer edge.
[0123] Obtaining the point cloud density corresponding to the towing edge line, and determining whether the point cloud density meets a density threshold;
[0124] Specifically, the dragging edge line refers to a straight line segment, and the dragging edge line can be divided into multiple parts evenly. For example, it is set to be divided into 5 parts, that is, the line segment is divided into 5 segments evenly, and the point cloud density corresponding to each segment, for example, the density threshold is set to 6 point clouds. If the number of point clouds in a certain segment is less than 6, it is considered insufficient to constitute the target dragging edge.
[0125] The target towing edge is screened, wherein the number of the towing edge point clouds satisfies the dynamic number threshold, the farthest distance satisfies the distance threshold, and the point cloud density satisfies the density threshold.
[0126] Specifically, for the dragging edge point clouds on the dragging edge lines line1 and line2, if they all meet the above conditions, it means that the filtered dragging edges are likely to be real dragging edges. As the target dragging edges, the corresponding target candidate boxes can be confirmed based on the target dragging edges.
[0127] S106, obtaining a target candidate frame and a first detection angle corresponding to the target candidate frame according to the target dragging edge;
[0128] Specifically, all angles are traversed, and the target dragging edge constitutes a candidate area. According to the target dragging edge, the candidate box with the largest number of point clouds is selected as the target candidate box. At this time, the corresponding first detection angle is the detected dragging angle.
[0129] In a specific example, step S106 includes:
[0130] Determine a candidate drag frame according to the target drag edge;
[0131] After determining the target hanging edge, the number of point clouds corresponding to the target hanging edge is counted, and the one consisting of the most point clouds is the hanging candidate box.
[0132] Filter the towing candidate box with the largest number of point clouds as the target candidate box;
[0133] Specifically, all angles are traversed, and the target candidate box with the largest number of point clouds is selected as the final target candidate box.
[0134] The first detection angle is determined according to the target candidate frame.
[0135] The target dragging frame is the finally determined dragging edge, and the corresponding first detection angle is the detected dragging angle.
[0136] S107, obtaining a current prediction angle through Kalman filtering, and obtaining a second detection angle through detection through the region of interest based on the current prediction angle;
[0137] S108: Determine a towing angle according to the first detection angle and the second detection angle.
[0138] In order to further improve the accuracy of the towing angle, the above step S107 performs Kalman filtering based on the towing angle of the previous frame, and obtains the prediction result at the current moment, which is the current predicted angle. Then, a small-range search detection is performed on the current angle using the region of interest again to obtain the second detection angle detected by the current predicted angle. The subsequent Kalman correlation of the above first detection angle according to the second detection angle in step S108 helps to find the towing angle that best meets the actual situation. It is real-time and accurate, and can quickly and stably detect the towing angle, greatly improving the accuracy of detection.
[0139] In a specific example, step S107 includes:
[0140] Get the drag angle of the previous frame;
[0141] Perform Kalman filtering according to the towing angle of the previous frame to obtain the current predicted angle;
[0142] Specifically, a simple angular velocity tracking model is used to perform Kalman filtering based on the trailer angle of the previous frame. , adjust the appropriate noise value to obtain the current predicted angle, and then perform a new detection on the current predicted angle.
[0143] According to the current prediction angle, the region of interest is searched within a second preset angle range according to a second preset angle granularity to obtain a current candidate frame;
[0144] Optionally, the second preset angle range is within the range of plus or minus 8 degrees of the current detection angle, and the second preset angle granularity of the angle traversal accuracy is set to 0.1 degrees for high-precision detection. The specific process can refer to the above-mentioned process of searching the region of interest, and the current candidate frame can be obtained to obtain a rectangular area for searching the region of interest within the range of plus or minus 8 degrees.
[0145] Filter the point clouds in the current candidate frame that are higher than a third preset height to obtain candidate point clouds;
[0146] Optionally, considering that the height between the edge of the trailer and the ground is 1.7m on a flat ground, when selecting candidate points, set the third preset height to 0.8m, select the point cloud above 0.8m from the point to the plane, and the point cloud above 0.8m as the candidate point cloud. Keep above 0.8m instead of close to 1.7m, because at a certain angle, the laser original point cloud cannot effectively identify the outermost edge of the trailer. Ensure that the outermost edge of the trailer is effectively identified at a certain angle.
[0147] According to the preset height weight threshold, determine the number of candidate point clouds corresponding to the current candidate frame;
[0148] For example, when the trailer is not carrying containers, the bottom and the lower inner edge of the trailer are likely to affect the detection of the outermost edge. For trailers without containers, set the preset height weight threshold virtual_height_ratio = 1.1. When the height of the point cloud to the ground exceeds 1.6 meters, the number of point clouds is calculated according to num×virtual_height_ratio to optimize the detection results. When it is less than or equal to 1.6m, the number of candidate point clouds can be calculated normally.
[0149] Determine a final candidate frame according to the number of candidate point clouds;
[0150] The corresponding second detection angle is determined according to the final candidate frame.
[0151] Specifically, by traversing all angle values, that is, 16 / 0.1=160 times of traversal, the final candidate box can be determined based on the candidate point cloud screening, and the one with the largest number of candidate point clouds is selected as the final candidate box. For details, please refer to the above-mentioned process of determining the target candidate box. The corresponding angle of the final candidate box is the second detection angle. Thus, the second detection angle, which is the result of the current predicted angle after detection in a finer angle range, is obtained. The second detection angle is Kalman correlated with the first detection obtained above to obtain a more accurate towing angle, which is closer to the actual towing situation.
[0152] In addition, if a suitable angle value still cannot be found in the above steps, the current predicted angle is reselected and a search is performed within the range of -90 to 90 degrees.
[0153] This embodiment obtains empirical strategies such as dynamic threshold detection for ground detection and weight adjustment of trailer detection height threshold, which can make trailer angle detection more stable and reliable. This detection method is not only suitable for specific tractor trailer systems, but also has wide applicability and can adapt to angle detection requirements in different vehicle models and similar scenarios. The data obtained by using laser radar avoids the limitation of the need for additional hardware sensors in traditional methods, thereby reducing the complexity and cost of the system and improving the detection stability in different environments.
[0154] In another embodiment, an electronic device is provided, comprising:
[0155] Processor; and
[0156] A memory, configured to store executable instructions of the processor;
[0157] Wherein, the processor is configured to execute any one of the above-mentioned methods for detecting the towing angle of the tractor by executing the executable instructions.
[0158] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0159] Refer to the following Figure 4 An electronic device 400 according to this embodiment of the present invention will be described. Figure 4 The electronic device 400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0160] like Figure 4As shown, the electronic device 400 is in the form of a general computing device. The components of the electronic device 400 may include but are not limited to: at least one processing unit 410, at least one storage unit 420, and a bus 430 connecting different system components (including the storage unit 420 and the processing unit 410).
[0161] The storage unit stores program codes, which can be executed by the processing unit 410, so that the processing unit 410 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 410 can perform the following steps: Figure 1 The towing angle detection method of the tractor described in.
[0162] The storage unit 420 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 4201 and / or a cache storage unit 4202 , and may further include a read-only storage unit (ROM) 4203 .
[0163] The storage unit 420 may also include a program / utility 4204 having a set (at least one) of program modules 4205, such program modules 4205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0164] Bus 430 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0165] The electronic device 400 may also communicate with one or more external devices 500 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 400, and / or may communicate with any device that enables the electronic device 400 to communicate with one or more other computing devices (e.g., routers, modems, etc.). This communication may be performed through an input / output (I / O) interface 450. In addition, the electronic device 400 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 460. As shown, the network adapter 460 communicates with other modules of the electronic device 400 through a bus 430. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0166] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0167] In yet another embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for detecting the towing angle of a tractor vehicle described in any one of the above is implemented.
[0168] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0169] A program product for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0170] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0171] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0172] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0173] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0174] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0175] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0176] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0177] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A method for detecting the towing angle of a tractor, characterized in that: include: Obtain point cloud data through the laser radar on the tractor; Performing plane detection according to the point cloud data, determining a target plane that meets a preset angle condition, and removing the ground point cloud according to the target plane; Acquire a preset edge point of the trailer at an initial position, wherein the initial position is a position where the rotation angle of the trailer relative to the tractor is 0 degrees; Determine the region of interest according to the preset edge points and the preset expansion parameters; Searching for regional point cloud data corresponding to the trailer through the region of interest, and obtaining the edge of the target trailer according to the regional point cloud data; Obtaining a target candidate frame and a first detection angle corresponding to the target candidate frame according to the target dragging edge; Acquire a current predicted angle through Kalman filtering, and acquire a second detection angle through detection through the region of interest based on the current predicted angle; determining a towing angle according to the first detection angle and the second detection angle; The step of searching the area point cloud data corresponding to the trailer through the area of interest and obtaining the edge of the target trailer according to the area point cloud data includes: The region of interest is rotated and searched with the rotation axis as the center according to a first preset angle granularity to obtain regional point cloud data; Obtaining a current edge point corresponding to the preset edge point after rotation; Determine a towing edge line according to the current edge point; Obtaining a trailer edge point cloud according to the regional point cloud data and the trailer edge line; Obtaining the number of edge point clouds corresponding to the trailer edge point cloud, and determining whether the number of edge point clouds meets a corresponding dynamic threshold of the number, wherein the dynamic threshold of the number is set to have different values based on the laser beam within different angle ranges; Obtaining the farthest distance of the towing edge point cloud, and determining whether the farthest distance meets a distance threshold; Obtaining the point cloud density corresponding to the towing edge line, and determining whether the point cloud density meets a density threshold; Screening the target towing edge whose number of edge point clouds satisfies the number dynamic threshold, whose farthest distance satisfies the distance threshold, and whose point cloud density satisfies the density threshold; The step of acquiring the current predicted angle by using Kalman filtering and acquiring the second detection angle by detecting the region of interest based on the current predicted angle includes: Get the drag angle of the previous frame; Perform Kalman filtering according to the towing angle of the previous frame to obtain the current predicted angle; According to the current prediction angle, the region of interest is searched within a second preset angle range according to a second preset angle granularity to obtain a current candidate frame; Filter the point clouds in the current candidate frame that are higher than a third preset height to obtain candidate point clouds; According to the preset height weight threshold, determine the number of candidate point clouds corresponding to the current candidate frame; Determine a final candidate frame according to the number of candidate point clouds; The corresponding second detection angle is determined according to the final candidate frame.
2. The method for detecting the towing angle of a tractor according to claim 1, characterized in that: The performing of plane detection according to the point cloud data, determining a target plane that meets a preset angle condition, and removing the ground point cloud according to the target plane includes: Acquire a first point cloud below a first preset height according to the point cloud data; Performing plane fitting using the RANSAC algorithm according to the first point cloud to obtain a first plane; According to the current angle between the normal vector of the first plane and the preset vector, selecting a second plane whose current angle satisfies a first preset angle range; Selecting the second plane having the largest number of point clouds exceeding a preset number as the target plane; A ground point cloud is acquired according to the target plane, and the ground point cloud is removed.
3. The method for detecting the towing angle of a tractor according to claim 2, characterized in that: Also includes: Obtaining a tracking normal vector corresponding to the first plane at a preset tracking frame number; Determining a tracking angle between the tracking normal vector and the preset vector; Determine the tracking angle mean and the tracking angle variance according to the tracking angle calculation; The first preset angle range is updated according to the tracking angle mean and the tracking angle variance.
4. The method for detecting the towing angle of a tractor according to claim 2, characterized in that: Also includes: If the target plane that meets the preset angle condition is not obtained, the point cloud below the second preset height is removed.
5. The method for detecting the towing angle of a tractor according to claim 1, characterized in that: The determining of the region of interest according to the preset edge points and the preset extension parameters includes: Determine the towing area according to the preset edge point, wherein the preset edge point is located at the edge position of the towing; The region of interest is obtained by expanding outward from the dragging region according to the preset expansion parameters.
6. The method for detecting the towing angle of a tractor according to claim 1, characterized in that: The obtaining a target candidate frame and a first detection angle corresponding to the target candidate frame according to the target dragging edge includes: Determine a candidate drag frame according to the target drag edge; Filter the towing candidate box with the largest number of point clouds as the target candidate box; The first detection angle is determined according to the target candidate frame.
7. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the method for detecting the towing angle of a tractor according to any one of claims 1 to 6 by executing the executable instructions.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for detecting the towing angle of a tractor according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Target vehicle course angle calculation method based on three-dimensional laser radar
CN105223583A
Trailer included angle measuring method and device, and vehicle
CN111366938A
