A Python-based Real-Time Location System (RTLS) that uses Bluetooth Low Energy (BLE) technology to track workers and objects in construction sites. The system localizes the position of workers wearing hardhats equipped with receivers that communicate with fixed transmitters on the job site.
- Real-time position tracking using BLE technology
- Modular infrastructure placement strategy
- Robust data processing and filtering
- Advanced localization algorithms combining triangulation and Kalman filtering
- Visualization of tracking results
- Support for multiple transmitters and receivers
Real_Time_Location_System/
├── data/
│ ├── raw/ # Raw data files
│ │ ├── elasticsearch/ # Elasticsearch datasets
│ │ └── rssi_dataset/ # RSSI-distance relationship data
│ ├── processed/ # Processed data files
│ └── results/ # Output results and visualizations
├── rtls/ # Main package directory
│ ├── config/ # Configuration files
│ ├── data/ # Data processing modules
│ ├── models/ # Localization models
│ └── utils/ # Utility functions
├── tests/ # Test files
├── requirements.txt # Python dependencies
├── setup.py # Package installation file
└── README.md # This file
The system consists of four main modules:
-
Data Pre-Processing
- Processes raw data from Elasticsearch
- Converts transmitter IDs to coordinates
- Implements Semi-Logical to Logical record conversion
- Handles data cleaning and validation
-
RSSI-Distance Prediction
- Converts Received Signal Strength Indicator (RSSI) to distance
- Uses calibrated path loss model
- Handles signal attenuation and interference
-
Position Estimation
- Implements triangulation-based localization
- Uses least squares method for position calculation
- Supports multiple transmitter configurations
- Handles edge cases and error conditions
-
Position Post-Processing
- Applies Kalman filtering for position smoothing
- Reduces noise and improves accuracy
- Handles missing or invalid data
- Clone the repository:
git clone https://github.com/yourusername/Real_Time_Location_System.git
cd Real_Time_Location_System
- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install the package:
pip install -e .
For development installation:
pip install -e ".[dev]"
-
Prepare your data:
- Place your raw data file in the
data/raw
directory - Ensure the data follows the expected format (see Data Format section)
- Place your raw data file in the
-
Run the localization system:
python -m rtls.main
- View results:
- Check the
data/results
directory for:localization_results.csv
: Detailed position datalocalization_plot.png
: Visualization of tracking results
- Check the
The system can be configured through rtls/config/settings.py
:
- Transmitter coordinates
- Maximum transmitter distance
- Kalman filter parameters
- Data processing parameters