An implementation method for detecting a vehicle left turn
Through the six-axis inertial measurement unit (IMU) and data fusion algorithm, accurate detection of vehicle left turns in complex environments is achieved, solving the problems of insufficient accuracy and real-time performance in existing technologies and improving traffic safety and management efficiency.
Patent Information
- Application Number
- CN202411753592.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-12-02
AI Technical Summary
Existing vehicle left-turn detection technology lacks accuracy and real-time performance in complex traffic environments, and is unable to respond quickly, leading to an increased risk of traffic accidents. In addition, it lacks multi-sensor data fusion and intelligent decision-making capabilities.
A six-axis inertial measurement unit (IMU) is used to monitor vehicle motion. Data is collected through the SPI interface and processed using low-pass filtering and Kalman filtering. Data fusion is performed using the Madgwick or Mahony algorithm. A time window mechanism and angle threshold judgment are introduced to achieve accurate recognition of left turns.
It improves the accuracy and real-time performance of vehicle left-turn detection, and can accurately identify left-turn behaviors in various complex environments, reduce traffic accidents, and optimize decision support for traffic management systems.
Smart Images

Figure CN119773782B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent transportation and vehicle motion detection, and in particular to an implementation method for detecting a vehicle turning left. Background Art
[0002] As the number of motor vehicles in cities increases, the pressure on traffic management also increases. Especially in complex traffic environments, vehicles turning left are highly susceptible to collisions with vehicles or pedestrians going straight, resulting in serious traffic accidents. Existing left-turn detection technologies lack accuracy, real-time performance, and adaptability to complex environments, making them difficult to meet practical needs. For example, detection methods based on a single sensor (such as a camera or GPS) cannot accurately determine a vehicle's turning maneuvers in conditions such as traffic congestion and inclement weather.
[0003] Many existing systems rely on single sensor data (such as cameras or GPS), which makes it impossible to accurately judge whether the vehicle is performing a left turn in complex environments (such as dense traffic, changing weather, etc.), especially at high speeds and in emergency situations.
[0004] Existing technologies perform poorly in various road and weather conditions. For example, camera image clarity decreases in rainy, snowy, or nighttime driving, affecting recognition capabilities. LiDAR can be obstructed in certain environments, resulting in data loss.
[0005] Existing detection systems often require a long processing time to analyze data, making them unable to quickly respond to left-turn behaviors. This can cause delays when vehicles turn right, increasing the risk of traffic accidents. When implementing right-turn detection, certain thresholds may be set based on the vehicle's steering angle and acceleration.
[0006] Many traditional systems fail to fully utilize data fusion from multiple sensors, resulting in redundant and missed information and an inability to fully understand vehicle behavior. In complex traffic environments, existing technologies often lack the ability to make intelligent decisions based on real-time data, failing to provide safety and reliability for vehicle users.
[0007] Therefore, developing a method that can accurately detect vehicle left-turn behavior in complex road environments is crucial to improving road safety. Summary of the Invention
[0008] To address the challenges of the existing technology, the present invention aims to provide a method for detecting left turns. This method aims to improve the accuracy and real-time performance of left-turn detection, particularly in adapting to various complex traffic conditions and environments. By accurately identifying left-turn maneuvers, this method reduces traffic accidents and provides more intelligent decision-making support for traffic management systems.
[0009] The present invention achieves the above-mentioned purpose through the following technical solutions:
[0010] A method for detecting a vehicle turning left, the method comprising the following steps:
[0011] A six-axis inertial measurement unit (IMU) is used to monitor the vehicle's motion state, collecting raw data of three-axis acceleration and angular velocity at fixed time intervals through the SPI interface.
[0012] The collected three-axis acceleration and three-axis angular velocity data are processed by data and six-axis fusion algorithm to obtain the vehicle's three-axis Euler angles, including pitch angle, roll angle, and yaw angle;
[0013] Create a storage structure for storing multiple data points of yaw angle and Z-axis angular velocity;
[0014] Integrate the stored yaw angle and Z-axis angular velocity data and calculate the angle change to obtain the angle change when the vehicle turns;
[0015] Compare the real-time calculated Z-axis angle change value with the preset left turn angle threshold. If it exceeds the threshold, it is determined that the vehicle is turning left.
[0016] A time window mechanism is introduced, requiring the vehicle's Z-axis angular velocity change to meet the left turn angle threshold within multiple consecutive data sampling periods in order to confirm the left turn behavior;
[0017] After the vehicle starts to turn left, the Z-axis angle change of the vehicle is continuously monitored in each data sampling cycle. When the Z-axis angular velocity decreases and approaches zero, it is determined that the left turn action is completed.
[0018] According to a method for detecting a left turn of a vehicle provided by the present invention, the data processing includes low-pass filtering the collected three-axis acceleration and three-axis angular velocity data, and performing Kalman filtering on the low-pass filtered data to eliminate uncertainty and perform state estimation; wherein the low-pass filtering is implemented using a discrete Fourier transform (DFT) or a Butterworth filter.
[0019] According to the present invention, a method for detecting a vehicle turning left is provided, which integrates stored yaw angle and Z-axis angular velocity data and calculates the angle change, including:
[0020] Get the current yaw angle and Z-axis angular velocity;
[0021] Calculate the change between the current Z-axis angular velocity and the last Z-axis angular velocity obtained. Specifically, multiply the current Z-axis angular velocity by 9.8 and subtract the result of multiplying the last Z-axis angular velocity by 9.8.
[0022] Integrate the calculated Z-axis angular velocity change value to obtain the current integral Z-axis data;
[0023] Calculate the average of the current integral Z-axis data and the last integral Z-axis data as the average integral change value;
[0024] Accumulate the obtained average integral change value to the yaw angle, thereby updating the yaw angle;
[0025] Continuously calculate and update the angle change when the vehicle is turning.
[0026] According to the implementation method for detecting the left turn of the vehicle provided by the application, the obtained average integral change value is accumulated to the yaw angle, which is expressed as the following formula:
[0027] θ Z轴 (t) = θ Z轴 (t-1) + ∫ t t--1 ω z dt
[0028] Wherein, ω z is the Z-axis angular velocity, and θ Z轴 is the accumulated yaw angle.
[0029] According to the implementation method for detecting the left turn of the vehicle provided by the application, the real-time calculated Z-axis angle change value is compared with the preset left turn angle threshold, which comprises:
[0030] Set a left turn angle threshold, which is adjusted according to the type of vehicle, turning habit and traffic environment;
[0031] The calculated Z-axis angle change value θ Z轴 is compared with the set left turn angle threshold;
[0032] If the Z-axis angle change value θ Z轴 exceeds the left turn angle threshold, it is judged that the vehicle is turning left;
[0033] If the Z-axis angle change value θ Z轴 does not exceed the left turn angle threshold, it is judged that the vehicle is not turning left.
[0034] According to the implementation method for detecting the left turn of the vehicle provided by the application, when the time window mechanism is introduced, a time window length is set, wherein the time window length is defined as the number of data sampling periods that need to be continuously satisfied with the left turn angle threshold, and the threshold and the window length are adjusted according to the type of vehicle, turning habit and traffic environment;
[0035] In the time window, the Z-axis angle change value of each data sampling period is compared with the left turn angle threshold, and the integral value in the time window is calculated;
[0036] If the Z-axis angle change values for multiple consecutive data sampling periods within the time window exceed the left turn angle threshold, and the integral value within the time window also meets the preset conditions, then it is determined that the vehicle is turning left;
[0037] If the Z-axis angle change value of any one or more data sampling periods within the time window does not exceed the left turn angle threshold, or the integral value within the time window does not meet the preset conditions, it is determined that the vehicle did not make a left turn.
[0038] According to an implementation method for detecting left turns of vehicles provided by the present invention, when calculating the integral value within a time window, for each new data sampling period, its Z-axis angle change value is added to the time window, and the Z-axis angle change value of the earliest data sampling period in the time window is removed at the same time to keep the length of the time window constant; the cumulative sum of all Z-axis angle change values in the time window is calculated as the integral value within the time window.
[0039] According to a method for detecting a vehicle's left turn provided by the present invention, if the change in the Z-axis angular velocity does not exceed a set left-turn angle threshold within a certain period of time, the system deems that the vehicle has completed the left turn.
[0040] After the vehicle starts to turn left, if the Z-axis angle change value does not exceed the set left turn angle threshold within M consecutive data sampling periods, where M is a preset positive integer, and the time length corresponding to M data sampling periods is sufficient to reflect the process of the vehicle completing the left turn, then it is determined that the vehicle has completed the left turn;
[0041] If the Z-axis angle change value of any one or more data sampling periods exceeds the set left turn angle threshold within M data sampling periods, the subsequent Z-axis angle change values will continue to be monitored until the condition that the vehicle has completed the left turn is met.
[0042] According to an implementation method for detecting a vehicle's left turn provided by the present invention, when creating a storage structure, two doubly linked lists or circular buffers are created, each for storing the yaw angle and the Z-axis angular velocity, wherein the first doubly linked list or circular buffer is used to store the vehicle's yaw angle data; the second doubly linked list or circular buffer is used to store the vehicle's Z-axis angular velocity data; the system stores the calculated three-axis Euler angles every 20 ms.
[0043] According to a method for detecting a vehicle turning left provided by the present invention, the six-axis fusion algorithm processing includes:
[0044] A data fusion module is provided. The module uses the Madgwick algorithm or the Mahony algorithm to fuse the acquired three-axis acceleration data and three-axis angular velocity data to calculate the vehicle's three-axis Euler angles, including pitch angle, roll angle, and yaw angle;
[0045] The data fusion module is configured to pay special attention to the yaw angle of the Z axis, which is used to reflect the steering behavior of the vehicle;
[0046] The data fusion module also includes:
[0047] A filtering unit is used to pre-process the original three-axis acceleration and three-axis angular velocity data;
[0048] The fusion algorithm implementation unit specifically implements the Madgwick algorithm or the Mahony algorithm to iteratively calculate the three-axis Euler angle;
[0049] The attitude output module is used to output the calculated three-axis Euler angles in a standard format for use by other systems or modules;
[0050] The fusion algorithm implementation unit is optimized to provide efficient and accurate posture estimation in real-time applications.
[0051] It can be seen that compared with the prior art, the present invention has the following beneficial effects:
[0052] 1. The present invention can significantly improve the accuracy of left turn detection by fusing multi-source sensor data (such as gyroscopes and accelerometers) and utilizing a six-axis fusion algorithm and filtering processing.
[0053] 2. The present invention can work normally under various weather and road conditions, and can maintain high detection accuracy regardless of rainy and snowy weather, low visibility environment at night, or complex road conditions such as traffic congestion.
[0054] 3. The present invention can monitor the left-turn behavior of the vehicle in real time and issue an early warning or take other safety measures in a timely manner when a dangerous situation is detected.
[0055] 4. The present invention adopts multi-source data fusion technology, which enables the system to fully utilize data from different sensors and reduce the occurrence of misjudgment, especially in scenarios of sharp turns or high-speed turns.
[0056] 5. The present invention is combined with the intelligent dispatching function of the traffic management system to optimize traffic signals according to the detected left-turn behavior, thereby improving the efficiency of traffic management.
[0057] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 The present invention is a flowchart of an embodiment of a method for detecting a vehicle turning left.
[0059] Figure 2 The present invention is a flowchart of a method for detecting a vehicle turning left. DETAILED DESCRIPTION
[0060] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0061] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0062] See also Figure 1 and Figure 2 The present invention provides a method for detecting a vehicle turning left, the method comprising the following steps:
[0063] Step S1, using a six-axis inertial measurement unit (IMU) to monitor the vehicle's motion state, and collecting raw data of three-axis acceleration and angular velocity at fixed time intervals through the SPI interface;
[0064] Step S2, performing data processing and six-axis fusion algorithm processing on the collected three-axis acceleration and three-axis angular velocity data to obtain the three-axis Euler angles of the vehicle, including pitch angle, roll angle, and yaw angle;
[0065] Step S3, creating a storage structure for storing multiple data points of yaw angle and Z-axis angular velocity;
[0066] Step S4, integrating the stored yaw angle and Z-axis angular velocity data and calculating the angle change to obtain the angle change when the vehicle turns;
[0067] Step S5, comparing the real-time calculated Z-axis angle change value with a preset left turn angle threshold. If the value exceeds the threshold, it is determined that the vehicle is turning left.
[0068] Step S6: A time window mechanism is introduced, requiring the vehicle's Z-axis angular velocity change to meet the left turn angle threshold within multiple consecutive data sampling periods before a left turn is confirmed.
[0069] Step S7: After the vehicle starts to turn left, the Z-axis angle change of the vehicle in each data sampling period is continuously monitored. When the Z-axis angular velocity decreases and approaches zero, it is determined that the left turn action is completed.
[0070] It can be seen that this embodiment uses a six-axis gyroscope IMU (three-axis accelerometer and three-axis gyroscope), the MCU obtains the original data through the SPI interface, the first stage processes the original data through low-pass filtering, the first layer of filtered data is processed by Kalman filtering, and finally the six-axis fusion algorithm is performed to obtain the three-axis Euler angle, the obtained data is processed by algorithm, and the signal filtering processing and threshold judgment algorithm are combined to achieve accurate recognition of left turns.
[0071] In step S1, a six-axis inertial measurement unit (IMU), consisting of a three-axis accelerometer and a three-axis gyroscope, is used to monitor the vehicle's motion. The MCU communicates with the IMU via an SPI interface, collecting raw data on the three-axis acceleration and angular velocity at fixed intervals (e.g., 20 milliseconds).
[0072] Before data acquisition, the sensor needs to be offset calibrated and temperature compensated to reduce the impact of external factors (such as temperature changes and sensor drift) on the data.
[0073] In the above step S2, the data processing includes low-pass filtering the collected three-axis acceleration and three-axis angular velocity data to remove high-frequency noise; wherein, the low-pass filtering is implemented using discrete Fourier transform DFT or Butterworth filter. The filtered data will be smoother, retaining the main motion signal and reducing the interference of environmental noise, thereby ensuring the availability of the data.
[0074] The Kalman filter further processes the low-pass filtered data to eliminate uncertainty and generate a state estimate. This algorithm combines the previous state estimate with the current measurement data to produce a more accurate state prediction. The Kalman gain dynamically adjusts the weighting between the measured and estimated values to better adapt to noisy environments. This is particularly effective for dynamic systems, such as turning vehicles.
[0075] In the above step S2, the six-axis fusion algorithm processing includes:
[0076] The three-axis acceleration and angular velocity data are fused to obtain the vehicle's three-axis Euler angles (pitch, roll, and yaw). Data fusion can be performed using either the Madgwick or Mahony algorithms. The fused Euler angles accurately reflect changes in the vehicle's posture, particularly the Z-axis yaw angle, which is used to determine the vehicle's steering behavior.
[0077] Specifically, a data fusion module is provided, which uses the Madgwick algorithm or the Mahony algorithm to fuse the acquired three-axis acceleration data and three-axis angular velocity data to calculate the vehicle's three-axis Euler angles, including pitch angle, roll angle and yaw angle.
[0078] The data fusion module is configured to pay special attention to the yaw angle of the Z axis, which is used to reflect the steering behavior of the vehicle.
[0079] In this embodiment, the data fusion module further includes:
[0080] A filtering unit is used to pre-process the original three-axis acceleration and three-axis angular velocity data;
[0081] The fusion algorithm implementation unit specifically implements the Madgwick algorithm or the Mahony algorithm to iteratively calculate the three-axis Euler angle;
[0082] The attitude output module is used to output the calculated three-axis Euler angles in a standard format for use by other systems or modules;
[0083] The fusion algorithm implementation unit is optimized to provide efficient and accurate pose estimation in real-time applications.
[0084] In the above step S3, when creating the storage structure, two doubly linked lists or circular buffers are created, which are used to store the yaw angle and Z-axis angular velocity respectively. Among them, the first doubly linked list or circular buffer is used to store the vehicle's yaw angle data; the second doubly linked list or circular buffer is used to store the vehicle's Z-axis angular velocity data; the system stores the calculated three-axis Euler angle once every 20ms, and the size of the linked list is dynamically adjusted according to the vehicle's driving speed and the required detection sensitivity (for example, storing the most recent N data points).
[0085] The value of N is dynamically determined based on the vehicle's speed and detection sensitivity requirements to ensure that more data points can be stored when the vehicle is traveling at high speed or requires high-sensitivity detection, and that the number of stored data points can be reduced when the vehicle is traveling at low speed or requires lower-sensitivity detection.
[0086] In the above step S4, the stored yaw angle and Z-axis angular velocity data are integrated and angle change calculated, including:
[0087] Get the current yaw angle and Z-axis angular velocity;
[0088] Calculate the change between the current Z-axis angular velocity and the last Z-axis angular velocity obtained. Specifically, multiply the current Z-axis angular velocity by 9.8 and subtract the result of multiplying the last Z-axis angular velocity by 9.8.
[0089] Integrate the calculated Z-axis angular velocity change value to obtain the current integrated Z-axis data;
[0090] Calculate the average value of the current integrated Z-axis data and the previous integrated Z-axis data as the average integrated change value;
[0091] The obtained average integral change value is added to the yaw angle to update the yaw angle;
[0092] Continuously calculate and update the angle change when the vehicle turns.
[0093] In this embodiment, the obtained average integrated change value is accumulated to the yaw angle, which is expressed as the following formula:
[0094] θ Z轴 (t) = θ Z轴 (t-1)+∫ t t--1 ω z dt
[0095] Among them, ω z is the Z-axis angular velocity, θ Z轴 (t) is the cumulative yaw angle at time t, ∫ t t--1 ω z dt represents the angular velocity ω from t-1 to t z The integral of , that is, the cumulative change in angular velocity during this period of time.
[0096] Specifically, when performing integration and angle change calculations, for the Z-axis angular velocity integral: the average value is obtained, and the yaw angle is accumulated by integrating the yaw angle and the average value of the Z-axis angular velocity (current Z-axis angular velocity x 9.8 - last angular velocity x 9.8). Each time, the current integrated Z-axis data is calculated with the previous Z-axis data to calculate the average integral change, and the angular velocity of the Z-axis (yaw angle) is integrated to calculate the angle change when the vehicle turns. The integration can be implemented using numerical integration methods, such as the trapezoidal method or the Simpson method.
[0097] In the above step S5, the Z-axis angle change value calculated in real time is compared with the preset left turn angle threshold, including:
[0098] a left turn angle threshold value is set, which is adjusted according to the vehicle type, turning habit and traffic environment;
[0099] the calculated Z-axis angle change value θ Z轴 is compared with the set left turn angle threshold value;
[0100] if the Z-axis angle change value θ Z轴 exceeds the left turn angle threshold value, it is determined that the vehicle is turning left;
[0101] if the Z-axis angle change value θ Z轴 does not exceed the left turn angle threshold value, it is determined that the vehicle is not turning left.
[0102] Specifically, after each integration, the system compares the real-time calculated Z-axis angle change value with the preset left turn angle threshold value. The typical left turn angle threshold value can be set to any value, and the specific value is adjusted according to the vehicle type, turning habit and traffic environment.
[0103] if the Z-axis angle change value θ Z轴 exceeds the left turn threshold, the system determines that the vehicle is turning left. If the Z-axis angle change value does not exceed the threshold, the system determines that the vehicle is not turning left.
[0104] In the above step S6, in order to avoid misjudgment, the system introduces a time window mechanism on the basis of angle judgment. For example, when introducing the time window mechanism, a time window length is set, wherein the time window length is defined as the number of data sampling periods that need to continuously satisfy the left turn angle threshold value, and the threshold value and window length are adjusted according to the vehicle type, turning habit and traffic environment;
[0105] In the time window, the Z-axis angle change value of each data sampling period is compared with the left turn angle threshold value, and the integral value in the time window is calculated;
[0106] if the Z-axis angle change value of a plurality of consecutive data sampling periods in the time window exceeds the left turn angle threshold value, and the integral value in the time window also satisfies the preset condition, it is determined that the vehicle is turning left;
[0107] if the Z-axis angle change value of any one or more data sampling periods in the time window does not exceed the left turn angle threshold value, or the integral value in the time window does not satisfy the preset condition, it is determined that the vehicle is not turning left.
[0108] In this embodiment, when calculating the integral value within the time window, for each new data sampling period, its Z-axis angle change value is added to the time window, and at the same time, the Z-axis angle change value of the earliest data sampling period in the time window is removed to keep the length of the time window constant; the cumulative sum of all Z-axis angle change values in the time window is calculated as the integral value within the time window.
[0109] Of course, the time window length of this embodiment is adjustable to meet the needs of different driving scenarios. For example, when the vehicle accelerates or makes a sharp turn, the time window length can be appropriately extended to improve the accuracy of the judgment.
[0110] In the above step S7, if the change in the Z-axis angular velocity does not exceed the set left turn angle threshold within a certain period of time, the system considers that the vehicle has completed the left turn.
[0111] After the vehicle starts to turn left, if the Z-axis angle change value does not exceed the set left turn angle threshold within M consecutive data sampling periods, where M is a preset positive integer, and the time length corresponding to M data sampling periods is sufficient to reflect the process of the vehicle completing the left turn, then it is determined that the vehicle has completed the left turn;
[0112] If the Z-axis angle change value of any one or more data sampling periods exceeds the set left turn angle threshold within M data sampling periods, the subsequent Z-axis angle change values will continue to be monitored until the condition that the vehicle has completed the left turn is met.
[0113] In this embodiment, the method further includes triggering corresponding vehicle control or navigation operations, such as adjusting vehicle speed, steering assistance, issuing a warning signal, or updating a navigation path, after determining that the vehicle is turning left.
[0114] In practical applications, this embodiment uses an MCU to obtain raw data from the six-axis gyroscope via the SPI interface. The raw data is first processed through a low-pass filter. The first-layer filtered data is then subjected to a Kalman filter to obtain the second-layer data. Finally, a six-axis fusion algorithm is used to obtain the three-axis Euler angles. Two array linked lists of size N are created. The N data points of the yaw angle and Z-axis angular velocity obtained every 20ms are stored in these cache array linked lists. The first x data points stored in the two-way linked lists are averaged. Finally, each average value is averaged and integrated. The resulting integral value is determined to be greater than a predetermined threshold. The result is then converted into a corresponding change angle. The angle obtained for each time is added to the Z-axis Euler angle to calculate the first x average integrals. The result is then determined to be greater than a predetermined threshold to determine whether a left turn has occurred. If the change value is less than the predetermined threshold and approaches zero, the left turn is considered complete, and the corresponding left turn flag is set to 1.
[0115] Further, in calculating the integral value within the time window, weighted average, moving average or other mathematical processing methods can also be used to smooth or emphasize the influence of certain data sampling periods.
[0116] Further, the integral threshold is determined based on experimental data, statistical analysis or expert experience to ensure accurate differentiation between left turn behavior and other types of motion in vehicle acceleration, sharp turns or other complex driving scenarios.
[0117] Further, the method provided by the embodiment further includes triggering a series of preset vehicle control or navigation operations after confirming that the vehicle is turning left, such as adjusting the vehicle speed, activating the steering assist system, issuing visual or audible warnings, or updating the path planning of the navigation system.
[0118] The method provided by the embodiment is used as part of the vehicle automatic driving system, assisted driving system or vehicle dynamic monitoring system, and is used in combination with other sensor data (such as GPS position, vehicle speed, steering wheel angle, etc.) to improve the accuracy and reliability of left turn judgment.
[0119] In summary, the present application can greatly improve the accuracy of left turn detection by fusing multi-source sensor data and using six-axis fusion algorithm and filtering processing. The present application can work normally under various weather and road conditions, whether it is rainy and snowy weather, night low visibility environment, or complex road conditions such as traffic congestion, and can maintain high detection accuracy. The present application can monitor the left turn behavior of the vehicle in real time, and issue warnings or take other safety measures in time when detecting dangerous situations. The present application uses multi-source data fusion technology, so that the system can make full use of the data of different sensors, reduce the occurrence of misjudgment, especially in the scene of sharp turns or high-speed turns. The present application combines the intelligent scheduling function of the traffic management system, and can optimize the traffic signal according to the detected left turn behavior, and improve the efficiency of traffic management.
[0120] It should be noted that the embodiments of the present application can be deployed on a networked server. Those skilled in the art can understand that the above method and system can be realized by using computer executable instructions and / or included in processor control code. The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto. Any modification, equivalent replacement and improvement made by those skilled in the art within the technical scope disclosed by the present application, as long as it is within the spirit and principle of the present application, should be covered within the protection scope of the present application.
[0121] The above embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and replacements made by technicians in this field on the basis of the present invention fall within the scope of protection required by the present invention.
Claims
1. A method for detecting a vehicle turning left, characterized in that: The method comprises the following steps: A six-axis inertial measurement unit (IMU) is used to monitor the vehicle's motion state, collecting raw data of three-axis acceleration and angular velocity at fixed time intervals through the SPI interface. The collected three-axis acceleration and three-axis angular velocity data are processed by data processing and six-axis fusion algorithm to obtain the vehicle's three-axis Euler angles, including pitch angle, roll angle, and yaw angle; Create a storage structure for storing multiple data points of yaw angle and Z-axis angular velocity; The stored yaw angle and Z-axis angular velocity data are integrated and the angle change is calculated to obtain the angle change when the vehicle turns. Specifically, the yaw angle and Z-axis angular velocity at the current moment are obtained. The change between the current Z-axis angular velocity and the last Z-axis angular velocity is calculated, specifically, the result of multiplying the current Z-axis angular velocity by 9.8 minus the result of multiplying the last Z-axis angular velocity by 9.
8. The calculated Z-axis angular velocity change is integrated to obtain the current integrated Z-axis data. The average of the current integrated Z-axis data and the last integrated Z-axis data is calculated as the average integrated change value. The average integrated change value is added to the yaw angle to update the yaw angle. The angle change when the vehicle turns is continuously calculated and updated. Compare the real-time calculated Z-axis angle change value with the preset left turn angle threshold. If it exceeds the threshold, it is determined that the vehicle is turning left. A time window mechanism is introduced, requiring the vehicle's Z-axis angular velocity change to meet the left turn angle threshold within multiple consecutive data sampling periods in order to confirm the left turn behavior; After the vehicle starts to turn left, the Z-axis angle change of the vehicle is continuously monitored in each data sampling cycle. When the Z-axis angular velocity decreases and approaches zero, it is determined that the left turn action is completed.
2. The method according to claim 1, wherein: The data processing includes low-pass filtering the collected three-axis acceleration and three-axis angular velocity data, and performing Kalman filtering on the low-pass filtered data to eliminate uncertainty and perform state estimation; wherein the low-pass filtering is implemented using discrete Fourier transform DFT or Butterworth filter.
3. The method according to claim 1, wherein: The obtained average integrated change value is added to the yaw angle, which is expressed as the following formula: θ Z轴 ( t )= θ Z轴 ( t -1)+∫ t t-1 ω z dt Among them, ω z is the Z-axis angular velocity, θ Z轴 is the Z-axis angle change value.
4. The method according to claim 1, wherein The step of comparing the real-time calculated Z-axis angle change value with a preset left turn angle threshold comprises: Set a left turn angle threshold that is adjusted based on vehicle type, turning habits, and traffic conditions; The calculated Z-axis angle change value θ Z轴 Compare with the set left turn angle threshold; If the Z-axis angle changes by θ Z轴 If the left turning angle threshold is exceeded, the vehicle is judged to be turning left; If the Z-axis angle changes by θ Z轴 If the left turn angle threshold is not exceeded, it is determined that the vehicle is not turning left.
5. The method according to claim 1, wherein: When introducing the time window mechanism, a time window length is set, where the time window length is defined as the number of data sampling cycles required to continuously meet the left turn angle threshold. The threshold and window length are adjusted according to the vehicle type, turning habits and traffic environment. In the time window, the Z-axis angle change value of each data sampling period is compared with the left turn angle threshold, and the integral value in the time window is calculated; If the Z-axis angle change values for multiple consecutive data sampling periods within the time window exceed the left turn angle threshold, and the integral value within the time window also meets the preset conditions, then it is determined that the vehicle is turning left; If the Z-axis angle change value of any one or more data sampling periods within the time window does not exceed the left turn angle threshold, or the integral value within the time window does not meet the preset conditions, it is determined that the vehicle did not make a left turn.
6. The method according to claim 5, characterized in that: When calculating the integral value within the time window, for each new data sampling period, its Z-axis angle change value is added to the time window, and the Z-axis angle change value of the earliest data sampling period in the time window is removed at the same time to keep the time window length constant; the cumulative sum of all Z-axis angle change values in the time window is calculated as the integral value within the time window.
7. The method according to claim 1, wherein: If the change in Z-axis angular velocity does not exceed the set left turn angle threshold within a certain period of time, the system considers that the vehicle has completed the left turn; After the vehicle starts to turn left, if the Z-axis angle change value does not exceed the set left turn angle threshold within M consecutive data sampling periods, where M is a preset positive integer, and the time length corresponding to M data sampling periods is sufficient to reflect the process of the vehicle completing the left turn, then it is determined that the vehicle has completed the left turn; If the Z-axis angle change value of any one or more data sampling periods exceeds the set left turn angle threshold within M data sampling periods, the subsequent Z-axis angle change values will continue to be monitored until the condition that the vehicle has completed the left turn is met.
8. The method according to claim 1, wherein: When creating the storage structure, create two doubly linked lists or ring buffers, which are used to store the yaw angle and Z-axis angular velocity respectively. The first doubly linked list or ring buffer is used to store the vehicle's yaw angle data; the second doubly linked list or ring buffer is used to store the vehicle's Z-axis angular velocity data; the system stores the calculated three-axis Euler angle every 20ms.
9. The method according to claim 1, wherein: The six-axis fusion algorithm processing includes: A data fusion module is provided. The module uses the Madgwick algorithm or the Mahony algorithm to fuse the acquired three-axis acceleration data and three-axis angular velocity data to calculate the vehicle's three-axis Euler angles, including pitch angle, roll angle, and yaw angle; The data fusion module is configured to pay special attention to the yaw angle of the Z axis, which is used to reflect the steering behavior of the vehicle; The data fusion module also includes: A filtering unit is used to pre-process the original three-axis acceleration and three-axis angular velocity data; The fusion algorithm implementation unit specifically implements the Madgwick algorithm or the Mahony algorithm to iteratively calculate the three-axis Euler angle; The attitude output module is used to output the calculated three-axis Euler angles in a standard format for use by other systems or modules; The fusion algorithm implementation unit is optimized to provide efficient and accurate posture estimation in real-time applications.
Citation Information
Patent Citations
Method for detecting turning angle of vehicle based on three-axis acceleration sensor
CN105523084A
Method for vehicle running state description and driving behavior detection based on state machine
CN106585636A