rlabbe / filterpy

Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
MIT License
3.22k stars 612 forks source link

Error in EKF.py predict_update #271

Open Paulkie99 opened 2 years ago

Paulkie99 commented 2 years ago

I believe the Jacobian should be computed after the predict step instead of before.

https://github.com/rlabbe/filterpy/blob/1d2834d5d162e17bcb5e8328e4d0f97392b0ff03/filterpy/kalman/EKF.py#L222-L242

jsvacha commented 1 year ago

I agree. You want to linearize the system about the current estimate. Once you run the prediction, the estimate changes and so should the measurement Jacobian.