Android accelerometer detect height?

我的未来我决定 提交于 2019-12-03 16:58:13

Assuming you mean you want to detect the height the phone was raised from its staring point, yes. The android accelerometer measures force, more info on how to use it can be found here. Keep in mind that the accelerometer isn't a perfect device, and so your results will be approximations of how much the phone was really moved.

The inaccuracy of the accelerometer will be insignificant when compared to the error caused by an unstable accelerometer. What I mean by this is the fact that as you move your phone you will not be able to keep the accelerometer orientated perfectly i.e. you will 'naturally' rotate it about its longitudinal,lateral and azimuth axes. This means that a vertical acceleration will partly be felt in all the above axes and result in an error if you were to just integrate twice the vertical acceleration measurement.

There are ways to eliminate this error which involve gyroscopes but that requires some complicated mathematics and gyros to be fitted in your phone as well.

In theory you can integrate an accelerometer's output but in a real-world device there are practical issues you must overcome.

Yes, bt you need to integrate the output twice and add in the two integration constants - initial velocity and displacement.

Rgds, Martin

First of all you measure Linear acceleration and gravity together (also some noise) So it means when you are using accelerometer you will get Accelerometer Readings = Linear Acc. + Gravity + Noise Here you just only need Linear Acc. but the Accelerometer reads all the values

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!