MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / get_traffic_lights

Function get_traffic_lights

PythonAPI/carla/scene_layout.py:186–198  ·  view source on GitHub ↗
(traffic_lights)

Source from the content-addressed store, hash-verified

184 return stop_signals_dict
185
186 def get_traffic_lights(traffic_lights):
187 traffic_lights_dict = dict()
188 for traffic_light in traffic_lights:
189 tl_transform = traffic_light.get_transform()
190 location_gnss = carla_map.transform_to_geolocation(tl_transform.location)
191 tl_dict = {
192 "id": traffic_light.id,
193 "state": int(traffic_light.state),
194 "position": [location_gnss.latitude, location_gnss.longitude, location_gnss.altitude],
195 "trigger_volume": [[v.longitude, v.latitude, v.altitude] for v in _get_trigger_volume(traffic_light)]
196 }
197 traffic_lights_dict[traffic_light.id] = tl_dict
198 return traffic_lights_dict
199
200 def get_vehicles(vehicles):
201 vehicles_dict = dict()

Callers 1

get_dynamic_objectsFunction · 0.85

Calls 1

_get_trigger_volumeFunction · 0.85

Tested by

no test coverage detected