Calibration code for iphone accelerometer and gyroscope

I am developing an iPhone application that will require accurate calibration for the iPhone accelerometer and gyroscopes. I will have to model the specific movements that I would ultimately want the code to execute. (Think shake or shuffle).

Is there a good way to do this already? or something you can think of? Is it possible to somehow generate a timeline / value of the motion data when it is captured?

+3
source share
2 answers

Movement data - see an example of a sample accelerometer graph that shows real-time data: http://developer.apple.com/library/ios/#samplecode/AccelerometerGraph/Introduction/Intro.html

The data is quite noisy - the gyroscope and accelerometer are not good enough now to track where the phone is in local 3d space, for example. The rotation, however, is very strong, and the orientation of the device can be pretty accurately tracked. You may have better results making gestures from rotation data instead of moving along the axis. Or, a mainstream, such as vibrations along the axis, will work, as Jacob Jennings said.

+1
source

A good starting point for recognizing accelerometer gestures is this Kevin Bomberry tutorial at AblePear: http://blog.ablepear.com/2010/02/iphone-sdk-shake-rattle-roll.html

It sets the threshold threshold value for the absolute acceleration value on any axis. I would generate an “event” for the axis that had the highest acceleration during the threshold break (Z POSITIVE, X NEGATIVE, etc.) and click them on the “event history” queue. At the end of each doneAccelerate call, evaluate the queue for patterns that correspond to the gesture, for example: X POSITIVE, X NEGATIVE, X POSITIVE, X NEGATIVE can be considered a “shake” along this axis. This should provide a couple of different gesture commands.

For a simple queue category that complements NSMutableArray, see the following: How do I create and use a queue in Objective-C?

0
source

Source: https://habr.com/ru/post/915029/


All Articles