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

Function get_hero_vehicle

PythonAPI/carla/scene_layout.py:214–228  ·  view source on GitHub ↗
(hero_vehicle)

Source from the content-addressed store, hash-verified

212 return vehicles_dict
213
214 def get_hero_vehicle(hero_vehicle):
215 if hero_vehicle is None:
216 return hero_vehicle
217
218 hero_waypoint = carla_map.get_waypoint(hero_vehicle.get_location())
219 hero_transform = hero_vehicle.get_transform()
220 location_gnss = carla_map.transform_to_geolocation(hero_transform.location)
221
222 hero_vehicle_dict = {
223 "id": hero_vehicle.id,
224 "position": [location_gnss.latitude, location_gnss.longitude, location_gnss.altitude],
225 "road_id": hero_waypoint.road_id,
226 "lane_id": hero_waypoint.lane_id
227 }
228 return hero_vehicle_dict
229
230 def get_walkers(walkers):
231 walkers_dict = dict()

Callers 1

get_dynamic_objectsFunction · 0.85

Calls 1

get_waypointMethod · 0.80

Tested by

no test coverage detected