Issue
I'm working on an android application which can calculate device's movement in 6 direction. I think I can use acceleration as;
"x=a.t^2" but a is not a constant. And this is the problem. How can I calculate the total movement??
Solution
The accelerometer gives you three directions (x, y, z). They are acceleration measurements which is harder to know what the position of the device is. But, remember acceleration is related to position through integration:
a(t) = a[x]
v(t) = a[x]t + c
x(t) = a[x]t ^ 2 + ct + d
Problem is you can't know c or d because as you take the derivative the constants drop out. So there is some amount you can't get right with c and d missing. You can attempt to compensate by remembering the values you used last for those. So after grabbing 3 samples you can start to calculate position from that.
There is a significant amount of information about how to interpret the data from the sensors. Like figuring out where gravity is for orientation, and subtracting out gravity to get linear acceleration.
http://developer.android.com/reference/android/hardware/SensorEvent.html
Here is a way to come up with position using an accelerometer along with an algorithm for finding position in detail:
https://www.nxp.com/docs/en/application-note/AN3397.pdf
Answered By - chubbsondubs
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.