iPhone - detecting motion with gyroscope/accelerometer
I'm trying to detect a swinging motion with an iPhone 4 using the gyro/accelerometer. I searched for some posts on SO about this, but couldn't find anything specific to my issues.
- Do I need to do any sort of calibration for data from the gyroscope/accelerometer?
- Anyone think of how I would measure a swinging motio开发者_如何学JAVAn?
Thanks!
1: Most iPhone games using the accelerometer don't do any calibration, but not all iphones are the same; there is some variation in accelerometer calibration. You could add a manual or automatic calibration to your program. If however, detecting a swinging motion is all you want, calibration is not necessary.
2: Apple has a nice little app that generates graphs of accelerometer motions in the iPhone SDK. You can download and build that and see the measurements for the motion you want. Then you can write code to detect similar accelerometer measurements.
精彩评论