From 12bcafbab4047726683c8a04bb1a27f25eb3f430 Mon Sep 17 00:00:00 2001 From: Heiko Rothe Date: Thu, 18 Mar 2021 21:20:32 +0100 Subject: [PATCH] fix(bluetooth-low-energy): make distance measurements less twitchy These new Kalman parameters should deliver a more stable RSSI estimation, which in turn leads to better distance and location estimation. --- .../bluetooth-low-energy/bluetooth-low-energy.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/integrations/bluetooth-low-energy/bluetooth-low-energy.service.ts b/src/integrations/bluetooth-low-energy/bluetooth-low-energy.service.ts index c0e0dfa..ff65cbb 100644 --- a/src/integrations/bluetooth-low-energy/bluetooth-low-energy.service.ts +++ b/src/integrations/bluetooth-low-energy/bluetooth-low-energy.service.ts @@ -33,9 +33,9 @@ import * as util from 'util'; export const NEW_DISTANCE_CHANNEL = 'bluetooth-low-energy.new-distance'; const APPLE_ADVERTISEMENT_ID = Buffer.from([0x4c, 0x00]); -@Injectable() // parameters determined experimentally +@Injectable() export class BluetoothLowEnergyService - extends KalmanFilterable(Object, 0.8, 15) + extends KalmanFilterable(Object, 0.008, 4) implements OnModuleInit, OnApplicationBootstrap { private readonly config: BluetoothLowEnergyConfig; private readonly logger: Logger;