To get a more accurate data from GPS, Kalman filter is being recommended. But I can't find any tutorial how to implement Kalman Filter for GPS, android.
GPS Data are already heavily Kalman filtered. This is done inside the GPS receiver. Dont expect an accuracy gain in position (lat / lon) if you create your own kalman filter. Further you dont have the information that the internal GPS receiver had. It feeds its internal kalman filter 1000 time / per second, before it outputs one location.
In your own post processing filter you might gain a smoother track (related to visualizing the positions). But smoother is not more accurate, only more pleasant to view.
Another topic is whether or not the GPS positions must be available in real time, e.g display the current position on screen. If you want to smooth your tracks afterwards (non realtime) you could be successfull, but I would not use a kalman filter for that case. A kalman filter is well suited for real time filtering, for post processing, you could try a sliding average with a triangle window filter (easy to implement, while kalman is very komplex)
There’s a lot of stuff you can find through Google and Wikipedia, but having a basic intuition could be useful.
Essentially, a Kalman filter means repeatedly applying a two-step process:
A Kalman filter formalizes a simple idea: when you know how fast you’re going, you can predict your geolocation from the last reported GPS position, and then update when a new GPS report comes in.
We will talk about two variables here: the mean, which is your best guess, and your uncertainty, which represents the accuracy of that guess. In terms of GPS, you would be talking about the GPS location and the margin of error (e.g. 10 meters).
With every update you do, you increase your uncertainty a bit because you’re not really that sure the velocity hasn’t changed. When a new measurement comes in, you update the position and the certainty.
The mean and uncertainty can be represented as a Bell curve (a normal distribution), with the variable on the X axis and the probability of it having that value on the Y axis:
Here µ (mu) is the mean and σ (sigma) is the uncertainty. Any such curve can be described by these two values.
The trick is that you can actually multiple two bell curves (your prediction and your measurement) and get a new one representing the combined knowledge, which you’d do when you get a new GPS position after having done some predictions. You’ll find the math for this on Wikipedia and other sites.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With