What exactly does the iPhone accelerometer measure?

前端 未结 6 822
星月不相逢
星月不相逢 2021-02-14 04:37

The apple documentation for UIAcceleration class says,

\"When a device is laying still with its back on a horizontal surface, each acceleration event has

相关标签:
6条回答
  • 2021-02-14 05:05

    You'll find the best answers in datasheet of the accelerometer used (LIS302DL).

    0 讨论(0)
  • 2021-02-14 05:14

    It measures the gravity. The unit is chosen so that the gravity, 9.81 m/s^2, equals 1 unit. The sign tells how the phone axis is directed. In other words, what the phone considers downwards.

    The phone measures 0 as acceleration in free fall. I don't know how much you want to throw your phone up and down to test it :)

    0 讨论(0)
  • 2021-02-14 05:15

    Answerers keep missing the right wording that should set it straight for you... The device is "laying still" only relatively to you. It is actually not laying still at all. The http://en.wikipedia.org/wiki/Centripetal_force of gravity gives it (and you) centripetal acceleration. It is real, it is what keeps you from flying off Earth on a tangent, and it is what the accelerometer dutifully shows. (Earth is nothing special - we rotate about the Sun also etc etc, whose centripetal accelerations are way smaller, but they would be all shown by an accelerometer sensitive enough.)

    0 讨论(0)
  • 2021-02-14 05:18

    When you're sitting, gravity is pulling you down to your chair. If it weren't for the chair or ground for that matter, you'd be falling down with acceleration of about 9.8m/s^2. In order for the chair to prevent you from falling down, it has to act with a force in the opposite direction with at least the same value.

    The accelometer shows the value of the pulling force and it's a three-dimensional vector. In this case it's directed straight down. And the value given is expressed in G, units of gravity acceleration multiplied by that value.

    0 讨论(0)
  • 2021-02-14 05:19

    You get a -1 on the Z axis because gravity is acting on the device, applying a constant acceleration of 1G. I assume you want user acceleration, which you can get from the DeviceMotion object using a device motion handler as opposed to an acceleration handler. The userAcceleration property filters out the effects of gravity on the device and only gives you how much the user is accelerating it.

    0 讨论(0)
  • 2021-02-14 05:32

    I found the answer [in the CoreMotion Reference guide, thanks to bensnider:

    The accelerometer measures the sum of two acceleration vectors: gravity and user acceleration. User acceleration is the acceleration that the user imparts to the device.

    0 讨论(0)
提交回复
热议问题