Prospective intelligent vehicle obstacle avoidance method based on density
Through a forward-looking smart car obstacle avoidance method based on density, 2D lidar and iterative Euclidean classifier are used to segment obstacles, combined with dynamic PID control, the challenge of smart car obstacle avoidance control in high-speed motion is solved, and the High-speed and stable obstacle avoidance and reduced computing costs.
Patent Information
- Application Number
- CN202410653736.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-08-30
AI Technical Summary
Existing smart vehicles have challenges in obstacle avoidance control during high-speed movement. Especially in complex road conditions and dense obstacles, traditional visual sensors or radar sensors are difficult to achieve effective high-speed obstacle avoidance, leading to problems such as barrel collision or running off the road section.
A forward-looking intelligent vehicle obstacle avoidance method based on density is used to obtain obstacle data through 2D lidar, perform filtering processing and cluster analysis, use an iterative Euclidean classifier to segment obstacles, and select forward-looking points based on body posture analysis. And use dynamic PID control algorithm for motion control to achieve high-speed obstacle avoidance.
It achieves effective obstacle avoidance when driving at high speeds, avoids the risk of drift caused by large turns, maintains vehicle stability, and reduces computing power and time costs.
Smart Images

Figure CN118567361A
Abstract
Description
Technical Field
[0001] The present invention relates to a forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness, which aims to solve the problem of accurately extracting the position information of unlabeled cone barrels and obstacles in radar data and belongs to the field of autonomous driving technology. Background Art
[0002] With the continuous development of artificial intelligence technology, intelligent robots, as one of the representatives of modern science and technology, have shown broad application prospects in various fields. Among them, ROS (Robot Operating System) intelligent vehicles, as one of the representatives of autonomous mobile robots, use sensors such as IMU, laser radar or camera to realize automatic route recognition, obstacle avoidance, steering and other functions, and have become a hot field of autonomous driving technology.
[0003] However, there are still a series of challenges in the obstacle avoidance control of smart cars on the market at high speeds. Existing algorithms do not perform well in complex road conditions, such as continuous S-curves, which can easily lead to problems such as crashing into barrels and running out of the target section. Especially when there are dense obstacles around special sections and a lot of interference from non-road elements, smart cars can only achieve low-speed driving through traditional visual sensors or radar sensors, and cannot effectively avoid obstacles at high speeds.
[0004] Therefore, it is necessary to design a forward-looking intelligent vehicle obstacle avoidance algorithm based on density. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides a forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness, which acquires, filters and fuses radar sensor data and performs path planning and obstacle avoidance decision-making algorithms, aiming to solve the problems of high cost and poor real-time performance of traditional image processing in autonomous driving.
[0006] The present invention adopts the following technical solution:
[0007] A forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness includes the following steps:
[0008] S1: Obstacle data is obtained based on 2D lidar, and machine learning methods are used to filter and cluster the data;
[0009] S2: Obstacle segmentation is achieved based on the Iterative Euclidean Classifier (IEC) to obtain dense side obstacles and sparse side obstacles;
[0010] S3: The smart car analyzes the obstacle information and the body posture, selects the forward point, and controls the smart car.
[0011] Preferably, step S1 specifically includes the following steps:
[0012] S11: Acquire 2D laser radar data, and pre-process it to convert the polar coordinate radar point cloud into radar point cloud data in a Cartesian coordinate system;
[0013] S12: Filtering the radar point cloud based on radius filtering and local outlier factor filtering;
[0014] S13: Clustering of radar point clouds based on DBSCAN density clustering algorithm.
[0015] Preferably, in step S11, the cone barrel obstacles around the road are scanned in real time by a 2D laser radar installed on the vehicle body. The laser radar adopts a triangulation series. Based on the ROS publish-subscribe communication method, the laser radar sensor can be extracted to obtain 1440 original polar coordinate obstacle points around. The data returned by the original data includes the echo intensity, the polar diameter and polar angle of each point. The radar point cloud under the polar coordinates is converted to a Cartesian coordinate system with the vehicle head direction as the positive x-axis and the left side of the vehicle head as the positive y-axis through the polar coordinate conversion formula:
[0016] x=ρcos(θ)
[0017] y=ρsin(θ)
[0018] Wherein, θ represents the polar angle in the polar coordinate system; ρ represents the polar diameter or the radial distance of the polar coordinate; x represents the abscissa of the Cartesian coordinate system; y represents the ordinate of the Cartesian coordinate system.
[0019] Preferably, in step S12, the radar point cloud is filtered based on radius filtering and local outlier factor filtering. The local outlier factor algorithm is a common unsupervised learning algorithm for identifying noise points in the point cloud after radius filtering, specifically:
[0020] By calculating the distance from the radar point cloud to the vehicle body, that is, the distance from the point cloud coordinates to the origin in the Cartesian coordinate system, and setting a distance threshold (such as 0.1m), data outside the distance threshold range is removed;
[0021] Outliers are detected through the local outlier factor algorithm to achieve noise removal after radius filtering.
[0022] Preferably, in step S13, the DBSCAN density clustering algorithm clusters the radar point cloud, specifically:
[0023] Input parameters, including the number of radar point clouds num and the radius of cluster center R, set num = 8, R = 0.2, input radar point cloud data after S12 filtering, first detect the number of point clouds within the radius R of a certain sample point in all radar point cloud data> = num, summarize it as the cluster center, and classify the point clouds with direct density into one category to form a temporary cluster; the point with direct density refers to the point with the number of points around it reaching or exceeding num within the given radius R;
[0024] Repeat the iteration until the point cloud directly reached by each point density is already in the temporary cluster and the clustering no longer changes;
[0025] By traversing the point cloud of each temporary cluster, the geometric center of each temporary cluster is calculated. The geometric center is obtained by calculating the average position of all points in the temporary cluster. The geometric center of each temporary cluster is regarded as the center of the obstacle detected by the radar.
[0026] Preferably, step S2 specifically includes the following steps:
[0027] S21: Calculate the Euclidean distance between each obstacle after clustering;
[0028] S22: Find the two points with the smallest Euclidean distance as temporary detection points and give dense point labels;
[0029] S23: With the temporary detection point as the center of the circle, mark the points within the specified threshold as dense points and replace the temporary detection point;
[0030] S24: Repeat step S23 until there are no unmarked points within the specified threshold.
[0031] Preferably, in step S21, the Euclidean distance between each pair of obstacles after clustering is calculated by calling an existing Python machine learning algorithm library (scipy.spatial.distance library) or an existing Python data processing algorithm library (Numpy library). Using the scipy.spatical.distance library and the Numpy library to calculate the Euclidean distance is a prior art. The spatial.distance module in the scipy.spatial.distance library provides various distance calculation methods, including the Euclidean distance; the Numpy library provides powerful array processing and broadcasting functions, which can effectively process the Euclidean distance calculation of large-scale data sets. If there are two points A(x 1 ,y 1 ) and B(x 2 ,y 2), the Euclidean distance between them can be expressed by the following formula, just substitute the coordinates of the corresponding points:
[0032] distance=(x 2 -x 1 ) 2 +(y 2 -y 1 ) 2
[0033] The specific process is:
[0034] The obstacle data is converted into a matrix list (List), which has n elements. Each element is a two-dimensional matrix with one row and two columns, representing the position x, y of the obstacle measured by a certain emission line of the laser radar calculated in S1. The matrix list is:
[0035] After the above-mentioned radius filtering and local outlier factor (LocalOutlierFactor) filtering processing, only a small data set is retained. After testing, it is found that the broadcasting function of the Numpy library is used for calculation under small data sets, and the calculation speed is better than that of the scipy.spatial.distance function.
[0036] The calculation process using the Numpy library is:
[0037] Transpose the above data matrix, and convert the original data matrix A with the shape of (1, n) represented by 1 row and n columns into the data matrix B with the shape of (n, 1) represented by n rows and 1 column. The transposition of a matrix refers to the operation of exchanging the rows and columns of a matrix. That is, if a matrix is composed of elements with m rows and n columns, then its transposed matrix will have elements with n rows and m columns, where the elements of the i-th row and j-th column will become the elements of the j-th row and i-th column in the original matrix. Using the broadcast function of the Numpy library for calculation, a difference matrix C=BA with the shape of (n, n) is obtained. The broadcast mechanism means that in the process of two different matrix operations, Numpy stretches the smaller matrix into the shape of a larger matrix, for example, stretching (1, n) A into (n, n), where each row is the first row of data copied, and the same is true for matrix B.
[0038] Square each element in the difference matrix of the previous step, corresponding to (x 2 -x 1 ) 2 +(y 2 -y 1 ) 2 part, and get a tensor.
[0039] Summing the tensor along the last dimension (in this case, the square of the interpolated value at each point) yields a vector of shape (n,) where each element k is the sum of the squared differences between the kth point in the data matrix and all other points. Here, "along the last dimension" refers to operations performed on the innermost dimension of a multidimensional array.
[0040] Taking the square root of each of the above elements, we can get the Euclidean distance between all pairs of points in the data matrix.
[0041] After calculating the Euclidean distance between obstacles, a symmetric matrix D is finally returned, in which the element at the i-th row and j-th column represents the distance between the i-th point and the j-th point in the input matrix. At the same time, the obstacle data is forward filtered again, that is, the data corresponding to y<0 of all points in the matrix is deleted, and the filtered obstacle data is retained. The above process is repeated to recalculate the Euclidean distance, and the symmetric matrix F of the filtered data is obtained;
[0042] In S22, for the symmetric matrix D and the symmetric matrix F, the main diagonal elements are filled with infinity. Specifically, the elements where the row index i and the column index j have the same value are changed to infinity, that is, the fixed value is reassigned to infinity (inf is used to represent infinity in computers), the minimum Euclidean distance f in the symmetric matrix F is found, the row index i corresponding to the minimum Euclidean distance f in the symmetric matrix D is extracted, and the data with index i in the obstacle data matrix list is marked as dense as a temporary detection point;
[0043] Taking the temporary detection point as the center of the circle, the points within the specified threshold τ (for example, 0.3m) are marked as dense points. This can be achieved by iteration. Specifically, an iteration function iteration is defined. The function needs to accept three parameters: the obstacle data matrix list, the symmetric matrix D and the row index i. According to the row index i, the row index with a threshold less than τ is extracted from the symmetric matrix D. And return the obstacle data matrix list indexed by Point and row indexes as the index i for the next step;
[0044] In S24, in order to ensure that the obstacle data points will not be detected repeatedly during the iteration process, the points of each iteration are marked: a marking list L and a judgment list l are defined. The marking list L records the row index of a single point detected. The decision list l records the row index i that has been detected. To make a judgment, , delete the marker i from the marker list L and proceed to the next iteration; when all row indexes in the marker list L are deleted, it is proved that all points have been detected. At this time, the iteration is stopped and all points detected in S23 are marked as dense to obtain dense side obstacles, and the remaining points are marked as sparse to obtain sparse side obstacles.
[0045] In order to remove the interference of non-obstacle elements outside the field, such as walls, it is necessary to define an anti-interference function. Using the points marked as dense obtained in S24, with a larger threshold γ as the radius (for example, 1m), the data matrix list is refiltered, that is, the data outside the threshold range is deleted, and the obstacle data after refiltering is retained.
[0046] Preferably, step S3 specifically includes the following steps:
[0047] S31: Obtain the forward point, integrate the obstacle space information, and calculate the target point;
[0048] S32: Calculating the expected body angle based on the target point and the body origin;
[0049] S33: Motion control based on dynamic PID control algorithm.
[0050] Preferably, in S31, the forward-looking point is obtained, the obstacle space information is integrated, the target point is calculated, and a labeled list of two types of obstacle point data, sparse and dense, is obtained. If the midpoint of the line connecting the nearest left and right obstacles is directly selected, or the midpoint of the line connecting the second closest obstacles to the vehicle body is selected, then basic obstacle avoidance can be achieved at low speeds and when the vehicle body posture is good. However, at medium and high speeds, considering that the vehicle body posture may be poor, a large turn in an unexpected direction may occur, leading to a collision with an obstacle. Therefore, the present invention innovatively proposes to select a third forward-looking point that is as far as possible.
[0051] In step S31, for sparse side obstacles, firstly, the obstacle a closest to the vehicle body is found by calculating the Euclidean distance, and on this basis, the vehicle body orientation is integrated to calculate the obstacle b in front of the vehicle and closest to obstacle a. If it does not exist, b=a, and then the obstacle c in front of the vehicle and closest to b is calculated. If it does not exist, c=b, and c is output as the sparse side forward point; similarly, for dense side obstacles, firstly, the obstacle d closest to the vehicle body is found by calculating the Euclidean distance, and on this basis, the vehicle body orientation is integrated to calculate the obstacle e in front of the vehicle and closest to obstacle d. If it does not exist, e=d, and then the obstacle f in front of the vehicle and closest to obstacle e is calculated. If it does not exist, f=e, and finally f is output as the dense side forward point;
[0052] By comparing the Euclidean distance distance1 between c and b and the Euclidean distance distance2 between f and e, if distance1 < distance2, modify the density prior, adjust the output such that c is the forward-looking point on the dense side and f is the forward-looking point on the sparse side; if distance1 ≥ distance2, there is no need to modify the forward-looking points on the dense side and the sparse side;
[0053] For the selection of the target point, the traditional method directly selects the midpoint of the two forward-looking points as the target point, which is feasible when there are few curves and the vehicle running speed is low. However, for continuous S-shaped curves, the vehicle stability is poor at medium and high speeds. Therefore, based on the output forward-looking point on the dense side and the forward-looking point on the sparse side, this solution calculates the trisection point on the side closer to the forward-looking point on the dense side of the line connecting the two as the target point output, which is very smooth for continuously passing through S-shaped curves at high speeds.
[0054] Preferably, in step S32, connect the origin of the vehicle body to the target point. The target point is positive in the first and second quadrants and negative in the third and fourth quadrants. Calculate the angle between the vehicle body orientation and the line connecting the vehicle body and the target point, and convert it to radians to obtain the expected vehicle body rotation angle;
[0055] In step S33, compared with the ordinary PID algorithm, the dynamic PID algorithm has a larger proportional adjustment parameter P when turning and a smaller proportional adjustment parameter P when going straight. It can effectively improve the situation where the proportional adjustment parameter P of the ordinary PID is set too large, resulting in good performance in turning but large oscillations after entering a straight road; or the proportional adjustment parameter P is set too small, resulting in small oscillations on the straight road but slow response at the turn. It has a better effect in a complex track environment;
[0056] Estimate the current vehicle body attitude based on the accumulation of the control quantity, obtain the expected vehicle body rotation angle output in S32, calculate the error error between the expected vehicle body rotation angle and the current vehicle body rotation angle, and calculate the dynamic proportional adjustment parameter K p :
[0057]
[0058] where A represents a dynamic parameter, and adjusting A can change K p with the degree of dynamic change of error; base_k p represents the fixed proportional adjustment parameter P reference value, which is a set constant value;
[0059] Based on the calculated dynamic proportional adjustment parameter K p and the set integral adjustment parameter I and differential adjustment parameter D are used for vehicle body control. K p , I, and D affect the stability of the system, the elimination of static error, and the anti-interference ability.
[0060] The adjustment of P, I, and D parameters is an iterative process. By modifying and testing them one by one, observing the operating results of the smart car, and gradually adjusting the parameters until the ideal control effect is achieved.
[0061] For any details not provided in the present invention, please refer to the prior art.
[0062] The beneficial effects of the present invention are:
[0063] 1. The present invention proposes an efficient radar data preprocessing framework, which performs coordinate system conversion, radius filtering, local outlier factor algorithm filtering, and DBSCAN clustering in sequence, and can use small computing power and time cost (the computing power does not affect the execution of other programs required for normal driving of the vehicle, and the time is within 10ms) to achieve preliminary processing of obstacle point cloud data.
[0064] 2. The present invention proposes an obstacle segmentation method based on an iterative Euclidean classifier, which can classify unlabeled obstacles on both sides of a closed-loop road into two categories: inner obstacles and outer obstacles, and use an iterative method to remove obstacles that do not belong to the sides of the road (such as walls far outside the road) to reduce interference, thereby realizing automatic driving control based on the classified obstacle points.
[0065] 3. The present invention proposes a forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness, which can keep the intelligent vehicle close to the inner side of the curve when continuously turning at high speed, thereby avoiding the risk of drift caused by large-scale steering at high speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The drawings in the specification, which constitute a part of the present application, are used to provide further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0067] Figure 1 It is a flow chart of the forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness of the present invention;
[0068] Figure 2 Schematic diagram of the iteration of step S2; the black dots in the figure represent obstacle data scanned by the radar, the cross represents the clustered data information, and each dotted circle represents the iterative detection area marked as a dense point;
[0069] Figure 3 A schematic diagram of re-filtering obstacle data marked as dense; the dotted line in the figure indicates the re-filtered area; the dots in the figure represent the scanned point cloud, the cross represents the cluster center, and the triangle represents the wall point cloud that should be filtered out;
[0070] Figure 4 This is a schematic diagram for calculating the desired body angle, where ★ indicates the target point;
[0071] Figure 5 This is a schematic diagram of a test site;
[0072] Figure 6 Schematic diagram of the specifications of the obstacle cones placed on the field;
[0073] Figure 7 The figure is a schematic diagram of the intelligent car decision route generated by the forward-looking intelligent car obstacle avoidance method based on density and sparseness, where the curve is the decision route. DETAILED DESCRIPTION
[0074] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of the present invention are clearly and completely described below in conjunction with the drawings in the implementation of this specification, but are not limited to this. Anything not fully described in the present invention shall be based on the conventional technology in the art.
[0075] Example 1
[0076] A forward-looking intelligent vehicle obstacle avoidance method based on density, such as Figure 1 As shown, the following steps are included:
[0077] S1: Obstacle data is obtained based on 2D lidar, and machine learning methods are used to filter and cluster the data;
[0078] S2: Obstacle segmentation is achieved based on the Iterative Euclidean Classifier (IEC) to obtain dense side obstacles and sparse side obstacles;
[0079] S3: The smart car analyzes the obstacle information and the body posture, selects the forward point, and controls the smart car.
[0080] Example 2
[0081] A forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness is as described in Example 1, except that step S1 specifically includes the following steps:
[0082] S11: Acquire 2D laser radar data, and pre-process it to convert the polar coordinate radar point cloud into radar point cloud data in a Cartesian coordinate system;
[0083] The cone barrel obstacles around the road are scanned in real time by the 2D laser radar installed on the vehicle body. The laser radar adopts the triangulation ranging series. Based on the ROS publish-subscribe communication method, the laser radar sensor can be extracted to obtain 1440 original polar coordinate obstacle points around. The data returned by the original data includes the echo intensity, the polar diameter and polar angle of each point. Through the polar coordinate conversion formula, the radar point cloud under the polar coordinate is converted to a Cartesian coordinate system with the vehicle head direction as the positive x-axis and the left side of the vehicle head as the positive y-axis:
[0084] x=ρcos(θ)
[0085] y=ρsin(θ)
[0086] Wherein, θ represents the polar angle in the polar coordinate system; ρ represents the polar diameter or the radial distance of the polar coordinate; x represents the abscissa of the Cartesian coordinate system; y represents the ordinate of the Cartesian coordinate system.
[0087] S12: Filter the radar point cloud based on radius filtering and local outlier factor filtering, specifically:
[0088] By calculating the distance from the radar point cloud to the vehicle body, that is, the distance from the point cloud coordinates to the origin in the Cartesian coordinate system, and setting a distance threshold (such as 0.1m), data outside the distance threshold range is removed;
[0089] Outliers are detected through the local outlier factor algorithm to achieve noise removal after radius filtering.
[0090] S13: Cluster the radar point cloud based on the DBSCAN density clustering algorithm, specifically:
[0091] Input parameters, including the number of radar point clouds num and the radius of cluster center R, set num = 8, R = 0.2, input radar point cloud data after S12 filtering, first detect the number of point clouds within the radius R of a certain sample point in all radar point cloud data> = num, summarize it as the cluster center, and classify the point clouds with direct density into one category to form a temporary cluster; the point with direct density refers to the point with the number of points around it reaching or exceeding num within the given radius R;
[0092] Repeat the iteration until the point cloud directly reached by each point density is already in the temporary cluster and the clustering no longer changes;
[0093] By traversing the point cloud of each temporary cluster, the geometric center of each temporary cluster is calculated. The geometric center is obtained by calculating the average position of all points in the temporary cluster. The geometric center of each temporary cluster is regarded as the center of the obstacle detected by the radar.
[0094] Example 3
[0095] A forward-looking intelligent vehicle obstacle avoidance method based on density, as described in Example 2, except that Figure 2 , step S2 specifically includes the following steps:
[0096] S21: Calculate the Euclidean distance between each obstacle after clustering;
[0097] S22: Find the two points with the smallest Euclidean distance as temporary detection points and give dense point labels;
[0098] S23: With the temporary detection point as the center of the circle, mark the points within the specified threshold as dense points and replace the temporary detection point;
[0099] S24: Repeat step S23 until there are no unmarked points within the specified threshold.
[0100] Example 4
[0101] A forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness is as described in Example 3, except that in step S21, the Euclidean distance between the clustered obstacles is calculated by the Numpy library, and the process is as follows:
[0102] Transpose the above data matrix, and convert the original data matrix A with the shape of (1, n) represented by 1 row and n columns into the data matrix B with the shape of (n, 1) represented by n rows and 1 column. The transposition of a matrix refers to the operation of exchanging the rows and columns of a matrix. That is, if a matrix is composed of elements with m rows and n columns, then its transposed matrix will have elements with n rows and m columns, where the elements of the i-th row and j-th column will become the elements of the j-th row and i-th column in the original matrix. Using the broadcast function of the Numpy library for calculation, a difference matrix C=BA with the shape of (n, n) is obtained. The broadcast mechanism means that in the process of two different matrix operations, Numpy stretches the smaller matrix into the shape of a larger matrix, for example, stretching (1, n) A into (n, n), where each row is the first row of data copied, and the same is true for matrix B.
[0103] Square each element in the difference matrix of the previous step, corresponding to (x 2 -x 1 ) 2 +(y 2 -y 1 ) 2 part, and get a tensor.
[0104] Summing the tensor along the last dimension (in this case, the square of the interpolated value at each point) yields a vector of shape (n,) where each element k is the sum of the squared differences between the kth point in the data matrix and all other points. Here, "along the last dimension" refers to operations performed on the innermost dimension of a multidimensional array.
[0105] Taking the square root of each of the above elements, we can get the Euclidean distance between all pairs of points in the data matrix.
[0106] After calculating the Euclidean distance between obstacles, a symmetric matrix D is finally returned, in which the element at the i-th row and j-th column represents the distance between the i-th point and the j-th point in the input matrix. At the same time, the obstacle data is forward filtered again, that is, the data corresponding to y<0 of all points in the matrix are deleted, and the filtered obstacle data is retained. The above process is repeated to recalculate the Euclidean distance and obtain the symmetric matrix F of the filtered data.
[0107] Example 5
[0108] A forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness, as described in Example 4, except that, in S22, for the symmetric matrix D and the symmetric matrix F, the main diagonal elements are filled with infinity, specifically: the elements where the row index i and the column index j have the same value are changed to infinity, that is, the fixed value is reassigned to infinity (inf is used to represent infinity in the computer), the minimum Euclidean distance f in the symmetric matrix F is found, the row index i corresponding to the minimum Euclidean distance f in the symmetric matrix D is extracted, and the data indexed by i in the obstacle data matrix list is marked as dense as a temporary detection point;
[0109] Taking the temporary detection point as the center of the circle, the points within the specified threshold τ (for example, 0.3m) are marked as dense points. This can be achieved by iteration. Specifically, an iteration function iteration is defined. The function needs to accept three parameters: the obstacle data matrix list, the symmetric matrix D and the row index i. According to the row index i, the row index with a threshold less than τ is extracted from the symmetric matrix D. And return the obstacle data matrix list indexed by Point and row indexes as the index i for the next step;
[0110] In S24, in order to ensure that the obstacle data points will not be detected repeatedly during the iteration process, the points of each iteration are marked: a marking list L and a judgment list l are defined. The marking list L records the row index of a single point detected. The decision list l records the row index i that has been detected. To make a judgment, , delete the marker i from the marker list L and proceed to the next iteration; when all row indexes in the marker list L are deleted, it is proved that all points have been detected. At this time, the iteration is stopped and all points detected in S23 are marked as dense to obtain dense side obstacles, and the remaining points are marked as sparse to obtain sparse side obstacles.
[0111] In order to remove the interference of non-obstacle elements outside the field, such as walls, it is necessary to define an anti-interference function. Using the densely marked points obtained in S24, with a larger threshold γ as the radius, γ is 1m, the data matrix list is refiltered, that is, the data outside the threshold range is deleted, and the obstacle data after refiltering is retained, such as Figure 3 shown.
[0112] Example 6
[0113] A forward-looking intelligent vehicle obstacle avoidance method based on density and sparseness is as described in Example 5, except that step S3 specifically includes the following steps:
[0114] S31: Obtain the forward point, integrate the obstacle space information, and calculate the target point;
[0115] S32: Calculating the expected body angle based on the target point and the body origin;
[0116] S33: Motion control based on dynamic PID control algorithm.
[0117] Example 7
[0118] A forward-looking intelligent vehicle obstacle avoidance method based on density is as described in Example 6, except that, in S31, a forward-looking point is obtained, obstacle spatial information is integrated, and target point calculation is performed to obtain a labeled list of two types of obstacle point data, density, and if the midpoint of the line connecting the nearest left and right obstacles is directly selected, or the midpoint of the line connecting the second closest obstacles to the vehicle body is selected, then basic obstacle avoidance can be achieved at low speeds and when the vehicle body posture is good. However, at medium and high speeds, when the vehicle body posture may be poor, a large turn in an unexpected direction may occur, leading to a collision with an obstacle. Therefore, the present invention innovatively proposes to select a third forward-looking point that is as far as possible.
[0119] In step S31, for sparse side obstacles, firstly, the obstacle a closest to the vehicle body is found by calculating the Euclidean distance, and on this basis, the vehicle body orientation is integrated to calculate the obstacle b in front of the vehicle and closest to obstacle a. If it does not exist, b=a, and then the obstacle c in front of the vehicle and closest to b is calculated. If it does not exist, c=b, and c is output as the sparse side forward point; similarly, for dense side obstacles, firstly, the obstacle d closest to the vehicle body is found by calculating the Euclidean distance, and on this basis, the vehicle body orientation is integrated to calculate the obstacle e in front of the vehicle and closest to obstacle d. If it does not exist, e=d, and then the obstacle f in front of the vehicle and closest to obstacle e is calculated. If it does not exist, f=e, and finally f is output as the dense side forward point;
[0120] By comparing the Euclidean distance distance1 between c and b and the Euclidean distance distance2 between f and e, if distance1 < distance2, modify the density prior, adjust the output such that c is the forward-looking point on the dense side and f is the forward-looking point on the sparse side; if distance1 ≥ distance2, there is no need to modify the forward-looking points on the dense side and the sparse side.
[0121] For the selection of the target point, the traditional method directly selects the midpoint of the two forward-looking points as the target point, which is feasible when there are few curves and the vehicle running speed is low. However, for continuous S-curves, the vehicle stability is poor at medium and high speeds. Therefore, based on the output forward-looking points on the dense side and the sparse side, this solution calculates the trisection point on the side closer to the forward-looking point on the dense side of the line connecting the two as the target point output, which is very smooth for continuously passing through S-curves at high speeds.
[0122] Embodiment 8
[0123] A density-based forward-looking intelligent vehicle obstacle avoidance method, as described in Embodiment 7, the difference is that in step S32, connect the origin of the vehicle body to the target point. The target point is positive in the first and second quadrants and negative in the third and fourth quadrants. Calculate the angle between the vehicle body orientation and the line connecting the vehicle body and the target point, and convert it to radians to obtain the expected vehicle body rotation angle, as Figure 4 shown;
[0124] In step S33, compared with the ordinary PID algorithm, the dynamic PID algorithm has a larger proportional adjustment parameter P in curves and a smaller proportional adjustment parameter P in straight lines. It can effectively improve the situation where the proportional adjustment parameter P of the ordinary PID is set larger, resulting in good performance in curves but large oscillations after entering a straight line; when the proportional adjustment parameter P is set smaller, the straight-line swing is smaller, but the response in curves is too slow. It has a better effect in a complex track environment;
[0125] Estimate the current vehicle body attitude based on the accumulation of control quantities, obtain the expected vehicle body rotation angle output in S32, calculate the error error between the expected vehicle body rotation angle and the current vehicle body rotation angle, and calculate the dynamic proportional adjustment parameter K p :
[0126]
[0127] where A represents a dynamic parameter, and adjusting A can change K p According to the degree of dynamic change of error, A can be taken as 5; base_k p represents the fixed proportional adjustment parameter P reference value, which is a set constant value and can be taken as 50;
[0128] Based on the calculated dynamic proportional adjustment parameter K p, the set integral adjustment parameter I, differential adjustment parameter D are used for body control, K p , I, and D affect the system's stability, static error elimination, and anti-interference capabilities.
[0129] The adjustment of P, I, and D parameters is an iterative process. By modifying and testing them one by one, observing the operating results of the smart car, and gradually adjusting the parameters until the ideal control effect is achieved.
[0130] The forward-looking intelligent vehicle obstacle avoidance method based on density of the present invention is applied to an intelligent driving car based on the ROS operating system, and the following settings are made: Figure 5 The test was carried out on the track shown. Figure 7 In order to obtain the route that the smart car expects to pass through at this time through this algorithm, the obstacles are marked in the above manner and the smart car is driven to move forward. It can be seen that the smart car can still keep a posture close to the inside of the curve when passing through continuous curves, thereby avoiding the risk of drift caused by large-scale steering at high speed.
[0131] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A forward-looking intelligent vehicle obstacle avoidance method based on density, characterized in that: The steps include: S1: Obstacle data is obtained based on 2D lidar, and machine learning methods are used to filter and cluster the data; S2: Obstacle segmentation is achieved based on iterative Euclidean classifier IEC to obtain dense side obstacles and sparse side obstacles; S3: The smart car analyzes the obstacle information and the body posture, selects the forward point, and controls the smart car.
2. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 1 is characterized in that: Step S1 specifically includes the following steps: S11: Acquire 2D laser radar data, and pre-process it to convert the polar coordinate radar point cloud into radar point cloud data in a Cartesian coordinate system; S12: filtering the radar point cloud based on radius filtering and local outlier factor filtering; S13: Clustering of radar point clouds based on DBSCAN density clustering algorithm.
3. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 2 is characterized in that: In step S11, the cone barrel obstacles around the road are scanned in real time by a 2D laser radar installed on the vehicle body. The laser radar adopts a triangulation series and extracts 1440 original polar coordinate obstacle points around the laser radar sensor based on the ROS publish-subscribe communication method. The original data returned includes the echo intensity, the polar diameter and polar angle of each point. The polar coordinate conversion formula is used to convert the radar point cloud under polar coordinates to a Cartesian coordinate system with the vehicle head direction as the positive x-axis and the left side of the vehicle head as the positive y-axis: x=ρcos(θ) y=ρsin(θ) Wherein, θ represents the polar angle in the polar coordinate system; ρ represents the polar diameter or the radial distance of the polar coordinate; x represents the abscissa of the Cartesian coordinate system; and y represents the ordinate of the Cartesian coordinate system.
4. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 3 is characterized in that: In step S12, by calculating the distance from the radar point cloud to the vehicle body, that is, the distance from the point cloud coordinates to the origin in the Cartesian coordinate system, a distance threshold is set to remove data outside the distance threshold range; Outliers are detected through the local outlier factor algorithm to achieve noise removal after radius filtering.
5. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 4 is characterized in that: In step S13, the DBSCAN density clustering algorithm clusters the radar point cloud, specifically: Input parameters, including the number of radar point clouds num and the radius of the cluster center R, set num = 8, R = 0.2, input the radar point cloud data after S12 filtering, first detect the number of point clouds within the radius R of a certain sample point in all radar point cloud data> = num, summarize it as the cluster center, and classify the point clouds with the highest density into one category to form a temporary cluster; Repeat the iteration until the point cloud directly reached by each point density is already in the temporary cluster and the clustering no longer changes; By traversing the point cloud of each temporary cluster, the geometric center of each temporary cluster is calculated. The geometric center is obtained by calculating the average position of all points in the temporary cluster. The geometric center of each temporary cluster is regarded as the center of the obstacle detected by the radar.
6. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 5 is characterized in that: Step S2 specifically includes the following steps: S21: Calculate the Euclidean distance between each obstacle after clustering; S22: Find the two points with the smallest Euclidean distance as temporary detection points and give dense point labels; S23: With the temporary detection point as the center of the circle, mark the points within the specified threshold as dense points and replace the temporary detection point; S24: Repeat step S23 until there are no unmarked points within the specified threshold.
7. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 6 is characterized in that: In step S21, the Euclidean distance between pairs of obstacles after clustering is calculated by calling the Python machine learning algorithm library or the Python data processing algorithm library. After calculating the Euclidean distance between pairs of obstacles, a symmetric matrix D is finally returned. The element at the i-th row and j-th column represents the distance between the i-th point and the j-th point in the input matrix. At the same time, forward filtering is performed on the obstacle data again, that is, all data with y < 0 corresponding to the points in the matrix are deleted, and the filtered obstacle data is retained. The above process is repeated to recalculate the Euclidean distance to obtain the symmetric matrix F of the filtered data. In S22, for the symmetric matrix D and the symmetric matrix F, their main diagonal elements are filled with infinity. The minimum Euclidean distance f in the symmetric matrix F is found, and the row index i corresponding to the minimum Euclidean distance f in the symmetric matrix D is extracted. The data with index i in the obstacle data matrix list is marked as dense and used as a temporary detection point. Taking the temporary detection point as the center of the circle, the points within the specified threshold τ are marked as dense points. This can be achieved by iteration. Specifically, an iteration function iteration is defined. The function needs to accept three parameters: the obstacle data matrix list, the symmetric matrix D and the row index i. According to the row index i, the row index with a threshold less than τ is extracted from the symmetric matrix D. And return the obstacle data matrix list indexed by Point and row indexes as the index i for the next step; In S24, in order to ensure that the obstacle data points will not be detected repeatedly during the iteration process, the points of each iteration are marked: a marking list L and a judgment list l are defined. The marking list L records the row index of a single point detected. The decision list l records the row index i that has been detected. To make a judgment, , delete the marker i from the marker list L and proceed to the next iteration; when all row indexes in the marker list L are deleted, it is proved that all points have been detected. At this time, the iteration is stopped and all points detected in S23 are marked as dense, and the dense side obstacles are obtained. The remaining points are marked as sparse, and the sparse side obstacles are obtained. Using the points marked as dense obtained in S24, the data matrix list is re-filtered with a larger threshold Υ as the radius, that is, the data outside the threshold range is deleted, and the obstacle data after re-filtering is retained.
8. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 7 is characterized in that: Step S3 specifically includes the following steps: S31: Obtain the look-ahead points, fuse the obstacle space information, and calculate the target points. S32: Calculate the expected vehicle body rotation angle based on the target points and the vehicle body origin. S33: Perform motion control based on the dynamic PID control algorithm.
9. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 8 is characterized in that: In step S31, for the sparse-side obstacles, first find the obstacle a closest to the vehicle body by calculating the Euclidean distance. On this basis, fuse the vehicle body orientation and calculate the obstacle b in front of the vehicle and closest to the obstacle a. If it does not exist, then b = a. Then calculate the obstacle c in front of the vehicle and closest to b. If it does not exist, then c = b. Output c as the sparse-side look-ahead point. For the dense-side obstacles, first find the obstacle d closest to the vehicle body by calculating the Euclidean distance. On this basis, fuse the vehicle body orientation and calculate the obstacle e in front of the vehicle and closest to the obstacle d. If it does not exist, then e = d. Then calculate the obstacle f in front of the vehicle and closest to the obstacle e. If it does not exist, then f = e. Finally, output f as the dense-side look-ahead point. By comparing the Euclidean distance distance1 between c and b and the Euclidean distance distance2 between f and e, if distance1 < distance2, modify the density prior, adjust the output, set c as the dense-side look-ahead point, and f as the sparse-side look-ahead point. If distance1 ≥ distance2, there is no need to modify the dense-side look-ahead point and the sparse-side look-ahead point. Based on the output dense-side look-ahead point and sparse-side look-ahead point, calculate the trisection point on the side closer to the dense-side look-ahead point of the line connecting the two as the target point output.
10. The forward-looking intelligent vehicle obstacle avoidance method based on density according to claim 9 is characterized in that: In step S32, connect the vehicle body origin and the target point, calculate the angle between the vehicle body orientation and the line connecting the vehicle body and the target point, and convert it to radians to obtain the expected vehicle body rotation angle. In step S33, the current posture of the vehicle body is estimated based on the accumulated control amount, the desired vehicle body angle output in S32 is obtained, the error error between the desired vehicle body angle and the current vehicle body angle is calculated, and the dynamic proportional adjustment parameter K is calculated. p : Among them, A represents the dynamic parameter; base_k p Indicates the fixed proportional adjustment parameter P reference value, which is a set constant value; Based on the calculated dynamic proportional adjustment parameter K p The set integral adjustment parameter I and differential adjustment parameter D are used for body control.
Citation Information
Cited By
Information data management system for vehicle calibration
CN119600110A
