Search code examples
iosswiftcore-motion

Detect if iPhone thrown in air using core motion


I'm trying to detect if my iPhone has been thrown into the air.
I've tried using core motion's acceleration API and its altitude API.

However, because the axes are fixed to the phone doing the detection of the changes is incredibly difficult.

Is there a better way to do what I want?
Is it possible to speed up the refresh rate of the CMAltitude API?


Solution

  • In freefall, you should see your 3 accelerometer values go to 0. Even in a projectile type of fall (throwing), the phone is in freefall as soon as it leaves the thrower's hand.

    This white paper talks about using a MCU, but the concept is there. http://www.nxp.com/files/sensors/doc/app_note/AN3151.pdF