(self, input_data)
| 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 | |
| 55 | def get_nearby_lights(vehicle, lights, pixels_per_meter=5.5, size=512, radius=5): |
no test coverage detected