def f1(route_id): matcher = 'rmse' pre_proc = {'blur': True, 'shape': (180, 50)} window = 14 dist = 100 w, x_inlimit, y_inlimit, world_grid_imgs, x_route, y_route, \ route_heading, route_images = load_route(route_id=route_id, grid_pos_limit=dist) pre_world_grid_imgs = pre_process(world_grid_imgs, pre_proc) pre_route_images = pre_process(route_images, pre_proc) nav = spm.SequentialPerfectMemory(pre_route_images, matcher, window=window) recovered_heading, window_log = nav.navigate(pre_world_grid_imgs) print(mean_degree_error(x_inlimit, y_inlimit, x_route, y_route, route_heading, recovered_heading))
from source2 import pre_process, load_route, check_for_dir_and_create, plot_map from source2 import seqnav as spm directory = 'LoopRoutes/' matcher = 'mae' pre_proc = {'blur': True, 'shape': (180, 50)} window = 11 figures_path = 'Figures/' dist = 100 check_for_dir_and_create(figures_path) w, x_inlimit, y_inlimit, world_grid_imgs, x_route, y_route, \ route_heading, route_images = load_route(route_id=1, grid_pos_limit=dist) plot_map(w, [x_route, y_route], [x_inlimit, y_inlimit], size=(15, 15), route_headings=route_heading, scale=40) pre_world_grid_imgs = pre_process(world_grid_imgs, pre_proc) pre_route_images = pre_process(route_images, pre_proc) nav = spm.SequentialPerfectMemory(pre_route_images, matcher, window=window) recovered_heading, window_log = nav.navigate(pre_world_grid_imgs) # nav = pm.PerfectMemory(pre_route_images, matcher) # recovered_heading = nav.navigate(pre_world_grid_imgs) # print(mean_degree_error(x_inlimit, y_inlimit, x_route, y_route, route_heading, recovered_heading)) plot_map(w, [x_route, y_route], [x_inlimit, y_inlimit], size=(15, 15),