def reset(self, soft=False): self._reset_world(soft=soft) # reset actions self.control = carla.VehicleControl() self.prev_actions = self.DEFAULT_ACTIONS observation = env_utils.replace_nans(self._get_observation(sensors_data={})) return observation
def execute(self, actions, record_path: str = None): self.prev_actions = actions pygame.event.get() self.clock.tick() sensors_data = self.world_step(actions, record_path=record_path) reward = self.reward(actions) terminal = self.terminal_condition() next_state = env_utils.replace_nans(self._get_observation(sensors_data)) self.collision_penalty = 0.0 return next_state, terminal, reward