I am trying to write a system that would be able to estimate the velocity of a traveling vehicle (usually a car) using a smartphone. Most smartphones have the next sensors:
- 1Hz Low-Frequency GPS
- 10-100Hz Accelerometer
- 10-100Hz Gyroscope
- 10-100Hz Magnetometer
I would also impose a limitation, that device must be in either portrait or landscape position, relative to vehicle's direction of travel.
Now, the GPS will tell me speed and position once per second, but I would like to estimate the velocity in time between GPS data comes in, up to 10-100 times per second, for which I would like to use other sensors. The speed should be accurately represented, even if the car is decelerating.
For now, I've implemented Kalman filter which fuses together GPS, accelerometer and gyroscope and estimates the velocity. But the biggest problem becomes the deceleration, as in all usual references I could find, only the absolute velocity from all axes is taken into consideration.
How to approach this problem? Am I even correct in using Kalman? How to get correct deceleration? What if vehicle is cornering?
Thank you for your help!