Kalman Filter For Beginners With Matlab Examples Download Top

Update: K_k = P_k H^T (H P_k-1 H^T + R)^-1 x̂_k = x̂_k-1 + K_k (z_k - H x̂_k-1) P_k = (I - K_k H) P_k

% plot figure; plot(true_traj(1,:), true_traj(2,:), '-k'); hold on; plot(meas(1,:), meas(2,:), '.r'); plot(est(1,:), est(2,:), '-b'); legend('True','Measurements','Estimate'); xlabel('x'); ylabel('y'); axis equal; For nonlinear systems x_k = f(x_k-1,u_k-1) + w, z_k = h(x_k)+v, linearize via Jacobians F and H at current estimate, then apply predict/update with F and H in place of A and H. Update: K_k = P_k H^T (H P_k-1 H^T

dt = 0.1; A = [1 0 dt 0; 0 1 0 dt; 0 0 1 0; 0 0 0 1]; H = [1 0 0 0; 0 1 0 0]; Q = 1e-3 * eye(4); R = 0.05 * eye(2); x = [0;0;1;0.5]; % true initial xhat = [0;0;0;0]; P = eye(4); For nonlinear systems x_k = f(x_k-1

Goal: estimate x_k given measurements z_1..z_k. Predict: x̂_k = A x̂_k-1 + B u_k-1 P_k = A P_k-1 A^T + Q u_k-1) + w

S’abonner
Notifier de
guest

4 Commentaires
le plus ancien
le plus récent le plus populaire
Commentaires en ligne
Afficher tous les commentaires