Search code examples
iosiphonelocationtracking

How can I locate people with a gyroscope and accelerometer?


I want to build an app that locate and track people by iPhone using Gyro+Accelerometer. No need for GPS here.

How should I approach this problem?


Solution

  • You don't!

    The values retrieved from the gyroscope and accelerometer are "relative" to the device. They have no absolute meaning which you would need to retrieve some kind of location.

    You can theoretically measure / calculate what way a device has taken but you do not know if the user took that way in Germany, China or the USA. You know he went right, then left, then 200m straight - but that is not of any help if you do not know from where he originated.

    That being said, if you do have the initial position you can theoretically calculate the new position based on the measured values. But that calculation is probably far to error prone and far to inexact. If you try to measure the values over the course of a few minutes or even hours you will probably get an measurement that is many meters or even kilometers off.