A method, system, medium, and device for accurately detecting vehicles turning right and stopping.

By using inertial sensor IMU, Kalman filtering and six-axis data fusion technology in intelligent vehicle systems, the accuracy and real-time problems of vehicle turn and parking status detection in complex environments are solved, and higher detection accuracy and system reliability are achieved.

CN119416159BActive Publication Date: 2025-04-08ZHUHAI MAGIC CUBE INTELLIGENT TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411791278.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-08
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

It is difficult for existing autonomous driving and intelligent vehicle systems to accurately judge the steering and parking status of the vehicle in complex environments such as low speeds or turns, and problems of misjudgment or detection delays often occur.

Method used

The inertial sensor IMU is adopted, combined with Kalman filtering and six-axis data fusion technology, and through low-pass filtering and data update, the vehicle is accurately judged by the right turn and parking status.

Benefits of technology

It improves the accuracy and real-time detection of vehicle turn and parking status in complex environments, reduces misjudgment and detection delays, and enhances the reliability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416159B_ABST
    Figure CN119416159B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of intelligent vehicle control technology, and more specifically, to a method, system, medium and device for accurately detecting right turn and parking of a vehicle. The scheme includes a single chip microcomputer to acquire original turning and parking monitoring data; low-pass filtering the collected data according to the original turning and parking monitoring data to form first filtered data; updating the data according to the first filtered data using Kalman filtering; real-time fusion of the data acquired by the three-axis accelerometer and the gyroscope to set the final output data; setting storage data, including collected data and a bidirectional linked list; judging whether the right turn logic is met according to the stored data, and judging whether to start the parking logic according to the preset requirements. The scheme uses Kalman filtering and six-axis fusion based on the inertial sensor IMU to achieve accurate right turn parking judgment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent vehicle control technology, and more specifically, to a method, system, medium and device for accurately detecting right turn parking of a vehicle. Background Art

[0002] Research in the field of intelligent vehicle control is working on accurately detecting how a vehicle turns / parks, which involves using advanced sensors, computer vision, and machine learning algorithms to recognize road signs, pedestrians, and other vehicles, and predict their behavior. The significance of this technology is to improve driving safety and reduce traffic accidents, especially in complex urban environments. Its importance lies in providing more reliable decision support for autonomous vehicles, ensuring that they can accurately comply with traffic regulations when performing right-turn parking maneuvers and avoid conflicts with other road users.

[0003] Prior to the present invention, accurate judgment of the vehicle's steering and parking status was the key to vehicle control in existing autonomous driving and intelligent vehicle systems. Traditional detection methods mostly rely on GPS, wheel speed sensors and other equipment. Although they can provide a certain degree of accuracy, they often cause misjudgment or detection delay problems in complex environments such as low speeds or turns. Summary of the invention

[0004] In view of the above problems, the present invention proposes a method, system, medium and device for accurately detecting right turn parking of a vehicle, and accurately judges right turn parking by using Kalman filtering and six-axis fusion based on inertial sensor IMU.

[0005] According to a first aspect of an embodiment of the present invention, a method for accurately detecting right turn parking of a vehicle is provided.

[0006] In one or more embodiments, preferably, the method for accurately detecting a vehicle turning right to stop comprises:

[0007] The single chip microcomputer acquires the original turning and parking monitoring data;

[0008] Performing low-pass filtering on the collected data according to the original turning and parking monitoring data to form first filtered data;

[0009] Performing data updating using Kalman filtering according to the first filtered data;

[0010] The data obtained by the three-axis accelerometer and gyroscope are integrated in real time to set the final output data;

[0011] Set up storage data, including collected data and bidirectional linked lists;

[0012] Determine whether the right turn logic is met based on the stored data, and determine whether to start the parking logic based on the preset requirements.

[0013] In one or more embodiments, preferably, the single chip microcomputer acquires original turning and parking monitoring data, specifically including:

[0014] Use the SPI interface of the microcontroller to communicate with the six-axis gyroscope;

[0015] Get the original data of the six axes, perform offset calibration and temperature compensation, and form the original turning and parking monitoring data.

[0016] In one or more embodiments, preferably, the step of performing low-pass filtering on the collected data according to the original turning and parking monitoring data to form the first filtered data specifically includes:

[0017] Set the filter form, where the filter is discrete Fourier transform or Butterworth filter;

[0018] The three-axis acceleration and the three-axis angular velocity output by the gyroscope are subjected to low-pass filtering according to the filter to form first filtered data.

[0019] In one or more embodiments, preferably, the updating of data by using Kalman filtering according to the first filtered data specifically includes:

[0020] Previous state estimates and current measurements, update the system state;

[0021] By calculating the Kalman gain, combining the new measurement value, updating the state estimate and error covariance, more accurate angle data can be obtained.

[0022] In one or more embodiments, preferably, the real-time fusion of the data acquired by the three-axis accelerometer and the gyroscope to set the final output data specifically includes:

[0023] Apply Madgwick or Mahony algorithm for six-axis data fusion;

[0024] Set the final output data to three-axis Euler angles, including roll angle, pitch angle, and yaw angle.

[0025] In one or more embodiments, preferably, the setting of storing data includes collecting data and a bidirectional linked list, specifically including:

[0026] The three-axis angular velocity, three-axis acceleration, and three-axis Euler angle data are read from the inertial sensor IMU every 20 milliseconds as a real-time data stream;

[0027] The yaw angle and Z-axis angular velocity data collected each time are stored in a circular buffer using a circular indexing method;

[0028] Define two circular buffers, each with a size of N, which are used to store the yaw angle and Z-axis angular velocity of the IMU respectively;

[0029] A circular buffer is used so that when the buffer reaches the maximum size N, new data will overwrite old data.

[0030] In one or more embodiments, preferably, judging whether the right turn logic is satisfied according to the stored data and judging whether to start the parking logic according to the preset requirements specifically include:

[0031] Read the yaw angle value in the stored data, convert the angle change obtained by each integration into the actual angle value, add it to the current Z-axis Euler angle to form a new angle value, and calculate the average integral change value of the X angle values ​​in the current stored data;

[0032] Determine whether the average of the first N angle values ​​satisfies the first calculation formula;

[0033] When the first calculation formula is satisfied, the vehicle starts turning right;

[0034] When the first calculation formula is not satisfied, it is considered that the vehicle does not make a right turn;

[0035] Determine whether the integral change value continuously satisfies the second calculation formula within a preset time period;

[0036] When the second calculation formula is continuously satisfied within a preset time period, it is considered that the vehicle has completed the right turn;

[0037] When the second calculation formula is not continuously satisfied within the preset time period, the OBD vehicle speed is read;

[0038] Read the OBD speed or GPS speed as the identification speed, where OBD reading has a higher priority than GPS reading;

[0039] determining whether the identified vehicle speed satisfies a third calculation formula, and if so, the vehicle turns right and stops;

[0040] If not satisfied, turn right without stopping;

[0041] The first calculation formula is:

[0042] AVG>YB

[0043] Wherein, AVG is the average value of the first N angle values ​​obtained according to the stored data, and YB is the preset comparison value;

[0044] The second calculation formula is:

[0045] BH <Y0

[0046] Among them, BH is the integral change value, and Y0 is the preset comparison threshold value tending to 0;

[0047] The third calculation formula is:

[0048] CS <X

[0049] Wherein, CS is the identified vehicle speed, and X is the preset parking speed judgment threshold.

[0050] According to a second aspect of an embodiment of the present invention, a system for accurately detecting a vehicle turning right and parking is provided.

[0051] In one or more embodiments, preferably, the system for accurately detecting a vehicle turning right and parking comprises:

[0052] Data acquisition module, used for the single chip microcomputer to acquire original turning and parking monitoring data;

[0053] A first data processing module, configured to perform low-pass filtering on the collected data according to the original turning and parking monitoring data to form first filtered data;

[0054] A second data processing module, used for updating data by using Kalman filtering according to the first filtered data;

[0055] The six-axis data fusion module is used to fuse the data obtained by the three-axis accelerometer and the gyroscope in real time and set the final output data;

[0056] A data storage module, used to set storage data, including collected data and a bidirectional linked list;

[0057] The parking determination module is used to determine whether the right turn logic is met based on the stored data, and to determine whether to start the parking logic based on the preset requirements.

[0058] According to a third aspect of an embodiment of the present invention, there is provided a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method as described in any one of the first aspect of the embodiment of the present invention is implemented.

[0059] According to a fourth aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement any one of the methods described in the first aspect of the embodiment of the present invention.

[0060] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:

[0061] In the solution of the present invention, by fusing six-axis data, using low-pass filtering and Kalman filtering to process the data, and through integral calculation and angle threshold judgment, the right turn state of the vehicle and its parking action can be accurately identified, solving the problem of misjudgment or delay in complex environments in the prior art.

[0062] The solution of the present invention can overcome the problems of poor accuracy and adaptability caused by the prior art relying on a single sensor, and achieve high-precision detection of right-turn parking behavior in real time, which is particularly suitable for various complex traffic roads and improves the real-time performance and reliability of the system.

[0063] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0064] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0066] Figure 1 The present invention is a flowchart of a method for accurately detecting a vehicle turning right and stopping according to an embodiment of the present invention.

[0067] Figure 2 The present invention is a flowchart of a single chip microcomputer acquiring original turning and parking monitoring data in a method for accurately detecting right turning and parking of a vehicle according to an embodiment of the present invention.

[0068] Figure 3 The present invention is a flowchart of a method for accurately detecting a vehicle turning right and stopping in one embodiment of the present invention, which performs low-pass filtering on collected data according to original turning and parking monitoring data to form first filtered data.

[0069] Figure 4 The present invention is a flowchart of a method for accurately detecting a vehicle turning right and stopping, which uses Kalman filtering to update data according to first filtering data.

[0070] Figure 5The present invention is a flowchart of a method for accurately detecting a vehicle turning right and parking in one embodiment of the present invention, which combines data obtained by a three-axis accelerometer and a gyroscope in real time and sets the final output data.

[0071] Figure 6 The invention discloses a flow chart of setting and storing data in a method for accurately detecting a vehicle turning right and parking in one embodiment of the present invention, including collecting data and a bidirectional linked list.

[0072] Figure 7 It is a flowchart of a method for accurately detecting a vehicle turning right and parking in one embodiment of the present invention, which determines whether the right turn logic is satisfied according to stored data, and determines whether to start the parking logic according to preset requirements.

[0073] Figure 8 The present invention is a structural diagram of a system for accurately detecting a vehicle turning right and parking according to an embodiment of the present invention.

[0074] Fig. 9 It is a structural diagram of an electronic device in one embodiment of the present invention. DETAILED DESCRIPTION

[0075] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0077] Research in the field of intelligent vehicle control is working on accurately detecting how a vehicle turns / parks, which involves using advanced sensors, computer vision, and machine learning algorithms to recognize road signs, pedestrians, and other vehicles, and predict their behavior. The significance of this technology is to improve driving safety and reduce traffic accidents, especially in complex urban environments. Its importance lies in providing more reliable decision support for autonomous vehicles, ensuring that they can accurately comply with traffic regulations when performing right-turn parking maneuvers and avoid conflicts with other road users.

[0078] Prior to the present invention, accurate judgment of the vehicle's steering and parking status was the key to vehicle control in existing autonomous driving and intelligent vehicle systems. Traditional detection methods mostly rely on GPS, wheel speed sensors and other equipment. Although they can provide a certain degree of accuracy, they often cause misjudgment or detection delay problems in complex environments such as low speeds or turns.

[0079] In an embodiment of the present invention, a method and system for accurately detecting a vehicle turning right to park are provided. The solution uses Kalman filtering and six-axis fusion based on an inertial sensor IMU to accurately determine the right turn to park.

[0080] According to a first aspect of an embodiment of the present invention, a method for accurately detecting right turn parking of a vehicle is provided.

[0081] Figure 1 The present invention is a flowchart of a method for accurately detecting a vehicle turning right and stopping according to an embodiment of the present invention.

[0082] In one or more embodiments, preferably, the method for accurately detecting a vehicle turning right to stop comprises:

[0083] S101, the single chip microcomputer acquires the original turning and parking monitoring data;

[0084] S102, performing low-pass filtering on the collected data according to the original turning and parking monitoring data to form first filtered data;

[0085] S103, updating data using Kalman filtering according to the first filtered data;

[0086] S104, fusing the data obtained by the three-axis accelerometer and the gyroscope in real time to set the final output data;

[0087] S105, setting storage data, including collected data and a bidirectional linked list;

[0088] S106: Determine whether the right turn logic is satisfied according to the stored data, and determine whether to start the parking logic according to the preset requirements.

[0089] In the embodiment of the present invention, a detection method for right turn parking of a vehicle based on IMU is provided. By fusing six-axis data, processing data using low-pass filtering and Kalman filtering, and judging by integral operation and angle threshold, the right turn state of the vehicle and its parking action can be accurately identified, solving the problem of misjudgment or delay in complex environments of the prior art. It can overcome the shortcomings of the prior art, realize high-precision detection of right turn parking behavior, and is particularly suitable for various complex traffic roads, and improves the real-time performance and reliability of the system.

[0090] Figure 2 The present invention is a flowchart of a single chip microcomputer acquiring original turning and parking monitoring data in a method for accurately detecting right turning and parking of a vehicle according to an embodiment of the present invention.

[0091] like Figure 2 As shown, in one or more embodiments, preferably, the single chip microcomputer acquires original turning and parking monitoring data, specifically including:

[0092] S201, using the SPI interface of the single-chip microcomputer to communicate with the six-axis gyroscope;

[0093] S202: Acquire the original data of the six axes, and perform offset calibration and temperature compensation to form original turning and parking monitoring data.

[0094] In an embodiment of the present invention, in order to accurately monitor the right turn parking behavior of the vehicle, the method described in the following embodiment can be adopted. First, it is necessary to select a single-chip microcomputer with SPI (serial peripheral interface) communication capability, such as the common STM32 series single-chip microcomputer. Then, a six-axis gyroscope sensor (such as MPU6050) is connected through the SPI interface, and the sensor can provide three-axis acceleration and three-axis angular velocity data for sensing the posture change of the vehicle. The specific implementation steps are as follows: initialize the SPI interface of the single-chip microcomputer, set the appropriate communication rate and mode, and ensure normal communication with the six-axis gyroscope sensor. Send a read instruction to the six-axis gyroscope through the SPI interface to obtain the raw data of its output, including three-axis acceleration values ​​and three-axis angular velocity values. The obtained raw data is offset calibrated, that is, the dynamic measurement value is adjusted according to the static output value of the sensor to eliminate the deviation caused by the installation position or manufacturing tolerance. Temperature compensation is performed, because the performance of the sensor may change with temperature changes, and the corresponding temperature compensation formula is obtained by consulting the data manual of the sensor, and applied to the collected data. The calibrated and compensated data are recorded as raw turning and parking monitoring data, which can be further used to analyze the vehicle's motion state, such as determining whether a right turn parking action is being performed.

[0095] Figure 3The present invention is a flowchart of a method for accurately detecting a vehicle turning right and stopping in one embodiment of the present invention, which performs low-pass filtering on collected data according to original turning and parking monitoring data to form first filtered data.

[0096] like Figure 3 As shown, in one or more embodiments, preferably, the low-pass filtering of the collected data according to the original turning and parking monitoring data to form the first filtered data specifically includes:

[0097] S301, setting a filter form, wherein the filter is a discrete Fourier transform or a Butterworth filter;

[0098] S302: Perform low-pass filtering on the three-axis acceleration and three-axis angular velocity output by the gyroscope according to the filter to form first filtered data.

[0099] In an embodiment of the present invention, in order to improve the accuracy and reliability of vehicle turning and parking monitoring data, the low-pass filtering method described in the following embodiments can be used. First, select a suitable filter form, such as discrete Fourier transform (DFT) or Butterworth filter. Both filters are commonly used digital signal processing tools for removing high-frequency noise from the original signal and retaining low-frequency components. The specific implementation steps are as follows: Determine the parameters of the filter, including the cutoff frequency and the filter order. For the Butterworth filter, it is also necessary to specify its design type (such as low-pass, high-pass, etc.). In this example, a Butterworth low-pass filter is used. According to the selected filter type and parameters, a corresponding filtering algorithm is designed. For the Butterworth filter, the coefficients of the filter can be calculated using existing mathematical formulas. The original turning and parking monitoring data are input into the designed filter for processing. These data include the three-axis acceleration values ​​and three-axis angular velocity values ​​output by the six-axis gyroscope. The input data is low-pass filtered by the filter to obtain the first filtered data. This process is mainly achieved through convolution operation, that is, the coefficients of the filter are weighted and summed with the input data to obtain a smoothed signal. Output the first filtered data after low-pass filtering as the basis for subsequent analysis and control. Take a specific example to illustrate this process: suppose there is a set of raw data from a six-axis gyroscope, which contains the three-axis acceleration values ​​and three-axis angular velocity values ​​of the vehicle when performing a right turn parking operation. First, based on experience or experimental results, set the cutoff frequency of the Butterworth low-pass filter to 5Hz, and select a suitable order (such as second order). Then, use the coefficients of the Butterworth filter to perform a convolution operation on the raw data to obtain the smoothed three-axis acceleration and three-axis angular velocity values. Finally, these low-pass filtered data are output as the first filtered data for further analysis of the vehicle's motion state.

[0100] Figure 4The present invention is a flowchart of a method for accurately detecting a vehicle turning right and stopping, which uses Kalman filtering to update data according to first filtering data.

[0101] like Figure 4 As shown, in one or more embodiments, preferably, the data updating using Kalman filtering according to the first filtered data specifically includes:

[0102] S401, previous state estimation and current measurement value, update system state;

[0103] S402: By calculating the Ka lman gain and combining the new measurement value, the state estimation and error covariance are updated to obtain more accurate angle data.

[0104] In an embodiment of the present invention, in order to further improve the accuracy of vehicle turning and parking monitoring data, the Kalman filter data update method described in the following embodiment can be used. Kalman filtering is a recursive algorithm that can process and optimize observation data in a dynamic system in real time, and is often used for sensor data fusion in navigation and control systems. The specific implementation steps are as follows: Initialize the state variables of the Kalman filter, including the initial state estimate (such as the initial posture of the vehicle) and the initial error covariance matrix (indicating the uncertainty of the estimated value). Define the state transition model of the system, that is, a mathematical model that describes how the system state changes over time. For vehicle turning and parking monitoring, a simplified kinematic model can be used to describe the dynamic behavior of the vehicle. Define the measurement model of the system, that is, a mathematical model that describes how to obtain measurement values ​​(in this case, the first filtered data) from the real world. In each time step, the state estimate and error covariance at the current moment are predicted according to the state transition model of the system. Calculate the Kalman gain, which is a weight coefficient used to balance the trust between the predicted value and the actual measured value. The calculation of the Kalman gain depends on the predicted error covariance and the covariance of the measurement noise. Use the Kalman gain to combine the new measurement value (first filtered data) to update the state estimate and error covariance. This step is the core of the Kalman filter, which fuses the predicted value and the measured value by weighted averaging to obtain a more accurate state estimate. Each new measurement value is processed to achieve continuous updating of the vehicle turning and parking monitoring data. Take a specific example to illustrate this process: Assume that a set of first filtered data of three-axis acceleration and three-axis angular velocity has been obtained through low-pass filtering. Set the initial state estimate to the zero vector and the initial error covariance to the unit matrix. Then, define a simple uniform linear motion model as the state transition model of the system, and assume that the measurement noise is Gaussian distributed. In each time step, the state estimate and error covariance at the current moment are predicted according to the state transition model. Next, calculate the Kalman gain, and use this gain to update the state estimate and error covariance in combination with the new measurement value. Finally, the updated state estimate is output as more accurate angle data for further analysis of the vehicle's motion state.

[0105] Figure 5 The present invention is a flowchart of a method for accurately detecting a vehicle turning right and parking in one embodiment of the present invention, which combines data obtained by a three-axis accelerometer and a gyroscope in real time and sets the final output data.

[0106] like Figure 5 As shown, in one or more embodiments, preferably, the data acquired by the three-axis accelerometer and the gyroscope are fused in real time to set the final output data, specifically including:

[0107] S501, applying Madgwick or Mahony algorithm to perform six-axis data fusion;

[0108] S502: Setting the final output data to three-axis Euler angles, specifically including roll angle, pitch angle and yaw angle.

[0109] In an embodiment of the present invention, in order to obtain accurate attitude information of a vehicle in real time, a data fusion method described in the following embodiment may be used. The method combines the data of a three-axis accelerometer and a gyroscope, and applies the Madgwick or Mahony algorithm to perform six-axis data fusion, and finally outputs the three-axis Euler angle of the vehicle, including the roll angle, the pitch angle, and the yaw angle. The specific implementation steps are as follows: linear acceleration data of the vehicle in three-dimensional space is obtained from the three-axis accelerometer, and these data reflect the direction change of the vehicle relative to the earth's gravity. At the same time, the rotation angular velocity data of the vehicle around its own three axes is obtained from the gyroscope, and these data reflect the instantaneous rotation rate of the vehicle. The data of these two sensors are used as input, and the Madgwick or Mahony algorithm is applied for data fusion. Both algorithms are based on the principle of complementary filtering, which can effectively combine the advantages of accelerometers and gyroscopes and reduce their respective disadvantages, such as the low-frequency response of accelerometers and the high-frequency noise of gyroscopes. The Madgwick algorithm is a gradient descent method, which iteratively solves the attitude quaternion of the vehicle by minimizing the difference between the predicted direction and the measured direction. The Mahony algorithm is a Kalman filter-based method that uses the prediction error covariance matrix to weight the fusion data of the accelerometer and gyroscope. After the algorithm is processed, the quaternion representation of the vehicle is obtained, which is a vector containing four elements that describes the rotation state of the vehicle. Finally, the quaternion is converted into three-axis Euler angles, namely the roll angle (the rotation of the vehicle around its longitudinal axis), the pitch angle (the rotation of the vehicle around its lateral axis), and the yaw angle (the rotation of the vehicle around its vertical axis). These angles intuitively reflect the spatial attitude of the vehicle. Take a specific example to illustrate this process: suppose the vehicle is performing a right turn parking maneuver. At this time, the three-axis accelerometer detects that the vehicle has an acceleration component to the right on the horizontal plane, and the gyroscope detects that the vehicle has a right rotation angular velocity around the vertical axis. By applying the Madgwick or Mahony algorithm, the data of these two sensors can be fused to calculate the quaternion representation of the vehicle, and then the roll angle, pitch angle, and yaw angle of the vehicle can be obtained. In this way, the real-time attitude of the vehicle when performing a right turn parking maneuver can be accurately known, providing a basis for subsequent control decisions.

[0110] Figure 6 The invention discloses a flow chart of setting and storing data in a method for accurately detecting a vehicle turning right and parking in one embodiment of the present invention, including collecting data and a bidirectional linked list.

[0111] like Figure 6As shown, in one or more embodiments, preferably, the setting of storing data includes collecting data and a bidirectional linked list, specifically including:

[0112] S601, reading three-axis angular velocity, three-axis acceleration and three-axis Euler angle data from the inertial sensor I MU once every 20 milliseconds as a real-time data stream;

[0113] S602, using a circular index method, storing the yaw angle and Z-axis angular velocity data collected each time into a circular buffer;

[0114] S603, define two circular buffers, each of which has a size of N and is used to store the yaw angle and Z-axis angular velocity of the IMU respectively;

[0115] S604: A circular buffer is used so that when the buffer reaches a maximum size N, new data will overwrite old data.

[0116] In an embodiment of the present invention, in order to monitor and record the dynamic behavior of the vehicle in real time, the data storage method described in the following embodiment can be used. The method involves setting a structure for storing data, including collecting data and a bidirectional linked list, and using a circular buffer to efficiently manage real-time data streams. The specific implementation steps are as follows: Define the data structure: First, define two circular buffers, each of which has a size of NN. One buffer is used to store the yaw angle data of the I MU (inertial measurement unit), and the other is used to store the Z-axis angular velocity data. These data are key parameters for evaluating the turning and parking status of the vehicle. Data acquisition and storage: The three-axis angular velocity, three-axis acceleration and three-axis Euler angle data are read from the I MU every 20 milliseconds as a real-time data stream. In particular, the yaw angle and Z-axis angular velocity data collected each time are stored in the corresponding circular buffer respectively. This high-frequency sampling ensures the real-time and continuity of the data. Circular index and overwriting mechanism: Using a circular index method, when the buffer reaches the maximum size NN, the new data will overwrite the oldest data. This means that the buffer always keeps the latest NN data points without the need to grow infinitely over time. This mechanism effectively prevents memory overflow and maintains the efficiency of data processing. Application of bidirectional linked lists: Although the use of bidirectional linked lists is not directly mentioned in this particular embodiment, it can be understood that the implementation of the ring buffer can utilize the characteristics of the bidirectional linked list, that is, each element can be accessed through the predecessor and successor pointers, thereby supporting efficient data insertion and deletion operations. Take a specific example to illustrate this process: Assume that there is an intelligent vehicle that is performing a right turn parking operation, and the IMU sensor reads data every 20 milliseconds. In the first 20 milliseconds, the IMU reads a yaw angle of 5 degrees and a Z-axis angular velocity of 10 degrees / second; in the second 20 milliseconds, the yaw angle is 7 degrees and the Z-axis angular velocity is 12 degrees / second; and so on. These data are continuously stored in the corresponding ring buffer. When the buffer reaches the preset maximum size NN, for example, when the 101th data point arrives, the earliest data point (the first) will be overwritten by the new data. In this way, whenever the dynamic behavior of the vehicle needs to be analyzed, the latest NN data points can be obtained from the buffer for analysis.

[0117] Figure 7 It is a flowchart of a method for accurately detecting a vehicle turning right and parking in one embodiment of the present invention, which determines whether the right turn logic is satisfied according to stored data, and determines whether to start the parking logic according to preset requirements.

[0118] like Figure 7 As shown, in one or more embodiments, preferably, judging whether the right turn logic is satisfied according to the stored data and judging whether to start the parking logic according to the preset requirements specifically include:

[0119] S701, read the angle value of the yaw angle in the stored data, convert the angle change obtained by each integration into an actual angle value, add it to the current Z-axis Euler angle to form a new angle value, and calculate the average integral change value of the X angle values ​​in the current stored data;

[0120] S702, determining whether the average of the first N angle values ​​satisfies the first calculation formula;

[0121] S703: when the first calculation formula is satisfied, the vehicle is started to turn right; when the first calculation formula is not satisfied, it is considered that the vehicle does not turn right;

[0122] S704, determining whether the integral change value continuously satisfies the second calculation formula within a preset time period;

[0123] S705: when the second calculation formula is continuously satisfied within a preset time period, it is considered that the vehicle has completed the right turn;

[0124] S706, when the second calculation formula is not continuously satisfied within the preset time period, reading the OBD vehicle speed;

[0125] S707, reading the OBD speed or the GPS speed as the identified speed, wherein the OBD reading has a higher priority than the GPS reading;

[0126] S708, determining whether the identified vehicle speed satisfies a third calculation formula, if so, the vehicle turns right and stops, if not, the vehicle turns right and does not stop;

[0127] The first calculation formula is:

[0128] AVG>YB

[0129] Wherein, AVG is the average value of the first N angle values ​​obtained according to the stored data, and YB is the preset comparison value;

[0130] The second calculation formula is:

[0131] BH <Y0

[0132] Among them, BH is the integral change value, and Y0 is the preset comparison threshold value tending to 0;

[0133] The third calculation formula is:

[0134] CS <X

[0135] Wherein, CS is the identified vehicle speed, and X is the preset parking speed judgment threshold.

[0136] In the embodiments of the present invention, in order to accurately determine whether the vehicle makes a right turn and decide whether to activate the parking logic, the method described in the following embodiments can be adopted. This method involves reading stored data, calculating angle changes, judging specific conditions, and making decisions according to preset requirements. The specific implementation steps are as follows: Reading stored data: First, read the angle values of the yaw angle from the circular buffer. These data are collected and stored in real time by the IMU sensor, reflecting the rotation of the vehicle around the vertical axis. Calculating angle changes: Convert the angle changes obtained by each integration into actual angle values, and add them to the current Euler angle of the Z axis to form new angle values. Then, calculate the average integral change value of X angle values in the current stored data. Judging whether the first calculation formula is satisfied: Use the first calculation formula to judge whether the average value of the first N angle values meets specific conditions. The formula is AVG>YB, where AVG is the average value of the first N angle values obtained from the stored data, and YB is a preset comparison constant value. If this formula is satisfied, it is considered that the vehicle is making a right turn. Judging the right turn state of the vehicle: When the first calculation formula is satisfied, start the right turn of the vehicle; if not, it is considered that the vehicle has not made a right turn. Judging the end of the right turn: Further judge whether there is a continuous situation where the integral change value satisfies the second calculation formula within a preset time period. The formula is BH<Y0, where BH is the integral change value, and Y0 is a preset comparison threshold tending to 0. If there is a continuous situation where this formula is satisfied within the preset time period, it is considered that the right turn of the vehicle ends. Reading vehicle speed: When the right turn ends, read the OBD vehicle speed or GPS vehicle speed as the recognized vehicle speed. Here, the OBD reading priority is higher than the GPS reading. Judging whether to park: Use the third calculation formula to judge whether the recognized vehicle speed meets specific conditions. The formula is CS<X, where CS is the recognized vehicle speed, and X is a preset parking vehicle speed judgment threshold. If this formula is satisfied, it is considered that the vehicle makes a right turn and parks; if not, it is considered that the vehicle makes a right turn but does not park. Take a specific example to illustrate this process: Suppose an intelligent vehicle is performing a right turn and parking operation, and the IMU sensor reads the yaw angle and Z-axis angular velocity data every 20 milliseconds and stores them in the circular buffer. After a period of data collection, the system starts to analyze these data. By calculating the average integral change value and comparing it with the preset first calculation formula, the system determines that the vehicle is making a right turn. Subsequently, the system continues to monitor the integral change value and determines the end of the right turn when the second calculation formula is satisfied. At this time, the system reads the OBD vehicle speed and judges whether the vehicle speed is lower than the preset parking vehicle speed threshold according to the third calculation formula. If so, it is considered that the vehicle has successfully completed a right turn and parked; if not, it is considered that the vehicle has made a right turn but has not parked.

[0137] According to the second aspect of the embodiments of the present invention, an implementation system for accurately detecting a vehicle's right turn and parking is provided.

[0138] Figure 8 The present invention is a structural diagram of a system for accurately detecting a vehicle turning right and parking according to an embodiment of the present invention.

[0139] In one or more embodiments, preferably, the system for accurately detecting a vehicle turning right and parking comprises:

[0140] The data acquisition module 801 is used for the single chip microcomputer to acquire the original turning and parking monitoring data;

[0141] A first data processing module 802, configured to perform low-pass filtering on the collected data according to the original turning and parking monitoring data to form first filtered data;

[0142] A second data processing module 803 is used to update data using Kalman filtering according to the first filtered data;

[0143] The six-axis data fusion module 804 is used to fuse the data obtained by the three-axis accelerometer and the gyroscope in real time and set the final output data;

[0144] The data storage module 805 is used to set storage data, including acquisition data and a bidirectional linked list;

[0145] The parking determination module 806 is used to determine whether the right turn logic is satisfied according to the stored data, and determine whether to start the parking logic according to the preset requirements.

[0146] In the embodiment of the present invention, a system suitable for different structures is realized through a series of modular designs. The system can achieve closed-loop, reliable and efficient execution through collection, analysis and control.

[0147] According to a third aspect of an embodiment of the present invention, there is provided a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method as described in any one of the first aspect of the embodiment of the present invention is implemented.

[0148] According to a fourth aspect of an embodiment of the present invention, an electronic device is provided. Fig. 9 It is a structural diagram of an electronic device in one embodiment of the present invention. Fig. 9The electronic device shown is a general-purpose implementation device for accurately detecting right-turn parking of a vehicle, which includes a general-purpose computer hardware structure, which at least includes a processor 901 and a memory 902. The processor 901 and the memory 902 are connected via a bus 903. The memory 902 is suitable for storing instructions or programs executable by the processor 901. The processor 901 can be an independent microprocessor or a collection of one or more microprocessors. Thus, the processor 901 executes the instructions stored in the memory 902, thereby executing the method flow of the embodiment of the present invention as described above to realize the processing of data and the control of other devices. The bus 903 connects the above-mentioned multiple components together, and at the same time connects the above-mentioned components to the display controller 904 and the display device and the input / output (I / O) device 905. The input / output (I / O) device 905 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a somatosensory input device, a printer, and other devices known in the art. Typically, the input / output device 905 is connected to the system via an input / output (I / O) controller 906.

[0149] The technical solution provided by the embodiments of the present invention may have the following beneficial effects:

[0150] In the solution of the present invention, by fusing six-axis data, using low-pass filtering and Kalman filtering to process the data, and through integral calculation and angle threshold judgment, the right turn state of the vehicle and its parking action can be accurately identified, solving the problem of misjudgment or delay in complex environments in the prior art.

[0151] The solution of the present invention can overcome the problems of poor accuracy and adaptability caused by the prior art relying on a single sensor, and achieve high-precision detection of right-turn parking behavior in real time, which is particularly suitable for various complex traffic roads and improves the real-time performance and reliability of the system.

[0152] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0153] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0154] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0156] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for accurately detecting a vehicle turning right and stopping, characterized in that: The method includes: The single chip microcomputer acquires the original turning and parking monitoring data; Performing low-pass filtering on the collected data according to the original turning and parking monitoring data to form first filtered data; Performing data updating using Kalman filtering according to the first filtered data; The data obtained by the three-axis accelerometer and gyroscope are integrated in real time to set the final output data; Set up storage data, including collected data and bidirectional linked lists; Determine whether the right turn logic is met based on the stored data, and determine whether to start the parking logic based on the preset requirements; The determining whether the right turn logic is satisfied according to the stored data and determining whether to start the parking logic according to the preset requirements specifically includes: Read the angle value of the yaw angle in the stored data, convert the angle change obtained by each integration into an actual angle value, add it to the current Z-axis Euler angle to form a new angle value, and calculate the average integral change value of the N angle values ​​in the current stored data; Determine whether the average integral change value of the first N angle values ​​satisfies the first calculation formula; When the first calculation formula is satisfied, the vehicle starts turning right; When the first calculation formula is not satisfied, it is considered that the vehicle does not make a right turn; Determine whether the integral change value continuously satisfies the second calculation formula within a preset time period; When the second calculation formula is continuously satisfied within a preset time period, it is considered that the vehicle has completed the right turn; When the second calculation formula is not continuously satisfied within the preset time period, the OBD vehicle speed is read; Read the OBD speed or GPS speed as the identification speed, where OBD reading has a higher priority than GPS reading; determining whether the identified vehicle speed satisfies a third calculation formula, and if so, the vehicle turns right and stops; If not satisfied, turn right without stopping; The first calculation formula is: AVG>YB Wherein, AVG is the average integral change value of the first N angle values ​​obtained according to the stored data, and YB is the preset comparison constant; The second calculation formula is: BH <Y0 Among them, BH is the integral change value, and Y0 is the preset comparison threshold value tending to 0; The third calculation formula is: CS <X Among them, CS is the recognized vehicle speed, and X is the preset parking speed judgment threshold; Among them, when calculating the average integral change value of the first N angle values, if the average integral change value of M consecutive angle values ​​is 0, but the vehicle's right turn light is on during this process, then when analyzing the first calculation formula, the average integral change value of the first N angle values ​​is calculated using only the average integral change value obtained from NM non-zero angles. On this basis, when analyzing the integral change value using the second calculation formula, if the right turn light is kept on within a preset time period, the right turn is considered to be completed only when the right turn light is turned off.

2. A method for accurately detecting a vehicle turning right and stopping as claimed in claim 1, characterized in that: The single chip microcomputer acquires original turning and parking monitoring data, specifically including: Use the SPI interface of the microcontroller to communicate with the six-axis gyroscope; The original data of the six axes are acquired, and offset calibration and temperature compensation are performed to form the original turning and parking monitoring data.

3. The method for accurately detecting a vehicle turning right and stopping as claimed in claim 1, characterized in that: The step of performing low-pass filtering on the collected data according to the original turning and parking monitoring data to form the first filtered data specifically includes: Set the filter form, where the filter is discrete Fourier transform or Butterworth filter; The three-axis acceleration and the three-axis angular velocity output by the gyroscope are subjected to low-pass filtering according to the filter to form first filtered data.

4. The method for accurately detecting a vehicle turning right and stopping as claimed in claim 1, characterized in that: The updating of data by using Kalman filtering according to the first filtered data specifically includes: Previous state estimates and current measurements, update the system state; By calculating the Kalman gain, combining the new measurement value, updating the state estimate and error covariance, more accurate angle data can be obtained.

5. The method for accurately detecting a vehicle turning right and stopping as claimed in claim 1, characterized in that: The data obtained by the three-axis accelerometer and the gyroscope are integrated in real time to set the final output data, specifically including: Apply Madgwick or Mahony algorithm for six-axis data fusion; The final output data is set to three-axis Euler angles, including roll angle, pitch angle and yaw angle.

6. A method for accurately detecting a vehicle turning right and stopping as claimed in claim 1, characterized in that: The setting of storing data includes collecting data and a bidirectional linked list, specifically including: The three-axis angular velocity, three-axis acceleration, and three-axis Euler angle data are read from the inertial sensor IMU every 20 milliseconds as a real-time data stream; The yaw angle and Z-axis angular velocity data collected each time are stored in a circular buffer using a circular indexing method; Define two circular buffers, each with a size of N, which are used to store the yaw angle and Z-axis angular velocity of the IMU respectively; A circular buffer is used so that when the buffer reaches the maximum size N, new data will overwrite old data.

7. A system for accurately detecting right turn parking of a vehicle, characterized in that: The system is used to implement the method according to any one of claims 1 to 6, and the system comprises: Data acquisition module, used for the single chip microcomputer to acquire original turning and parking monitoring data; A first data processing module, configured to perform low-pass filtering on the collected data according to the original turning and parking monitoring data to form first filtered data; A second data processing module, used for updating data by using Kalman filtering according to the first filtered data; The six-axis data fusion module is used to fuse the data obtained by the three-axis accelerometer and the gyroscope in real time and set the final output data; A data storage module, used to set storage data, including collected data and a bidirectional linked list; The parking determination module is used to determine whether the right turn logic is met based on the stored data, and to determine whether to start the parking logic based on the preset requirements.

8. A computer-readable storage medium storing computer program instructions, characterized in that: The computer program instructions implement the method according to any one of claims 1 to 6 when executed by a processor.

9. An electronic device, comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Multi-sensor vehicle driving detecting system and method based on machine learning

    CN110329271A

  • Vehicle driving state recognition method and device, electronic equipment and readable storage medium

    CN113095197A