Skip to content

Commit

Permalink
Increased timeouts (#55)
Browse files Browse the repository at this point in the history
Co-authored-by: germanros1987 <[email protected]>
  • Loading branch information
glopezdiest and germanros1987 authored Jul 21, 2020
1 parent da926d2 commit bd9e755
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
10 changes: 7 additions & 3 deletions leaderboard/leaderboard_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions leaderboard/scenarios/route_scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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")

Expand Down
7 changes: 5 additions & 2 deletions leaderboard/scenarios/scenario_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down Expand Up @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion leaderboard/utils/route_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bd9e755

Please sign in to comment.