move the function to libs, convert output to numpy format

This commit is contained in:
HappyZ 2019-06-04 00:50:08 -05:00
parent bb256bec1a
commit c67a71ee26
2 changed files with 17 additions and 17 deletions

View File

@ -22,6 +22,22 @@ PICKLE_MAP_STEP = 0.1 # meter
np.set_printoptions(threshold=sys.maxsize)
def get_groundtruth_dict(f_gt):
gt = {}
if f_gt is None:
return gt
with open(f_gt, 'r') as f:
lines = f.readlines()
for line in lines:
if '#' in line:
continue
tmp = line.rstrip('\n').split(',')
addr = tmp[0]
loc_x = float(tmp[1])
loc_y = float(tmp[2])
gt[addr] = np.array([loc_x, loc_y])
return gt
def load_rss_data_with_pkt_types(fp: str, orientation: int) -> dict:
'''

View File

@ -11,23 +11,7 @@ from libs.parser_post import convert_to_pickle_rss
from libs.parser_post import get_locs_from_slam_data
from libs.parser_post import get_locs_from_parsed_sig_data
from libs.parser_post import extract_dev_from_combined
def get_groundtruth_dict(f_gt):
gt = {}
if f_gt is None:
return gt
with open(f_gt, 'r') as f:
lines = f.readlines()
for line in lines:
if '#' in line:
continue
tmp = line.rstrip('\n').split(',')
addr = tmp[0]
loc_x = float(tmp[1])
loc_y = float(tmp[2])
gt[addr] = [loc_x, loc_y]
return gt
from libs.parser_post import get_groundtruth_dict
def get_files(folder):