且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何测量两个iphone设备之间的距离使用蓝牙?

更新时间:2023-02-01 22:37:32

使用蓝牙进行本地化是一个非常有名的研究领域( ref。)。简单的答案是:你不能。信号强度不是两个连接的蓝牙设备之间的距离的好指标,因为它太受环境条件的制约(设备之间是否有人?如何拥有他/她的设备?有任何RF反射表面?)。使用蓝牙你最多可以获得几米的距离分辨率,但你不能计算方向,甚至不能粗略。



您可以通过使用多个蓝牙设备和三角测量各种信号强度,但即使在这种情况下,很难比估计中的几米更准确。


I'd like to do something in the following using bluetooth.

  1. Measure and display how far my iPhone is from another iPhone.
  2. Display direction of my iPhone.

For example,

I'd like to display something in the following on my iPhone application.

My iPhone is connected to another iPhone:Harry's iPhone.

In this case,

  • Distance : 3m 45.3cm (Accuracy:milimeter)
  • Direction : North East(one of 8 available directions)

Does anyone know how to do this? If I get the answer, that'll be very thankful.

Expect good news.

Thanks.

Using bluetooth for localization is a very well known research field (ref.). The short answer is: you can't. Signal strength isn't a good indicator of distance between two connected bluetooth devices, because it is too much subject to environment condition (is there a person between the devices? How is the owner holding his/her device? Is there a wall? Are there any RF reflecting surfaces?). Using bluetooth you can at best obtain a distance resolution of few meters, but you can't calculate the direction, not even roughly.

You may obtain better results by using multiple bluetooth devices and triangulating the various signal strength, but even in this case it's hard to be more accurate than few meters in your estimates.