carla-simulator / leaderboard

CARLA Autonomous Driving leaderboard
MIT License
156 stars 76 forks source link

Fix KeyError when using DummyAgent #168

Closed Daraan closed 3 months ago

Daraan commented 4 months ago

The DummyAgent sensors does not add two keys for the radar sensor, causing an issue later on; here

Traceback (most recent call last):
  File ".../leaderboard/leaderboard_evaluator.py", line 342, in _load_and_run_scenario
    self.manager.load_scenario(self.route_scenario, self.agent_instance, config.index, config.repetition_index)
  File ".../leaderboard/leaderboard/scenarios/scenario_manager.py", line 125, in load_scenario
    self._agent_wrapper.setup_sensors(self.ego_vehicles[0])
  File ".../leaderboard/leaderboard/autoagents/agent_wrapper.py", line 225, in setup_sensors
    type_, id_, sensor_transform, attributes = self._preprocess_sensor_spec(sensor_spec)
  File ".../leaderboard/leaderboard/autoagents/agent_wrapper.py", line 174, in _preprocess_sensor_spec
    attributes['vertical_fov'] = str(sensor_spec['vertical_fov'])  # degrees
KeyError: 'vertical_fov'

This PR adds the vertical_fov and horizontal_fovkeys to the dummy agents sensors.


This change is Reviewable