Skip to main content
. 2019 Mar 20;10(3):198. doi: 10.3390/mi10030198
Algorithm 1 Two-stage EKF for WiFi/MEMS integration.
Step 1: Initialize the attitude-determination EKF
D^0=[0.5π  0  0]T, P10=diag([111]), k=1
Step 2: Attitude-determination EKF
Fk1=(fk1/D)|D^k1+, where fk1(·) is the system model defined in Equation (12)
P1k=Fk1P1,k1+Fk1T+Q1,k1
D^k=fk1(D^k1+,uk1,0), where uk1=[ωx,k1  ωy,k1  ωz,k1]T
Hk=(Tk1/D)|D^k×[0  0  1]T
K1k=P1kHkT(HkP1kHkT+R1k)1
D^k+=D^k+K1k(AkTk1[0  0  1]T)
P1k+=(IK1kHk)P1k, where I is the identity matrix
Step 3: k=k+1 and return to Step 2
Step 4: Initialize the position-tracking EKF
B^0=[0.6  0  0.6  0.5π]T, P20=diag([0.010.010.010.01]), k=1
Step 5: Position-tracking EKF
Gk1=(gk1/B)|B^k1+, where gk1(·) is the system model defined in Equation (21)
P2k=Gk1P2,k1+Gk1T+Q2,k1
B^k=gk1(B^k1+,0)
K2k=P2k(P2k+R2k)1
B^k+=B^k+K2k(CkB^k)
P2k+=(IK2k)P2k
Step 6: k=k+1 and return to Step 5