Search code examples
iphonecoordinatesaccelerometerplotspatial

Visualizing/plotting location based on accelerometer/gyro readings over time


What's the easiest way to plot location track based on series of reading of accelerometer/gyro/compass sensors taken over time? Let's say I have following data taken every second:

ElapsedTime(s) xMag(uT) yMag(uT) zMag(uT) xAccel(g) yAccel(g) zAccel(g) xRate(rad/sec) yRate(rad/sec) zRate(rad/sec) roll(rad) pitch(rad) yaw(rad) ...

Is there an easy way to draw a location plot for any given time? I'm using iPhone 4 with xSensor app to capture data, but can't just use GPS. I would appreciate any hints. Both standalone applications and Java libraries would be good.


Solution

  • Double integration of the acceleration vector (after gyro & compass direction correction) will give you a location from some initial or arbitrary offset. The problem is that any small offset or errors in the acceleration data, which there will be, will result in a rapidly diverging position.

    What might be more possible is to get frequent and precise GPS position data, and use the acceleration data to estimate the route in between two very nearby GPS fixes.