Hello,
I am not able to connect the dots. After setting up the beacons, ( adopted ble_beacon_app from Sdk 16 ) how can I perform localization algorithm ( trilateration) in example ( ble_app_beacon ) by code?
Thank you
Hello,
I am not able to connect the dots. After setting up the beacons, ( adopted ble_beacon_app from Sdk 16 ) how can I perform localization algorithm ( trilateration) in example ( ble_app_beacon ) by code?
Thank you
Hello Tom,
My apologies for my late reply. There was a public holiday here in Norway yesterday.
Indoor positioning is no easy task, and depends on a lot of variables.
To explain how one might go about using trilateration to locate an object we will first assume we know the distances between our nodes, and that we have access to the one-dimensional distances between each of our nodes and the unknown position - we may then make use of trilateration to pinpoint the position exactly.
In essence, trilateration is nothing more than a set of equations to calculate the positions of an object, using its one-dimensional distance to other nodes that we already know where are located. The equations to calculate the unknown position is
To achieve this in a 2D space we will need a minimum of 3 independently placed nodes to avoid location ambiguity.
Take a look at this math stackoverflow answer for more detail on the exact equations.
Using the equations we would easily be able to pinpoint the unknown position by sending the measured distance between each node and the unknown position to a single device which would perform the computations, so far so good.
We started with two assumptions. The first assumption was that we knew the distances between our nodes, and have this available on the calculating node. We can satisfy this assumption by measuring the distances upon placing the nodes, or by performing some kind of calibration upon their initialization.
The second assumption is where it gets tricky - correctly measuring the distance between each node and the unknown position.
Since there is only one point that satisfies the analytical equations referenced earlier, we would need the measurements to be exactly correct to use them as they are.
RSSI(received signal strength indicator) is what many users of this forum seeks to utilize for this measurement. The RSSI is already part of the beacon example, and is readily available from the SoftDevice using the calls sd_ble_gap_rssi_start and sd_ble_gap_rssi_get functions.
However, the RSSI is not as accurate as many people assume when it comes to measuring distance - this is due to the fact that the signal strength is impacted by a lot more factors than just distance alone, such as physical obstacles, interference in the environment, antenna orientation, etc.
Typically, a ~ 6 db increase in RSSI would indicate a doubling of distance in a steady environment - but rarely is the environment stable enough for this to be observable. You may check this yourself by uploading the Beacon example, and using the nRF Connect smartphone application to read its RSSI value. Likely you will see it shift between 10-20 db just by moving it around different parts of your computer.
The precision of the RSSI as a distance measure is therefore constantly varying, and not very well suited for precision positioning.
Exactly how precise your measurements will be will vary with your environment, and is only possible for me to estimate.
I have seen other customers discuss one-dimensional direction with an accuracy of +/- ~ 1 meter without significant effort. I would therefore think that if a filter was created that accounted for(and flattened) the impact of sudden RSSI spikes(such as if someone suddenly is standing in the beacons line-of-sight) and other usual disturbances, then it could achieve high accuracy. Additionally, if measurements from multiple units are combined, it might be possible to create a model that is able to more accurately estimate an unknown position in a room with some confidence.
In conclusion, using only RSSI is not a reliable source for accurate distance measuring, but it may very well be used for the purpose of seeing if an object is within a certain room - for example. One might also be able to develop a model which could improve the accuracy further, but if high accuracy positioning is required then perhaps you must look into using Ultra-wide band or time-of-flight methods.
There is also multiple other posts here on the DevZone forum that discuss using RSSI for distance measuring that might be informative to have a look at.
I hope this could help shed some light on the matter.
Best regards,
Karl
Hello Karl,
Sorry to get back to you after so long. I was pretty caught up with other projects.
First of all thank you so much for detailed reply. Yesterday we had a meeting regarding our localization strategy. and for the time being we have decided to go with RSSI based strategy. It will be pretty small room where we will test and present our application.
I agree with your points personally but we have to follow the requirement guidelines so I think i will note your points for future applications.
I thought to install few beacons and change their default TXPower so we can detect nearest beacon without ambiguities.
Any thought what minimum range can be achieved with nrf52840 dongle? I believe i can do that in code.
Thanks,
Tom