From 7f60e652777a802ade01fb7f7cc1494a2dbe5d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 29 Dec 2024 02:16:45 +0100 Subject: [PATCH] more improvements with locate maybe --- src/c3nav/routing/locator.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 26a00945..bb0e00ec 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -257,7 +257,7 @@ class Locator: already_got.add(key) deduplicized_scan_data_in_the_same_room.append((peer_id, value)) - the_sum = sum((value.rssi + 90) for peer_id, value in deduplicized_scan_data_in_the_same_room[:3]) + the_sum = sum((value.rssi + 100) for peer_id, value in deduplicized_scan_data_in_the_same_room[:3]) level = router.levels[space.level_id] if level.on_top_of_id: @@ -274,9 +274,10 @@ class Locator: else: x = 0 y = 0 + # sure this can be better probably for peer_id, value in deduplicized_scan_data_in_the_same_room[:3]: - x += float(self.peers[peer_id].xyz[0]) * (value.rssi+90) / the_sum - y += float(self.peers[peer_id].xyz[1]) * (value.rssi+90) / the_sum + x += float(self.peers[peer_id].xyz[0]) * (value.rssi+100) / the_sum + y += float(self.peers[peer_id].xyz[1]) * (value.rssi+100) / the_sum return CustomLocation( level=level, x=x/100,