I have to implement Kalman filter for a better accuracy with GPS positions... I use Stochastically solution (Smooth GPS data). In ValidPosition I have some checks like:
public boolean checkPosition(Location location) {
if (( location != null ) &&
(distance != 0) &&
(distance > MINIMUM_DISTANCE) && // 10 metres
(location.hasSpeed()) &&
(location.getSpeed() > 0) &&
(averageTime < HUMANSPEED) &&
(location.hasAccuracy()) &&
(location.getAccuracy() < MINIMUM_ACCURACY) &&
(isBetterLocation(location, lastLocation)) // From Google example in http://developer.android.com/guide/topics/location/strategies.html#BestPerformance
return true;
}
return false;
}
Now, in my main class with Location Fusion Provider I have this:
public static final int ACCURACY_DECAYS_TIME = 3; // Metres per second
private KalmanLatLong kalmanLatLong = new KalmanLatLong(ACCURACY_DECAYS_TIME);
private ValidPosition validPosition = new ValidPosition();
@Override
public void onLocationChanged(Location location) {
if(validPosition.checkPosition(location)) {
kalmanLatLong.process(
location.getLatitude(),
location.getLongitude(),
location.getAccuracy(),
location.getTime());
mCallback.handleNewLocation(location);
}
}`
And now? How can I use Kalman predictions? What do I have write here in Stochastically code?
// TODO: USE VELOCITY INFORMATION HERE TO GET A BETTER ESTIMATE OF CURRENT POSITION
Thanks