track small movements of iphone with no GPS

13,699

If you integrate the acceleration twice you get position but the error is horrible. It is useless in practice.

Here is an explanation why (Google Tech Talk) at 23:20. I highly recommend this video.

I answered a similar question here and here.

Share:
13,699
Ricky Robinson
Author by

Ricky Robinson

Updated on June 04, 2022

Comments

  • Ricky Robinson
    Ricky Robinson almost 2 years

    I have to write an application for iphone that tracks the movement of the iphone itself, given its initial position, without ever using GPS. That is, I can only use data provided by the gyroscope and the accelerometer. The distances I need to measure are rather small and the precision I'm looking for is 40-50cm (~2 feet) at the very most.

    Is this possible? If so, what's the best way to go about it? Also, do you know of any existing (and possibly open source) projects that have implemented this already?

    Thanks a lot!

  • David Seek
    David Seek about 8 years
    @Ali could you explain or give an code example of "integrate the acceleration twice"?
  • Ali
    Ali about 8 years
    @DavidSeek As for an introduction, I would recommend the Rectangle method; this is the simplest way of numerical integration. If you first apply the rectangle method to the acceleration data that you receive from the sensor, you get velocity. If you repeat the same procedure on the velocity just obtained, you get position. It is useless, as already stated in the answer.
  • David Seek
    David Seek about 8 years
    thank you for the hint. but according to this, there must be a possibility... because the app is almost perfectly accurate...
  • Ali
    Ali about 8 years
    @DavidSeek Oh, sure there are other ways of getting the position. In this answer I only claim that you cannot do it with integrating the acceleration twice. The website that you link to tells me how awesome this app is, but nothing about the technical background. I would have to see this app in action; then I could make some educated guesses how it might work.
  • Ali
    Ali about 8 years
    @DavidSeek I am puzzled. Do you have access to his app? Can you try it? There are a bunch of things I would try. What happens if I fully cover both cameras e.g. with a dark tape? How does the camera set the focus when photographing, does it have some infrared sensor for measuring distance? What happens if there no GPS reception in the building? What happens if I touch the walls in random order? What happens if I walk around in the room once every time before touching the wall?
  • David Seek
    David Seek about 8 years
    I have the app and I have tested it today completely. the app doesnt needs the cameras. i have held fingers on it. the gps was unused because I was in a room inside a big building. i have tested it 10 times in the same building in different orders of the walls. backwars. forwars. the variance was between 10-20cm in a 45qm room... so it is pretty awesome... you have to put your phone against a wall for a couple of secs (i guess so one of the sensors has a constant value) and then go from wall to wall. A-B-C-D-A-B done. accurate...
  • Ali
    Ali about 8 years
    @DavidSeek My uncle had a device back in the 1980's which essentially did the same as this app but back then we did not have iPhones. :) That device emitted ultrasound, and calculated distances from the time it took the echo to get back. Of course, as a human, you could not hear anything. An iPhone could probably do the same. You can most likely do something similar with WiFi waves too and measure the distance from the interference. So, there are a bunch of ways of doing it, but I would need to mess with this app to reverse engineer it. Anyway, I am pretty curios how this works.
  • David Seek
    David Seek about 8 years
    @Ali interesting theory with the wifi waves. but just for a try i've put my phone into flight mode and it did the job perfect in my little apartment room. so no wifi. no gps. no gms. no bluetooth.
  • David Seek
    David Seek about 8 years
  • Ali
    Ali about 8 years
    @DavidSeek Thanks for the picture! The device can measure orientation accurately, no surprise there, I implemented that 6 years ago too. However, I have no idea where the position is coming from. Certainly not from integrating the acceleration twice. These were my guesses so far: ultrasound, WiFi signal interference, infrared sensor, GPS, camera. What other sensors does your iPhone have?
  • David Seek
    David Seek about 8 years
    you're very welcome. well, we can for sure exclude Wifi and GPS cause of the flight mode. can't we? infrared? didnt knew the 6S has that. I have an 6S
  • Ali
    Ali about 8 years
    @DavidSeek My camera measures distance with an infrared sensor before taking a picture. This is partly how it sets the focus, and it is a cheap camera, nothing fancy. My guess is that any phone that can take pictures has something similar built-in. Ultrasound is still an option; the iPhone certainly has a mike and can make sounds. But I am puzzled.
  • Ali
    Ali about 8 years
    @DavidSeek I am still wondering how this app works. Is there an strace like tool for iPhone? Maybe these can be useful Frida or Cydia? (I don't know, I have never done iPhone development myself, sorry.) Alternatively, I have a few ideas that might be worth testing, but it would be far better to actually trace that app and figure out what sensors it uses. I am curious.
  • Ali
    Ali about 8 years
    @DavidSeek My guess is that the app is similar to this: Autonomous robotic plane flies indoors at MIT but instead of laser scans, the app uses something else to scan the walls, and that is how it gets distances. So, as I asked in my previous post: Would it be possible to trace somehow what parts (sensors, cameras, mic, speakers, GPS, etc) of the phone that app is using? Alternatively, I could suggest two experiments that would maybe rule out certain possibilities, assuming you are still interested.
  • David Seek
    David Seek about 8 years
    @Ali for firda or cydia i have to jailbreak my phone first? that is not really an option for me... or at least i have to research if it gets me in trouble with the development plan or something like that... but i have an iphone 6S bought cash for 1k€ with 3 years apple care left. don't want to ruin anything. apple is not really fun when it comes to jailbreaks. i will research tomorrow, what possibilies i have to trace what parts are used during the usage or an app. if any i can exclude some of the parts like camera, mic, speaker, GPS etc by covering them or putting the phone to flight again
  • David Seek
    David Seek about 8 years
    and of course I'm still interested. it's almost 12pm over here and sleepy time, but if you want me to try some experiments, just tell me.