## Device motion detection using Acceleration data.

Nibbie
Posts: 4
Joined: 2011.02
Post: #1
Hello All,

I am developing an app, in which i need to detect device motion for doing different-2 task.

Example:- Suppose we move Device like a (Frisbee Throw)? How we can get this motion occur in Device.

Rocky
Member
Posts: 31
Joined: 2010.02
Post: #2
I assume you are developing an iOS app? If so, check out the UIAccelerometerDelegate protocol reference: http://developer.apple.com/library/ios/#...egate.html

There are links to sample code projects on that page which are also good to check out. You can see exactly how to initialize and use the data given to you by the accelerometer delegate.
Nibbie
Posts: 4
Joined: 2011.02
Post: #3
Thanks Dear... YesÂ i am making iOS app. i already using this (UIAccelerometerDelegate). my problem is how we distinguished between different-2 device motion.

For example we have moved device like a frisbee, and we get x, y, z data in acceleration.

How we calibrate these data for identifying motion?

One idea take some sample motion data in x, y, z as a standard for particular motion and compare it.

But every time we got different data and it's not possible to how to compare these data?

Thanks
Member
Posts: 31
Joined: 2010.02
Post: #4
I think you are going down the right path for detecting motions like a "frisbee-throw."

Like you said, I would sample data for the "ideal" frisbee throw motion. Then use that data to create a array of vectors which define the general shape or spline of the throw motion. Then transform that shape into a common reference frame so that the acceleration values are similar no matter which direction you move your phone during a throw. Now the values will differ a good amount for each throw, but the general shape should be similar. Just find an appropriately large epsilon to compare the throw shapes.

There are a number of ways you can tackle this problem, and this is just the first idea that came to my head.

Another idea would be to utilize the iPhone 4's gyroscope for more accurate data. But, that would limit your audience because it is only available with the iPhone 4. I'd also recommend watching the 'Device Motion' WWDC session if you're a registered apple developer.
Nibbie
Posts: 4
Joined: 2011.02
Post: #5
Thanks, i am trying to get pattern data which can be easily calculate device motion.
I try to draw graphs of value x, y, z. Most of the time graph pattern is same.
Here my problem is how we compare user acceleration data with sample pattern data.

Thanks for help me.