无线位置三角位置

2023-09-11 01:50:14 作者:共眼前无憾

我需要了解如何无线上网的三角测量基本工作原理。场景是如被刻画在上面的图。序实现无线三角,我需要至少3 WiFi热点和它们的位置。该设置: 1.为了简单起见,我们假设我有一个 1平方千米1平方千米区,而我在这方面有3个WiFi热点。坐标系如下:1角的平方面积是(0,0,0),和对角最远角落将具有坐标(1,1,1)。所有的位置确定是独自完成相对于这个坐标系(为简单起见,我不希望全球XYZ坐标)。在此,我有3个WiFi热点,在(X1,Y1,Z1),(X2,Y2,Z2),(X3,Y3,Z3)。 2。我们有一个人能够接收无线信号,并计算信号强度的位置(X,Y,Z)的装置。该设备可以是手机,平板电脑等 的问题:动态计算的人的位置(X,Y,Z),因为他们走动时,你现在有以下输入:< BR> 1。信号的信号强度从每一个WiFi热点 2的好评。在WiFi热点$ P $的坐标pviously存储在变量或数据库 第一个问题:如何计算从上面的投入持何立场?我认为信号强度成正比,从路由器的距离,但有什么确切的关系?如何的Skyhook 做到这一点,以便准确地 第二个问题:我认为上述的输入就足够了。有没有别的什么要求?_爱谢谢!

I need to understand how Wifi triangulation basically works. The scene is as portrayed in above diagram. Inorder to implement wifi triangulation, I need a minimum of 3 Wifi hotspots and their positions. The setup: 1. For simplicity, let's assume I have a 1 sq-Km by 1 sq-Km area, and I have 3 Wifi hotspots in this area. The coordinate system is as follows: 1 corner of the square area is (0,0,0), and the diagonally furthest corner will have coordinates (1,1,1). All position determination is to be done relative to this coordinate system alone (for simplicity, I don't want global xyz coordinates). Within this, I have 3 wifi hotspots at (x1,y1,z1) , (x2,y2,z2), (x3,y3,z3).2. We have a person with a device capable of receiving wifi signals and calculating the strength of the signal at position (x,y,z). The device could be a phone, a tablet etc.The problem: Calculate position (x,y,z) of the person dynamically, as they move around when you now have following inputs:1. Signal strength of signals received from each of the wifi hotspots2. Coordinates of the wifi hotspots previously stored in variables or a database. First Question: How do I calculate position from above inputs? I assume signal strength is directly proportional to distance from router, but what's the exact relation? How does Skyhook do this so accurately?Second Question: I believe the above inputs are sufficient. Is there anything else required? Thanks!

推荐答案

这是pretty的方便。这只是一些基本的数学。把它分解成两部分:

This is pretty easy. It's just some basic maths. Break it down into 2 parts:

1)寻找你的水平位置(不高)。

1) Finding your horizontal location (no height).

要找到你的位置,你需要3分,但只注重2分第二。通过使用2点,你可以创建自己一个三角形,您的位置基于两个点之间的信号强度找到。这会找出你在两个路由器之间。举例来说,如果你在路由器3和4,和你的信号强度之间的比较,以3为-89,你的信号强度4是-54,你知道,你比你要4更接近3。如果你距离VS信号强度的近似值,你能拿出你身在何处路由器3和4遗留那么问题之间的pretty的准确读取,是决定你在两者之间哪一方图3和4中,由于可以有相同的信号强度值(-89,-54)高于或低于路由器(看图)

To find your location, you need 3 points, but just focus on 2 points for a second. by using 2 points, you can create a triangle with yourself, and find your location based on your signal strength between two points. This will find out where you are in between two routers. For instance, if you're in between routers 3 and 4, and your signal strength in comparison to 3 is -89 and your signal strength to 4 is -54, you know that you're closer to 3 than you are to 4. If you do an approximation of distance vs signal strength, you can come up with a pretty accurate read of where you are in between routers 3 and 4. The problem left over then, is determining which side you're on in between 3 and 4, since you could have the same signal strength values (-89, -54) either above or below the routers (look at diagram)

           6

   You could be here

3--------------------------4

  You could also be here

            5

然后,只需找到另一台路由器,并注意你的信号强度。你应该能够确定你是在pretty的哪一面轻松地将采取一起来看看5和6路由器之间的信号强度的关系(图中)。

Then just find another router, and notice your signal strength. You should be able to determine which side you're on pretty easily just by taking a look at signal strength relationships between 5 and 6 routers (in the diagram).

2)你可以做同样的事情的高度。

2) You can do the same thing with height.

要做到以上,你真的只需要距离VS信号强度的近似,与路由器之间的距离。从我的测试(我写我自己的WiFi三角code),信号强度在移动设备pretty的统一,使一台设备应该有它旁边的相同的结果设备。

To do all of the above, you really only need an approximation of distance vs signal strength, and the distances between the routers. From my testing (I wrote my own WiFi triangulation code), the signal strength is pretty uniform across mobile devices, so one device should have the same results as the device next to it.

天钩做到这一点,我认为无论是通过GPS定位(这可能是很难codeD),或基本相同的原则,因为这。天棚是苹果认可这一点,因此苹果基本上做同样的事情,然后确信其他应用程序无法使用它(任何iPhone应用程序,使用受限80211库,它包含的功能,为了做到这一点意志的唯一服务可以从App Store拒绝)。

skyhook does this I think either through GPS positioning (it might be hard coded in), or basically the same principle as this. Skyhook is the only service that is apple approved for this, so Apple basically did this same thing and then made sure other apps couldn't use it (any iPhone app that uses the restricted 80211 library that contains the functions in order to do this will be denied from the app store).

编辑:如何找到距离:

您需要做一些简单的近似。这些近似不会完全取决于你的环境是相同的,所以-89脚可能意味着你15英尺距离路由器3,但-89从路由器4可能意味着你13英尺了。不管你做什么,这不会是100%准确,但是没关系,因为你可以在5站得起来了肯定。

You need to do some simple approximations. These approximations will not be all the same depending on your environment, so -89 feet might mean you're 15 feet away from Router 3, but -89 from router 4 might mean you're 13 feet away. No matter what you do, this isn't going to be 100 percent accurate, but that's okay, because you can get within 5 feet for sure.

让你做什么,你是找一堆,你得到-89阅读从路由器3,你记下你的距离为点。然后,你取一个平均值,并且使用这个平均放下你的数据库(它说当你从路由器3是-89,你是15英尺)。然后,你这样做对其他的值,比如-50或什么的,你记下你的价值观,并找到一个平均值。现在,如果-89意味着你15英尺路程,-50意味着你25英尺远(只是一个例子),你必须接近你的距离,当你从路由器3是-75,除非你想要去得到一个近似值由专人为-75。这将是繁琐吨的价值观,但你不得不尝试着去看看你如何准确是用尽可能少的数据点,你可以得到。您可以通过认识到的信号强度是对数的两条信号强度平均值之间的接近,这样你就可以估算,自-89长15英尺,然后-75将是对数(基数为10或基地2个,我不记得了,但我由100分之14一个因素倾向于基数为10)远于-89。

so what you do is you find a bunch of points where you get a reading from -89 from router 3, and you jot down what your distance was. Then, you take an average, and you use this average to put down in your database (which says when you're -89 from router 3, you're 15 feet). You then do this for other values, like -50 or whatever, and you jot down your values and find an average. Now, if -89 means you're 15 feet away, and -50 means you're 25 feet away (just an example), you have to approximate your distance when you're -75 from router 3 unless you want to go get an approximation by hand for -75. This would be cumbersome for tons of values, but you'll have to experiment to see how accurate you can be with as few data points as you can get. You can approximate between two signal strength averages by realizing that signal strength is logarithmic, so you can estimate that since -89 is 15 feet, then -75 would be logarithmically (base 10 or base 2, I can't remember but I'm leaning towards base 10) further away than -89 by a factor of 14/100.

编辑:问计code

我有code的地方,但它是一个几年前,我不得不通过大量的东西挖找到它。我认为,从概念上讲,它应该很容易,而不code复制。我花了大约50行Java code为Android设备我测试。

I have the code somewhere, but it was a couple years ago so I'd have to dig through a lot of stuff to find it. I think conceptually, it should be easy to replicate without code. It took me about 50 lines of java code for the android devices I was testing.

基本上我花了一个android手机,并创建了一个应用程序,它可以让我随时显示连接的WiFi设备,它的信号强度,附近的其他无线网络ID和它们的信号强度,然后GPS定位的电流ID。这是通过Android的API的所有访问。我认为你需要的API 4或更高,一些Android设备。这就像3或4年前,所以我刚才扔了这一点,从我记得。

Essentially I took an android phone and created an application that allows me to at any moment display the current ID of the connected wifi device, its signal strength, other nearby wifi ID's and their signal strength, and then GPS location. This is all accessible through android's api. I think you need an android device on API 4 or higher or something. This was like 3 or 4 years ago so I'm just throwing this out from what I remember.

GPS定位部分是使身体和WiFi强度之间的映射更容易,而不必以其他方式创建我工厂的蓝图地图,我可能只是谷歌地图的,因为在同一时间做对我来说我可以覆盖他们的地图和GPS坐标的基本上,在创建距离图。你仍然需要一个深度图映射楼层不过,我们可以通过手工pretty的做很容易被发现,如果你在两台路由器的中间。我们知道,信号强度最强,以无线集线器在同一层楼,然后就可以仔细检查,通过确保您有较弱的信号在不同的楼层无线集线器。这个深度图基本上是无线集线器,和它们各自的楼层的列表。我们不需要他们的位置,因为我们可以最适合的信号强度,我们周围的工厂走,抓住信号强度一定的轮毂时抓住了GPS位置。这是一些简单的数学。因此,对于2D平面位置上,低头从上面,我们有一大堆的对象,像这样的:

The GPS location part was to make the mapping between physical and wifi strength easier, rather than having to create a blueprint map of my facility in some other way, I could just have google maps do it for me at the same time since I can overlay their map and the GPS coordinates essentially, while creating the distance map. You'd still need a depth map to map floor levels though, which we can do by hand pretty easily by finding if you're in the middle of two routers. We know that signal strength is strongest to wifi hubs on the same floor, and then can double check by making sure you have weaker signals to wifi hubs on different floors. This depth map is essentially a list of wifi hubs, and their respective floors. We do not need their positions, since we can best fit the signal strength to the GPS locations we grabbed when walking around the facility and grabbing the signal strength to certain hubs. This is some simple math. So for 2D plane position, looking down from the top, we have a bunch objects like such:

BestFitObject{
   Tuple<long, long> GPSLocation;
   List<Tuple<WifiDevice, signedInt>> WifiReadings; //WifiDeviceName(through UUID or some other way), tupled with the signalStrength when that bestFit reading was taken
}

WifiDevice{
   UUID ID; //Think a string should work fine, might be an internal type that encompasses UUID which woudl be better.
   int floorNumber;
   Tuple<long, long> GPSLocation; //Not entirely necessary, could provide better accuracy though
}

然后当我们ping客户端设备,并希望以最适合它,它会返回一个对象是这样的:

And then when we ping the client device and want to best fit it, it returns an object like this:

ClientPosition{
   List<Tuple<UUID, signedIt> NearbySignals; //Tuple of the UUID of the wifi device and the signal strength taken during the time of the ping.  
}

然后我们就可以很容易地最适合我们的ClientPosition来,我们与上述两个对象创建的2D地图。

Then we can easily best fit our ClientPosition to the 2D map that we created with the above two objects.

以上是pretty的简单,深度图就更简单了在我看来。

The above is pretty simple, and the depth map is even simpler In my opinion.

在理想情况下,你会想尝试打,涵盖了几个不同的无线技术人员几个不同的设备(有的一设备,一些B设备,N,G等)只是为了得到更准确的结果。我发现虽然是精度不是什么大不了的事,你会在5英尺左右。这是我的需求不够准确。理想情况下,所有的无线集线器是相同的模型,他们通常是在大型设备/公司,但即使这样,它不是什么大不了的事。变异是如此之小,如果你不需要疯狂的准确性,都不会有问题。

Ideally, you'd want to try and hit a couple different devices that encompass a couple different wireless techs (some a devices, some b devices, n, g etc) just to get more accurate results. What I found though, was that accuracy isn't that big of a deal, and you'll be within 5 feet or so. That was accurate enough for my needs. Ideally, all the wifi hubs are the same model, and they usually are in large facilities/companies, but even then, its not that big of a deal. The variability is so small, and if you don't need crazy accuracy, it won't matter.