Skip to content

Commit 621ef34

Browse files
refactor
1 parent d51c4d1 commit 621ef34

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

‎aw_scenario_runner.py‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,25 +145,12 @@ def run_scenario(
145145
route_config.agent = self.aw_agent
146146
except Exception as e: # Forces the simulation to run synchronously # pylint: disable=broad-except
147147
logger.error("Could not setup required agent due to {}".format(e))
148-
# self._cleanup()
148+
self._cleanup()
149149
return False
150150

151151
ego.prepare_ego()
152152

153153
logger.info("Loading route...")
154-
155-
try:
156-
scenario = RouteScenario(
157-
world=self.carla_world,
158-
config=route_config,
159-
debug_mode=self.DEBUG,
160-
ego_vehicle=ego._actor,
161-
)
162-
except Exception:
163-
logger.info("Could not load Route Scenario")
164-
traceback.print_exc()
165-
return False
166-
167154
logger.info("Updating world settings:")
168155

169156
# tick asynchronously until then
@@ -182,6 +169,17 @@ def run_scenario(
182169

183170
tm.set_random_device_seed(int(self._tm_config["seed"])) # ADD TO CONFIG
184171
tm.set_synchronous_mode(self._tm_config["sync"])
172+
try:
173+
scenario = RouteScenario(
174+
world=self.carla_world,
175+
config=route_config,
176+
debug_mode=self.DEBUG,
177+
ego_vehicle=ego._actor,
178+
)
179+
except Exception:
180+
logger.info("Could not load Route Scenario")
181+
traceback.print_exc()
182+
return False
185183

186184
logger.info("Starting scenario...")
187185
try:

0 commit comments

Comments
 (0)