Skip to content

Commit 0bce569

Browse files
bug fix; _sync flag was never set in CarlaDataProvider
1 parent 621ef34 commit 0bce569

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

aw_scenario_runner.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ def run_scenario(
120120
self.carla_world = self.carla_client.get_world()
121121
self.carla_client.load_world(env_config.town)
122122

123-
CarlaDataProvider.set_world(self.carla_world)
124-
125123
logger.info("Spawning ego...")
126124
ego = EgoVehicle(env_config)
127125
self.ego_vehicles.append(ego.spawn())
@@ -154,10 +152,10 @@ def run_scenario(
154152
logger.info("Updating world settings:")
155153

156154
# tick asynchronously until then
157-
settings = CarlaDataProvider.get_world().get_settings()
155+
settings = self.carla_world.get_settings()
158156
settings.synchronous_mode = True
159157
settings.fixed_delta_seconds = self._carla_config["fixed_delta_seconds"]
160-
CarlaDataProvider.get_world().apply_settings(settings)
158+
self.carla_world.apply_settings(settings)
161159

162160
logger.info(f"{settings.__str__()}")
163161

@@ -169,6 +167,10 @@ def run_scenario(
169167

170168
tm.set_random_device_seed(int(self._tm_config["seed"])) # ADD TO CONFIG
171169
tm.set_synchronous_mode(self._tm_config["sync"])
170+
171+
# update the world
172+
CarlaDataProvider.set_world(self.carla_world)
173+
172174
try:
173175
scenario = RouteScenario(
174176
world=self.carla_world,

0 commit comments

Comments
 (0)