当前位置:网站首页>Slam Kalman filter & nonlinear optimization
Slam Kalman filter & nonlinear optimization
2022-06-11 00:52:00 【Little Hawking】
SLAM Kalman filtering && Nonlinear optimization
Gaussian distribution ( Normal distribution ) Is a common continuous probability distribution . A mathematical expectation or expectation of a normal distribution μ μ μ Equal to the position parameter , Determines the location of the distribution ; Its variance σ 2 \sigma ^{2} σ2 The square root or standard deviation of σ \sigma σ Equal to scale parameter , It determines the magnitude of the distribution .
1. Gaussian distribution
A random variable x x x Obey Gauss distribution N N N, Then its probability density function is :
p ( x ) = 1 σ 2 π e x p ( − ( x − μ ) 2 2 σ 2 ) p(x)=\frac{1} { {\sigma\sqrt{2\pi}}}exp(-\frac{(x-\mu)^2}{2\sigma^2}) p(x)=σ2π1exp(−2σ2(x−μ)2)
Its high dimensional form is :
P ( x ) = 1 ( 2 π ) N d e t ( Σ ) e x p ( − 1 2 ( x − μ ) T Σ − 1 ( x − μ ) ) P(x) = \frac{1}{\sqrt{(2\pi)^N det(\Sigma)}}exp(-\frac{1}{2}(x-\mu)^T\Sigma^{-1}(x-\mu)) P(x)=(2π)Ndet(Σ)1exp(−21(x−μ)TΣ−1(x−μ))
2. Operation of Gaussian distribution
2.1 Linear operation
Let two independent Gaussian distributions :
x ∼ N ( μ x , Σ x x ) , y ∼ N ( μ y , Σ y y ) x\sim N(\mu_x,\Sigma_{xx}),y\sim N(\mu_y,\Sigma_{yy}) x∼N(μx,Σxx),y∼N(μy,Σyy)
So their sum is still a Gaussian distribution :
x + y ∼ N ( μ x + μ y , Σ x x + Σ y y ) x+y\sim N(\mu_x+\mu_y,\Sigma_{xx}+\Sigma_{yy}) x+y∼N(μx+μy,Σxx+Σyy)
If you take a constant a a a multiply x x x, that a x ax ax Satisfy :
a x ∼ N ( μ a x , a 2 Σ x x ) ax\sim N(\mu_ax,a^2 \Sigma_{xx}) ax∼N(μax,a2Σxx)
If you take y = A x y=Ax y=Ax, that y y y Satisfy :
y ∼ N ( μ A x , A 2 Σ x x ) y\sim N(\mu_Ax,A^2 \Sigma_{xx}) y∼N(μAx,A2Σxx)
2.2 The product of
Let the product of two Gaussian distributions satisfy p ( x y ) = N ( μ , Σ ) p(xy)=N(\mu,\Sigma) p(xy)=N(μ,Σ), that :
Σ − 1 = Σ x x − 1 + Σ y y − 1 Σ μ = Σ x x − 1 μ x + Σ y y − 1 μ y \Sigma^{-1}=\Sigma^{-1}_{xx}+\Sigma^{-1}_{yy}\\\Sigma_{\mu}=\Sigma^{-1}_{xx}\mu_x+\Sigma^{-1}_{yy}\mu_y Σ−1=Σxx−1+Σyy−1Σμ=Σxx−1μx+Σyy−1μy
2.2 Compound operation
At the same time, consider x x x and y y y, When they are not independent , The composite distribution is :
p ( x , y ) = N ( [ μ x μ y ] , [ Σ x x Σ x y Σ y x Σ y y ] ) p(x,y)=N\left (\begin{bmatrix}\mu_x\\\mu_y\end{bmatrix}, \begin{bmatrix}\Sigma_{xx}&\Sigma_{xy}\\\Sigma_{yx}&\Sigma_{yy}\end{bmatrix}\right) p(x,y)=N([μxμy],[ΣxxΣyxΣxyΣyy])
among Σ y x \Sigma_{yx} Σyx and Σ y x \Sigma_{yx} Σyx Is the covariance of two variables , Satisfy :
C o v ( X , Y ) = E [ ( X − E ( X ) ) ( Y − E ( Y ) ) ] = E [ X Y ] − E [ X ] E [ Y ] Cov(X,Y) =E[(X-E(X))(Y-E(Y))]=E[XY]-E[X]E[Y] Cov(X,Y)=E[(X−E(X))(Y−E(Y))]=E[XY]−E[X]E[Y]
The covariance is positive , It means that these two variables are positively correlated , Zero is irrelevant , Negative is negative correlation .
By conditional distribution ( Bayes' rule ) Expansion p ( x , y ) = p ( x ∣ y ) p ( y ) p(x,y)=p(x|y)p(y) p(x,y)=p(x∣y)p(y) Can be launched , Conditional probability p ( x ∣ y ) p(x|y) p(x∣y) Satisfy :
p ( x ∣ y ) = N ( μ x + Σ x x Σ y y − 1 ( y − μ y ) , Σ x x − Σ x y Σ y y − 1 Σ y x ) p(x|y)=N(\mu_x+\Sigma_{xx}\Sigma_{yy}^{-1}(y-\mu_y),\Sigma_{xx}-\Sigma_{xy}\Sigma_{yy}^{-1}\Sigma_{yx}) p(x∣y)=N(μx+ΣxxΣyy−1(y−μy),Σxx−ΣxyΣyy−1Σyx)
Shuerbu
Now let's deduce how to reach this conclusion :
Shure complement theory : Decompose the matrix into upper triangular matrix 、 Diagonal matrix 、 The form of product of lower triangular matrix , Easy to calculate , namely :
[ A B C D ] = [ I B D − 1 0 I ] [ Δ D 0 0 D ] [ I 0 D − 1 C I ] \begin{bmatrix}A&B\\C&D\end{bmatrix}\\= \begin{bmatrix}I&BD^{-1}\\0&I\end{bmatrix}\begin{bmatrix}\Delta D&0\\0&D\end{bmatrix}\begin{bmatrix}I&0\\D^{-1}C&I\end{bmatrix} [ACBD]=[I0BD−1I][ΔD00D][ID−1C0I]
among Δ D = A − B D − 1 C \Delta D=A-BD^{-1}C ΔD=A−BD−1C It's called a matrix D D D Of Shuerbu .
similarly :
[ A B C D ] − 1 = [ I 0 − D − 1 C I ] [ Δ D − 1 0 0 D − 1 ] [ I − B D − 1 0 I ] \begin{bmatrix}A&B\\C&D\end{bmatrix}^{-1}\\= \begin{bmatrix}I&0\\-D^{-1}C&I\end{bmatrix}\begin{bmatrix}\Delta D^{-1}&0\\0&D^{-1}\end{bmatrix}\begin{bmatrix}I&-BD^{-1}\\0&I\end{bmatrix} [ACBD]−1=[I−D−1C0I][ΔD−100D−1][I0−BD−1I]
Specific derivation process ( understand )
because p ( x ∣ y ) = p ( x , y ) / p ( y ) p(x|y)=p(x,y)/p(y) p(x∣y)=p(x,y)/p(y), According to its exponential partial expansion form, we can get :
( [ x y ] − [ μ x μ y ] ) T [ Σ x x Σ x y Σ y x Σ y y ] T ( [ x y ] − [ μ x μ y ] ) = ( [ x y ] − [ μ x μ y ] ) T [ 1 0 − Σ y y − 1 Σ y x 1 ] [ ( Σ x x − Σ x y Σ y y − 1 Σ y x ) − 1 0 0 Σ y y − 1 ] [ 1 − Σ x y Σ y y − 1 0 1 ] ( [ x y ] − [ μ x μ y ] ) = ( x − μ x − Σ x x Σ y y − 1 ( y − μ y ) ) T ( Σ x x − Σ x y Σ y y − 1 Σ y x ) T ( x − μ x − Σ x x Σ y y − 1 ( y − μ y ) ) T + ( y − μ y ) T Σ y y − 1 ( y − μ y ) \left(\begin{bmatrix}x\\y\end{bmatrix}-\begin{bmatrix}\mu_x\\\mu_y\end{bmatrix} \right)^T\begin{bmatrix}\Sigma_{xx}&\Sigma_{xy}\\\Sigma_{yx}&\Sigma_{yy}\end{bmatrix}^T\left(\begin{bmatrix}x\\y\end{bmatrix}-\begin{bmatrix}\mu_x\\\mu_y\end{bmatrix} \right)\\=\left(\begin{bmatrix}x\\y\end{bmatrix}-\begin{bmatrix}\mu_x\\\mu_y\end{bmatrix} \right)^T \begin{bmatrix}1&0\\-\Sigma_{yy}^{-1}\Sigma_{yx}&1\end{bmatrix} \begin{bmatrix}(\Sigma_{xx}-\Sigma_{xy}\Sigma_{yy}^{-1}\Sigma_{yx})^{-1}&0\\0&\Sigma_{yy}^{-1}\end{bmatrix} \begin{bmatrix}1&-\Sigma_{xy}\Sigma_{yy}^{-1}\\0&1\end{bmatrix}\left(\begin{bmatrix}x\\y\end{bmatrix}-\begin{bmatrix}\mu_x\\\mu_y\end{bmatrix} \right)\\=\left(x-\mu_x-\Sigma_{xx}\Sigma_{yy}^{-1}(y-\mu_y)\right)^{T}(\Sigma_{xx}-\Sigma_{xy}\Sigma_{yy}^{-1}\Sigma_{yx})^{T}\left(x-\mu_x-\Sigma_{xx}\Sigma_{yy}^{-1}(y-\mu_y)\right)^{T}+(y-\mu_y)^T\Sigma_{yy}^{-1}(y-\mu_y) ([xy]−[μxμy])T[ΣxxΣyxΣxyΣyy]T([xy]−[μxμy])=([xy]−[μxμy])T[1−Σyy−1Σyx01][(Σxx−ΣxyΣyy−1Σyx)−100Σyy−1][10−ΣxyΣyy−11]([xy]−[μxμy])=(x−μx−ΣxxΣyy−1(y−μy))T(Σxx−ΣxyΣyy−1Σyx)T(x−μx−ΣxxΣyy−1(y−μy))T+(y−μy)TΣyy−1(y−μy)
because p ( y ) p(y) p(y) The index part of is :
( y − μ y ) T Σ y y − 1 ( y − μ y ) (y-\mu_y)^T\Sigma_{yy}^{-1}(y-\mu_y) (y−μy)TΣyy−1(y−μy)
therefore ,
p ( x ∣ y ) = p ( x , y ) / p ( y ) = N ( μ x + Σ x x Σ y y − 1 ( y − μ y ) , Σ x x − Σ x y Σ y y − 1 Σ y x ) p(x|y)=p(x,y)/p(y)=N(\mu_x+\Sigma_{xx}\Sigma_{yy}^{-1}(y-\mu_y),\Sigma_{xx}-\Sigma_{xy}\Sigma_{yy}^{-1}\Sigma_{yx}) p(x∣y)=p(x,y)/p(y)=N(μx+ΣxxΣyy−1(y−μy),Σxx−ΣxyΣyy−1Σyx)
3. Examples of compound operations
Consider random variables x ∼ N ( μ x , Σ x x ) x\sim N(\mu_x,\Sigma_{xx}) x∼N(μx,Σxx), Another variable y y y Satisfy :
y = A x + b + w y=Ax+b+w y=Ax+b+w
among A , b A,b A,b Is the coefficient matrix and offset of the linear variable , w w w Is the noise term , Gaussian distribution with zero mean : w ∼ N ( 0 , R ) w \sim N(0,R) w∼N(0,R). therefore :
E ( y ) = E ( A x + b + w ) = A E ( x ) + b + E ( w ) = A μ x + b C o v ( y ) = E [ ( x − E [ x ] ) ( x − E ( x ) ) ] + C o v ( w ) = A E [ ( x − μ x ) ( x − μ x ) T ] A T + R = A Σ x x A T + R E(y)=E(Ax+b+w)=AE(x)+b+E(w)=A\mu_x+b\\ Cov(y)=E[(x-E[x])(x-E(x))]+Cov(w)=AE[(x-\mu_x)(x-\mu_x)^T]A^T+R=A\Sigma_{xx} A^T+R E(y)=E(Ax+b+w)=AE(x)+b+E(w)=Aμx+bCov(y)=E[(x−E[x])(x−E(x))]+Cov(w)=AE[(x−μx)(x−μx)T]AT+R=AΣxxAT+R
p ( y ) = N ( A μ x + b , A Σ x x A T + R ) p(y)=N(A\mu_x+b,A\Sigma_{xx}A^T+R) p(y)=N(Aμx+b,AΣxxAT+R)
4.SLAM The mathematical representation of the problem
Usually , A robot or an unmanned vehicle will carry a sensor to measure its own motion (IMU, Wheel speed odometer, etc ), Through integral operation, we can abstract a mathematical model about ontology perception :
x k = f ( x k − 1 , u k , w k ) x_k=f(x_{k-1},u_k,w_k) xk=f(xk−1,uk,wk)
there u k u_k uk Is the movement sensor reading ( Sometimes called input ), w k w_k wk Is noise , This equation is called Equation of motion , At present, there is no specific sports significance , Because the motion sensor can be selected , Different equations can be listed according to different motion sensors , Or a combination of them , That is, multi-sensor fusion .
alike , stay SLAM There is also an environment sensing sensor in the ( Laser radar 、 The camera 、 Infrared equipment ) The observation part of , The corresponding equation of environmental perception is The observation equation , When a robot or an unmanned car is x k x_k xk A road marking is observed at the position of y j y_j yj, At this point, an observation data is generated z_{k,j}, Similarly, the mathematical model is abstracted as :
z k , j = h ( y j , x k , v k , j ) z_{k,j}=h(y_j,x_k,v_{k,j}) zk,j=h(yj,xk,vk,j)
among , v k , j v_{k,j} vk,j To observe noise , Similarly, the observation equation has different forms according to different environmental sensors .
therefore SLAM The problem can be summed up in two basic equations :
{ x k = f ( x k − 1 , u k , w k ) z k , j = h ( y j , x k , v k , j ) \left\{ \begin{array}{lr} x_k=f(x_{k-1},u_k,w_k) \\ z_{k,j}=h(y_j,x_k,v_{k,j})& \end{array} \right. { xk=f(xk−1,uk,wk)zk,j=h(yj,xk,vk,j)
It can be seen from the above equation :
1. In the observation equation , Only in position x k x_k xk I saw it y j y_j yj The observation data will be generated , Otherwise, there will be no . But in practice , A small number of road signs can usually be seen at one location , At the same time, whether it is a camera or a lidar to observe features , There are many feature points , So in the actual process The observation equation will be much larger than the number of motion equations .
2. In the equation of motion , In the actual process , If you do pure vision SLAM Or pure laser SLAM, The equation of motion is often missing ; In this case, it is usually assumed that the vehicle is moving at a constant speed or at a constant speed or at a constant acceleration .
3. Postures x x x( location ) And road signs y y y( Drawing ) as A random variable that obeys a certain probability distribution , Not a single number . Since both are quantities to be estimated , Change the mark , Make x k x_k xk by k k k All the unknowns of time , At the same time, it includes the vehicle posture at the current time ( It is assumed that the calibration of the sensor and the vehicle body has been completed ) And m A road mark , be :
x k ≜ { x k , y 1 , . . . . . . , y m } x_k\triangleq \{x_k,y_1,......,y_m\} xk≜{ xk,y1,......,ym}
In the same way k k k All observations at all times are recorded as z k z_k zk, therefore :
{ x k = f ( x k − 1 , u k ) + w k z k = h ( x k ) + v k , j \left\{ \begin{array}{lr} x_k=f(x_{k-1},u_k) +w_k\\ z_{k}=h(x_k)+v_{k,j}& \end{array} \right. { xk=f(xk−1,uk)+wkzk=h(xk)+vk,j
The posterior probability density to be estimated is directly given as :
P ( x k ∣ x 0 , u 1 : k , z 1 : k ) P(x_k|x_0,u_{1:k},z_{1:k}) P(xk∣x0,u1:k,z1:k)
among :
x 0 x_0 x0 The initial value representing the state ; u 1 : k u_{1:k} u1:k Express 1 1 1 To k k k Input of motion sensor ; z 1 : k z_{1:k} z1:k It means 0 0 0 To k k k All observations at all times , The question means :** Based on all historical data ( Input 、 observation 、 The initial state ) Get the final fusion result , That is, the filtering problem .** It is shown by a graph as :

according to Bayes The laws of , take z k z_k zk and x k x_k xk Swap places :
P ( x k ∣ x 0 , u 1 : k , z 1 : k ) ∝ P ( z k ∣ x k ) P ( x k ∣ x 0 , u 1 : k , z 1 : k − 1 ) P(x_k|x_0,u_{1:k},z_{1:k})\propto P(z_k|x_k)P(x_k|x_0,u_{1:k},z_{1:k-1}) P(xk∣x0,u1:k,z1:k)∝P(zk∣xk)P(xk∣x0,u1:k,z1:k−1)
Note here : The first item is called likelihood , The second item is called transcendental . In different ways , The prior part is actually obtained by motion prediction , be called forecast part , There are also sections based on all past states called transcendental , as follows , according to x k − 1 x_k-1 xk−1 Time is the conditional probability expansion :
P ( x k ∣ x 0 , u 1 : k , z 1 : k − 1 ) = ∫ P ( x k ∣ x k − 1 , x 0 , u 1 : k , z 1 : k − 1 ) P ( x k − 1 ∣ x 0 , u 1 : k , z 1 : k − 1 ) d x k − 1 P(x_k|x_0,u_{1:k},z_{1:k-1})=\int P(x_k|x_{k-1},x_0,u_{1:k},z_{1:k-1})P(x_{k-1}|x_0,u_{1:k},z_{1:k-1})dx_{k-1} P(xk∣x0,u1:k,z1:k−1)=∫P(xk∣xk−1,x0,u1:k,z1:k−1)P(xk−1∣x0,u1:k,z1:k−1)dxk−1
For this formula , This is called (A) The formula , Draw the following conclusions and assumptions :
1. If we think about what we were like a long time ago , You can also continue to expand this formula .
2. If you only care about k k k Time and k − 1 k-1 k−1 moment , We can assume that First order Markov property : k k k The state of the moment is only related to k − 1 k-1 k−1 Time state is irrelevant , It has nothing to do with the previous state , Get the filtering method , Such as Extended Kalman filter (EKF): Estimate by the state at a certain time , To the next moment .
3. If you think about k k k Time status and before All States The connection of , obtain An optimization framework based on nonlinear optimization .
5. Kalman filtering (KF)
Yes (A) The formula makes Markov assumption , The current moment is only related to the previous moment , The forecast part is :
P ( x k ∣ x k − 1 , x 0 , u 1 : k , z 1 : k − 1 ) = P ( x k ∣ x k − 1 , u k ) P(x_k|x_{k-1},x_0,u_{1:k},z_{1:k-1})=P(x_k|x_{k-1},u_k) P(xk∣xk−1,x0,u1:k,z1:k−1)=P(xk∣xk−1,uk)
The prior part can be reduced to :
P ( x k − 1 ∣ x 0 , u 1 : k , z 1 : k − 1 ) = P ( x k − 1 ∣ x 0 , u 1 : k − 1 , z 1 : k − 1 ) P(x_{k-1}|x_0,u_{1:k},z_{1:k-1})=P(x_{k-1}|x_0,u_{1:k-1},z_{1:k-1}) P(xk−1∣x0,u1:k,z1:k−1)=P(xk−1∣x0,u1:k−1,z1:k−1)
As can be seen from the figure, the input quantity u k u_{k} uk And k − 1 k-1 k−1 Time independent . The two equations above : With k − 1 k-1 k−1 State estimation of time , Deduce to k k k moment .
hypothesis :
1. The state quantity here obeys the Gaussian distribution , It only needs to consider the mean and covariance of the maintenance state quantity .
2. All States and noises satisfy Gaussian distribution .
Linear Gauss system can be expressed by motion equation and observation equation :
{ x k = A k x k − 1 + u k + w k z k = C k x k + v k \left\{ \begin{array}{lr} x_k=A_kx_{k-1}+u_k+w_k\\ z_{k}=C_kx_k+v_k& \end{array} \right. { xk=Akxk−1+uk+wkzk=Ckxk+vk
The noise obeys the zero mean Gaussian distribution , be :
w k ∼ N ( 0 , R ) , v k ∼ N ( 0 , Q ) w_k\sim N(0,\bm R),v_k\sim N(0,\bm Q) wk∼N(0,R),vk∼N(0,Q)
remember x ^ \hat x x^ Is posterior , x ‾ \overline x x Is a priori distribution , Suppose that k − 1 k-1 k−1 A posteriori state estimation of time : x ^ k − 1 \hat x_{k-1} x^k−1 And the covariance at this time P ^ k − 1 \hat{\bm P}_{k-1} P^k−1. The purpose at this time is relatively clear : according to k − 1 k-1 k−1 A posteriori state estimation of time , And input and observation data determination k k k A posteriori distribution of time .
1. Forecast part
according to Equation of motion and Gaussian distribution Determined as :
P ( x k ∣ x k − 1 , x 0 , u 1 : k , z 1 : k − 1 ) = N ( A k x ^ k − 1 + u k , A k P ^ k − 1 A k T + R ) P(x_k|x_{k-1},x_0,u_{1:k},z_{1:k-1})=N(\bm A_k\hat x_{k-1}+u_k,\bm A_k\bm {\hat P}_{k-1}\bm A_k^T+\bm R) P(xk∣xk−1,x0,u1:k,z1:k−1)=N(Akx^k−1+uk,AkP^k−1AkT+R)
remember :
x ‾ = A k x ^ k − 1 + u k , P ‾ = A k P ^ k − 1 A k T + R \overline x=\bm A_k\hat x_{k-1}+u_k,\overline {\bm P}=\bm A_k\bm {\hat P}_{k-1}\bm A_k^T+\bm R x=Akx^k−1+uk,P=AkP^k−1AkT+R
2. The observation equation
The observation equation can be calculated in a certain state , Data should be observed , according to The observation equation and Gaussian distribution Determined as :
P ( z k ∣ x k ) = N ( C k x k , Q ) P(z_k|x_k)=N(C_kx_k,Q) P(zk∣xk)=N(Ckxk,Q)
Let the result be x k ∼ N ( x ^ k , P ^ k ) x_k\sim N(\hat x_k,\hat {\bm P}_k) xk∼N(x^k,P^k), According to the formula :
P ( x k ∣ x 0 , u 1 : k , z 1 : k ) ∝ P ( z k ∣ x k ) P ( x k ∣ x 0 , u 1 : k , z 1 : k − 1 ) P(x_k|x_0,u_{1:k},z_{1:k})\propto P(z_k|x_k)P(x_k|x_0,u_{1:k},z_{1:k-1}) P(xk∣x0,u1:k,z1:k)∝P(zk∣xk)P(xk∣x0,u1:k,z1:k−1)
You can get a formula familiar with the previous derivation :
N ( x ^ k , P ^ k ) = N ( x ‾ k , P ‾ k ) ⋅ N ( C k x k , Q ) = N ( [ μ x μ y ] , [ Σ x x Σ x y Σ y x Σ y y ] ) N(\hat x_k,\hat {\bm P}_k)=N(\overline x_k,\overline {\bm P}_k)\cdot N(\bm C_kx_k,\bm Q)=N\left (\begin{bmatrix}\mu_x\\\mu_y\end{bmatrix}, \begin{bmatrix}\Sigma_{xx}&\Sigma_{xy}\\\Sigma_{yx}&\Sigma_{yy}\end{bmatrix}\right) N(x^k,P^k)=N(xk,Pk)⋅N(Ckxk,Q)=N([μxμy],[ΣxxΣyxΣxyΣyy])
Use the conclusion directly :
N ( x ^ k , P ^ k ) = N ( μ x + Σ x y Σ y y − 1 ( y − μ y ) , Σ x x − Σ x y Σ y y − 1 Σ y x ) N(\hat x_k,\hat {\bm P}_k)=N(\mu_x+\Sigma_{xy}\Sigma_{yy}^{-1}(y-\mu_y),\Sigma_{xx}-\Sigma_{xy}\Sigma_{yy}^{-1}\Sigma_{yx}) N(x^k,P^k)=N(μx+ΣxyΣyy−1(y−μy),Σxx−ΣxyΣyy−1Σyx)
You can see... Directly here :
P ‾ k = Σ x x Σ y y = Σ ( C k x k ) + Σ ( n ) = E [ ( C k x k − u x ) ( C k x k − u x ) T ] + Q = C k P ‾ k C k T + Q \bm {\overline P}_k=\Sigma_{xx}\\\Sigma_{yy}=\Sigma(C_kx_k)+\Sigma(n)=E[(C_kx_k-u_x)(C_kx_k-u_x)^T]+\bm Q= C_k\bm {\overline P}_kC_k^T+\bm Q Pk=ΣxxΣyy=Σ(Ckxk)+Σ(n)=E[(Ckxk−ux)(Ckxk−ux)T]+Q=CkPkCkT+Q
Can be derived
Σ x y = E [ ( x − u x ) ( z k − u z ) T ] = E [ ( x − u x ) ( C k x k − C k u x + n ) T ) ] = E [ ( x − u x ) ( C k x k − C k u x ) T + ( x − u x ) n T ] = Σ x x C k T = P ‾ k C k T Σ y x = Σ x y T = C k P ‾ k \Sigma_{xy}=E[(x-u_x)(z_k-u_z)^T]\\ =E[(x-u_x)(C_kx_k-C_ku_x+n)^T)]\\ =E[(x-u_x)(C_kx_k-C_ku_x)^T+(x-u_x)n^T]\\ =\Sigma_{xx}C_k^T\\ =\bm {\overline P}_kC_k^T\\ \Sigma_{yx}=\Sigma_{xy}^T=C_k\bm {\overline P}_k Σxy=E[(x−ux)(zk−uz)T]=E[(x−ux)(Ckxk−Ckux+n)T)]=E[(x−ux)(Ckxk−Ckux)T+(x−ux)nT]=ΣxxCkT=PkCkTΣyx=ΣxyT=CkPk
Definition :
K = Σ x y Σ y y − 1 = P ‾ k C k T ( C k P ‾ k C k T + Q ) − 1 \bm K=\Sigma_{xy}\Sigma_{yy}^{-1}=\bm {\overline P}_kC_k^T(C_k\bm {\overline P}_kC_k^T+\bm Q)^{-1} K=ΣxyΣyy−1=PkCkT(CkPkCkT+Q)−1
Then there are
P ^ k = P ‾ k − K C k P ‾ k = ( I − K C k ) P ‾ k x ^ k = x ‾ k + K ( z k − C k x ‾ ) \hat{\bm P}_k=\bm {\overline P}_k-\bm KC_k\bm {\overline P}_k=(\bm I-\bm KC_k)\bm {\overline P}_k\\ \hat x_k=\overline x_k+\bm K(z_k-C_k\overline x) P^k=Pk−KCkPk=(I−KCk)Pkx^k=xk+K(zk−Ckx)
Sort it out , The five equations are :
1. forecast : x ‾ = A k x ^ k − 1 + u k , P k ‾ = A k P ^ k − 1 A k T + R \overline x=\bm A_k\hat x^{k-1}+u_k,\bm {\overline { P_k}}=\bm A_k\bm {\hat P}_{k-1}\bm A_k^T+\bm R x=Akx^k−1+uk,Pk=AkP^k−1AkT+R
2. to update : To calculate K \bm K K, Also known as Kalman gain :
K = P ‾ k C k T ( C k P ‾ k C k T + Q ) − 1 \bm K=\bm {\overline P}_kC_k^T(C_k\bm {\overline P}_kC_k^T+\bm Q)^{-1} K=PkCkT(CkPkCkT+Q)−1
Then calculate the posterior probability distribution : P ^ k = ( I − K C k ) P ‾ k x ^ k = x ‾ k + K ( z k − C k x ‾ ) \hat{\bm P}_k=(\bm I-\bm KC_k)\bm {\overline P}_k\\ \hat x_k=\overline x_k+\bm K(z_k-C_k\overline x) P^k=(I−KCk)Pkx^k=xk+K(zk−Ckx)
thus , We deduce the whole process of the classical Kalman filter . In fact, there are several ways to deduce Kalman filter , We use the form of maximum posterior probability estimation from the perspective of probability . We see , In a linear Gaussian system , Kalman filter constitutes the maximum posterior probability estimation in the system . and , Because the Gaussian distribution is
After linear transformation, it still obeys Gaussian distribution , So we didn't make any approximations in the whole process . so to speak , Kalman filter constitutes the best unbiased estimation of linear system .
6. Extended Kalman filter (EKF)
Kalman filter is usually applied to linear systems , But in SLAM in , The equations of motion and observation are usually nonlinear functions . Regardless of vision SLAM The model is still a laser SLAM, Use lie algebra to represent the pose , It's even less likely to be a linear system . A Gaussian distribution , After nonlinear transformation , It's often no longer Gaussian , So in nonlinear systems , Approximate treatment is required , A non Gaussian distribution is approximated to a Gaussian distribution .
The results of Kalman filter are usually extended to nonlinear systems , It is called extended Kalman filter (Extended Kalman Filter,EKF), The usual way is , Consider the first-order Taylor expansion of the equation of motion and the observation equation near a point , Only the first-order term is retained , The linear part , Then it is deduced according to the linear system . The nonlinear equations of motion and observation are :
Equation of motion :
x k = f ( x k − 1 , u k , w k ) x_k=f(x_{k-1},u_k,w_k) xk=f(xk−1,uk,wk)
The observation equation is :
z k = h ( x k , n k ) z_k=h(x_k,n_k) zk=h(xk,nk)
Make k − 1 k-1 k−1 The mean and covariance matrix at the time point is x ^ k − 1 \hat \bm{x}_{k-1} x^k−1, P ^ k − 1 \hat \bm{P}_{k-1} P^k−1. stay k k k moment , Combine the equation of motion with the equation of observation , stay x ^ k − 1 \hat \bm{x}_{k-1} x^k−1, P ^ k − 1 \hat \bm{P}_{k-1} P^k−1 Linearization at ( Equivalent to first-order Taylor expansion ):
x k ≈ f ( x ^ k − 1 , u k , w k ) + ∂ f ∂ x k − 1 ∣ x ^ k − 1 ( x k − 1 − x ^ k − 1 ) + ∂ f ∂ w k ∣ x ^ k − 1 w k \left. x_k\approx f(\hat x_{k-1},u_k,w_k)+\frac{\partial f}{\partial x_{k-1}}\right|_ {\hat x_{k-1}}(x_{k-1}-\hat x_{k-1})+\left.\frac{\partial f}{\partial w_{k}}\right|_ {\hat x_{k-1}}w_k xk≈f(x^k−1,uk,wk)+∂xk−1∂f∣∣∣∣x^k−1(xk−1−x^k−1)+∂wk∂f∣∣∣∣x^k−1wk
Note that the partial derivative here is :
F = ∂ f ∂ x k − 1 ∣ x ^ k − 1 \left. \bm F=\frac{\partial f}{\partial x_{k-1}}\right|_ {\hat x_{k-1}} F=∂xk−1∂f∣∣∣∣x^k−1
B k − 1 = ∂ f ∂ w k ∣ x ^ k − 1 \bm B_{k-1}=\left.\frac{\partial f}{\partial w_{k}}\right|_ {\hat x_{k-1}} Bk−1=∂wk∂f∣∣∣∣x^k−1
For the observation equation , Similarly, there are :
z k ≈ h ( x ‾ k ) + ∂ h ∂ x k ∣ x ‾ k ( x k − x ‾ k ) + ∂ h ∂ n k ∣ x ‾ k n k \left. z_k\approx h(\overline x_k)+\frac{\partial h}{\partial x_{k}}\right|_ {\overline x_{k}}(x_{k}-\overline x_k)+\left.\frac{\partial h}{\partial n_{k}}\right|_ {\overline x_{k}}n_k zk≈h(xk)+∂xk∂h∣∣∣∣xk(xk−xk)+∂nk∂h∣∣∣∣xknk
remember :
H = ∂ h ∂ x k ∣ x ^ k \left. \bm H=\frac{\partial h}{\partial x_{k}}\right|_ {\hat x_{k}} H=∂xk∂h∣∣∣∣x^k
C k = ∂ h ∂ n k ∣ x ‾ k C_k=\left.\frac{\partial h}{\partial n_{k}}\right|_ {\overline x_{k}} Ck=∂nk∂h∣∣∣∣xk
The expansion linearization result equation is :
E [ x k ] = f ( x ^ k − 1 , u k , 0 ) + F k − 1 ( x k − 1 − x ^ k − 1 ) + E [ B k − 1 w k ] E[x_k]=f(\hat x_{k-1},u_k,0)+\bm F_{k-1}(x_{k-1}-\hat x_{k-1})+E[\bm B_{k-1}w_k] E[xk]=f(x^k−1,uk,0)+Fk−1(xk−1−x^k−1)+E[Bk−1wk]
here w k w_k wk and n k n_k nk Obey the zero mean distribution :
w k ∼ N ( 0 , R ) , n k ∼ N ( 0 , Q ) w_k\sim N(0,\bm R),n_k\sim N(0,\bm Q) wk∼N(0,R),nk∼N(0,Q)
therefore E [ B k − 1 w k ] = 0 E[\bm B_{k-1}w_k]=0 E[Bk−1wk]=0,
here E ( x k − 1 ] = x ^ k − 1 E(x_{k-1}]=\hat x_{k-1} E(xk−1]=x^k−1 E ( x ^ k − 1 ) = x ^ k − 1 E(\hat x_{k-1})=\hat x_{k-1} E(x^k−1)=x^k−1
The result is :
E [ x k ] = f ( x ^ k − 1 , u k , 0 ) E[x_k]=f(\hat x_{k-1},u_k,0) E[xk]=f(x^k−1,uk,0)
The covariance matrix is :
C o v [ x k ] = E [ ( x k − 1 − E [ x k − 1 ] ) ( x k − 1 − E [ x k − 1 ] ) T ] + C o v [ B k − 1 w k ] = F P ^ k − 1 F T + B k − 1 R k B k − 1 T \begin{aligned} Cov[x_k]&=E[(x_{k-1}-E[x_{k-1}])(x_{k-1}-E[x_{k-1}])^T]+Cov[\bm B_{k-1}w_k]\\ &=\bm F \bm{\hat{P}}_{k-1}\bm F^T +\bm B_{k-1}\bm R_k\bm B_{k-1}^T \end{aligned} Cov[xk]=E[(xk−1−E[xk−1])(xk−1−E[xk−1])T]+Cov[Bk−1wk]=FP^k−1FT+Bk−1RkBk−1T
* The derivation here is based on the transitivity of Gaussian distribution covariance :
E ( y ) = E ( A x + b + w ) = A E ( x ) + b + E ( w ) = A μ x + b C o v ( y ) = E [ ( x − E [ x ] ) ( x − E ( x ) ) ] + C o v ( w ) = A E [ ( x − μ x ) ( x − μ x ) T ] A T + R = A Σ x x A T + R E(y)=E(Ax+b+w)=AE(x)+b+E(w)=A\mu_x+b\\ Cov(y)=E[(x-E[x])(x-E(x))]+Cov(w)=AE[(x-\mu_x)(x-\mu_x)^T]A^T+R=A\Sigma_{xx} A^T+R E(y)=E(Ax+b+w)=AE(x)+b+E(w)=Aμx+bCov(y)=E[(x−E[x])(x−E(x))]+Cov(w)=AE[(x−μx)(x−μx)T]AT+R=AΣxxAT+R
C o v [ B k − 1 w k ] = B k − 1 C o v [ w k ] B k − 1 T Cov[\bm B_{k-1}w_k]=\bm B_{k-1}\bm Cov[w_k]\bm B_{k-1}^T Cov[Bk−1wk]=Bk−1Cov[wk]Bk−1T
Synthesis can lead to
p ( x k ∣ x 0 , u 1 : k , z 0 : k − 1 ) = N ( f ( x ^ k − 1 , u k , 0 ) , F P ^ k − 1 F T + B k − 1 R k B k − 1 T ) p(x_k|x_0,u_{1:k},z_{0:k-1})=N(f(\hat x_{k-1},u_k,0),\bm F \bm{\hat{P}}_{k-1}\bm F^T +\bm B_{k-1}\bm R_k\bm B_{k-1}^T) p(xk∣x0,u1:k,z0:k−1)=N(f(x^k−1,uk,0),FP^k−1FT+Bk−1RkBk−1T)
Similar to Kalman filter , Here you are :
x ‾ k = f ( x ^ k − 1 , u k , 0 ) , P ‾ k = F P ^ k − 1 F T + B k − 1 R k B k − 1 T \overline x_k=f(\hat x_{k-1},u_k,0),\bm {\overline P}_{k}=\bm F \bm{\hat{P}}_{k-1}\bm F^T +\bm B_{k-1}\bm R_k\bm B_{k-1}^T xk=f(x^k−1,uk,0),Pk=FP^k−1FT+Bk−1RkBk−1T
similarly , In the observation equation :
E [ z k ] = E [ h ( x ‾ k ) + H ( x k − x ‾ k ) + C k n k ] = h ( x ‾ k ) + H ( x k − x ‾ k ) C o v [ z k ] = E [ ( x ‾ k − E [ x ‾ k ] ) ( x ‾ k − E [ x ‾ k ] ) T ] + C o v [ C k n k ] = C k E [ n k ] C k T = C k Q C k T E[z_k]=E[h(\overline x_k)+\bm H(x_k-\overline x_{k})+\bm C_kn_k]=h(\overline x_k)+\bm H(x_k-\overline x_{k})\\ Cov[z_k]=E[(\overline x_k-E[\overline x_k])(\overline x_k-E[\overline x_k])^T]+Cov[\bm C_kn_k]\\ =\bm C_kE[n_k]\bm C_k^T=\bm C_k\bm Q\bm C_k^T E[zk]=E[h(xk)+H(xk−xk)+Cknk]=h(xk)+H(xk−xk)Cov[zk]=E[(xk−E[xk])(xk−E[xk])T]+Cov[Cknk]=CkE[nk]CkT=CkQCkT
Observed as
p ( z k ∣ x k ) = N ( h ( x ‾ k ) + H ( x k − x ‾ k ) , C k Q C k T ) p(z_k|x_k)=N(h(\overline x_k)+\bm H(x_k-\overline x_{k}),\bm C_k\bm Q\bm C_k^T) p(zk∣xk)=N(h(xk)+H(xk−xk),CkQCkT)
deduction EKF For the same :
N ( x ^ k , P ^ k ) = N ( x ‾ k , P ‾ k ) ⋅ N ( h ( x ‾ k ) + H ( x k − x k − 1 ) , C k Q C k T ) = N ( [ μ x μ y ] , [ Σ x x Σ x y Σ y x Σ y y ] ) N(\hat x_k,\hat {\bm P}_k)=N(\overline x_k,\overline {\bm P}_k)\cdot N(h(\overline x_k)+\bm H(x_k-x_{k-1}),\bm C_k\bm Q\bm C_k^T)=N\left (\begin{bmatrix}\mu_x\\\mu_y\end{bmatrix}, \begin{bmatrix}\Sigma_{xx}&\Sigma_{xy}\\\Sigma_{yx}&\Sigma_{yy}\end{bmatrix}\right) N(x^k,P^k)=N(xk,Pk)⋅N(h(xk)+H(xk−xk−1),CkQCkT)=N([μxμy],[ΣxxΣyxΣxyΣyy])
Also use the conclusion directly :
Use the conclusion directly :
N ( x ^ k , P ^ k ) = N ( μ x + Σ x y Σ y y − 1 ( y − μ y ) , Σ x x − Σ x y Σ y y − 1 Σ y x ) N(\hat x_k,\hat {\bm P}_k)=N(\mu_x+\Sigma_{xy}\Sigma_{yy}^{-1}(y-\mu_y),\Sigma_{xx}-\Sigma_{xy}\Sigma_{yy}^{-1}\Sigma_{yx}) N(x^k,P^k)=N(μx+ΣxyΣyy−1(y−μy),Σxx−ΣxyΣyy−1Σyx)
You can see... Directly here :
P ‾ k = Σ x x Σ y y = Σ ( h ( x ‾ k ) ) + Σ ( H k ( x k − x ‾ k ) ) + Σ ( C k n k ) = 0 + H E [ ( x k − 1 − E [ x k − 1 ] ) ( x k − 1 − E [ x k − 1 ] ) T ] H T + C k Q C k T = H P ‾ k H T + C k Q C k T \bm {\overline P}_k=\Sigma_{xx}\\\Sigma_{yy}=\Sigma(h(\overline x_k))+\Sigma(H_k(x_k-\overline x_k))+\Sigma(\bm C_kn_k)=0+\bm HE[(x_{k-1}-E[x_{k-1}])(x_{k-1}-E[x_{k-1}])^T]\bm H^T+\bm C_k\bm Q\bm C_k^T= \bm H\bm {\overline P}_k\bm H^T+\bm C_k\bm Q\bm C_k^T Pk=ΣxxΣyy=Σ(h(xk))+Σ(Hk(xk−xk))+Σ(Cknk)=0+HE[(xk−1−E[xk−1])(xk−1−E[xk−1])T]HT+CkQCkT=HPkHT+CkQCkT
Can be derived
Σ x y = E [ ( x − u x ) ( z k − u z ) T ] = E [ ( x − u x ) ( h ( x ‾ k ) + H ( x k − x ‾ k ) + C n k − h ( x ‾ k ) ] = E [ ( x − u x ) ( H k x k − H k u x ) T + ( x − u x ) n T ] = Σ x x H k T = P ‾ k H k T Σ y x = Σ x y T = H k P ‾ k \Sigma_{xy}=E[(x-u_x)(z_k-u_z)^T]\\ =E[(x-u_x)(h(\overline x_k)+\bm H(x_{k}-\overline x_k)+\bm Cn_k-h(\overline x_k)]\\ =E[(x-u_x)(\bm H_kx_k-\bm H_ku_x)^T+(x-u_x)n^T]\\ =\Sigma_{xx}\bm H_k^T\\ =\bm {\overline P}_k\bm H_k^T\\ \Sigma_{yx}=\Sigma_{xy}^T=\bm H_k\bm {\overline P}_k Σxy=E[(x−ux)(zk−uz)T]=E[(x−ux)(h(xk)+H(xk−xk)+Cnk−h(xk)]=E[(x−ux)(Hkxk−Hkux)T+(x−ux)nT]=ΣxxHkT=PkHkTΣyx=ΣxyT=HkPk
Define the Kalman gain :
K k = Σ x y Σ y y − 1 = P ‾ k H k T ( H k P ‾ k H k T + C k Q C k T ) − 1 \bm K_k=\Sigma_{xy}\Sigma_{yy}^{-1}=\bm {\overline P}_kH_k^T(H_k\bm {\overline P}_kH_k^T+\bm C_k\bm Q\bm C_k^T)^{-1} Kk=ΣxyΣyy−1=PkHkT(HkPkHkT+CkQCkT)−1
Based on Kalman gain :
x ^ k = x ‾ k + K k ( z k − h ( x ‾ k ) ) \hat x_k=\overline x_k+\bm K_k(z_k-h(\overline x_k)) x^k=xk+Kk(zk−h(xk))
P ^ k = P ‾ k − K k H k P ‾ k = ( I − K k H k ) P ‾ k \bm {\hat P}_k=\overline {\bm P}_k-\bm K_k\bm H_k\bm {\overline P}_k=(\bm I-\bm K_k\bm H_k)\bm {\overline P}_k P^k=Pk−KkHkPk=(I−KkHk)Pk
Sum up , obtain EKF The five classical formulas of are :
1. forecast :
x ‾ k = f ( x ^ k − 1 , u k , 0 ) , P ‾ k = F P ^ k − 1 F T + B k − 1 R k B k − 1 T \overline x_k=f(\hat x_{k-1},u_k,0),\bm {\overline P}_{k}=\bm F \bm{\hat{P}}_{k-1}\bm F^T +\bm B_{k-1}\bm R_k\bm B_{k-1}^T xk=f(x^k−1,uk,0),Pk=FP^k−1FT+Bk−1RkBk−1T
2. to update : To calculate K \bm K K, Also known as Kalman gain :
K k = Σ x y Σ y y − 1 = P ‾ k H k T ( H k P ‾ k H k T + C k Q C k T ) − 1 \bm K_k=\Sigma_{xy}\Sigma_{yy}^{-1}=\bm {\overline P}_kH_k^T(H_k\bm {\overline P}_kH_k^T+\bm C_k\bm Q\bm C_k^T)^{-1} Kk=ΣxyΣyy−1=PkHkT(HkPkHkT+CkQCkT)−1
Then calculate the posterior probability distribution :
P ^ k = P ‾ k − K k H k P ‾ k = ( I − K k H k ) P ‾ k x ^ k = x ‾ k + K k ( z k − h ( x ‾ k ) ) \bm {\hat P}_k=\overline {\bm P}_k-\bm K_k\bm H_k\bm {\overline P}_k=(\bm I-\bm K_k\bm H_k)\bm {\overline P}_k\\ \hat x_k=\overline x_k+\bm K_k(z_k-h(\overline x_k)) P^k=Pk−KkHkPk=(I−KkHk)Pkx^k=xk+Kk(zk−h(xk))
thus , Extended Kalman filter (EKF) The derivation has been completed ,EKF Be concise in form 、 Widely used , In the early SLAM Has occupied a dominant position for a long time , however EKF There are some limitations :
1. The filter assumes Markov property to some extent : k k k The state of the moment is only related to k − 1 k -1 k−1 Time related , And with the k − 1 k -1 k−1 The previous state has nothing to do with the observation ( Or related to the first few finite time states ). This assumption leads to laser / The visual odometer only considers the relationship between two adjacent frames , In case of loopback , Difficult to deal with , This requires Nonlinear optimization All historical data are put together for optimization , But the disadvantage is that it increases the amount of calculation , Consume more computing resources .
2.EKF The filter is only used in x ^ k − 1 \hat x_{k-1} x^k−1 A linearization is done at , And then directly based on the linearization results , Calculate a posterior probability . This method considers the linearized approximation at this point , The posterior probability is still valid . But in fact , When we are far away from the work site , The first-order Taylor expansion does not necessarily approximate the entire function , This depends on the nonlinearity of the motion model and the observation model . If they have strong nonlinearity , Then the linear approximation only holds in a very small range , It can't be considered that it can still be approximated by linearity in far places . This is it. EKF Nonlinear error of , Is its main problem .
3. In terms of program implementation ,EKF It is necessary to store the mean and variance of the state quantity , And maintain and update them . If you put the road signs into the State , Because of vision SLAM There are a large number of middle road signs , This amount of storage is considerable , And increases squarely with the state quantity ( Because you want to store the covariance matrix ). therefore ,EKF SLAM It is generally considered unsuitable for large-scale scenarios .
7. Iterative extended Kalman filter (IEKF)
Because of the linearization approximation in the nonlinear model , When the degree of nonlinearity is stronger , The error will be large . however , Since the linearized operating point is closer to the true value , The smaller the linearization error , So one way to solve this problem is , Find the exact linearization point gradually through iteration , So as to improve the accuracy .
stay EKF In the derivation of , Only change the linearized observation point of the observation :
z k ≈ h ( x o p , k , 0 ) + H k ( x k − x o p , k ) + C k n k z_k\approx h(x_{op,k},0)+\bm H_k(x_{k}-x_{op,k})+\bm C_kn_k zk≈h(xop,k,0)+Hk(xk−xop,k)+Cknk
Define the Kalman gain :
K k = Σ x y Σ y y − 1 = P ‾ k H k T ( H k P ‾ k H k T + C k Q C k T ) − 1 \bm K_k=\Sigma_{xy}\Sigma_{yy}^{-1}=\bm {\overline P}_kH_k^T(H_k\bm {\overline P}_kH_k^T+\bm C_k\bm Q\bm C_k^T)^{-1} Kk=ΣxyΣyy−1=PkHkT(HkPkHkT+CkQCkT)−1
Based on Kalman gain :
x ^ k = x ‾ k + K k ( ( z k − H k x ‾ k ) − ( z o p , k − H ( x ‾ k ) ) \hat x_k=\overline x_k+\bm K_k((z_k-H_k\overline x_k)-(z_{op,k}-H(\overline x_k)) x^k=xk+Kk((zk−Hkxk)−(zop,k−H(xk))
During filtering , Repeat this 2 A formula , Take the posterior mean of the last time as the linear working point of this time , The purpose of reducing nonlinear error can be achieved . It should be noted that , In this filtering mode , A posteriori variance should be carried out in the last step .
8. Advantages and disadvantages of other filters
8.1 MSCKF
MSCKF The goal is solve EKF Dimension explosion problem of , That is to say EKF The third point of the discussion . Tradition EKF-SLAM Add feature points to the state vector and IMU State is estimated together , When the environment is very big , There will be many characteristic points , The dimension of the state vector becomes very large .SCKF Instead of adding feature points to the state vector , Instead, the positions and poses at different times are added to the state vector , Feature points will be seen by multiple sensors , Thus in multiple sensor states (Multi-State) Form geometric constraints between (Constraint), Then the observation model is constructed by using geometric constraints EKF Conduct update. Because the number of sensor pose will be much smaller than the number of feature points ,MSCKF The dimensions of the state vector are compared to EKF-SLAM Greatly reduced , The historical camera state will be continuously removed , Maintain only a fixed number of camera poses (Sliding Window), Thus to MSCKF The calculation amount of the back end is limited .
Study reference links and papers :
1.A Multi-State Constraint Kalman Filter for Vision-aided Inertial Navigation
2.Improving the Accuracy of EKF-Based Visual-Inertial Odometry
3. MSCKF Those things ( One )MSCKF Introduction to the algorithm
4. MSCKF Those things ( Two )S-MSCKF Trial and source code analysis
9. Kalman filtering - Discretization of system equations
Discrete derivation process :
Given continuous time linear stochastic systems ( Linear stochastic differential equation ):
X ˙ ( t ) = F ( t ) X ( t ) + G ( t ) w ( t ) \dot {\bm X}(t)=\bm F(t)\bm X(t)+\bm G(t)w(t) X˙(t)=F(t)X(t)+G(t)w(t)
According to linear system theory , The equivalent discretization form of the above formula is :
X k = Φ k / k − 1 X k − 1 + η k − 1 \bm X_k=\Phi_{k/k-1}\bm X_{k-1}+\eta_{k-1} Xk=Φk/k−1Xk−1+ηk−1
In the formula above ,
X k = X ( t k ) Φ k / k − 1 = Φ ( t k , t k − 1 ) ≈ e ∫ t k − 1 t k F ( τ ) d τ η k − 1 = ∫ t k − 1 t k Φ ( t k , τ ) G ( τ ) w ( τ ) d τ \bm X_k=\bm X(t_k)\\ \Phi_{k/k-1}=\Phi(t_k,t_{k-1})\approx e^{\int_{t_{k-1}}^{t_k}\bm F(\tau)d\tau}\\ \eta_{k-1}={\int_{t_{k-1}}^{t_k}\Phi(t_k,\tau)}\bm G(\tau)w(\tau)d\tau Xk=X(tk)Φk/k−1=Φ(tk,tk−1)≈e∫tk−1tkF(τ)dτηk−1=∫tk−1tkΦ(tk,τ)G(τ)w(τ)dτ
Note the discrete time interval T s = t k − t k − 1 T_s=t_k-t_{k-1} Ts=tk−tk−1, When F ( t ) \bm F(t) F(t) In a short integral interval [ t k − 1 , t k ] [t_{k-1},t_k] [tk−1,tk] When the internal change is not too drastic , And set F ( t k − 1 ) T s ≪ I \bm F(t_{k-1})T_s\ll \bm I F(tk−1)Ts≪I, Then the further transfer matrix can be approximated as follows :
Φ k / k − 1 = Φ ( t k , t k − 1 ) ≈ e F ( t k − 1 ) T s = I + F ( t k − 1 ) T s + F 2 ( t k − 1 ) T s 2 2 ! + F 3 ( t k − 1 ) T s 3 3 ! . . . . . . . ≈ I + F ( t k − 1 ) T s \Phi_{k/k-1}=\Phi(t_k,t_{k-1})\approx e^{\bm F(t_{k-1})T_s}=\bm I+\bm F(t_{k-1})T_s+\bm F^2(t_{k-1})\frac {T^2_s}{2!}+\bm F^3(t_{k-1})\frac {T^3_s}{3!}.......\approx \bm I+\bm F(t_{k-1})T_s Φk/k−1=Φ(tk,tk−1)≈eF(tk−1)Ts=I+F(tk−1)Ts+F2(tk−1)2!Ts2+F3(tk−1)3!Ts3.......≈I+F(tk−1)Ts
η k − 1 \eta_{k-1} ηk−1 Is a linear transformation of Gaussian white noise , The result is still a random vector with normal distribution , So we can use the mean value , variance , That is to say , Second order statistical characteristics to describe and equivalent η k − 1 \eta_{k-1} ηk−1.
Finally, the discretized formula is as follows :
X k = Φ k / k − 1 X k − 1 + Γ k − 1 w k − 1 \bm X_k=\Phi_{k/k-1}\bm X_{k-1}+\Gamma_{k-1}w_{k-1} Xk=Φk/k−1Xk−1+Γk−1wk−1
among :
Γ k − 1 ≈ [ I + F ( t k − 1 ) T s ] G ( k − 1 ) ≈ G ( k − 1 ) \Gamma_{k-1}\approx [\bm I+\bm F(t_{k-1})T_s]\bm G(k-1)\approx \bm G(k-1) Γk−1≈[I+F(tk−1)Ts]G(k−1)≈G(k−1)
Reference resources :
Vision SLAM Fourteen speak , a.
边栏推荐
- Shengteng AI development experience based on target detection and identification of Huawei cloud ECS [Huawei cloud to jianzhiyuan]
- Lucene mind map makes search engines no longer difficult to understand
- Kubernetes入门介绍与基础搭建
- Introduction and basic construction of kubernetes
- Décomposition détaillée du problème de chemin le plus court du graphique
- 安全培训管理办法
- How word inserts a guide (dot before page number) into a table of contents
- 负载均衡策略图文详解
- How about the CSC account of qiniu business school? Is it safe?
- 763. dividing alphabetic intervals
猜你喜欢

Unable to return to the default page after page Jump

如何保证消息的顺序性、消息不丢失、不被重复消费

The principle and source code interpretation of executor thread pool in concurrent programming

大厂是面对深度分页问题是如何解决的(通俗易懂)

项目连接不到远程虚拟机The driver has not received any packets from the server.

How word removes the header line
![[untitled] test](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled] test

The driver has not received any packets from the server
![[no title] 66666](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[no title] 66666
![[network planning] 2.5 brief introduction to P2P architecture](/img/a8/74a1b44ce4d8b0b1a85043a091a91d.jpg)
[network planning] 2.5 brief introduction to P2P architecture
随机推荐
Décomposition détaillée du problème de chemin le plus court du graphique
Word删除页眉横线的方法
Multipass Chinese document - Overview
哈工大软件构造复习——LSP原则,协变和逆变
Yum source update
Philips coo will be assigned to solve the dual crisis of "supply chain and product recall" in the face of crisis due to personnel change
MESI cache consistency protocol for concurrent programming
百度飞桨PaddlePaddle最新系列AI课程回放地址
【无标题】6666666
Complete uninstallation of MySQL under Linux
How to guarantee the quality of real-time data, the cornerstone of the 100 million level search system (Youku Video Search)? v2020
测试下吧先
数的奥秘之幂数与完全平方数
循环结构语句
Computer screen recording free software GIF and other format videos
B 树的简单认识
Unity mesh patch generates parabola and polyline
array_column() expects parameter 1 to be array, array given
qt程序插件报错plugin xcb
Blog recommendation | building IOT applications -- Introduction to flip technology stack