Java – Interprets android accelerometer values to get the phone’s translation along axes in the real world

Interprets android accelerometer values to get the phone’s translation along axes in the real world… here is a solution to the problem.

Interprets android accelerometer values to get the phone’s translation along axes in the real world

I did search but couldn’t find an answer; When interpreting android accelerometer values, how do I convert these values into real-world phone translations along the X/Y/Z axis?

I

hope this makes sense – I just can’t understand how we get rid of gravity? Do we need it?

I was thinking that if we took the size of the 3D vector returned by the accelerometer – it would be 9.8 or greater, then we subtract gravity to get the actual acceleration size. However, due to the movement of the phone + the direction of gravity distributed across all 3 axes, will the vector returned by the accelerometer event be inaccurate….

Please help!

Thanks

Solution

Disclaimer: I don’t know any Android details, it may also be phone-specific. I’m just starting with a background in physics.

You need to integrate acceleration to velocity and velocity to displacement (position).

You will suffer from integration drift. Each time an integral is integrated, an integral constant is introduced. Multiple integrations exacerbate this error.

You also need to worry about angular acceleration.
IE。 What happens when the phone rotates but remains in the same physical position?

There are ways to help reduce these sources of error.

If there are multiple accelerometers, you can compare them and try to determine any angular component.

If you have a gyroscope, you can use it to help counteract the angular component.

If the compass is accurate enough, you can try to remove at least the component of the horizontal plane.

GPS can be used to try to eliminate displacement integration errors.
When GPS shows that you have stopped, the integral constant is reset to zero.

You need to start working on numerical integration and filtering algorithms.
Without hardware acceleration, this can be computationally expensive.

At this point, do you really need to start asking yourself, does your problem really require accurate displacement measurements? Is GPS displacement sufficient? Can the same result be achieved just by accelerating?

You should try reading:

http://en.wikipedia.org/wiki/Inertial_navigation_system

Related Problems and Solutions