def run_follow_the_gap_forest(): sim_conf = lib.load_conf("fgm_config") env = ForestSim(map_name_forest, sim_conf) vehicle = ForestFGM() # test_single_vehicle(env, vehicle, True, 10, False, vis=True) test_single_vehicle(env, vehicle, False, 100, add_obs=True)
def run_follow_the_gap_track(): sim_conf = lib.load_conf("fgm_config") env = TrackSim(map_name_track, sim_conf) vehicle = TrackFGM() # test_single_vehicle(env, vehicle, True, 10, False) test_single_vehicle(env, vehicle, True, 100, add_obs=True)
def run_forest_gen(): fname = "config_test" sim_conf = lib.load_conf(fname) map_name = "forest2" pre_map = ForestPreMap(map_name, sim_conf) pre_map.run_generation()
def __init__(self, map_name, sim_conf, pp_conf=None) -> None: if pp_conf is None: pp_conf = lib.load_conf("mod_conf") self.name = "Pure Pursuit Path Follower" self.path_name = None self.map_name = map_name mu = sim_conf.mu g = sim_conf.g self.m = sim_conf.m self.wheelbase = sim_conf.l_f + sim_conf.l_r self.f_max = mu * self.m * g #* safety_f self.v_gain = pp_conf.v_gain self.lookahead = pp_conf.lookahead self.wpts = None self.vs = None self.N = None self.ss = None #TODO: I think this isn't needed and can be removed self.aim_pts = [] try: # raise FileNotFoundError self._load_csv_track() except FileNotFoundError: print(f"Problem Loading map - generate map pts")
def train_mod_track(): sim_conf = lib.load_conf("std_config") env = TrackSim(map_name_track, sim_conf) # vehicle = ModVehicleTrain(mod_name, map_name, env.sim_conf) vehicle = ModVehicleTrain(mod_name_track, map_name_track, sim_conf, load=False, h_size=500) train_vehicle(env, vehicle, 500000)
def run_pre_map(): fname = "config_test" conf = lib.load_conf(fname) # map_name = "example_map" map_name = "race_track" pre_map = PreMap(conf, map_name) pre_map.run_conversion()
def test_mod_forest(): sim_conf = lib.load_conf("std_config") env = ForestSim(map_name_f, sim_conf) vehicle = ModVehicleTest(mod_name_f, map_name_f, sim_conf) test_single_vehicle(env, vehicle, True, 100, wait=False)
def test_nav_track(): sim_conf = lib.load_conf("race_config") env = TrackSim(map_name_track, sim_conf) vehicle = NavTestVehicle(nav_name_track, sim_conf) test_single_vehicle(env, vehicle, False, 100, wait=True, vis=False, add_obs=False)
def test_nav_forest(): sim_conf = lib.load_conf("std_config") env = ForestSim(map_name_forest, sim_conf) vehicle = NavTestVehicle(nav_name_f, sim_conf) test_single_vehicle(env, vehicle, True, 100, wait=False)
def train_nav_forest(): sim_conf = lib.load_conf("std_config") env = ForestSim(map_name_forest, sim_conf) vehicle = NavTrainVehicle(nav_name_f, sim_conf, h_size=200) train_vehicle(env, vehicle, 1000)
def train_mod_f(): sim_conf = lib.load_conf("std_config") env = ForestSim(map_name_f, sim_conf) vehicle = ModVehicleTrain(mod_name_f, map_name_f, sim_conf, load=False, h_size=200) train_vehicle(env, vehicle, 1000)