Shyam Bhat
Shyam Bhat

Reputation: 1600

Detecting the user's spinning motion

I have been experimenting with the Core Motion framework to detect a user spinning around, say on a merry-go-round, holding an iphone in his hand. There are ways to detect the device motion around its own axes, but what is a good way to detect the iPhone spinning in circles? Thanks

Upvotes: 4

Views: 907

Answers (2)

Ali
Ali

Reputation: 58461

There is one degenerate case where you can run into trouble, only magnetometer (compass) can help in that particular case.

If you put the device (a) on the desk in stationary position then (b) on a perfectly horizontal turntable rotating slowly you will get the same qualitative sensor readings. Both the gyro and the accelerometer readings are constant in the two cases, although the readings quantitatively differ. The sad part is: gyro bias error can render case (a) to look like (b) and vice-versa. In this particular case you need a compass to cancel the gyro drift. Case (a) is typical for a phone.

Apart from this degenerate case, gyroscopes and accelerometers with sensor fusion are sufficient to track arbitrary rotations of the device.

Upvotes: 1

flopes
flopes

Reputation: 1355

You can use the gyroscope. Take a look here: Gyroscope example

You have to remind that it is only availble on iPhone4 and iPhone4S.

Upvotes: 1

Related Questions