File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments