This commit is contained in:
HappyZ 2019-05-23 14:51:37 -05:00
parent 0907bda236
commit 7927e7241c
5 changed files with 10 additions and 12 deletions

View File

@ -28,7 +28,7 @@ def exproom():
orientations = np.empty((64, 64), dtype=float) * float('nan') orientations = np.empty((64, 64), dtype=float) * float('nan')
wall_penetration = -30.0 wall_penetration = -30.0
wall_reflection = -10.0 wall_reflection = -15.0
glass_penetration = -3.0 glass_penetration = -3.0
glass_reflection = -3.0 glass_reflection = -3.0
# walls # walls

Binary file not shown.

View File

@ -522,22 +522,20 @@ class SpaceMap():
for path in self.endpaths: for path in self.endpaths:
current_p = path current_p = path
target_p_found = None target_p_found = None
original_path_flag = True
while current_p is not None: while current_p is not None:
target_p = getPathFromRay(current_p, rx_loc, self) target_p = getPathFromRay(current_p, rx_loc, self)
if target_p is None: if target_p is None:
break break
if ( angle_diff = abs(target_p.getAngle() % (2 * np.pi) - current_p.getAngle() % (2 * np.pi))
abs(target_p.getAngle() - current_p.getAngle()) < if angle_diff < self.ray_trace_deg_tol * max(target_p.getTraveledDistance(), 2):
self.ray_trace_deg_tol * target_p.getTraveledDistance() and
target_p not in rx_loc_paths
):
if target_p.getEndingPower() < NOISE_FLOOR: if target_p.getEndingPower() < NOISE_FLOOR:
break continue
target_p_found = target_p target_p_found = target_p
current_p = current_p.prev_ray current_p = current_p.prev_ray
if target_p_found is not None: original_path_flag = False
if target_p_found is not None and target_p_found not in rx_loc_paths:
rx_loc_paths.append(target_p_found) rx_loc_paths.append(target_p_found)
# clean up for too nearby paths # clean up for too nearby paths
removeRedundantPaths(rx_loc_paths) removeRedundantPaths(rx_loc_paths)
return aggreatePower(rx_loc_paths), rx_loc_paths return aggreatePower(rx_loc_paths), rx_loc_paths

View File

@ -84,7 +84,7 @@ def generateData(floormap, tx_locs, args):
for power in powers: for power in powers:
rss_vec = [] rss_vec = []
starttime = int(time.time()) starttime = int(time.time())
tx_loc = SpaceBlock(0, 0) tx_loc = SpaceBlock(3.2, 3.2)
floormap.traceRays(power, tx_loc) floormap.traceRays(power, tx_loc)
for j in range(0, rx_locs.shape[0], args.procnum): for j in range(0, rx_locs.shape[0], args.procnum):
procs = [] procs = []

View File

@ -53,8 +53,8 @@ def test():
plotSpace(spacemap, cminmax=(-50, 0.0)) plotSpace(spacemap, cminmax=(-50, 0.0))
rx_locs = [SpaceBlock(3.2, 3.2), SpaceBlock(5.2, 4.3)] rx_locs = [SpaceBlock(3.2, 3.3), SpaceBlock(3.2, 3.4), SpaceBlock(3.2, 3.5)]
spacemap.traceRays(0.0, SpaceBlock(0.0, 0.0)) spacemap.traceRays(-40, SpaceBlock(3.2, 3.2))
for rx_loc in rx_locs: for rx_loc in rx_locs:
rx_loc_rss, rx_loc_paths = spacemap.traceRay(rx_loc) rx_loc_rss, rx_loc_paths = spacemap.traceRay(rx_loc)
multipaths = [] multipaths = []