📜 ⬆️ ⬇️

Indoor navigation - from idea to working prototype


The developers of the internal practice of DataArt "Travel and Hotel Business" represent the internal positioning system and tell us how it is interesting for the industry.

What is an indoor positioning system?

Based on a Wikipedia article, this is a solution for finding objects and people inside a building using radio waves, magnetic fields, acoustic signals, or other sensory information collected using mobile devices. Simply put, using this system, you can determine your location in a large building, using only a special application on your smartphone. For people who do not work in the technical field, it sounds like magic; for those who are lost in airports, shopping centers and other buildings - as a panacea; for developers of hardware and software - as a serious challenge.

Why not use GPS?

Significant disadvantages of GPS are its dependence on signal stability and multipath propagation leading to fatal errors. Of course, you can use GPS repeaters, but this is not a cheap pleasure. Therefore, the positioning system in the interior is an extremely profitable alternative.

Why do we do this

First, this is a new global trend, and no one has yet offered a cheap and easy-to-use product that would meet the requirements of the trend. Therefore, development is a great opportunity to test the strength in this segment.
')
Secondly, we received several requests from companies that need solutions for internal navigation.

Thirdly, it is important and interesting for ourselves. Personally, even after five years spent on higher education and a degree, it is interesting for me to discover something new and solve complex mathematical and technical problems.

Necessary equipment



Modern approaches to solving problems



Main problems

Multipath and attenuation. Indoor navigation systems based on BLE all rely on electromagnetic waves. This can lead either to incorrect readings from beacons that are far away from the user, or to:
  1. Disappearing beacons. Sometimes CoreLocation shows that the range of the beacon is unknown, although a second ago it was listed as the closest.
  2. Intervals in measurement. Unfortunately, it is impossible to change the intervals of measurement and delivery of information, which are registered within CoreLocation (updates go every second).
  3. Mapping engine. All of the above things do not matter if you do not have a working map with metadata. The map is the heart of the navigation application, and the navigation and navigation engines are the brain.


Some technical details of the current implementation

The first problem we encountered is directly related to the map. "What is the problem? - you ask. - MapKit allows you to use custom items. If that doesn't help, use OSM and MapBox. ” Yes, this is true, but if you use MapKit, you end up with a lot of obstacles:



That's why we decided to stick with the CATiledLayer based approach: the map is an image made up of small tiles, and the image has several levels of detail.

The second (and main) problem was, of course, the search for the current location. We tested both trilateration and triangulation in two-dimensional space, but the results were significantly affected by the absence of Z-coordinates. After switching to 3D (each lighthouse has Vx, Vy, Vz coordinates), things went better, but not as much as expected.

After several brainstorming sessions, it was decided to use the normal distribution to simulate the height of the device and switch to the principle of Center of Force. In each iteration, the device calculates the influence vectors of each beacon on the coordinate and applies them to the current position, thus correcting errors. The direct distance to the beacons is calculated using their RSSI values. The only problem in this case is related to the fact that such calculations lack accuracy at small RSSI values ​​due to signal attenuation. This can lead to significant calculation errors.

Perspectives


Despite the fact that the prototype allows to achieve very good results (an approximate error is three meters, which, in general, is enough for airports and shopping centers), we see a lot of things that can be added or improved. Here are some:


Few screenshots





Author: Yaroslav Vorontsov, Senior iOS Developer.

Source: https://habr.com/ru/post/266539/


All Articles