Ubica: An Indoor Positioning System

Ubica (it locates) is another part of Jura and its function is to locate BLE beacons


Ubicar is the Spanish word of the verb “to locate“. The translation of ubica in English is “it locates“. Ubica is another part of Jura and its function is to locate BLE beacons, hereinafter beacons. Properly speaking, Ubica is a Kura’s plug-in, iot.challenge.jura.ubica, which is able to use Faro MQTT’s detection messages for positioning beacons indoors.

Ubica provides three services for positioning, iot.challenge.jura.ubica.installation, iot.challenge.jura.ubica.location and iot.challenge.jura.ubica.positioning. It also provides an experimental service to simulate scans in order to test the previous ones, iot.challenge.jura.ubica.simulation.


It allows defining the installations in which we are going to position. An installation is defined by a set of points (in millimetres) and a set of scanners located in it. Our approach is that a scanner does not belong to any installation, being the installations the ones which decide if a given scanner is in it and where. The reason is simple, a scanner can be used at the same time in multiple facilities (overlapping rooms, delimited areas, etc).

An example of installations might be as follows:

  "id":"room 01",

The service is subscribed to the MQTT topic of beacon’s scans and it is responsible for ‘distributing’ them by installations. Its information can be obtained using MQTT (<application.topic>/<installation.prefix>/<installation.id>/<scanner.addr>) or with query functions (all events, events in a time window, etc).

Service configuration


The following configuration options are available:

  • Installations JSON: Definition of the installations in JSON format. The option is validated internally to remove incorrect definitions.
  • Application topic: MQTT’s application topic.
  • Installations’ topic: Prefix for installations’ topic.
  • Scanners’ topic: Prefix for scanners’ topic. The detections are read from this topic.
  • MQTT publish: Enables or disables the MQTT publication of scans per installation.
  • Retention time: Events’ retention time. Expired events are eliminated by a garbage collector.


It allows positioning beacons signals using several trilateration algorithms. Although it is the cornerstone of the IPS, its implementation is not complex since we use mathematical methods which are already developed. Moreover, the service only provides a function, position, which given the id of an installation, a list of scanners identifiers and a list of scans of these scanners it returns a point in the installation.

As we say, the credit goes to the community, we ‘only’ have connected the dots. We use:

Service configuration


The following configuration options are available:

  • Least-squares algorithm: Least-squares trilateration algorithm to use. Valid options are ‘Linear’ and ‘NonLinear’.
  • Distance algorithm: Algorithm to calculate the distance of a beacon. Valid options are ‘Linear’ and ‘Accuracy’.
  • Minimum scanners: Minimum number of scanners to position a beacon.


It allows locating beacons in installations. To achieve its goal, the service uses the two previous services. The former to obtain the scans and the latter to calculate the positions. Note that the service not only connects the services, but also it processes the values to improve accuracy.

In order to contextualise, remember that in one of our first posts we talked about PANAL, a tool that we were developing at that time for the Challenge. Part of this tool has evolved into Jura. Another part that forms it are various methods to test the positioning (‘let’s see what happens if we do this!’, ‘what will happen if we consider this variable?’, …).

This last code is a complete mess, but it has allowed us to improve the positioning 🙂 . The service provides several configuration options such as: i) scanning window, ii) attenuation or iii) cutoff rate. These options are there thanks to PANAL.

Currently, we believe that PANAL no longer provides any value, so we do not know if we will publish anything about it. However, if we finish our proposal early enough, maybe we will develop a small application using Eclipse RCP or Eclipse RAP to reuse it (in some services we have added the option to publish using MQTT with that in mind).

Service configuration


The following configuration options are available:

  • Enable: Enable service.
  • Application topic: MQTT’s application topic.
  • Locations’ topic: Prefix for locations’ topic.
  • MQTT publish: Enables or disables the MQTT publication of locations.
  • Retention time: Locations’ retention time. Expired events are removed by a garbage collector.
  • Publication rate: Location’s publication rate.
  • Delay: Delay in positioning.
  • Scanning window: Time window for the location.
  • Attenuation: Attenuation of events.
  • Cutoff rate: Cutoff rate for outliers.


This service is a clear example of a part of PANAL that we have used almost ‘as it is’ in Jura. As the service description indicates, it allows simulating a BLE beacon that moves in circles in an installation. When it is enabled, the configuration is used to create a simulation and after that, the service is disabled again.

The reason to include this service in Ubica is simple, we are using it to test the last part of Jura, which will be ready in few days 🙂 (a spoiler).

Service configuration


The following configuration options are available:

  • Enable: Enable service.
  • degrees: Degrees or rotation.
  • rounds: Number of rotations.
  • beacon.interval: Beacon rotation interval.
  • delay: Delay in events.

6 comments on “Ubica: An Indoor Positioning System”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s