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()get_available_maps()reload_world()load_world(map_name)start_recorder(string filename)replay_file(string filename, float start, float duration, int camera_follow_id)show_recorder_file_info(string filename)show_recorder_collisions(string filename, char category1, char category2)show_recorder_actors_blocked(string filename, float min_time, float min_distance)apply_batch(commands, do_tick=False)apply_batch_sync(commands, do_tick=False) -> list(carla.command.Response)
carla.World
iddebugget_blueprint_library()get_map()get_spectator()get_settings()apply_settings(world_settings)get_weather()set_weather(weather_parameters)get_actors(actor_ids=None) -> carla.ActorListspawn_actor(blueprint, transform, attach_to=None)try_spawn_actor(blueprint, transform, attach_to=None)wait_for_tick(seconds=1.0)on_tick(callback)tick()
carla.WorldSettings
synchronous_modeno_rendering_mode__eq__(other)__ne__(other)
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_angular_velocity()get_acceleration()set_location(location)set_transform(transform)set_velocity(vector)set_angular_velocity(vector)add_impulse(vector)set_simulate_physics(enabled=True)destroy()__str__()
carla.Vehicle(carla.Actor)
bounding_boxapply_control(vehicle_control)get_control()get_physics_control()apply_physics_control(vehicle_physics_control)set_autopilot(enabled=True)get_speed_limit()get_traffic_light_state()is_at_traffic_light()get_traffic_light()
carla.TrafficLight(carla.Actor)
stateset_state(traffic_light_state)get_state()set_green_time(green_time)get_green_time()set_yellow_time(yellow_time)get_yellow_time()set_red_time(red_time)get_red_time()get_elapsed_time()freeze(True)is_frozen()get_pole_index()get_group_traffic_lights()
carla.Sensor(carla.Actor)
is_listeninglisten(callback_function)stop()
carla.SensorData
frame_numbertimestamptransform
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.GnssEvent(carla.SensorData)
latitudelongitudealtitude
carla.ObstacleDetectionSensorEvent(carla.SensorData)
actorother_actordistance
carla.VehicleControl
throttlesteerbrakehand_brakereversegearmanual_gear_shift__eq__(other)__ne__(other)
carla.WheelsPhysicsControl
tire_frictiondamping_ratesteer_angledisable_steering__eq__(other)__ne__(other)
carla.VehiclePhysicsControl
torque_curvemax_rpmmoidamping_rate_full_throttledamping_rate_zero_throttle_clutch_engageddamping_rate_zero_throttle_clutch_disengageduse_gear_autoboxgear_switch_timeclutch_strengthmassdrag_coefficientcenter_of_masssteering_curvewheels__eq__(other)__ne__(other)
carla.Map
nameget_spawn_points()get_waypoint(location, project_to_road=True, lane_type=carla.LaneType.Driving)get_topology()generate_waypoints(distance)transform_to_geolocation(location)to_opendrive()save_to_disk(path=self.name)
carla.LaneType
NONEDrivingStopShoulderBikingSidewalkBorderRestrictedParkingBidirectionalMedianSpecial1Special2Special3RoadWorksTramRailEntryExitOffRampOnRampAny
carla.LaneChange
NONERightLeftBoth
carla.LaneMarkingColor
Standard = WhiteBlueGreenRedWhiteYellowOther
carla.LaneMarkingType
NONEOtherBrokenSolidSolidSolidSolidBrokenBrokenSolidBrokenBrokenBottsDotsGrassCurb
carla.LaneMarking
type -> carla.LaneMarkingcolor -> carla.RoadMarkColorlane_change -> carla.LaneChangewidth
carla.Waypoint
idtransformis_intersectionlane_widthroad_idsection_idlane_idslane_change -> carla.LaneChangelane_type -> carla.LaneTyperight_lane_marking -> carla.LaneMarkingleft_lane_marking -> carla.LaneMarkingnext(distance) -> list(carla.Waypoint)get_right_lane() -> carla.Waypointget_left_lane() -> carla.Waypoint
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
pitchyawrollget_forward_vector()__eq__(other)__ne__(other)
carla.Transform
locationrotationtransform(geom_object)get_forward_vector()__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
RedYellowGreenOffUnknown
carla.LaneMarking
OtherBrokenSolid
module carla.command
carla.command.FutureActor (not yet spawned actor handler)
carla.command.Response
actor_iderror-> str|emptyhas_error()
carla.command.SpawnActor
__init__(blueprint, transform, parent=None)then(command)
carla.command.DestroyActor
__init__(actor)actor_id
carla.command.ApplyVehicleControl
__init__(actor, control)actor_idcontrol
carla.command.ApplyWalkerControl
__init__(actor, control)actor_idcontrol
carla.command.ApplyTransform
__init__(actor, transform)actor_idtransform
carla.command.ApplyVelocity
__init__(actor, velocity)actor_idvelocity
carla.command.ApplyAngularVelocity
__init__(actor, angular_velocity)actor_idangular_velocity
carla.command.ApplyImpulse
__init__(actor, impulse)actor_idimpulse
carla.command.SetSimulatePhysics
__init__(actor, bool)actor_idenabled
carla.command.SetAutopilot
__init__(actor, bool)actor_idenabled