neXenio / BLE-Indoor-Positioning

Multilateration using bluetooth beacons
Apache License 2.0
430 stars 129 forks source link

How to Set Elevation and Altitude Metric in Beacon Configuration? #176

Open maroufi opened 4 years ago

maroufi commented 4 years ago

Greetings and congratulations to neXenio team for this successful project. I have an issue in accuracy of location detection that maybe is error in my usage. This error in accuracy of user location is 1-4 meter(s) usually. I guess that cause of this low accuracy is error in beacon configuration or maybe in elevation and altitude parameter configuration. I have this question that how can i set elevation and altitude in test surface and are this parameters relative to the ground level around the building? What do you think about this location detection error? Thank you for your attention.

Steppschuh commented 4 years ago

If you take a look at the Location class, you can find two related fields:

However, these values have no effect on the beacon distance calculation. The elevation delta is relevant when using the calculated distances for the multilateration, though. We prepared the calculateDistanceWithoutElevationDeltaToDevice in BeaconDistanceCalculator to offset that delta, but it's currently not used:

Use this method to remove the elevation delta from the distance between device and beacon. Calculation based on Pythagoras to calculate distance on the floor (2D) to the beacon, if the distance is double the elevation delta. The elevation expected refers to the distance above the floor ground, rather than the altitude above sea level.

When using the LocationDistanceCalculator, the elevation has no effect but the altitude will be taken into account.


Anyway, the elevation shouldn't have a big impact on your accuracy (unless you're in a room with a very high ceiling). Please browse other open and closed issues in this repo, there a quite a few issues related to distance estimation accuracy.

maroufi commented 4 years ago

Thank you for your response. I use LocationDistanceCalculator for multilateration and estimate user location (map senario). Why should altitude effect on LocationDistanceCalculator for multilateratin while beacons and device have same altitude in a place? Is this intended to support multi floors or it has other reason?

Steppschuh commented 4 years ago

The LocationDistanceCalculator can be used to calculate the distance between Location instances (e.g. when calling firstLocation.getDistanceTo(secondLocation)). It is not used for multilateration. The altitude is relevant here because we're in a 3-dimensional space. See this StackOverflow post.

A BeaconDistanceCalculator (e.g. the PathLossBeaconDistanceCalculator) can be used to calculate the distance between a Beacon (with a known Location) and the device that received signals (i.e. RSSI values) from that beacon. These distances are used for multilateration. The altitude is not relevant here because id doesn't affect the measured signal strength.