计算我拿着手机的高度 [英] Calculate height where my phone is being held

查看:15
本文介绍了计算我拿着手机的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法计算地面和手机之间的高度?我以为我可以使用 accelerometer 来测量高度,但是 这篇文章 建议考虑到不准确率,您不应该使用它.如果是这样,我应该采取什么方法来测量手机的高度?

Is there a way to calculate the height between ground and your phone ? I thought i could use accelerometer to measure height but this post suggest that you should not use it considering the inaccuracy rate. If so what approach should i take to measure the height where my phone is held ?

推荐答案

GPS 的精度足以让您将海拔高度控制在几米之内,但这可能不是您想要的.

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.

我想您可以尝试某种声纳,在您确定手机的麦克风/扬声器通过加速度计直接指向地面之后.您可以假设 STP,这可能会引入大约 20% 的错误.

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.

这篇关于计算我拿着手机的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆