iBeacons的三角剖分示例 [英] Triangulate example for iBeacons

查看:76
本文介绍了iBeacons的三角剖分示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究使用多个iBeacons进行粗略"室内位置定位的可能性.该应用程序是一种博物馆"设置,能够更容易地形成一个网格,该网格具有用于放置不同对象的位置而不是放置单个信标的位置(尽管这可能也不是不可能的).

I am looking into the possibility to use multiple iBeacons to do a 'rough' indoor position location. The application is a kind of 'museum' setting, and it would be easier to be able to form a grid with locations for the different objects then individual beacons (although that might not be impossible too).

是否有使用多个信标进行三角剖分到某个位置的示例,经验或某种逻辑来帮助我自己编写它?

Are there examples, experiences, with using multiple beacons to triangulate into some kind of location, or some logic to help me on the way to write it myself?

推荐答案

我一直在进行一些实验,以使用三个信标获得精确的位置.

I have been making some experiments to get a precise position using three beacons.

三边测量结果

不幸的是,结果在质量方面令人非常失望.主要有两个问题:

Unluckily, the results were very disappointing in terms of quality. There were mainly two issues:

  1. 在不受控制的环境中,您可以找到金属和其他会影响信号的物体,信标的接收信号强度经常变化,因此似乎无法获得5米以下的误差范围.
  2. 根据用户使用接收器设备的方式,读数也会发生很大变化.如果用户将他/她的手放在蓝牙天线上,则该算法将以低信号作为输入,因此信标将被认为距离设备很远.请参阅此图像以查看蓝牙天线的确切位置.
  1. In non-controlled environments, where you can find metals, and other objects that affect the signal, the received signal strength of the beacons changes so often that it seems impossible to get error range below 5 meters.
  2. Depending on the way that the user is handling the receiver device, the readings can change a lot as well. If the user puts his/her hand over the bluetooth antenna, then the algorithm will have low signals as input, and thus the beacons will supposed to be very far from the device. See this image to see the precise location of the Bluetooth antenna.

可能的解决方案

与一位积极劝阻我采用这种方式的苹果工程师交谈之后,我现在更倾向于使用的选项是蛮力.尝试每隔X米设置一个信标(X是系统中允许的最大错误),因此我们可以通过计算网格上哪个信标最接近该设备并假设该信标在该信标网格上跟踪给定设备的位置.该设备位于同一位置.

After talking with an Apple engineer who actively discouraged me to go down this way, the option I feel more inclined to use right now is brute force. Try to set up a beacon every X meters (X being the maximum error tolerated in the system) so we can track on this beacons grid the position of a given device by calculating which beacon on the grid is the closest to the device and assuming that the device is on the same position.

三边测量算法

但是,为了完整起见,我在下面介绍了三边测量算法的核心功能.它基于本文的第3段(已知三个距离").

However, for the sake of completeness, I share below the core function of the trilateration algorithm. It's based on the paragraph 3 ("Three distances known") of this article.

- (CGPoint)getCoordinateWithBeaconA:(CGPoint)a beaconB:(CGPoint)b beaconC:(CGPoint)c distanceA:(CGFloat)dA distanceB:(CGFloat)dB distanceC:(CGFloat)dC {
    CGFloat W, Z, x, y, y2;
    W = dA*dA - dB*dB - a.x*a.x - a.y*a.y + b.x*b.x + b.y*b.y;
    Z = dB*dB - dC*dC - b.x*b.x - b.y*b.y + c.x*c.x + c.y*c.y;

    x = (W*(c.y-b.y) - Z*(b.y-a.y)) / (2 * ((b.x-a.x)*(c.y-b.y) - (c.x-b.x)*(b.y-a.y)));
    y = (W - 2*x*(b.x-a.x)) / (2*(b.y-a.y));
    //y2 is a second measure of y to mitigate errors
    y2 = (Z - 2*x*(c.x-b.x)) / (2*(c.y-b.y));

    y = (y + y2) / 2;
    return CGPointMake(x, y);
}

这篇关于iBeacons的三角剖分示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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