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

Function get_vehicles

PythonAPI/carla/scene_layout.py:200–212  ·  view source on GitHub ↗
(vehicles)

Source from the content-addressed store, hash-verified

198 return traffic_lights_dict
199
200 def get_vehicles(vehicles):
201 vehicles_dict = dict()
202 for vehicle in vehicles:
203 v_transform = vehicle.get_transform()
204 location_gnss = carla_map.transform_to_geolocation(v_transform.location)
205 v_dict = {
206 "id": vehicle.id,
207 "position": [location_gnss.latitude, location_gnss.longitude, location_gnss.altitude],
208 "orientation": [v_transform.rotation.roll, v_transform.rotation.pitch, v_transform.rotation.yaw],
209 "bounding_box": [[v.longitude, v.latitude, v.altitude] for v in _get_bounding_box(vehicle)]
210 }
211 vehicles_dict[vehicle.id] = v_dict
212 return vehicles_dict
213
214 def get_hero_vehicle(hero_vehicle):
215 if hero_vehicle is None:

Callers 1

get_dynamic_objectsFunction · 0.85

Calls 1

_get_bounding_boxFunction · 0.85

Tested by

no test coverage detected