Python API Reference
Important
Versions prior to 0.9.0 have a very different API. For the documentation of the stable version please switch to the stable branch.
carla.Client
Client(host, port, worker_threads=0)set_timeout(float_seconds)get_client_version()get_server_version()get_world()
carla.World
idmap_namedebugget_blueprint_library()get_map()get_spectator()get_weather()set_weather(weather_parameters)get_actors()spawn_actor(blueprint, transform, attach_to=None)try_spawn_actor(blueprint, transform, attach_to=None)wait_for_tick(seconds=1.0)on_tick(callback)
carla.DebugHelper
draw_point(location, size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)draw_line(begin, end, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)draw_arrow(begin, end, thickness=0.1, arrow_size=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)draw_box(box, rotation, thickness=0.1, color=carla.Color(), life_time=-1.0, persistent_lines=True)draw_string(location, text, draw_shadow=False, color=carla.Color(), life_time=-1.0, persistent_lines=True)
carla.BlueprintLibrary
find(id)filter(wildcard_pattern)__getitem__(pos)__len__()__iter__()
carla.ActorBlueprint
idtagshas_tag(tag)match_tags(wildcard_pattern)has_attribute(key)get_attribute(key)set_attribute(key, value)__len__()__iter__()
carla.ActorAttribute
idtyperecommended_valuesis_modifiableas_bool()as_int()as_float()as_str()as_color()__eq__(other)__ne__(other)__nonzero__()__bool__()__int__()__float__()__str__()
carla.ActorList
find(id)filter(wildcard_pattern)__getitem__(pos)__len__()__iter__()
carla.Actor
idtype_idparentsemantic_tagsis_aliveattributesget_world()get_location()get_transform()get_velocity()get_acceleration()set_location(location)set_transform(transform)set_simulate_physics(enabled=True)destroy()
carla.Vehicle(carla.Actor)
bounding_boxapply_control(vehicle_control)get_vehicle_control()set_autopilot(enabled=True)
carla.TrafficLight(carla.Actor)
state
carla.Sensor(carla.Actor)
is_listeninglisten(callback_function)stop()
carla.SensorData
frame_numbertransform
carla.Image(carla.SensorData)
widthheightfovraw_dataconvert(color_converter)save_to_disk(path, color_converter=None)__len__()__iter__()__getitem__(pos)__setitem__(pos, color)
carla.LidarMeasurement(carla.SensorData)
horizontal_anglechannelsraw_dataget_point_count(channel)save_to_disk(path)__len__()__iter__()__getitem__(pos)__setitem__(pos, location)
carla.CollisionEvent(carla.SensorData)
actorother_actornormal_impulse
carla.LaneInvasionEvent(carla.SensorData)
actorcrossed_lane_markings
carla.VehicleControl
throttlesteerbrakehand_brakereverse__eq__(other)__ne__(other)
carla.Map
nameget_spawn_points()get_waypoint(location, project_to_road=True)get_topology()generate_waypoints(distance)to_opendrive()save_to_disk(path=self.name)
carla.Waypoint
transformis_intersectionlane_widthroad_idlane_idnext(distance)
carla.WeatherParameters
cloudynessprecipitationprecipitation_depositswind_intensitysun_azimuth_anglesun_altitude_angle__eq__(other)__ne__(other)
Static presets
carla.WeatherParameters.ClearNooncarla.WeatherParameters.CloudyNooncarla.WeatherParameters.WetNooncarla.WeatherParameters.WetCloudyNooncarla.WeatherParameters.MidRainyNooncarla.WeatherParameters.HardRainNooncarla.WeatherParameters.SoftRainNooncarla.WeatherParameters.ClearSunsetcarla.WeatherParameters.CloudySunsetcarla.WeatherParameters.WetSunsetcarla.WeatherParameters.WetCloudySunsetcarla.WeatherParameters.MidRainSunsetcarla.WeatherParameters.HardRainSunsetcarla.WeatherParameters.SoftRainSunset
carla.Vector3D
xyz__add__(other)__sub__(other)__eq__(other)__ne__(other)
carla.Location
xyzdistance(other)__add__(other)__sub__(other)__eq__(other)__ne__(other)
carla.Rotation
pitchyawroll__eq__(other)__ne__(other)
carla.Transform
locationrotation__eq__(other)__ne__(other)
carla.BoundingBox
locationextent__eq__(other)__ne__(other)
carla.Timestamp
frame_countelapsed_secondsdelta_secondsplatform_timestamp__eq__(other)__ne__(other)
carla.Color
rgba__eq__(other)__ne__(other)
carla.ColorConverter
RawDepthLogarithmicDepthCityScapesPalette
carla.ActorAttributeType
BoolIntFloatRGBColor
carla.TrafficLightState
OffRedYellowGreenUnknown
carla.LaneMarking
OtherBrokenSolid