MCPcopy Index your code
hub / github.com/OpenDriveLab/DriveAdapter / tick

Method tick

leaderboard/team_code/map_agent.py:40–52  ·  view source on GitHub ↗
(self, input_data)

Source from the content-addressed store, hash-verified

38 self._traffic_lights = list()
39
40 def tick(self, input_data):
41 self._actors = self._world.get_actors()
42 self._traffic_lights = get_nearby_lights(self._vehicle, self._actors.filter('*traffic_light*'))
43 self._stop_signs = get_nearby_lights(self._vehicle, self._actors.filter('*stop*'))
44
45 topdown = input_data['map'][1][:, :, 2]
46 topdown = draw_traffic_lights(topdown, self._vehicle, self._traffic_lights)
47 topdown = draw_stop_signs(topdown, self._vehicle, self._stop_signs)
48
49 result = super().tick(input_data)
50 result['topdown'] = topdown
51
52 return result
53
54
55def get_nearby_lights(vehicle, lights, pixels_per_meter=5.5, size=512, radius=5):

Callers 6

_prepare_ego_vehiclesMethod · 0.45
setup_sensorsMethod · 0.45
_tick_scenarioMethod · 0.45
run_stepMethod · 0.45

Calls 4

get_nearby_lightsFunction · 0.85
draw_traffic_lightsFunction · 0.85
draw_stop_signsFunction · 0.85
get_actorsMethod · 0.80

Tested by

no test coverage detected