Context
I wanted to understand whether inertial measurements could stabilize UWB positioning and how the effect changed under different visibility conditions.
Approach
I adapted the DW3000 library for the required DS-TWR ranging. The ESP32 collected UWB at 5 Hz and IMU data at 50 Hz, timestamped both streams and sent them over MQTT. The backend synchronized and preprocessed the streams, then compared trilateration and EKF estimates against ground truth.
System
- Makerfabs ESP32 UWB-DW3000: ESP32-Wrover and DW3000, UWB channel 5, IEEE 802.15.4z MAC
- C++ on the ESP32-adapted Arduino framework, DW3000 library and Adafruit BNO08x
- BNO085: linear acceleration and Game Rotation Vector / quaternion over I²C
- ESP32 dual core: parallel acquisition, timestamps and MQTT transport
- Backend: stream synchronization, trilateration, EKF, ground truth and error analysis
Engineering decisions
- An anchor discovery phase exchanges addresses and configuration and schedules replies before DS-TWR ranging begins.
- The backend joins asynchronous UWB and IMU streams by timestamp.
- Evaluate LOS, WLOS and NLOS separately: a filter can smooth stochastic noise, but cannot identify systematic bias by itself.
What did not work
In WLOS, trilateration RMSE was 0.520 m and EKF RMSE was 0.518 m — a 0.4% difference. The filter reduced high-frequency noise but did not recognize the near-constant wall bias. In NLOS, raw UWB trilateration was unavailable for 85.5% of the measurement period; its 0.608 m RMSE describes only the remaining measurements.
Result
LOS: RMSE 0.078 m → 0.056 m (28.2%); 95% CDF 0.139 m → 0.086 m. WLOS: 0.520 m → 0.518 m. NLOS: 0.608 m on the available 14.5% of raw measurements versus 0.219 m for the continuous EKF estimate.
Measured results
LOS
- Trilateration
- Trilateration · RMSE 0.078 m · 95% CDF 0.139 m
- EKF / Fusion
- EKF · RMSE 0.056 m · 95% CDF 0.086 m
28.2% lower RMSE; 38.1% lower error at the 95th percentile.
WLOS · one wall
- Trilateration
- Trilateration · RMSE 0.520 m · 95% CDF 0.858 m
- EKF / Fusion
- EKF · RMSE 0.518 m · 95% CDF 0.817 m
Only 0.4% RMSE improvement; the wall bias remains.
NLOS · strong obstruction
- Trilateration
- Trilateration · RMSE 0.608 m on available measurements
- EKF / Fusion
- EKF · RMSE 0.219 m across the full run
64% lower RMSE, but raw UWB was missing 85.5% of the time. The two RMSE values therefore use different data coverage.
What stayed with me
On paper, a filter can look clean. On the bench, sometimes all it takes is a wall, a timing issue or one bad measurement to reveal the actual problem.
What the result does not say
The NLOS comparison is asymmetric: trilateration could only be calculated at the few points where enough UWB measurements were available. Its 0.608 m RMSE is therefore statistically optimistic. The EKF kept producing an estimate during UWB outages by predicting motion from IMU data.
Limits of the experiment
The measurements answer a narrower question than “does indoor positioning work?” They compare three visibility conditions in a controlled setup.
- Stop-and-go movement on a predefined, approximately 1.7 m linear path; complex dynamic 2D motion was not evaluated.
- The anchors used favorable geometry. Poorly conditioned arrangements were not systematically measured.
- Q and R were chosen empirically and stayed static across scenarios. An adaptive, NLOS-aware noise model could treat WLOS differently.
- Synchronization and the EKF ran offline in the backend, not in real time on the ESP32.