ios - 无法使用 iOS Estimote Indoor SDK 手动创建位置

标签 ios ibeacon estimote indoor-positioning-system

无法手动创建正确的位置 - 它总是显示错误的位置。有人可以告诉我如何正确地做并显示我的代码中哪里有错误的值吗?谢谢。

enter image description here

    ESTLocationBuilder *locationBuilder = [ESTLocationBuilder new];

    [locationBuilder setLocationBoundaryPoints:@[
                                                 [ESTPoint pointWithX:0 y:0],
                                                 [ESTPoint pointWithX:0 y:7.46],
                                                 [ESTPoint pointWithX:7.6 y:7.46],
                                                 [ESTPoint pointWithX:7.6 y:0]
                                                 ]];

    [locationBuilder setLocationOrientation:275];

    [locationBuilder addBeaconIdentifiedByMac:kBeaconMac1
                       atBoundarySegmentIndex:0
                                   inDistance:0
                                     fromSide:ESTLocationBuilderLeftSide];

    [locationBuilder addBeaconIdentifiedByMac:kBeaconMac2
                       atBoundarySegmentIndex:1
                                   inDistance:0
                                     fromSide:ESTLocationBuilderLeftSide];

    [locationBuilder addBeaconIdentifiedByMac:kBeaconMac3
                       atBoundarySegmentIndex:2
                                   inDistance:0
                                     fromSide:ESTLocationBuilderRightSide];

    [locationBuilder addBeaconIdentifiedByMac:kBeaconMac4
                       atBoundarySegmentIndex:3
                                   inDistance:0
                                     fromSide:ESTLocationBuilderRightSide];

    self.location = [locationBuilder build];

最佳答案

您设置点和方向的方式看起来不错。

唯一需要改变的是:

[locationBuilder addBeaconIdentifiedByMac:kBeaconMac1
                       atBoundarySegmentIndex:0
                                   inDistance:0
                                     fromSide:ESTLocationBuilderLeftSide];

这段代码是这样的:

I have a beacon with MAC addreses kBeaconMac1 placed on the first wall (atBoundarySegmentIndex:0), 0 meters (inDistance:0) from the left side of the wall (fromSide:ESTLocationBuilderLeftSide).

“左”或“右”理解为“我在房间中间,正对着墙;左边在我的左边,右边在我的右边”。

“第一堵墙”理解为您在 setLocationBoundaryPoints 中定义的前两点之间的墙。 “第二面墙”位于第二点和第三点之间,“第三面墙”位于第三点和第四点之间,最后的“第四面墙”——第四面和第一面。

看图片,你的信标实际上在墙的中间,所以你想将 inDistance 参数设置为 theWidthOfTheWall/2,即“第一堵墙”,7.46/2 = 3.73。在这种特定情况下,“左”或“右”并不重要。

下面是与图片匹配的代码:

[locationBuilder addBeaconIdentifiedByMac:kBeaconMac1
                   atBoundarySegmentIndex:0
                               inDistance:3.73
                                 fromSide:ESTLocationBuilderLeftSide];

[locationBuilder addBeaconIdentifiedByMac:kBeaconMac2
                   atBoundarySegmentIndex:1
                               inDistance:3.8
                                 fromSide:ESTLocationBuilderLeftSide];

[locationBuilder addBeaconIdentifiedByMac:kBeaconMac3
                   atBoundarySegmentIndex:2
                               inDistance:3.73
                                 fromSide:ESTLocationBuilderRightSide];

[locationBuilder addBeaconIdentifiedByMac:kBeaconMac4
                   atBoundarySegmentIndex:3
                               inDistance:3.8
                                 fromSide:ESTLocationBuilderRightSide];

关于ios - 无法使用 iOS Estimote Indoor SDK 手动创建位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30369615/

相关文章:

ios - 没有调用 didReceiveRemoteNotification,当应用程序被杀死时

php - 将图像从iOS上传到PHP脚本

ios - (NSString *) 它是指针还是 NSString?

bluetooth - iBeacon/低功耗蓝牙(BLE 设备)- 最大信标数量

ios - iBeacon 案例 - 触发具有距离限制的 didEnterRegion

swift - Estimote:将更新间隔更改为 5 Hz

ios - 苹果登录 : How to use it for custom server endpoint authentication?

java - For 循环迭代器类型与我尝试访问的类型不同

ios - 简单 Estimote (iBeacon) Xamarin 示例不工作

android - 是否可以使用 AltBeacon 从属于具体区域的 iBeacon 获取 Major 和 Minor 值?