我正在调查是否可能使用多个iBeacons的室内位置定位。我试过了三元制公式。但我认为有一些问题,它没有给出调整的位置。
我有三个iBeacons在一个特定的位置
CGPoint a=CGPointMake(100, 0);
CGPoint b=CGPointMake(160, 270);
CGPoint c=CGPointMake(0, 145);在didRangeBeacons上,我得到了以下距离
float ra =0.0f;
float rb=0.0f ;
float rc=0.0f ;
for (CLBeacon *beacon in beacons) {
if ([beacon.minor floatValue]==57726) {
//ra = beacon.accuracy; ra=5.33124
ra = beacon.proximity;
}
if ([beacon.minor floatValue]==31901) {
// rb = beacon.accuracy; rb=0.185142
rb = beacon.proximity;
}
if ([beacon.minor floatValue]==53482) {
// rc = beacon.accuracy; rc=3.23776
rc = beacon.proximity;
}
}最后,我使用的是三元数公式。
float S = (pow(c.x, 2.) - pow(b.x, 2.) + pow(c.y, 2.) - pow(b.y, 2.) + pow(rb, 2.) - pow(rc, 2.)) / 2.0;
float T = (pow(a.x, 2.) - pow(b.x, 2.) + pow(a.y, 2.) - pow(b.y, 2.) + pow(rb, 2.) - pow(ra, 2.)) / 2.0;
float y = ((T * (b.x - c.x)) - (S * (b.x - a.x))) / (((a.y - b.y) * (b.x - c.x)) - ((c.y - b.y) * (b.x - a.x)));
float x = ((y * (a.y - b.y)) - T) / (b.x - a.x);位置的OutPut
point = (x=138.025452, y=133.269165)但这并不完美。它应该给点靠近点b。我不知道什么是错的。
请帮帮忙。
发布于 2014-06-10 10:19:48
我不确定你能否得到一个非常准确的位置。CLBeacon accuracy property州的苹果文档-
讨论表示一个西格玛的水平精度(以米为单位)。使用此属性对具有相同邻近值的信标进行区分。不要用它来确定信标的精确位置。由于射频干扰,精度值可能会波动。
由于它是一个西格玛的准确性,它只有68%的准确性。
如果你校准信标,你可能会得到更好的结果,但即使这样,来自环境的射频干扰(特别是人)也会影响你的读数。
https://stackoverflow.com/questions/24137846
复制相似问题