From f0516878991fe984744427840af32bf26201a7e4 Mon Sep 17 00:00:00 2001 From: HappyZ Date: Thu, 23 May 2019 15:56:58 -0500 Subject: [PATCH] bug fix --- libs/util.py | 2 +- tests/spacemap.py | 4 ++-- visualize.py | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libs/util.py b/libs/util.py index c8b0bc0..b010082 100644 --- a/libs/util.py +++ b/libs/util.py @@ -47,7 +47,7 @@ def convert_vector_to_mat( x, y = rx_locs[i, :] / block_size else: x, y = (rx_locs[i, :] + offset) / block_size - result[int(x), int(y)] = rx_rsses[i] + result[int(round(x)), int(round(y))] = rx_rsses[i] return result diff --git a/tests/spacemap.py b/tests/spacemap.py index 4cafae9..a943628 100644 --- a/tests/spacemap.py +++ b/tests/spacemap.py @@ -34,7 +34,7 @@ def test(): # add walls wall_penetration = -30.0 - wall_reflection = -10.0 + wall_reflection = -15.0 glass_penetration = -3.0 glass_reflection = -3.0 # walls @@ -53,7 +53,7 @@ def test(): plotSpace(spacemap, cminmax=(-50, 0.0)) - rx_locs = [SpaceBlock(3.2, 3.3), SpaceBlock(3.2, 3.4), SpaceBlock(3.2, 3.5)] + rx_locs = [SpaceBlock(1.0, 4.3), SpaceBlock(4.2, 4.4), SpaceBlock(4.4, 4.4)] spacemap.traceRays(-40, SpaceBlock(3.2, 3.2)) for rx_loc in rx_locs: rx_loc_rss, rx_loc_paths = spacemap.traceRay(rx_loc) diff --git a/visualize.py b/visualize.py index db21fdf..66dd911 100644 --- a/visualize.py +++ b/visualize.py @@ -25,7 +25,6 @@ def plotSingle(filepath, args): if data is None: print("err: failed to load file {}".format(filepath)) return - plotRSS(data)