Re:Rudolf Kálmán Has Died
by jmaygarden on Wednesday July 06, 2016 @09:38AM
(#12042956)
Interesting. I don't see generic Kalman filter implementations too often. Thanks for sharing.
I've always found that determining where to put outputs from disparate sensors as opposed to just filtering a single observation like the GPS output in your example is challenging. Have you tried extending this to include input from other sensors (e.g. accelerometer, gyroscope, magnetometer, etc.)?
I actually found it to be such a pain in the ass to tune, it didn't even seem that great on iPhones with plain old GPS compared to a hacky bundle of heuristics. I left the code on github because why not, and it turned out over the years people have used it for various things.
You can tune the matrices in other ways - I wrote my thesis around fuzzy autotuning - but most do it by hand.
Here's some ancient code from those days: https://github.com/Qworg/Robot-Sensor-Fusion
GPS already use a Kalman filter to create a filtered output. You cannot apply a second filter to the output of the first and expect better results.
Specifically, the Kalman filter depends on the data having the Markov property, and that the noise is Gaussian. The output of the filter has neither property, so you are not going to get better data. You may "smooth" the data, but all you are really doing is 1) discarding useful information, and/or 2) introducing a lag into the signal.
That, and tuning the covariance matrices can be tough and time-consuming.
Although I guess I should have been calling it a "Kálmán filter" this whole time.