Fingerprint-based indoor localization methods require the construction of a radio map. This is a tool automating this tedious task, by having a robot follow a line, and stop every x cm to gather location-dependent characteristics (i.e. a fingerprint).
Fingerprint-based indoor localization methods require the construction of a radio map. This is a tedious task which can be automated. The presented solution consists of a Software-Defined Radio (SDR) mounted on a wheeled-robot (Thymio II). The SDR is connected to a LTE tower using a modified version of the srsLTE software. The robot follows a line, stopping every x cm to let the SDR gather characteristics (Channel State Information (CSI), Received Signal Strength Indicator (RSSI), Reference Signal Receive Power (RSRP), ...) from its communication with the LTE tower. Those characteristics are saved, along with the robot's location (estimated through dead-reckoning), and are ready to be used as fingerprints.
- Thymio II
 - USRP B200mini
 - PC/SC reader with a SIM card
 
- 
Install a specific fork of
srsLTEfollowing thisThis fork saves the channel characteristics (CSI, RSSI, RSRP, ...) to a file every ms
Make sure
SRSUE_FOLDERPATHinrun.pypoints to the correct location (of thesrsuefolder, from thesrsLTEinstallation) - 
Install the Thymio Suite and prepare the connection with the Thymio II following this
 - 
Install Aseba following this
Run
asebamedulla --versionto ensure it is correctly installed - 
Ensure that you're able to connect to the Thymio II by launching
asebastudiothrough some terminal. You'll be prompted to select a target: select the one calledThymio-II. This should establish the connection.If clicking on the
Thymio-IItarget simply re-shows the same popup, this is a known bug. To fix it, add yourself to the dialout group (sudo adduser <USERNAME> dialout), replacing<USERNAME>by your Ubuntu username. Log out then log in for the change to take effect.Make sure the Thymio II is connected to the computer by USB
 - 
Create conda environment (called
thymio) and activate it:conda env create -f environment.yml -n thymio conda activate thymio
 - 
Install
dbus,gobjectand sox:pip install dbus-pythonTo install
dbus-python, you might need to first runsudo apt install git virtualenv build-essential python3-dev libdbus-glib-1-dev libgirepository1.0-dev libcairo2-devpip install PyGObjectsudo apt install sox 
There are two ways to run the software.
- 
Continuous: Establish once the connection between the SDR and the eNodeB, then keep it alive by pinging its IP address.
 - 
Non-Continuous: Re-establish the connection between the SDR and the eNodeB everytime the Thymio II stops.
 
- Modify the constants defined in 
run_continuous.pyto modify e.g.:- Distance travelled by the Thymio II between each stop
 - Amount of stops to make before fully stopping the recording
 - Initial position of the Thymio II
 - ...
 
 
- 
Connect by USB the Thymio II, the Software-Defined Radio and the PC/SC reader (with a SIM card plugged in) to the computer
 - 
Open a terminal and establish the connection to the Thymio II by running:
asebamedulla "ser:name=Thymio-II"This opens a connection to the Thymio II. The terminal should read
Found Thymio-II on port /dev/ttyACM0and keep running. - 
Open another terminal and launch srsUE from this repo's root directory
sudo srsue <PATH_TO_SRSLTE>/srsue/ue.conf
Replace
<PATH_TO_SRSLTE>by the path to the fork of thesrsLTEsoftware, andue.confby the configuration file you want to run - 
Wait for the SDR to connect (the terminal will somewhere output
Network attach: 10.xx.xx.xx)The fingerprint files (i.e.
ce.txt,else.txtandinfo.txt) should appear in this repo's root directory. Watch out, becausece.txtwill grow quickly in size. - 
Open another terminal and ping the above IP address by running
ping 10.xx.xx.xx
This maintains the connection between the SDR and the eNodeB. Otherwise, no traffic is sent and the connection eventually times out.
 - 
Open another terminal and launch the run script by running:
conda activate thymio python run_continuous.py
 
- 
Connect by USB the Thymio II, the Software-Defined Radio and the PC/SC reader (with a SIM card plugged in) to the computer
 - 
Open a terminal and establish the connection to the Thymio II by running:
asebamedulla "ser:name=Thymio-II"This opens a connection to the Thymio II. The terminal should read
Found Thymio-II on port /dev/ttyACM0and keep running. - 
Open another terminal and launch the run script by running:
conda activate thymio python run.py
 
To ensure that the Thymio and SDR are working, several files are available:
test_thymio.pytest_fingerprint.py
To ensure that the Thymio II is able to work as intended:
- 
Plug in the Thymio II through USB and place the Thymio II on the line to follow
 - 
Open a terminal and establish the connection to the Thymio II by running:
asebamedulla "ser:name=Thymio-II" - 
Open another terminal and launch the test script by running:
conda activate thymio python test_thymio.py
This should instruct the Thymio to follow the black-line for x cm, then wait, then repeat y times
 
To ensure that the Software Defined Radio works as intended:
- 
Connect via USB the Software-Defined Radio (SDR) and the PC/SC reader (with a SIM card plugged in) to the computer
For the SDR, you have to used USB 3.0, else the datarate is too high for the connection.
 - 
Open a terminal and launch the test script by running:
conda activate thymio python test_fingerprint.py
This should instruct the SDR to connect to the eNodeB, gather a fingerprint and save it in a folder called
test_fingerprint 
Some python scripts were written to facilitate the data gathering step, e.g.:
- 
move_fingerprint.py:- Move the files generated by 
sudo srsue ue.conf(i.e.ce.txt,else.txtandinfo.txt) into their own folders (ce,else,info) - Record the (x,y) coordinates where those files were gathered into a JSON file (i.e. 
locations.json) 
 - Move the files generated by 
 - 
clean_fingerprints.py- Clean the fingerprint files (i.e. 
ce_0_raw.txt,else_0_raw.txtandinfo_0_raw.txt) - Save the cleaned files, e.g.:
ce_0_raw.txt->ce_0.parquetelse_0_raw.txt->else_0.pklinfo_0_raw.txt->info_0.pkl
 
 - Clean the fingerprint files (i.e. 
 - 
offset_origin_locations.py- Offset the (x,y) coordinates of the origin after the recording.
 
 
plot_fingerprints.py- Plot the amplitude and phase held in the cleaned 
ce.txt(e.g.ce_0.parquet) - Save the plot, e.g.:
ce_0.parquet->ce_0.png
 
- Plot the amplitude and phase held in the cleaned 
 
Tested with
- Ubuntu 18.04
 - Aseba medulla 1.6.1
 


