Calculate height where my phone is being held

老子叫甜甜 提交于 2019-12-01 18:43:53

GPS is accurate enough for you to get the elevation to within a few meters, but that's probably not what you're going for.

I suppose you could try some sort of sonar, after you determine that the phone's mic/speaker is pointing straight towards the ground with the accelerometer. You could assume STP, which would probably introduce about 20% error.

You could also tell the user to drop the thing, and use the accelerometer to see how long it falls before hitting the ground. Probably the most precise and accurate. This might use up a lot of phones though.

An accelerometer (and timer) could measure relative height. If you start from the ground you could get an approximation.

If you don't mind it only working once:

Drop it, use the same technique, stop timing after the first impact.

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