Splits the retrieved actors by type id
(self)
| 1107 | self._hud.add_info('NEARBY VEHICLES', info_text) |
| 1108 | |
| 1109 | def _split_actors(self): |
| 1110 | """Splits the retrieved actors by type id""" |
| 1111 | vehicles = [] |
| 1112 | traffic_lights = [] |
| 1113 | speed_limits = [] |
| 1114 | walkers = [] |
| 1115 | |
| 1116 | for actor_with_transform in self.actors_with_transforms: |
| 1117 | actor = actor_with_transform[0] |
| 1118 | if 'vehicle' in actor.type_id: |
| 1119 | vehicles.append(actor_with_transform) |
| 1120 | elif 'traffic_light' in actor.type_id: |
| 1121 | traffic_lights.append(actor_with_transform) |
| 1122 | elif 'speed_limit' in actor.type_id: |
| 1123 | speed_limits.append(actor_with_transform) |
| 1124 | elif 'walker.pedestrian' in actor.type_id: |
| 1125 | walkers.append(actor_with_transform) |
| 1126 | |
| 1127 | return (vehicles, traffic_lights, speed_limits, walkers) |
| 1128 | |
| 1129 | def _render_traffic_lights(self, surface, list_tl, world_to_pixel): |
| 1130 | """Renders the traffic lights and shows its triggers and bounding boxes if flags are enabled""" |