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

时间:2021-03-15 18:53:12

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

我想在下面使用蓝牙做一些事情。

  1. Measure and display how far my iPhone is from another iPhone.
  2. 测量并显示我的iPhone与另一部iPhone的距离。
  3. Display direction of my iPhone.
  4. 显示我的iPhone的方向。

For example,

例如,

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

我想在我的iPhone应用程序中显示以下内容。

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

我的iPhone连接到另一部iPhone:Harry的iPhone。

In this case,

在这种情况下,

  • Distance : 3m 45.3cm (Accuracy:milimeter)
  • 距离:3米45.3厘米(精度:毫米)
  • Direction : North East(one of 8 available directions)
  • 方向:东北(8个可用方向之一)

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

有谁知道如何做到这一点?如果我得到答案,那将非常感激。

Expect good news.

期待好消息。

Thanks.

谢谢。

7 个解决方案

#1


33  

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.

您可以通过使用多个蓝牙设备并对各种信号强度进行三角测量来获得更好的结果,但即使在这种情况下,您的估算中也很难比精确到几米。

#2


7  

You could use sound and knowledge of speed sound to calculate the distance between the iphones.

您可以使用声音和速度声音知识来计算iphone之间的距离。

#3


6  

In iOS7 Apple introduced iBeacons. This will give you the distance between 1 phone and another. It is simple to setup, check out the WWDC sample AirLocate.

在iOS7中,Apple推出了iBeacons。这将为您提供1部电话与另一部电话之间的距离。设置简单,查看WWDC样本AirLocate。

#4


4  

You can't do this with bluetooth. You could meassure the distance between two BT devices by analysing the BT reception quality - but this will strongly differ in every new environment (e.g. simply a new room or in the open air). For direction: here is exactly the same problem, especially inside buildings. A lot of BT signal echos will make it almost impossible to receive useful direction data. There are ways to determine distance and directions via wireless connections (doesn't matter if BT, WLAN or ZigBee or something else) - not with standard customer devices, but with real-hitech laboratory equipment.

你无法用蓝牙做到这一点。您可以通过分析BT接收质量来确保两个BT设备之间的距离 - 但这在每个新环境(例如,仅仅是新房间或露天)中都会有很大差异。方向:这里是完全相同的问题,特别是在建筑物内部。很多BT信号回声将几乎不可能接收有用的方向数据。有多种方法可以通过无线连接确定距离和方向(无论是BT,WLAN还是ZigBee等) - 不是标准的客户设备,而是真实的实验室设备。

#5


2  

found this insightful and helpful:

发现这有见地,有帮助:

http://www.youtube.com/watch?v=dMWEl6GBGqk

http://www.youtube.com/watch?v=dMWEl6GBGqk

#6


0  

For direction, you would have to hold the phone away from you and spin in a circle allowing the phone to measure the increase/decrease in signal strength. Not sure how good the iPhone signal reception will be.

对于方向,您必须将手机远离您并旋转一圈,以便手机测量信号强度的增加/减少。不确定iPhone信号接收有多好。

You could estimate the distance by looking at the signal receive strength. You will have to perform many tests, in different environments in order to get some half decent metrics to use within your app.

您可以通过查看信号接收强度来估计距离。您将不得不在不同的环境中执行许多测试,以便在您的应用程序中使用一些相当不错的指标。

#7


-1  

As what Giuseppe Cardone has mentioned, using the signal strength wont work. However, I would suggest requesting the location information of the other device (let's say that, you install an app on the other device that replies to location requests.). Once you get the location information from the other device you may compare it with your device's location and calculate the distance and the direction.

正如Giuseppe Cardone提到的那样,使用信号强度不会起作用。但是,我建议请求其他设备的位置信息(假设您在另一台设备上安装了回复位置请求的应用程序)。从其他设备获取位置信息后,您可以将其与设备的位置进行比较,并计算距离和方向。

#1


33  

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.

您可以通过使用多个蓝牙设备并对各种信号强度进行三角测量来获得更好的结果,但即使在这种情况下,您的估算中也很难比精确到几米。

#2


7  

You could use sound and knowledge of speed sound to calculate the distance between the iphones.

您可以使用声音和速度声音知识来计算iphone之间的距离。

#3


6  

In iOS7 Apple introduced iBeacons. This will give you the distance between 1 phone and another. It is simple to setup, check out the WWDC sample AirLocate.

在iOS7中,Apple推出了iBeacons。这将为您提供1部电话与另一部电话之间的距离。设置简单,查看WWDC样本AirLocate。

#4


4  

You can't do this with bluetooth. You could meassure the distance between two BT devices by analysing the BT reception quality - but this will strongly differ in every new environment (e.g. simply a new room or in the open air). For direction: here is exactly the same problem, especially inside buildings. A lot of BT signal echos will make it almost impossible to receive useful direction data. There are ways to determine distance and directions via wireless connections (doesn't matter if BT, WLAN or ZigBee or something else) - not with standard customer devices, but with real-hitech laboratory equipment.

你无法用蓝牙做到这一点。您可以通过分析BT接收质量来确保两个BT设备之间的距离 - 但这在每个新环境(例如,仅仅是新房间或露天)中都会有很大差异。方向:这里是完全相同的问题,特别是在建筑物内部。很多BT信号回声将几乎不可能接收有用的方向数据。有多种方法可以通过无线连接确定距离和方向(无论是BT,WLAN还是ZigBee等) - 不是标准的客户设备,而是真实的实验室设备。

#5


2  

found this insightful and helpful:

发现这有见地,有帮助:

http://www.youtube.com/watch?v=dMWEl6GBGqk

http://www.youtube.com/watch?v=dMWEl6GBGqk

#6


0  

For direction, you would have to hold the phone away from you and spin in a circle allowing the phone to measure the increase/decrease in signal strength. Not sure how good the iPhone signal reception will be.

对于方向,您必须将手机远离您并旋转一圈,以便手机测量信号强度的增加/减少。不确定iPhone信号接收有多好。

You could estimate the distance by looking at the signal receive strength. You will have to perform many tests, in different environments in order to get some half decent metrics to use within your app.

您可以通过查看信号接收强度来估计距离。您将不得不在不同的环境中执行许多测试,以便在您的应用程序中使用一些相当不错的指标。

#7


-1  

As what Giuseppe Cardone has mentioned, using the signal strength wont work. However, I would suggest requesting the location information of the other device (let's say that, you install an app on the other device that replies to location requests.). Once you get the location information from the other device you may compare it with your device's location and calculate the distance and the direction.

正如Giuseppe Cardone提到的那样,使用信号强度不会起作用。但是,我建议请求其他设备的位置信息(假设您在另一台设备上安装了回复位置请求的应用程序)。从其他设备获取位置信息后,您可以将其与设备的位置进行比较,并计算距离和方向。