本文主要是介绍让GNSSRTK不再难【第二天-第7部分2】,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
状态更新计算过程:
-
计算卡尔曼增益:
根据预测的误差协方差矩阵 P k − P_k^- Pk− 和观测噪声协方差矩阵 R R R 计算卡尔曼增益 K k K_k Kk:
K k = P k − H T ( H P k − H T + R ) − 1 K_k = P_k^- H^T (H P_k^- H^T + R)^{-1} Kk=Pk−HT(HPk−HT+R)−1带入预测的 P k − P_k^- Pk− 和 R R R 计算:
P k − = [ C o v X X 0 0 0 0 0 0 C o v Y Y 0 0 0 0 0 0 C o v Z Z 0 0 0 0 0 0 C o v δ t δ t 0 0 0 0 0 0 ∗ ∗ 0 0 0 0 ∗ ∗ ] P_k^- = \begin{bmatrix} Cov_{XX} & 0 & 0 & 0 & 0 & 0 \\ 0 & Cov_{YY} & 0 & 0 & 0 & 0 \\ 0 & 0 & Cov_{ZZ} & 0 & 0 & 0 \\ 0 & 0 & 0 & Cov_{\delta t \delta t} & 0 & 0 \\ 0 & 0 & 0 & 0 & * & * \\ 0 & 0 & 0 & 0 & * & * \\ \end{bmatrix} Pk−= CovXX000000CovYY000000CovZZ000000Covδtδt000000∗∗0000∗∗
R = [ σ 1 2 0 ⋯ 0 0 σ 2 2 ⋯ 0 ⋮ ⋮ ⋱ ⋮ 0 0 ⋯ σ n 2 ] R = \begin{bmatrix} \sigma_1^2 & 0 & \cdots & 0 \\ 0 & \sigma_2^2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \sigma_n^2 \\ \end{bmatrix} R= σ120⋮00σ22⋮0⋯⋯⋱⋯00⋮σn2
假设观测矩阵 H H H 为设计矩阵 A A A:
A = [ l f 1 G 1 m f 1 G 1 n f 1 G 1 − 1 0 0 0 l f 2 G 2 m f 2 G 2 n f 2 G 2 − 1 0 0 0 l f 3 G 3 m f 3 G 3 n f 3 G 3 − 1 0 0 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n G n m f n G n n f n G n − 1 0 0 0 l f 1 C 1 m f 1 C 1 n f 1 C 1 − 1 0 − 1 0 l f 2 C 2 m f 2 C 2 n f 2 C 2 − 1 0 − 1 0 l f 3 C 3 m f 3 C 3 n f 3 C 3 − 1 0 − 1 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n C n m f n C n n f n C n − 1 0 − 1 0 ] A = \begin{bmatrix} l_{f_1}^{G_1} & m_{f_1}^{G_1} & n_{f_1}^{G_1} & -1 & 0 & 0 & 0 \\ l_{f_2}^{G_2} & m_{f_2}^{G_2} & n_{f_2}^{G_2} & -1 & 0 & 0 & 0 \\ l_{f_3}^{G_3} & m_{f_3}^{G_3} & n_{f_3}^{G_3} & -1 & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{G_n} & m_{f_n}^{G_n} & n_{f_n}^{G_n} & -1 & 0 & 0 & 0 \\ l_{f_1}^{C_1} & m_{f_1}^{C_1} & n_{f_1}^{C_1} & -1 & 0 & -1 & 0 \\ l_{f_2}^{C_2} & m_{f_2}^{C_2} & n_{f_2}^{C_2} & -1 & 0 & -1 & 0 \\ l_{f_3}^{C_3} & m_{f_3}^{C_3} & n_{f_3}^{C_3} & -1 & 0 & -1 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{C_n} & m_{f_n}^{C_n} & n_{f_n}^{C_n} & -1 & 0 & -1 & 0 \end{bmatrix} A= lf1G1lf2G2lf3G3⋮lfnGnlf1C1lf2C2lf3C3⋮lfnCnmf1G1mf2G2mf3G3⋮mfnGnmf1C1mf2C2mf3C3⋮mfnCnnf1G1nf2G2nf3G3⋮nfnGnnf1C1nf2C2nf3C3⋮nfnCn−1−1−1⋮−1−1−1−1⋮−1000⋮0000⋮0000⋮0−1−1−1⋮−1000⋮0000⋮0
则卡尔曼增益 K k K_k Kk 计算为:
K k = P k − A T ( A P k − A T + R ) − 1 K_k = P_k^- A^T (A P_k^- A^T + R)^{-1} Kk=Pk−AT(APk−AT+R)−1(1)计算 A P k − A T A P_k^- A^T APk−AT:
A P k − A T = A [ C o v X X 0 0 0 0 0 0 C o v Y Y 0 0 0 0 0 0 C o v Z Z 0 0 0 0 0 0 C o v δ t δ t 0 0 0 0 0 0 ∗ ∗ 0 0 0 0 ∗ ∗ ] A T A P_k^- A^T = A \begin{bmatrix} Cov_{XX} & 0 & 0 & 0 & 0 & 0 \\ 0 & Cov_{YY} & 0 & 0 & 0 & 0 \\ 0 & 0 & Cov_{ZZ} & 0 & 0 & 0 \\ 0 & 0 & 0 & Cov_{\delta t \delta t} & 0 & 0 \\ 0 & 0 & 0 & 0 & * & * \\ 0 & 0 & 0 & 0 & * & * \\ \end{bmatrix} A^T APk−AT=A CovXX000000CovYY000000CovZZ000000Covδtδt000000∗∗0000∗∗ AT(2)计算 A P k − A T + R A P_k^- A^T + R APk−AT+R:
A P k − A T + R = A [ C o v X X 0 0 0 0 0 0 C o v Y Y 0 0 0 0 0 0 C o v Z Z 0 0 0 0 0 0 C o v δ t δ t 0 0 0 0 0 0 ∗ ∗ 0 0 0 0 ∗ ∗ ] A T + R A P_k^- A^T + R = A \begin{bmatrix} Cov_{XX} & 0 & 0 & 0 & 0 & 0 \\ 0 & Cov_{YY} & 0 & 0 & 0 & 0 \\ 0 & 0 & Cov_{ZZ} & 0 & 0 & 0 \\ 0 & 0 & 0 & Cov_{\delta t \delta t} & 0 & 0 \\ 0 & 0 & 0 & 0 & * & * \\ 0 & 0 & 0 & 0 & * & * \\ \end{bmatrix} A^T + R APk−AT+R=A CovXX000000CovYY000000CovZZ000000Covδtδt000000∗∗0000∗∗ AT+R由于 A P k − A T + R A P_k^- A^T + R APk−AT+R 是对角矩阵,其逆矩阵为:
( A P k − A T + R ) − 1 = [ ( C o v X X + σ 1 2 ) − 1 0 0 0 ( C o v Y Y + σ 2 2 ) − 1 0 0 0 ( C o v Z Z + σ 3 2 ) − 1 ] (A P_k^- A^T + R)^{-1} = \begin{bmatrix} (Cov_{XX} + \sigma_1^2)^{-1} & 0 & 0 \\ 0 & (Cov_{YY} + \sigma_2^2)^{-1} & 0 \\ 0 & 0 & (Cov_{ZZ} + \sigma_3^2)^{-1} \\ \end{bmatrix} (APk−AT+R)−1= (CovXX+σ12)−1000(CovYY+σ22)−1000(CovZZ+σ32)−1 (3)计算 K k K_k Kk:
K k = P k − A T ( A P k − A T + R ) − 1 K_k = P_k^- A^T (A P_k^- A^T + R)^{-1} Kk=Pk−AT(APk−AT+R)−1带入 P k − P_k^- Pk− 和 ( A P k − A T + R ) − 1 (A P_k^- A^T + R)^{-1} (APk−AT+R)−1:
K k = [ C o v X X 0 0 0 C o v Y Y 0 0 0 C o v Z Z 0 0 0 0 0 0 0 0 0 0 0 0 ] A T [ ( C o v X X + σ 1 2 ) − 1 0 0 0 ( C o v Y Y + σ 2 2 ) − 1 0 0 0 ( C o v Z Z + σ 3 2 ) − 1 ] K_k = \begin{bmatrix} Cov_{XX} & 0 & 0 \\ 0 & Cov_{YY} & 0 \\ 0 & 0 & Cov_{ZZ} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} A^T \begin{bmatrix} (Cov_{XX} + \sigma_1^2)^{-1} & 0 & 0 \\ 0 & (Cov_{YY} + \sigma_2^2)^{-1} & 0 \\ 0 & 0 & (Cov_{ZZ} + \sigma_3^2)^{-1} \\ \end{bmatrix} Kk= CovXX0000000CovYY0000000CovZZ0000 AT (CovXX+σ12)−1000(CovYY+σ22)−1000(CovZZ+σ32)−1 简化计算得到:
K k = [ C o v X X ( C o v X X + σ 1 2 ) − 1 0 0 0 C o v Y Y ( C o v Y Y + σ 2 2 ) − 1 0 0 0 C o v Z Z ( C o v Z Z + σ 3 2 ) − 1 0 0 0 0 0 0 0 0 0 0 0 0 ] K_k = \begin{bmatrix} Cov_{XX} (Cov_{XX} + \sigma_1^2)^{-1} & 0 & 0 \\ 0 & Cov_{YY} (Cov_{YY} + \sigma_2^2)^{-1} & 0 \\ 0 & 0 & Cov_{ZZ} (Cov_{ZZ} + \sigma_3^2)^{-1} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} Kk= CovXX(CovXX+σ12)−10000000CovYY(CovYY+σ22)−10000000CovZZ(CovZZ+σ32)−10000 因此,卡尔曼增益 K k K_k Kk 为:
K k = [ C o v X X C o v X X + σ 1 2 0 0 0 C o v Y Y C o v Y Y + σ 2 2 0 0 0 C o v Z Z C o v Z Z + σ 3 2 0 0 0 0 0 0 0 0 0 0 0 0 ] K_k = \begin{bmatrix} \frac{Cov_{XX}}{Cov_{XX} + \sigma_1^2} & 0 & 0 \\ 0 & \frac{Cov_{YY}}{Cov_{YY} + \sigma_2^2} & 0 \\ 0 & 0 & \frac{Cov_{ZZ}}{Cov_{ZZ} + \sigma_3^2} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} Kk= CovXX+σ12CovXX0000000CovYY+σ22CovYY0000000CovZZ+σ32CovZZ0000 -
更新状态估计:
根据观测值 z k z_k zk 和预测值 x ^ k − \hat{x}_k^- x^k− 进行状态更新:
x k = x ^ k − + K k ( z k − H x ^ k − ) x_k = \hat{x}_k^- + K_k (z_k - H \hat{x}_k^-) xk=x^k−+Kk(zk−Hx^k−)带入观测值 z k z_k zk 和预测值 x ^ k − \hat{x}_k^- x^k−:
假设 x ^ k − \hat{x}_k^- x^k− 为:
x ^ k − = [ x ^ k , 1 − x ^ k , 2 − x ^ k , 3 − ⋮ x ^ k , 7 − ] \hat{x}_k^- = \begin{bmatrix} \hat{x}_{k,1}^- \\ \hat{x}_{k,2}^- \\ \hat{x}_{k,3}^- \\ \vdots \\ \hat{x}_{k,7}^- \end{bmatrix} x^k−= x^k,1−x^k,2−x^k,3−⋮x^k,7− 观测值 z k z_k zk 为:
z k = [ z k , 1 z k , 2 z k , 3 ] z_k = \begin{bmatrix} z_{k,1} \\ z_{k,2} \\ z_{k,3} \end{bmatrix} zk= zk,1zk,2zk,3 假设观测矩阵 H H H 为设计矩阵 A A A:
A = [ l f 1 G 1 m f 1 G 1 n f 1 G 1 − 1 0 0 0 l f 2 G 2 m f 2 G 2 n f 2 G 2 − 1 0 0 0 l f 3 G 3 m f 3 G 3 n f 3 G 3 − 1 0 0 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n G n m f n G n n f n G n − 1 0 0 0 l f 1 C 1 m f 1 C 1 n f 1 C 1 − 1 0 − 1 0 l f 2 C 2 m f 2 C 2 n f 2 C 2 − 1 0 − 1 0 l f 3 C 3 m f 3 C 3 n f 3 C 3 − 1 0 − 1 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n C n m f n C n n f n C n − 1 0 − 1 0 ] A = \begin{bmatrix} l_{f_1}^{G_1} & m_{f_1}^{G_1} & n_{f_1}^{G_1} & -1 & 0 & 0 & 0 \\ l_{f_2}^{G_2} & m_{f_2}^{G_2} & n_{f_2}^{G_2} & -1 & 0 & 0 & 0 \\ l_{f_3}^{G_3} & m_{f_3}^{G_3} & n_{f_3}^{G_3} & -1 & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{G_n} & m_{f_n}^{G_n} & n_{f_n}^{G_n} & -1 & 0 & 0 & 0 \\ l_{f_1}^{C_1} & m_{f_1}^{C_1} & n_{f_1}^{C_1} & -1 & 0 & -1 & 0 \\ l_{f_2}^{C_2} & m_{f_2}^{C_2} & n_{f_2}^{C_2} & -1 & 0 & -1 & 0 \\ l_{f_3}^{C_3} & m_{f_3}^{C_3} & n_{f_3}^{C_3} & -1 & 0 & -1 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{C_n} & m_{f_n}^{C_n} & n_{f_n}^{C_n} & -1 & 0 & -1 & 0 \end{bmatrix} A= lf1G1lf2G2lf3G3⋮lfnGnlf1C1lf2C2lf3C3⋮lfnCnmf1G1mf2G2mf3G3⋮mfnGnmf1C1mf2C2mf3C3⋮mfnCnnf1G1nf2G2nf3G3⋮nfnGnnf1C1nf2C2nf3C3⋮nfnCn−1−1−1⋮−1−1−1−1⋮−1000⋮0000⋮0000⋮0−1−1−1⋮−1000⋮0000⋮0
则状态更新为:
x k = [ x ^ k , 1 − x ^ k , 2 − x ^ k , 3 − ⋮ x ^ k , 7 − ] + K k ( [ z k , 1 z k , 2 z k , 3 ] − A [ x ^ k , 1 − x ^ k , 2 − x ^ k , 3 − ⋮ x ^ k , 7 − ] ) x_k = \begin{bmatrix} \hat{x}_{k,1}^- \\ \hat{x}_{k,2}^- \\ \hat{x}_{k,3}^- \\ \vdots \\ \hat{x}_{k,7}^- \end{bmatrix}+ K_k \left( \begin{bmatrix} z_{k,1} \\ z_{k,2} \\ z_{k,3} \end{bmatrix} - A \begin{bmatrix} \hat{x}_{k,1}^- \\ \hat{x}_{k,2}^- \\ \hat{x}_{k,3}^- \\ \vdots \\ \hat{x}_{k,7}^- \end{bmatrix} \right) xk= x^k,1−x^k,2−x^k,3−⋮x^k,7− +Kk zk,1zk,2zk,3 −A x^k,1−x^k,2−x^k,3−⋮x^k,7−
简化后:
x k = [ x ^ k , 1 − x ^ k , 2 − x ^ k , 3 − ⋮ x ^ k , 7 − ] + K k [ z k , 1 − ( A x ^ k − ) 1 z k , 2 − ( A x ^ k − ) 2 z k , 3 − ( A x ^ k − ) 3 ] x_k = \begin{bmatrix} \hat{x}_{k,1}^- \\ \hat{x}_{k,2}^- \\ \hat{x}_{k,3}^- \\ \vdots \\ \hat{x}_{k,7}^- \end{bmatrix}+ K_k \begin{bmatrix} z_{k,1} - (A \hat{x}_k^-)_{1} \\ z_{k,2} - (A \hat{x}_k^-)_{2} \\ z_{k,3} - (A \hat{x}_k^-)_{3} \end{bmatrix} xk= x^k,1−x^k,2−x^k,3−⋮x^k,7− +Kk zk,1−(Ax^k−)1zk,2−(Ax^k−)2zk,3−(Ax^k−)3 带入卡尔曼增益 K k K_k Kk 计算结果:
K k = [ C o v X X C o v X X + σ 1 2 0 0 0 C o v Y Y C o v Y Y + σ 2 2 0 0 0 C o v Z Z C o v Z Z + σ 3 2 0 0 0 0 0 0 0 0 0 0 0 0 ] K_k = \begin{bmatrix} \frac{Cov_{XX}}{Cov_{XX} + \sigma_1^2} & 0 & 0 \\ 0 & \frac{Cov_{YY}}{Cov_{YY} + \sigma_2^2} & 0 \\ 0 & 0 & \frac{Cov_{ZZ}}{Cov_{ZZ} + \sigma_3^2} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} Kk= CovXX+σ12CovXX0000000CovYY+σ22CovYY0000000CovZZ+σ32CovZZ0000 最终状态更新为:
x k = [ x ^ k , 1 − x ^ k , 2 − x ^ k , 3 − ⋮ x ^ k , 7 − ] + [ C o v X X C o v X X + σ 1 2 0 0 0 C o v Y Y C o v Y Y + σ 2 2 0 0 0 C o v Z Z C o v Z Z + σ 3 2 0 0 0 0 0 0 0 0 0 0 0 0 ] [ z k , 1 − ( A x ^ k − ) 1 z k , 2 − ( A x ^ k − ) 2 z k , 3 − ( A x ^ k − ) 3 ] x_k = \begin{bmatrix} \hat{x}_{k,1}^- \\ \hat{x}_{k,2}^- \\ \hat{x}_{k,3}^- \\ \vdots \\ \hat{x}_{k,7}^- \end{bmatrix}+ \begin{bmatrix} \frac{Cov_{XX}}{Cov_{XX} + \sigma_1^2} & 0 & 0 \\ 0 & \frac{Cov_{YY}}{Cov_{YY} + \sigma_2^2} & 0 \\ 0 & 0 & \frac{Cov_{ZZ}}{Cov_{ZZ} + \sigma_3^2} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} \begin{bmatrix} z_{k,1} - (A \hat{x}_k^-)_{1} \\ z_{k,2} - (A \hat{x}_k^-)_{2} \\ z_{k,3} - (A \hat{x}_k^-)_{3} \end{bmatrix} xk= x^k,1−x^k,2−x^k,3−⋮x^k,7− + CovXX+σ12CovXX0000000CovYY+σ22CovYY0000000CovZZ+σ32CovZZ0000 zk,1−(Ax^k−)1zk,2−(Ax^k−)2zk,3−(Ax^k−)3 -
更新误差协方差矩阵:
更新误差协方差矩阵 P k P_k Pk:P k = ( I − K k A ) P k − P_k = (I - K_k A) P_k^- Pk=(I−KkA)Pk−
带入计算:
假设 I I I 为单位矩阵:
I = [ 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 ] I = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix} I= 1000000010000000100000001000000010000000100000001 卡尔曼增益 K k K_k Kk 为:
K k = [ C o v X X C o v X X + σ 1 2 0 0 0 C o v Y Y C o v Y Y + σ 2 2 0 0 0 C o v Z Z C o v Z Z + σ 3 2 0 0 0 0 0 0 0 0 0 0 0 0 ] K_k = \begin{bmatrix} \frac{Cov_{XX}}{Cov_{XX} + \sigma_1^2} & 0 & 0 \\ 0 & \frac{Cov_{YY}}{Cov_{YY} + \sigma_2^2} & 0 \\ 0 & 0 & \frac{Cov_{ZZ}}{Cov_{ZZ} + \sigma_3^2} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} Kk= CovXX+σ12CovXX0000000CovYY+σ22CovYY0000000CovZZ+σ32CovZZ0000 假设观测矩阵 H H H 为设计矩阵 A A A:
A = [ l f 1 G 1 m f 1 G 1 n f 1 G 1 − 1 0 0 0 l f 2 G 2 m f 2 G 2 n f 2 G 2 − 1 0 0 0 l f 3 G 3 m f 3 G 3 n f 3 G 3 − 1 0 0 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n G n m f n G n n f n G n − 1 0 0 0 l f 1 C 1 m f 1 C 1 n f 1 C 1 − 1 0 − 1 0 l f 2 C 2 m f 2 C 2 n f 2 C 2 − 1 0 − 1 0 l f 3 C 3 m f 3 C 3 n f 3 C 3 − 1 0 − 1 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n C n m f n C n n f n C n − 1 0 − 1 0 ] A = \begin{bmatrix} l_{f_1}^{G_1} & m_{f_1}^{G_1} & n_{f_1}^{G_1} & -1 & 0 & 0 & 0 \\ l_{f_2}^{G_2} & m_{f_2}^{G_2} & n_{f_2}^{G_2} & -1 & 0 & 0 & 0 \\ l_{f_3}^{G_3} & m_{f_3}^{G_3} & n_{f_3}^{G_3} & -1 & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{G_n} & m_{f_n}^{G_n} & n_{f_n}^{G_n} & -1 & 0 & 0 & 0 \\ l_{f_1}^{C_1} & m_{f_1}^{C_1} & n_{f_1}^{C_1} & -1 & 0 & -1 & 0 \\ l_{f_2}^{C_2} & m_{f_2}^{C_2} & n_{f_2}^{C_2} & -1 & 0 & -1 & 0 \\ l_{f_3}^{C_3} & m_{f_3}^{C_3} & n_{f_3}^{C_3} & -1 & 0 & -1 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{C_n} & m_{f_n}^{C_n} & n_{f_n}^{C_n} & -1 & 0 & -1 & 0 \end{bmatrix} A= lf1G1lf2G2lf3G3⋮lfnGnlf1C1lf2C2lf3C3⋮lfnCnmf1G1mf2G2mf3G3⋮mfnGnmf1C1mf2C2mf3C3⋮mfnCnnf1G1nf2G2nf3G3⋮nfnGnnf1C1nf2C2nf3C3⋮nfnCn−1−1−1⋮−1−1−1−1⋮−1000⋮0000⋮0000⋮0−1−1−1⋮−1000⋮0000⋮0 则更新误差协方差矩阵为:
P k = ( [ 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 ] − [ C o v X X C o v X X + σ 1 2 0 0 0 C o v Y Y C o v Y Y + σ 2 2 0 0 0 C o v Z Z C o v Z Z + σ 3 2 0 0 0 0 0 0 0 0 0 0 0 0 ] [ l f 1 G 1 m f 1 G 1 n f 1 G 1 − 1 0 0 0 l f 2 G 2 m f 2 G 2 n f 2 G 2 − 1 0 0 0 l f 3 G 3 m f 3 G 3 n f 3 G 3 − 1 0 0 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n G n m f n G n n f n G n − 1 0 0 0 l f 1 C 1 m f 1 C 1 n f 1 C 1 − 1 0 − 1 0 l f 2 C 2 m f 2 C 2 n f 2 C 2 − 1 0 − 1 0 l f 3 C 3 m f 3 C 3 n f 3 C 3 − 1 0 − 1 0 ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ ⋮ l f n C n m f n C n n f n C n − 1 0 − 1 0 ] ) [ C o v X X 0 0 0 0 0 0 C o v Y Y 0 0 0 0 0 0 C o v Z Z 0 0 0 0 0 0 C o v δ t δ t 0 0 0 0 0 0 ∗ ∗ 0 0 0 0 ∗ ∗ ] P_k = \left( \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix} - \begin{bmatrix} \frac{Cov_{XX}}{Cov_{XX} + \sigma_1^2} & 0 & 0 \\ 0 & \frac{Cov_{YY}}{Cov_{YY} + \sigma_2^2} & 0 \\ 0 & 0 & \frac{Cov_{ZZ}}{Cov_{ZZ} + \sigma_3^2} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} \begin{bmatrix} l_{f_1}^{G_1} & m_{f_1}^{G_1} & n_{f_1}^{G_1} & -1 & 0 & 0 & 0 \\ l_{f_2}^{G_2} & m_{f_2}^{G_2} & n_{f_2}^{G_2} & -1 & 0 & 0 & 0 \\ l_{f_3}^{G_3} & m_{f_3}^{G_3} & n_{f_3}^{G_3} & -1 & 0 & 0 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{G_n} & m_{f_n}^{G_n} & n_{f_n}^{G_n} & -1 & 0 & 0 & 0 \\ l_{f_1}^{C_1} & m_{f_1}^{C_1} & n_{f_1}^{C_1} & -1 & 0 & -1 & 0 \\ l_{f_2}^{C_2} & m_{f_2}^{C_2} & n_{f_2}^{C_2} & -1 & 0 & -1 & 0 \\ l_{f_3}^{C_3} & m_{f_3}^{C_3} & n_{f_3}^{C_3} & -1 & 0 & -1 & 0 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ l_{f_n}^{C_n} & m_{f_n}^{C_n} & n_{f_n}^{C_n} & -1 & 0 & -1 & 0 \end{bmatrix} \right) \begin{bmatrix} Cov_{XX} & 0 & 0 & 0 & 0 & 0 \\ 0 & Cov_{YY} & 0 & 0 & 0 & 0 \\ 0 & 0 & Cov_{ZZ} & 0 & 0 & 0 \\ 0 & 0 & 0 & Cov_{\delta t \delta t} & 0 & 0 \\ 0 & 0 & 0 & 0 & * & * \\ 0 & 0 & 0 & 0 & * & * \\ \end{bmatrix} Pk= 1000000010000000100000001000000010000000100000001 − CovXX+σ12CovXX0000000CovYY+σ22CovYY0000000CovZZ+σ32CovZZ0000 lf1G1lf2G2lf3G3⋮lfnGnlf1C1lf2C2lf3C3⋮lfnCnmf1G1mf2G2mf3G3⋮mfnGnmf1C1mf2C2mf3C3⋮mfnCnnf1G1nf2G2nf3G3⋮nfnGnnf1C1nf2C2nf3C3⋮nfnCn−1−1−1⋮−1−1−1−1⋮−1000⋮0000⋮0000⋮0−1−1−1⋮−1000⋮0000⋮0 CovXX000000CovYY000000CovZZ000000Covδtδt000000∗∗0000∗∗ 进一步计算得到:进一步计算得到:
P k = ( [ 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 ] − [ C o v X X C o v X X + σ 1 2 0 0 0 C o v Y Y C o v Y Y + σ 2 2 0 0 0 C o v Z Z C o v Z Z + σ 3 2 0 0 0 0 0 0 0 0 0 0 0 0 ] ) [ C o v X X 0 0 0 0 0 0 C o v Y Y 0 0 0 0 0 0 C o v Z Z 0 0 0 0 0 0 C o v δ t δ t 0 0 0 0 0 0 ∗ ∗ 0 0 0 0 ∗ ∗ ] P_k = \left( \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix} - \begin{bmatrix} \frac{Cov_{XX}}{Cov_{XX} + \sigma_1^2} & 0 & 0 \\ 0 & \frac{Cov_{YY}}{Cov_{YY} + \sigma_2^2} & 0 \\ 0 & 0 & \frac{Cov_{ZZ}}{Cov_{ZZ} + \sigma_3^2} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix} \right) \begin{bmatrix} Cov_{XX} & 0 & 0 & 0 & 0 & 0 \\ 0 & Cov_{YY} & 0 & 0 & 0 & 0 \\ 0 & 0 & Cov_{ZZ} & 0 & 0 & 0 \\ 0 & 0 & 0 & Cov_{\delta t \delta t} & 0 & 0 \\ 0 & 0 & 0 & 0 & * & * \\ 0 & 0 & 0 & 0 & * & * \\ \end{bmatrix} Pk= 1000000010000000100000001000000010000000100000001 − CovXX+σ12CovXX0000000CovYY+σ22CovYY0000000CovZZ+σ32CovZZ0000 CovXX000000CovYY000000CovZZ000000Covδtδt000000∗∗0000∗∗ 最终得到:
P k = [ ( 1 − C o v X X C o v X X + σ 1 2 ) C o v X X 0 0 0 0 0 0 ( 1 − C o v Y Y C o v Y Y + σ 2 2 ) C o v Y Y 0 0 0 0 0 0 ( 1 − C o v Z Z C o v Z Z + σ 3 2 ) C o v Z Z 0 0 0 0 0 0 C o v δ t δ t 0 0 0 0 0 0 ∗ ∗ 0 0 0 0 ∗ ∗ ] P_k = \begin{bmatrix} \left(1 - \frac{Cov_{XX}}{Cov_{XX} + \sigma_1^2}\right) Cov_{XX} & 0 & 0 & 0 & 0 & 0 \\ 0 & \left(1 - \frac{Cov_{YY}}{Cov_{YY} + \sigma_2^2}\right) Cov_{YY} & 0 & 0 & 0 & 0 \\ 0 & 0 & \left(1 - \frac{Cov_{ZZ}}{Cov_{ZZ} + \sigma_3^2}\right) Cov_{ZZ} & 0 & 0 & 0 \\ 0 & 0 & 0 & Cov_{\delta t \delta t} & 0 & 0 \\ 0 & 0 & 0 & 0 & * & * \\ 0 & 0 & 0 & 0 & * & * \\ \end{bmatrix} Pk= (1−CovXX+σ12CovXX)CovXX000000(1−CovYY+σ22CovYY)CovYY000000(1−CovZZ+σ32CovZZ)CovZZ000000Covδtδt000000∗∗0000∗∗
16.2 站星双差Kalman滤波伪距差分定位流程
站星双差仅有位置状态量,所以其Kalman滤波流程更加简单。
对于时间更新步骤,基本就使用单点结果对概略位置进行填充,所以实际上已经降级为最小二乘,因为前后历元状态量在时间序列上不存在相关性。
但对于观测更新过程,观测值的方差需要考虑因星间作差引入的相关性。
对于没有做星间单差之前
V u d = [ p 1 p 2 p 3 p 4 ] R u d = [ σ 1 2 0 0 0 0 σ 2 2 0 0 0 0 σ 3 2 0 0 0 0 σ 4 2 ] V_{ud} = \begin{bmatrix} p^1 \\ p^2 \\ p^3 \\ p^4 \end{bmatrix} \quad R_{ud} = \begin{bmatrix} \sigma_1^2 & 0 & 0 & 0 \\ 0 & \sigma_2^2 & 0 & 0 \\ 0 & 0 & \sigma_3^2 & 0 \\ 0 & 0 & 0 & \sigma_4^2 \end{bmatrix} Vud= p1p2p3p4 Rud= σ120000σ220000σ320000σ42
星间单差之后
V s d = [ p 2 − p 1 p 3 − p 1 p 4 − p 1 ] R s d = [ σ 2 2 + σ 1 2 σ 2 2 + σ 1 2 σ 2 2 + σ 1 2 σ 1 2 + σ 3 2 σ 1 2 + σ 3 2 σ 1 2 + σ 3 2 σ 1 2 + σ 4 2 σ 1 2 + σ 4 2 σ 1 2 + σ 4 2 ] V_{sd} = \begin{bmatrix} p^2 - p^1 \\ p^3 - p^1 \\ p^4 - p^1 \end{bmatrix} \quad R_{sd} = \begin{bmatrix} \sigma_2^2 + \sigma_1^2 & \sigma_2^2 + \sigma_1^2 & \sigma_2^2 + \sigma_1^2 \\ \sigma_1^2 + \sigma_3^2 & \sigma_1^2 + \sigma_3^2 & \sigma_1^2 + \sigma_3^2 \\ \sigma_1^2 + \sigma_4^2 & \sigma_1^2 + \sigma_4^2 & \sigma_1^2 + \sigma_4^2 \end{bmatrix} Vsd= p2−p1p3−p1p4−p1 Rsd= σ22+σ12σ12+σ32σ12+σ42σ22+σ12σ12+σ32σ12+σ42σ22+σ12σ12+σ32σ12+σ42
其余流程相同,不再推导。
这篇关于让GNSSRTK不再难【第二天-第7部分2】的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!