Device motion detection using Acceleration data. - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Device motion detection using Acceleration data. (/thread-8632.html)
Device motion detection using Acceleration data. - RockyDilse - Feb 11, 2011 05:28 AM
I am developing an app, in which i need to detect device motion for doing different-2 task.
Could you please help any one how we got it using acceleration values?
Example:- Suppose we move Device like a (Frisbee Throw)? How we can get this motion occur in Device.
Please*help me anyone..
Thanks in Advance
RE: Device motion detection using Acceleration data. - Macmenace - Feb 13, 2011 06:23 PM
I assume you are developing an iOS app? If so, check out the UIAccelerometerDelegate protocol reference: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIAccelerometerDelegate_Protocol/UIAccelerometerDelegate/UIAccelerometerDelegate.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.
RE: Device motion detection using Acceleration data. - RockyDilse - Feb 13, 2011 10:46 PM
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?
Please help me....
RE: Device motion detection using Acceleration data. - Macmenace - Feb 15, 2011 12:09 PM
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.
RE: Device motion detection using Acceleration data. - RockyDilse - Feb 16, 2011 12:57 AM
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.