update frequency set for deviceMotionUpdateInterval it's the actual frequency?

馋奶兔 提交于 2019-11-30 05:28:07

问题


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?


回答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.



来源:https://stackoverflow.com/questions/6777799/update-frequency-set-for-devicemotionupdateinterval-its-the-actual-frequency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!