iosaccelerometeruiaccelerometer

is IPad accelerometer normalized to gravity


While porting my Android app to iOS I was confused with one thing, so I want to find out: am I right or mo code works wrong. At Android device accelerometer returns values in physical measure units: m/s2. On ipad i get summary force approximately = 1.0 for still device(and i expect 9.8). My first explanation is that returning value is normalized to 9.8, so I must multiply it with 9.8 to get real force. My second idea - my code is totally wrong, but it's hard to believe.


Solution

  • From the Docs on CMAcceleration:

    CMAcceleration
    The type of a structure containing 3-axis acceleration values.
    
    typedef struct {
          double x;
          double y;
          double z;
    } CMAcceleration;
    

    X-axis acceleration in G's (gravitational force).
    Y-axis acceleration in G's (gravitational force).
    Z-axis acceleration in G's (gravitational force).

    A G is a unit of gravitation force equal to that exerted by the earth’s gravitational field (9.81 m s−2).