env.add_obstacle(new_obstacle) # update position of existing tag else: new_obstacle = deepcopy(obstacle) new_obstacle = transform_shape(new_obstacle, rotation, translation) env.update_obstacle(new_obstacle) # create boundaries for obstacles env.create_boundaries() print("Done creating boundaries") # create a planner with current env, agent, and goal location and solve for a path planner = PathFinder(env, env.agent, goal_.points[0]) planner.solve() print("Done solving") profiler = Profiler() profiler.add_path(planner.export_path()) smooth_path = profiler.get_profile() i = 0 # The following parameters may need to be tuned step_size = 0.01 step_size_rot = 0.005 threshold = 0.05 rot_threshold = 0.01 pose = (0, 0)
import _pickle as pickle import time from path_finder import PathFinder from boundary_detection import * from path_profiler import Profiler import matplotlib.pyplot as plt env = pickle.load(open('sample_env.pkl', 'rb')) pf = PathFinder(env, env.agent, Point(2, 7)) pf.solve() env.path = pf.export_path() print(len(env.path)) env.update_viz() env.show_viz() pr = Profiler() pr.add_path(env.path) pp = pr.get_profile() pr.smooth_path()