I am playing with the gyro on iPhone 4, although I am settin开发者_StackOverflowg the gyro update rate to 100Hz
motionManager.gyroUpdateInterval = 0.01;
Despite that I seem to be getting the updates only with 50Hz.
Does anyone have experience with that and can either confirm that number or maybe tell me what the official update frequency is?
Cheers Esden
The ST chipsets used in iPhone are capable of 1KHz for Accel and 800Hz for Gyro, in theory you may be able to get that..
Since iOS 4.2 you can run the gyroscope with 100 Hz - I am pretty sure as I checked it from my sampled input data.
Some time ago I filed a bug related to previous iOS version (4.0x or 4.1x?) preventing the timestamp from being updated. But now this was fixed and data is delivered correctly.
EDIT: I was wrong (little bug when measuring). 76Hz is maximum on Core Motion and I don't kno why. While this seems to be enough for me, it is a little bit annoying.
EDIT(2): Using raw gyro data I get 58 Hz and sometimes a notable delay (> 1/f) between accelerometer and gyroscope data :-(
Are you doing anything in the UI run loop, updating some text or label for instance, that could take around 0.01 seconds or more before the UI run loop is completely idle again? That could block accelerometer or gyroscope updates, that is if any more data is available.
Event Handling Guide for iOS: Motion Events
精彩评论