0

Possible Duplicate:
Android accelerometer accuracy (Inertial navigation)

I am an amateur in android programming and currently designing a game where I need to calculate the distance covered when the user moves his/her device.

I get the value of linear acceleration either from the device or applying High Pass Filter on Accelerometer which is pretty much the same.

The problem I am facing is that even if I keep my device at a STEADY CONDITION where it might form an angle with X, Y and Z. At this time, I get some non zero value of by the Linear Acceleration. Here I am not able to understand that even on keeping my device in an steady condition, why I am getting a non-zero value. Is there a way to apply a filter so that I can make value of linear acceleration zero in the steady condition.

Community
  • 1
  • 1
Varun Gupta
  • 1,349
  • 6
  • 23
  • 51
  • In a word, gravity. Inertial determination of distance requires sensors orders of magnitude better than found on a phone, and even then soon drifts due to double integration of the inevitable error. You also need a 3-axis gyro sensor (rated for angle, not rate) or an external angular reference. – Chris Stratton Nov 24 '12 at 20:34

1 Answers1

0

Say x, y and z are the accelerations you're reading. If you take the value of Math.sqrt(x*x+y*y+z*z), you sould get 9.81 for a steady condition (acceleration of the Earth's gravity). So you can say that the step was made when this value gets equal to 11 or so(needs a little calibration)

Alex Timonin
  • 1,465
  • 11
  • 26