Moving target trajectory prediction method based on EKF
By performing approximate linearization and state estimation of the nonlinear system based on the extended Kalman filter method, combined with IOU comparison to solve the deflection angle jump, the accurate trajectory prediction of the moving target in the nonlinear system is achieved, and the prediction problem in the existing technology is solved. Inaccurate questions.
Patent Information
- Application Number
- CN202410715208.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-10-01
AI Technical Summary
Existing technologies are difficult to accurately predict and track moving targets in nonlinear systems, especially in complex environments. Traditional methods are difficult to handle nonlinear and non-Gaussian noise systems, resulting in inaccurate trajectory prediction.
The moving target trajectory prediction method based on the extended Kalman filter is used to construct the state transition function and observation function of the target vehicle, calculate the Jacobian matrix, approximate linearization of the nonlinear system, and use the extended Kalman filter algorithm for state estimation, combined with The IOU comparison method solves the jump problem of deflection angle and adjusts the Q matrix to achieve fast curve filtering.
It achieves more accurate angular velocity prediction for nonlinear systems, solves the problem of unstable deflection angle of armor plates in the world coordinate system, and improves the accuracy and stability of target vehicle trajectory prediction.
Smart Images

Figure CN118735967A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of control theory and signal processing, and in particular relates to a moving target trajectory prediction method based on an extended Kalman filter (EKF). Technical Background
[0002] RoboMaster is an educational technology competition that combines robotics, engineering and artificial intelligence, aiming to inspire students' innovative thinking and practical ability, and cultivate teamwork and problem-solving skills. The competition is divided into two teams, red and blue, and each team prepares a robot vehicle to compete.
[0003] like Figure 1 As shown in the figure, the plate with numbers and red light bar is the armor plate. The gimbal controls the movement direction of the whole vehicle, and the camera is installed on the gimbal. The armor plate is the target of the red and blue sides. When the armor plate is hit by the enemy vehicle with projectiles, the health of the whole vehicle will decrease until it dies. Therefore, the goal of the red and blue sides is to hit the armor plate of the enemy vehicle as much as possible.
[0004] In the first few years of the game, the red and blue teams basically used operators to manually control the pan / tilt to turn and hit the armor plates. With the development of technology, the self-aiming function has emerged. The armor plate data is collected using a camera, and the armor plate can be identified through complex algorithms and data processing, thereby achieving the self-aiming function. At the same time, in order to reduce the probability of the vehicle being hit, the vehicle spins to avoid bullets. Therefore, the problem to be solved in this patent briefing is to be able to hit the target while the enemy vehicle spins and translates, so it is necessary to predict the position, speed and other information of the armor plate. The following is the relevant technical background of moving target modeling and prediction algorithms.
[0005] Motion prediction refers to the ability of a robot to predict the future state of an object, including trajectory prediction, path prediction, and posture prediction. Trajectory prediction is a subfield of motion prediction, which refers to the task of predicting the future position, speed, direction, and other state information of a target given its past or current motion trajectory. It is an important component in many fields and has a wide range of applications in robotics, autonomous driving, unmanned aerial vehicles, motion analysis, and other fields.
[0006] Trajectory prediction modeling can generally be divided into three categories: physical model-based methods, motion pattern-based methods, and planning-based methods.
[0007] Methods based on physical models: This type of method uses physical models (such as dynamic models or kinematic models) to describe the motion of the target and infer the future state based on the current state. Its process belongs to "perception-prediction", and the methods include single-model-based methods (uniform velocity model, uniform acceleration model, autoregressive model, etc.) and multi-model-based methods. This type of method is simple and efficient and does not require training data, but ignores environmental and interactive factors. Therefore, it is not suitable for complex environments, only for short-term trajectory prediction, and only for open environments without obstacles.
[0008] Motion pattern-based methods: These methods follow the "perception-learning-prediction" process, learn dynamic models from training data, statistical behavior patterns, and then make predictions. These methods can be divided into two categories: probability-based models (such as uncertainty perception methods, Gaussian process-based methods, and accessible set-based methods) and learning-based models (such as CNN, RNN, LSTM, trajectory clustering-based methods, etc.). These methods are suitable for environments with complex unknown dynamic objects and for long-term trajectory prediction, but require a large amount of training data.
[0009] Planning-based methods: These methods follow the "perception-reasoning-prediction" process, combining the purpose of movement to infer the long-term path, including intention inference, and can also be combined with environmental semantic information. These methods can also be divided into two categories: forward planning methods (such as Motion and path planning methods, Multi-agent forward planning) and reverse planning methods (such as Single agent inverse learning, Imitation learning, Multi-agent inverse learning). These methods are also applicable to long-term trajectory prediction.
[0010] Predictive filtering algorithms are a class of algorithms used to estimate the state of a system by combining the current observations with information about the previous state to predict the future state. Common predictive filtering algorithms include Kalman filters and their variants, such as the extended Kalman filter (EKF), the unscented Kalman filter (UKF), and the particle filter (PF). These algorithms achieve accurate estimation and prediction of the system state by considering the relationship between the system dynamic model and the observation model, as well as measurement noise and process noise.
[0011] The Kalman filter is a classic linear dynamic system state estimation algorithm, which is suitable for linear systems with Gaussian noise. Its advantages include high computational efficiency and effective processing of noise and errors. However, the Kalman filter has weak processing capabilities for nonlinear systems and non-Gaussian noise. The extended Kalman filter (EKF) linearizes the nonlinear system and is suitable for a certain degree of nonlinear systems, but may lead to inaccurate estimates in highly nonlinear situations. The unscented Kalman filter (UKF) uses a set of unscented transformation points to better approximate the state distribution of the nonlinear system. Compared with the EKF, it has higher accuracy and stability, but the amount of calculation is relatively large. The particle filter (PF) can handle systems with highly nonlinear and non-Gaussian noise, and performs state estimation through random sampling, but the computational cost is high in high-dimensional state space and large sample size. Summary of the invention
[0012] The problem to be solved by the present invention is to realize target tracking of a nonlinear system. The present invention proposes a moving target trajectory prediction method based on extended Kalman filtering, wherein the moving target refers to the current observed armor plate of the target vehicle, and the method comprises the following steps:
[0013] Constructing a state transfer function of the target vehicle and an observation function of the target vehicle, and calculating the Jacobian matrix of the state transfer function and the Jacobian matrix of the observation function; converting the nonlinear system of the target vehicle into an approximate linear system;
[0014] The observed world coordinates of the armor plate and the deflection angle θ of the armor plate are input into the extended Kalman filter EKF, and the angular velocity of the armor plate is predicted, thereby obtaining the position information of the armor plate at the next moment.
[0015] Furthermore, the state transfer function of the target vehicle is expressed as follows:
[0016]
[0017] Among them, x c ,y c ,z a represents the world coordinates of the target vehicle center, θ represents the rotation angle of the current observed armor plate in the XOY plane, and v xc Indicates the linear velocity of the currently observed armor plate in the X direction, v yc Indicates the linear velocity of the currently observed armor plate in the Y direction, v θ represents the angular velocity of the currently observed armor plate, and r represents the distance from the center of the vehicle to the currently observed armor plate.
[0018] The observation function of the target vehicle is expressed as follows:
[0019]
[0020] Among them, x a ,y a ,z a Represents the coordinates of the center of the observable armor plate in the world coordinate system.
[0021] Furthermore, the Jacobian matrix F of the state transfer function is expressed as follows:
[0022]
[0023] The Jacobian matrix H of the observation function is as follows:
[0024]
[0025] Furthermore, the coordinates of the four corner points of the armor plate are calculated according to the center coordinates of the armor plate in the target vehicle, the armor plate mounting structure and the size of the armor plate, and then the coordinates of the four corner points are compared with the pixel coordinates of the armor plate obtained by the camera, and the deflection angle with the highest overlap is selected as the armor plate deflection angle θ.
[0026] Furthermore, the process of obtaining the armor plate deflection angle θ is as follows:
[0027] On the XOY plane, the three-dimensional coordinates of the four corner points of the observed armor plate in the world coordinate system are expressed as (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), and (x4, y4, z4), which are specifically expressed as follows:
[0028]
[0029] Among them, H represents the height of the armor plate, and L represents the length of the armor plate.
[0030] The three-dimensional coordinates of the four corner points of the armor plate in the world coordinate system are converted into pixel coordinates, and a rectangle is calculated. The calculated rectangle is compared with the armor plate rectangle obtained by the camera, and the deflection angle with the highest overlap is selected as the armor plate deflection angle θ.
[0031] Furthermore, the calculation method of the Q matrix in the extended Kalman filter EKF is as follows:
[0032]
[0033] Where Δt is the time interval of integration, is the state transfer matrix, and Q(σ) is the noise covariance matrix.
[0034] Beneficial effects: In the prior art, trajectory prediction and tracking control of moving targets are of great significance in many fields, such as autonomous driving, robot navigation, intelligent transportation systems, etc. These application scenarios pose challenges to the accurate and stable trajectory prediction and tracking control of moving targets. Traditional moving target tracking methods often have difficulty in handling nonlinear and non-Gaussian system dynamics. The method of the present invention uses the extended Kalman filter algorithm to derive and model the moving target trajectory prediction system. The problem of the deflection angle jump of the armor plate in the world coordinate system is solved to input the correct observation amount. By adjusting the Q matrix, the fast filtering of the extended Kalman filter curve is realized, and finally a more accurate prediction of the angular velocity of the target vehicle is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a physical picture of the vehicle;
[0036] Figure 2 It is the overall structure diagram of the vehicle system;
[0037] Figure 3 It is a modeling schematic diagram of the present invention;
[0038] Figure 4 is the extended Kalman filter input-output diagram of the present invention;
[0039] Figure 5 is a flow chart for calculating the deflection angle θ of the armor plate;
[0040] Figure 6 It is a schematic diagram of the armor plate;
[0041] Figure 7 It is a schematic representation of the four corner points of the armor plate;
[0042] Figure 8 It is a schematic diagram of iou overlap;
[0043] Fig. 9 It is a comparison chart of deflection angles;
[0044] Fig.10 This is the EKF test effect diagram;
[0045] Fig.11 is the angular velocity prediction graph. DETAILED DESCRIPTION
[0046] The moving target trajectory prediction system based on the extended Kalman filter (EKF) is mainly divided into three parts. The lower computer, as the control center of the entire gimbal, is composed of 3508 motors, 2006 motors, 6020 motors, IMU and other modules. It is connected to the upper computer through serial communication. The upper and lower computers use serial communication protocols for data transmission to achieve data interoperability. The upper computer is composed of a NUC module and a camera module. The camera module is responsible for collecting data from the target vehicle and processing it through the NUC. Figure 2 As shown, the present invention solves the jump problem of the observed quantity, i.e., the deflection angle of the armor plate, caused by the PNP algorithm based on the vehicle system, applies the extended Kalman filter to realize the angular velocity prediction, angle prediction, world coordinate position prediction, etc. of the target vehicle armor plate, and combines the control of the lower computer to realize the armor plate of the target vehicle in motion.
[0047] The basic principle of Kalman filtering is to use the prior probability density function of the system state and the likelihood function of the observed data to recursively update the posterior probability density function of the state. Extended Kalman filtering is a generalization of Kalman filtering in nonlinear systems. It converts the nonlinear system into an approximate linear system by performing a first-order Taylor series expansion on the nonlinear system, and then uses Kalman filtering for state estimation. The mathematical formula of the extended Kalman filter is divided into two parts, the prediction step and the update step.
[0048] The prediction step is as follows:
[0049] x k∣k-1 =f(x k-1∣k-1 )
[0050] P k∣k-1 =F*P k-1∣k-1 *F T +Q
[0051] x k∣k-1 represents the state estimate at time k, x k-1∣k-1 represents the state estimation at time k-1, P k∣k-1 represents the covariance matrix predicted at time k, P k-1∣k-1 represents the covariance matrix predicted at time k-1, F represents the state transfer matrix, and Q represents the process noise covariance matrix;
[0052] The update steps are as follows:
[0053] K=P k∣k-1 *H T *(H*P k∣k-1 *H T +R) -1
[0054] x k∣k =x k∣k-1 +K*(z k-h(x k∣k-1 ))
[0055] P k∣k =(IK*H)*P k∣k-1
[0056] K represents the Kalman gain, x k∣k The updated state estimate, P k∣k represents the updated covariance matrix, H represents the observation model matrix, and R represents the observation noise covariance matrix.
[0057] Compared with the standard Kalman filter (KF), the extended Kalman filter (EKF) introduces additional linearization steps when the state and observation models are nonlinear. These additional steps mainly include:
[0058] Jacobian matrices of state transfer function and observation function: In EKF, when Taylor series expansion is performed on nonlinear state transfer function and nonlinear observation function, their Jacobian matrices at the current state need to be calculated. These Jacobian matrices linearize the nonlinear functions so that the Kalman filter predictions and observations can be updated in each filtering step.
[0059] Update of state and observation equations: In EKF, the update steps of state estimate and error covariance are the same as KF, but these updates are based on linearized state transfer function and observation function instead of directly using nonlinear functions.
[0060] Update of the covariance matrix: The covariance matrix update process in EKF is similar to that in KF, but in EKF, the update step is based on the linearized Jacobian matrix. Because the Jacobian matrix of a nonlinear function may change at different state points, the Jacobian matrix needs to be recalculated at each update.
[0061] The present invention provides a moving target trajectory prediction method based on extended Kalman filtering, wherein the moving target refers to the currently observed armor plate of the target vehicle; the target vehicle is a robot with a circular chassis, and four armor plates are distributed on the chassis, respectively located in four directions of the chassis. The installation angle of the armor plate on the pitch axis is fixed to be inclined at 15°. In order to establish a system model, it is necessary to consider the positional relationship and mechanical properties between the center of the vehicle and the center of the armor plate, such as Figure 3 As shown, the center of the armor plate coordinate system is (Xa, Ya), the center coordinates of the target vehicle are (Xb, Yb), and the deflection angle of the armor plate in the world coordinate system is θ; the target vehicle usually moves in a translational and rotational manner, so the traditional linear motion model is not applicable.
[0062] The method comprises the following steps:
[0063] Step 1, constructing the state transfer function of the target vehicle and the observation function of the target vehicle;
[0064] Assuming that the motion model of the target vehicle is uniform linear motion of the chassis, with rotational motion superimposed only in the XOY plane, the state variable x in the system is set to the world coordinate x of the center of the target vehicle. c ,y c ,z a , the rotation angle θ of the armor plate in the XOY plane, the linear velocity v in the X direction xc , Linear velocity v in the Y direction yc , angular velocity v θ And the distance r from the center of the vehicle to the current observation armor plate is expressed as:
[0065] x=[x c ,y c ,z a ,θ,v xc ,v yc ,v z ,v θ ,r] T
[0066] The observed variable is set to the world coordinate system coordinate (x a ,y a ,z a ) and the deflection angle θ of the armor plate:
[0067] z=[x a ,y a ,z a ,θ] T
[0068] The state function of the target vehicle is as follows:
[0069]
[0070] The Jacobian matrix F is calculated based on the state transfer function and is expressed as follows:
[0071]
[0072] according to Figure 3 Modeling diagram, the observation function equations of the target vehicle are listed as follows:
[0073]
[0074] The Jacobian matrix H is calculated based on the observation function as follows:
[0075]
[0076] The nonlinear system is transformed into an approximate linear system through the Jacobian matrix of the state transfer function and the Jacobian matrix of the observation function;
[0077] From the observation function, we can see that the extended Kalman filter includes two sets of input variables: the observed armor plate world coordinate x a ,y a ,z a and the observed deflection angle θ of the armor plate, such as Figure 4 As shown in the figure, the traditional calculation of the armor plate deflection angle θ has the problem of angle instability and jump caused by PNP solution error. In order to solve this problem, an IOU comparison method is proposed. IOU (Intersection over Union) comparison is a commonly used target detection evaluation indicator, which is used to measure the degree of overlap between the predicted bounding box and the true bounding box. The calculation method is to divide the intersection area of the two bounding boxes by their union area, that is, IOU = (intersection area) / (union area). The higher the IOU value, the better the match between the predicted box and the true box.
[0078] The coordinates of the four corner points of the armor plate are calculated based on the center coordinates of the armor plate in the target vehicle, the armor plate installation structure and the size of the armor plate. These coordinates are then compared with the pixel coordinates obtained by the camera, and the deflection angle with the highest coincidence between the two results is selected as the final deflection angle. Figure 5 As shown in the figure, the process of calculating the deflection angle θ of the armor plate is shown; the target armor plate installation has clear requirements, the pitch axis of the armor plate is tilted 15°, and a target vehicle generally has four armor plates. Figure 6 As shown in the figure, on the XOY plane, the schematic diagram of the four corner points of the armor plate observed is as follows Figure 7 Assume that the center of the armor plate coincides with the origin of the world coordinate system, the deflection angle of the armor plate in the world coordinate system is θ, and the observed height H1 of the armor plate is expressed as follows:
[0079] H1=H*sin(π / 12)
[0080] Where H is the height of the armor plate,
[0081] L1 = L, L represents the length of the armor plate;
[0082] The three-dimensional coordinates of the four corner points of the observed armor plate in the world coordinate system are expressed as (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), and (x4, y4, z4), specifically:
[0083]
[0084]
[0085] The three-dimensional coordinates of the four corner points of the armor plate in the world coordinate system are converted into pixel coordinates, and a rectangle is calculated. The calculated rectangular armor plate is compared with the rectangular armor plate obtained by the camera, and the deflection angle with the highest overlap is selected as the final armor plate deflection angle θ, as shown in Figure 8 As shown;
[0086] as follows Fig. 9 As shown in the figure, the blue curve is the deflection angle of the armor plate measured by the traditional method, which has large-scale data jitter and jump problems, resulting in deviations in the input extended Kalman filter observations, affecting the final result. The red curve is the deflection angle measured by the iou comparison method, which is stable at a certain value in a small range, and the improvement effect is obvious;
[0087] Step 2, using Kalman filtering to estimate the state of the armor plate;
[0088] Position, velocity and acceleration models are used. In each discrete time step, the acceleration can be assumed to remain constant. However, due to the influence of process noise, the actual acceleration will change due to the influence of external unmodeled forces. This continuous change is represented by zero-mean white noise ω(t). Since the noise is continuous, it needs to be integrated to obtain the noise value discretized at the selected time step. The specific formula is as follows.
[0089]
[0090] The Q' obtained by integrating the above formula is a 2*2 matrix. The actual Q matrix is a 9*9 matrix, which is divided into four 2*2 matrices on the diagonal line. Each 2*2 matrix is calculated using the above formula;
[0091] The test waveform obtained by substituting the above results into the Q matrix is as follows. The blue curve represents the observed value, and the red curve represents the filtered curve. Fig.10 It can be seen that this method works well.
[0092] After all the work is done, the actual coordinate system and the deflection angle of the armor plate are brought in, and the predicted angular velocity is as follows Fig.11 As shown in the figure, by using the speed information output by the extended Kalman filter algorithm, the position information of the armor plate at the next moment of rotation can be obtained, so as to hit the target point.
Claims
1. A moving target trajectory prediction method based on extended Kalman filtering, characterized in that: The moving target refers to the currently observed armor plate of the target vehicle, and the method comprises the following steps: Constructing a state transfer function of the target vehicle and an observation function of the target vehicle, and calculating the Jacobian matrix of the state transfer function and the Jacobian matrix of the observation function; converting the nonlinear system of the target vehicle into an approximate linear system; The observed world coordinates of the armor plate and the deflection angle θ of the armor plate are input into the extended Kalman filter EKF, and the angular velocity of the armor plate is predicted, thereby obtaining the position information of the armor plate at the next moment.
2. The moving target trajectory prediction method based on extended Kalman filtering according to claim 1 is characterized in that: The state transfer function of the target vehicle is expressed as follows: Among them, x c ,y c ,z a represents the world coordinates of the target vehicle center, θ represents the rotation angle of the current observed armor plate in the XOY plane, and v xc Indicates the linear velocity of the currently observed armor plate in the X direction, v yc Indicates the linear velocity of the currently observed armor plate in the Y direction, v θ represents the angular velocity of the currently observed armor plate, and r represents the distance from the center of the vehicle to the currently observed armor plate; The observation function of the target vehicle is expressed as follows: Among them, x a ,y a ,z a Represents the coordinates of the center of the observable armor plate in the world coordinate system.
3. The moving target trajectory prediction method based on extended Kalman filtering according to claim 2 is characterized in that: The Jacobian matrix F of the state transfer function is expressed as follows: The Jacobian matrix H of the observation function is as follows:
4. The moving target trajectory prediction method based on extended Kalman filtering according to claim 1 is characterized in that: The coordinates of the four corner points of the armor plate are calculated according to the center coordinates of the armor plate in the target vehicle, the armor plate mounting structure and the size of the armor plate. Then, the coordinates of the four corner points are compared with the pixel coordinates of the armor plate obtained by the camera, and the deflection angle with the highest overlap is selected as the armor plate deflection angle θ.
5. The moving target trajectory prediction method based on extended Kalman filtering according to claim 1 is characterized in that: The process of obtaining the armor plate deflection angle θ is as follows: On the XOY plane, the three-dimensional coordinates of the four corner points of the observed armor plate in the world coordinate system are expressed as (x1, y1, z1), (x2, y2, z2), (x3, y3, z3), and (x4, y4, z4), which are specifically expressed as follows: Wherein, H represents the height of the armor plate, and L represents the length of the armor plate; The three-dimensional coordinates of the four corner points of the armor plate in the world coordinate system are converted into pixel coordinates, and a rectangle is calculated. The calculated rectangle is compared with the armor plate rectangle obtained by the camera, and the deflection angle with the highest overlap is selected as the armor plate deflection angle θ.
6. The moving target trajectory prediction method based on extended Kalman filtering according to claim 1 is characterized in that: The calculation method of the Q matrix in the extended Kalman filter EKF is as follows: Where Δt is the time interval of integration, is the state transfer matrix, and Q(σ) is the noise covariance matrix.
