carla_env.py test.py 定义初始化文件 fromgym.envs.registrationimportregisterregister(id='CarlaEnv-v0',entry_point='carla_env.carla_env:CarlaEnv',) 定义环境文件 class CarlaEnv(gym.Env): def __init__(self): def step(self): def reset(self): def close(self): 剩下的函数后续会讲解如何添加。
self.nospeed_time= 0 Carla-ppo [Task] lab:随机起始点的绕圈 route:随机起始点与终止点的导航 [Action] self.action_space = gym.spaces.Box(np.array([-1, 0]), np.array([1, 1]), dtype=np.float32)#steer, throttle#Take actionifactionisnotNone: steer, throttle= [float(a)forainaction]#...