5

analyzing the deviceMotion.timestamp i saw that the the update frequency set in DeviceMotion is not the actual frequency of update.

I implemented an app in order to test, below what I saw!

    update frequency     actual frequency       average time between two calls
       1/10.000000          10.232265              0.097730
       1/20.000000          19.533729              0.051194
       1/30.000000          30.696613              0.032577
       1/40.000000          42.975122              0.023269
       1/50.000000          53.711000              0.018618
       1/60.000000          53.719106              0.018615
       1/70.000000          71.627016              0.013961
       1/80.000000          71.627263              0.013961
       1/90.000000          53.719365              0.018615
       1/100.000000        107.442667              0.009307
       1/110.000000        107.437022              0.009308

someone has noticed the same thing? it's a bug?

Batti
  • 425
  • 4
  • 15

1 Answers1

1

Some people are reporting the same phenomenon, for example Actual frequency of device motion updates lower than expected, but scales up with setting but there is still no answer. Surprisingly you are the first on to report higher actual frequencies. I did several tests on this and it makes no real difference which way you go.

  • Push or pull i.e. handler callback or own timer loop
  • iOS 4.2x, iOS 4.3x ([Update:]tested with pull only)
  • Raw sensor data or Device Motion
  • Gyroscope or accelerometer
  • Running it in a separate thread

I assume it is a little bug in the Core Motion framework.

Community
  • 1
  • 1
Kay
  • 12,918
  • 4
  • 55
  • 77
  • 1
    i'm using push (i read in the documentation that it's the more accurate method to grab data), iOS 4.3x iPhone4, just in DeviceMotion the actual frequency is different from that set, if i use [CMMotionManager startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) everything works fine, the actual frequency is the same that i set, CoreMotion creates its own thread to: handle raw data from sensors and run device motion algorithms (i'm reading the slides WWDC 2010/2011) – Batti Jul 22 '11 at 09:09
  • Raw Accelerometer Data using push method to grab it. [1/10.000000 9.988813 0.100112] [1/20.000000 19.957865 0.050106] [1/30.000000 29.902478 0.033442] [1/40.000000 39.825712 0.025109] [1/50.000000 49.725514 0.020110] [1/60.000000 59.608615 0.016776] [1/70.000000 69.477139 0.014393] [1/80.000000 79.321895 0.012607] [1/90.000000 88.883474 0.011251] [1/100.000000 98.643989 0.010137] – Batti Jul 22 '11 at 09:56
  • So do understand you right, that you have now solved the problem by using NSOperationQueue? If so I suggest that you edit your question and paste the solution at the end. Thus other can see the solution at first glance. – Kay Jul 22 '11 at 13:36
  • I have not solved the problem, but I tested that the problem is only in DeviceMotion (userAcceleration, attitude, rotationRate, gravity) and not in CMAccelerometerData and CMGyroData – Batti Jul 22 '11 at 14:24
  • Ah I see - sorry for not reading accurately ;) Maybe I didn't had this combination running on iOS 4.3. I am using pull method within own thread to gain more control. Anyway, valuable Information I vote your question up. – Kay Jul 22 '11 at 14:49