I have a question regarding inertial navigation with a mobile device. I am using an android tablet for development but I think the question is related to all types (even with better sensors) of hardware.
The most basic question when developing an inertial system is how to determine the direction of the carrier's movement. Even if we assume that the magnetometer readings are 100% accurate (which they are obviously not!) There is still the question of the device orientation relative to the user.
Simple example - if the user is walking north, but holds the device with the device's Y axis points north-east, (a link to a picture of the different axis: http://developer.android.com/reference/android/hardware/SensorEvent.html) Then the magnetometer will point towards north-east. How can we tell which way the user is actually heading? (The same will be true if we use both magnetometer and Gyro for determining heading)
A possible solution will be to use the Accelerometer's Y-axis and X-axis readings. Something in the direction of using arctan(a-Y/a-X) (for example - if the user holds the device perfectly straight, then the X-Axis will show nothing...) But since the Accelerometer's readings are not stable, it is not so easy...
Does anyone know of an algorithm that actually works? I am sure this is a well known problem, but I can't seem to find references to solutions...
Thanks in advance!
Ariel
The really right answer is to leave the device sitting there for a while, detect the rotation of the earth, and then compute true north from that. Unfortunately, the gyros in a mobile phone aren't accurate enough for that....