Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How does one separate the acceleration due to gravity from other motion in accelerometer input?

share|improve this question
up vote 8 down vote accepted

When working on Wii titles, i found that a low pass filter on the accelerometer reading could be used as a reasonable approximation of the gravity vector component. Subtracting this from the real values then left me with a good basis stream for instantaneous gesture analysis. My low pass was around 1hz (just the average of enough packets of data) but tweaked dependent on the gesture being developed.

share|improve this answer
That sounds sensible enough. – drxzcl Aug 17 '10 at 14:06

That really depends on what you are trying to do.

If you are planning to use the accelerometers for navigation (essentially building an inertial navigation device) you need to keep track of which way is down in your integration cycle. If you device is being accellerated with an accelleration equal to g in a lateral direction and you have no measurement history, you have no way of telling which is which.

If you are using the accelerometers as a sort of tilt sensor you can just assume your measurement is gravity, that is your local down vector. Decomposing it along the device's body will yield the orientation.

share|improve this answer

Several techniques only use the difference in acceleration, not the instantaneous value. In those situations, constant acceleration is removed for you.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.