diff --git a/scenario_runner.py b/scenario_runner.py index 5d2dd6015..c2abdb410 100755 --- a/scenario_runner.py +++ b/scenario_runner.py @@ -132,7 +132,7 @@ def _signal_handler(self, signum, frame): """ self._shutdown_requested = True if self.manager: - self.manager.stop_scenario() + self.manager._running = False def _get_scenario_class_or_fail(self, scenario): """ @@ -187,14 +187,6 @@ def _cleanup(self): CarlaDataProvider.cleanup() - for i, _ in enumerate(self.ego_vehicles): - if self.ego_vehicles[i]: - if not self._args.waitForEgo and self.ego_vehicles[i] is not None and self.ego_vehicles[i].is_alive: - print("Destroying ego vehicle {}".format(self.ego_vehicles[i].id)) - self.ego_vehicles[i].destroy() - self.ego_vehicles[i] = None - self.ego_vehicles = [] - if self.agent_instance: self.agent_instance.destroy() self.agent_instance = None @@ -415,7 +407,7 @@ def _load_and_run_scenario(self, config): self._analyze_scenario(config) # Remove all actors, stop the recorder and save all criterias (if needed) - scenario.remove_all_actors() + # scenario.remove_all_actors() if self._args.record: self.client.stop_recorder() self._record_criteria(self.manager.scenario.get_criteria(), recorder_name) diff --git a/srunner/scenariomanager/scenario_manager.py b/srunner/scenariomanager/scenario_manager.py index 62cffabf1..cbe96cbfd 100644 --- a/srunner/scenariomanager/scenario_manager.py +++ b/srunner/scenariomanager/scenario_manager.py @@ -182,7 +182,7 @@ def _tick_scenario(self, timestamp): sys.stdout.flush() if self.scenario_tree.status != py_trees.common.Status.RUNNING: - self._running = False + self._running = True if self._sync_mode and self._running and self._watchdog.get_status(): CarlaDataProvider.get_world().tick() @@ -198,7 +198,7 @@ def stop_scenario(self): """ This function is used by the overall signal handler to terminate the scenario execution """ - self._running = False + pass def analyze_scenario(self, stdout, filename, junit, json): """