GET iBeacon. Myths and Reality / Sudo Null IT News FREE
(picture from developer.apple.com )
What it is?
In mid-2013, Apple at a conference for developers dead said that they had prepared a new technology premeditated for indoor navigation, that they began to create maps of museums, shopping centers and other interesting places and generally, everything was cool. Having believed the word of a large troupe, many began to advise "solutions" for indoor seafaring, simply few the great unwashe managed something workable. It turned out that in world it is quite difficult to apply this technology.
I also took an active part in engineering science research. Managed to deploy a pharos web at GeekPicnic eventsin Moscow and St. Petersburg Campaign, testing the capabilities of the technology. Aft which I wrote a library, which, using a small number of lighthouses, is quite good at determining indoor locations.
In the article I will shortly account what iBeacon is, what tasks I had to solve with this technology, what was possible, which is not same.
What is iBeacon ? This is a protocol subset of Bluetooth Low Energy that lets you know:
- UUID, Major, Child for beacon
- signal strength from a beacon
It looks like this:
fb0b57a2-8228-44 cd-913a-94a122ba1206 Major 1 Limited 2
You can use iBeacon on iPhones, starting from 4S, iPads, opening from the third generation, iPad Miniskirt, iPod Touch (from the fifth contemporaries), Android support should be sought-after in specific devices, and the OS version should be 4.3 or higher. You bathroom also habituate Macintosh computers.
Rattling-world get
When we considered possible uses of the engineering science, it turned retired very attractively:
- navigation,
- tracking movements (goods, employees),
- security checks
- advertising.
In practice, it clad that everything is non then hastate.
The of import disappointment is that the navigation is extremely inaccurate. In the next department, I will display how to make adequate navigation on beacons, but in gross, beacons are poorly studied for sailing.
Generally, the main algorithmic rule for working with bicones is when a user device approaches it, a notification appears. Immediately I want to catch all the beacons in a row. But, unfortunately, in order to process the presentment, you take to publish the corresponding application and enter the parameters of a specific beacon (or a specific type of beacon, for this, UUIDs are ordinarily used, which are the same for wholly requirement beacons). That is, you put up't just call for information technology and hang it, for example, an advertising beacon indeed that information technology hangs and scribbles all passing. You need to force the applications programme to be installed that listens only to the beacons that it is configured for (it's unrealizable to prepare it to all-all-all, since startMonitoringForRegion will non set aside adding an infinite numeral of regions):
NSString *uuid = @"B9407F30-F5F8-466E-AFF9-25556B57FE6D"; CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:uuid] identifier:[NSString stringWithFormat:@"beacon_%@", uuid]]; region.notifyEntryStateOnDisplay = YES; _locationManager startMonitoringForRegion:region]; [_locationManager startRangingBeaconsInRegion:region];
Sawing is also not easy. The reaction speed of the device (smartphone) is from a second to a couple of minutes. That is, the exploiter can go up past the beacon, walk few minutes, only subsequently that a presentment will appear.
Beacons themselves - break. If you buy a lot of them (and this is around a necessity for almost all utilisation cases), past you have to save, therefore, the beacons fail and they want to be replaced. There is nothing simpler, only after replacement it is necessary to reassign the commensurateness to a taxon data beacon (advertising text, or coordinates). As a final result, development cannot be done only with the application program and beacons. You have to create a server that needs to bread and butter the information reconciled with the bicones, and the application program needs to regularly update the data.
Reversive to tangible utilization. In 2015, two GeekPicnic events took put down, in Capital of the Russian Federation and St. Petersburg. These are outdoor events, which bring in collaboration many different speakers, interesting artifacts, cars, art objects. For two days, the event is accompanied by 25,000 people.
At each event (which takes place in the out-of-doors and in several pavilions) dozens of stimulating objects. Searching for them on the map is not very convenient, indeed information technology was decided to use beacons for their designation and notifications when the user approaches them. I wrote an application for iPhone, my colleagues and so repeated it for Humanoid.
The study scheme itself clad to be approximately arsenic follows:
- bicons are hung all over the event
- the floating application acts as a electronic scanner, notifying the visitor that he has approached an interesting come in
- data on the connection of beacons and texts of gripping places is stored happening the server and updated in the flying application when they butt (there are a good deal of visitors and communication with the server directly at the event is not very)
In ordination to avoid "bounce" and a large number of notifications, data was stored for all the beacons roughly and the nearest one was located, and it should personify "considerably closest", while several beacons are at roughly the same distance, the notification does non pass.
I also had to solve the problem of energy ingestion. To prevent navigation from turn on immediately after installing the lotion, firstly, beacon scanning was turned connected only on certain years, and secondly, only in a bound area (within a radius of several kilometers from the venue). It was funny to test both of these conditions, I had to drive a car with debugging turned along, observance the activity of the smartphone (moreover, in different states, active, sleep mode).
As a result, everything worked out, and my colleagues and I got invaluable experience in implementing a large task victimization beacons.
Indoor seafaring
Rent's advance to the technique. When people talk of the town about navigation, they usually mean determination a location by a distance to various points (this is how GPS works, triangulating a location on cell towers and this is exactly what movies usually say). The algorithm is simple:
- we have intercourse where several reference beacons are located. This outer, towers or bicones - it doesn't matter. Most importantly, points must be defined, and fairly accurately.
- someway we determine the distance to at to the lowest degree three points. In the real life, three is not enough, they examine to use of goods and services more. The accuracy of these calculations also depends on the accuracy of these distances.
- at these distances, the emplacemen of the receiving system (user) is calculated.
Everyone who tried to do this with bicones cursorily realized the futility of the estimation. The location of the beacons can be measured accurately, but the distance to them is measured by the magnate of the beacon signal. This might is real dependent on tune imperativeness, humidness, the presence of various obstacles (including people and other animals). Very - this way several times. Of course, software tries to smooth this out past applying filters and various algorithms, but this is not important. The algorithm in such conditions, in fact, does not work (produces extremely inaccurate results).
Thought process a itsy-bitsy, I remembered that there is another option. Unlike the "normal" algorithm, it does non devote the exact location of the user, but rather shows in which field it is located. Simply for indoor locations this is often enough.
The algorithm is called fingerprinting, fingermark position. In general, information technology looks wish this:
- we format the beacons for some reason "adequately",
- we run around the elbow room, remembering what the picture looks like on beacons (which are stronger, which are weaker), taking "prints" of the fancy of beacons in different places.
- subsequently the fingerprints are taken, the user moves and the smartphone compares the current fingermark with those in his memory. Having selected the closest similar one, we realise in which area the user is placed.
Ready for the algorithmic program to employment successfully, I had to tinker. Simply the termination was very good.
An incomprehensible moment was how to preserve prints. Capacities cannot be directly (they drift a lot). I tried the proportional power, IT sour out much better.
Power swimming is noticeable even if you just twist in one place. We stand, turn away, and the show changes dramatically. Thus, I began to take several prints, erect in unitary place. The prints themselves were A follows:
@property (nonatomic) NSString *uuid; @property (nonatomic) CLBeaconMajorValue major; @property (nonatomic) CLBeaconMajorValue minor; @attribute (nonatomic) CGFloat relativeDistance; // 0-1 (normalized by the powerful) @property (nonatomic) CGFloat relativePowerDispersion; // 0-1 (normalized by the most powerful)
I took these parameters for each overt beacon at a given point, and all the parameters for all beacons became an embossment.
I also wanted, course, that the point on the correspondenc did not just jump, but impress around the map. To do this, I had to interpolate the fingermark, understanding between which areas / points the user is, and, of course, filter the resulting result. The distance betwixt the current fingerprint and the fingerprints of the regions was calculated something like this:
for (Fingermark *f in in _regions[regionName].fingerprints) { CGFloat newDistance = [f normalizedDistanceToFingerprint:aBeaconsFingerprint]; CGFloat distance = (CGFloat) (result[regionName] == nil ? FLT_MAX : [result[regionName] doubleValue]); aloofness = MIN(newDistance, distance); result[regionName] = @(distance); }
And, in fact, the very distance between the prints, like this:
- (CGFloat)normalizedDistanceToFingerprint:(NSMutableDictionary *)aBeaconsFingerprint { // if we do non have a beacon in domain fingerprint — add DISTANCE_PENALTY_FOR_ABSENT_BEACON // if we do not have any beacons, result is "FLT_MAX" CGFloat result = 0; BOOL resultIsNotInfinite = No; NSArray *regionBeaconIds = [_beaconsFingerprint allKeys]; NSArray *testingBeaconIds = [aBeaconsFingerprint allKeys]; for (NSString *beaconId in regionBeaconIds) { if (![testingBeaconIds containsObject:beaconId]) { result += DISTANCE_PENALTY_FOR_ABSENT_BEACON; } other { termination += fabs( fabs(((Fingermark *) _beaconsFingerprint[beaconId]).relativeDistance) - fabs([aBeaconsFingerprint[beaconId] doubleValue])); resultIsNotInfinite = YES; } } for (NSString *testingBeaconId in testingBeaconIds) { if (![regionBeaconIds containsObject:testingBeaconId]) { result += DISTANCE_PENALTY_FOR_ABSENT_BEACON; } } take resultIsNotInfinite ? resultant role : FLT_MAX; }
IT turned out very asymptomatic. This solution will require you to reckon a organisation for replacing a failed beacon (retaking all prints is a bad decision, it can take a lot of clock time). And if there are a sufficient number of aptly placed bicones (it is best to hang them closer to the ceiling, for example, only this is not the only recommendation) - and the accuracy is good (± a couple of meters).
conclusions
Now the bombilation around iBeacon technology has subsided. Simply the tasks have not done for aside. Interior navigation is even obligatory. Still demand the opportunity to inform visitors of the store about new products. And at once you can do this not only with advertizing banners, but also with such beacons.
Of course, their actual use is not so unequivocal, and many tasks need to be solved so that everything works as it should. The briny conclusion of much a year of working with technology is that, with certain reservations, it is viable. And then you need to look after at whether it is suitable for a particular application or not. Unfortunately, the silver bullet hasn't worked impermissible yet.
DOWNLOAD HERE
GET iBeacon. Myths and Reality / Sudo Null IT News FREE
Posted by: gillianflery1969.blogspot.com
0 Response to "GET iBeacon. Myths and Reality / Sudo Null IT News FREE"
Post a Comment