From bd9e75500c9c20b45a0609c701387a96492bd60f Mon Sep 17 00:00:00 2001 From: glopezdiest <58212725+glopezdiest@users.noreply.github.com> Date: Wed, 22 Jul 2020 01:11:18 +0200 Subject: [PATCH] Increased timeouts (#55) Co-authored-by: germanros1987 <38517452+germanros1987@users.noreply.github.com> --- leaderboard/leaderboard_evaluator.py | 10 +++++++--- leaderboard/scenarios/route_scenario.py | 6 ++---- leaderboard/scenarios/scenario_manager.py | 7 +++++-- leaderboard/utils/route_parser.py | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/leaderboard/leaderboard_evaluator.py b/leaderboard/leaderboard_evaluator.py index 7ffcb733..7ac5173f 100644 --- a/leaderboard/leaderboard_evaluator.py +++ b/leaderboard/leaderboard_evaluator.py @@ -288,9 +288,11 @@ def _load_and_run_scenario(self, args, config): crash_message = "Simulation crashed" entry_status = "Crashed" + self._register_statistics(config, args.checkpoint, entry_status, crash_message) + if args.record: self.client.stop_recorder() - self._register_statistics(config, args.checkpoint, entry_status, crash_message) + self._cleanup() sys.exit(-1) @@ -319,9 +321,11 @@ def _load_and_run_scenario(self, args, config): # Stop the scenario try: self.manager.stop_scenario() - self.client.stop_recorder() self._register_statistics(config, args.checkpoint, entry_status, crash_message) + if args.record: + self.client.stop_recorder() + # Remove all actors scenario.remove_all_actors() @@ -375,7 +379,7 @@ def main(): parser.add_argument('--debug', type=int, help='Run with debug output', default=0) parser.add_argument('--record', type=str, default='', help='Use CARLA recording feature to create a recording of the scenario') - parser.add_argument('--timeout', default="30.0", + parser.add_argument('--timeout', default="60.0", help='Set the CARLA client timeout value in seconds') # simulation setup diff --git a/leaderboard/scenarios/route_scenario.py b/leaderboard/scenarios/route_scenario.py index a0ad0e5e..35350222 100644 --- a/leaderboard/scenarios/route_scenario.py +++ b/leaderboard/scenarios/route_scenario.py @@ -48,10 +48,8 @@ ROUTESCENARIO = ["RouteScenario"] -MAX_ALLOWED_RADIUS_SENSOR = 5.0 -SECONDS_GIVEN_PER_METERS = 0.4 +SECONDS_GIVEN_PER_METERS = 0.8 INITIAL_SECONDS_DELAY = 5.0 -MAX_CONNECTION_ATTEMPTS = 5 NUMBER_CLASS_TRANSLATION = { "Scenario1": ControlLoss, @@ -548,7 +546,7 @@ def _create_test_criteria(self): blocked_criterion = ActorSpeedAboveThresholdTest(self.ego_vehicles[0], speed_threshold=0.1, - below_threshold_max_time=90.0, + below_threshold_max_time=180.0, terminate_on_failure=True, name="AgentBlockedTest") diff --git a/leaderboard/scenarios/scenario_manager.py b/leaderboard/scenarios/scenario_manager.py index d1d8b09c..7236dd15 100644 --- a/leaderboard/scenarios/scenario_manager.py +++ b/leaderboard/scenarios/scenario_manager.py @@ -43,6 +43,7 @@ class ScenarioManager(object): 4. If needed, cleanup with manager.stop_scenario() """ + def __init__(self, debug_mode=False): """ Setups up the parameters, which will be filled at load_scenario() @@ -57,9 +58,11 @@ def __init__(self, debug_mode=False): self._agent = None self._running = False self._timestamp_last_run = 0.0 + self._timeout = float(timeout) # Used to detect the simulation is down, but doesn't create any exception - self._watchdog = Watchdog(5) + watchdog_timeout = max(5, self._timeout - 2) + self._watchdog = Watchdog(watchdog_timeout) self.scenario_duration_system = 0.0 self.scenario_duration_game = 0.0 @@ -165,7 +168,7 @@ def _tick_scenario(self, timestamp): self.ego_vehicles[0].apply_control(ego_action) if self._running and self.get_running_status(): - CarlaDataProvider.get_world().tick() + CarlaDataProvider.get_world().tick(self._timeout) def get_running_status(self): """ diff --git a/leaderboard/utils/route_parser.py b/leaderboard/utils/route_parser.py index 78513e79..56c3cbc1 100644 --- a/leaderboard/utils/route_parser.py +++ b/leaderboard/utils/route_parser.py @@ -88,7 +88,7 @@ def parse_weather(route): route_weather = route.find("weather") if route_weather is None: - weather = carla.WeatherParameters(sun_altitude_angle = 70) + weather = carla.WeatherParameters(sun_altitude_angle=70, cloudiness=70) else: weather = carla.WeatherParameters()