如何估计两款Android设备之间的距离? (蓝牙preferred) [英] How to estimate distance between two android devices? (bluetooth preferred)

查看:133
本文介绍了如何估计两款Android设备之间的距离? (蓝牙preferred)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目标是不是有真正的距离。这是简单的东西。
目标是检查其它设备是否是非常非常接近。对或错。比方说10或15厘米接近所以我们的检查是真实的,任何设备上渐行渐远未通过检查,这是错误的。

Target is not to have the real distance. It is something simpler.
Target is to check whether another device is very very close. True or false. Let's say 10 or 15 cms is close so our check is true and any device further away fails the check and it is false.

我的第一个方法是使用API​​的方法 fetchUuidsWithSdp()但是失败了!
延迟似乎是一样的,不管这些设备,其中一对夫妇厘米的距离,或在一个大房间的另一端!

My first approach was to use api's method fetchUuidsWithSdp() but it failed!
Latency seemed the same whether the devices where a couple of cms away or at the other end of a large room!

即使没有蓝牙的任何解决方案是可以接受的。举例来说,我完全不熟悉的无线网络直接P2P 的协议。也许有可能是一些在那里有距离的粗略估计是有用的。

Any solution even without bluetooth is acceptable. For instance, I am totally unfamiliar with the wifi direct p2p protocol. Maybe there could be something in there useful to have a rough estimation of distance.

编辑:我阅读有关接收信号强度指示器( RSSI )。这可用于我们的具体情况下,设备之间的距离的一个粗略估计。但也许可能有东西,以提高精度结合起来。

I am reading about Received Signal Strength Indicator(RSSI). This could be used for our particular case, a rough estimation of distance between devices. But maybe there could be something to combine in order to improve the accuracy.

编辑:我把Ralgha的答案测试。我也建立了连接,并有较小的协议为乒乓设备之一。
当平-pong式是 1个字节的平均潜伏期为22.6000毫秒时非常接近,22.6087毫秒在房间的另一角时。
当平-pong式是 1024字节的平均潜伏期为40.3173毫秒时非常接近,甚至更小,32.3138毫秒,当上了房间的另一角。
毕竟,事实上,延迟不携带距离的任何信息

I put Ralgha's answer to the test. I did established a connection and had a minor protocol to ping-pong among devices.
When ping-ponged with 1 byte average latency was 22.6000 msec when very close and 22.6087 msec when on the other corner of the room.
When ping-ponged with 1024 bytes average latency was 40.3173 msec when very close and even smaller, 32.3138 msec, when on the other corner of the room.
After all, indeed, latency does not carry any information about distance!

谢谢!

推荐答案

您可以测量距离有声

这篇关于如何估计两款Android设备之间的距离? (蓝牙preferred)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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