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?
To identify each iBeacon, an iBeacon is identified using three numbers: Proximity UUID (16-bytes), Major (2 bytes), and Minor (2 bytes) (see Figure 1). Figure 1: Three numbers are used to identify an iBeacon . The assignment of these three numbers is totally up to the implementers.
iBeacon is just a Bluetooth protocol whereas beacon is a common name for a device that transmits iBeacon or Eddystone protocols. iBeacon does not collect any data - it is a protocol received by mobile apps that can with a user consent track certain information.
2-Dimensional triangulation 2-D triangulation uses relative location information to measure the location of a desired user. 2-D triangulation is a key technology in 2-D positioning system because it calculates the location based on (x, y) coordinates which are the important factor in 2-D positioning system.
Go to Settings in the app menu. Tap on iBeacons. Select your iBeacon (If there is more than one in the area, you can identify yours using the 4-digit code on its side) If you have more than one vehicle in the app, choose the one you'll use the iBeacon for from the dropdown menu.
I have been making some experiments to get a precise position using three beacons.
Results of trilateration
Unluckily, the results were very disappointing in terms of quality. There were mainly two issues:
Possible solutions
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.
Trilateration algorithm
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); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With