#Python API reference
This reference contains all the details the Python API. To consult a previous reference for a specific CARLA release, change the documentation version using the panel in the bottom right corner.
This will change the whole documentation to a previous state. Remember that the latest version is the `dev` branch and may show features not available in any packaged versions of CARLA.
child_location = Location(0,0,2)
).
- **SpringArmGhost**
An attachment like the previous one but that does not make the collision test, and that means that it does not expands or retracts the position of the actor. The term **ghost** is because then the camera can cross walls and other geometries. This attachment is only recommended to record videos from the simulation where a smooth movement is needed. SpringArms are an Unreal Engine component so [check the UE docs](https://docs.unrealengine.com/en-US/Gameplay/HowTo/UsingCameras/SpringArmComponents/index.html) to learn more about them. child_location = Location(0,0,2)
).
---
## carla.BlueprintLibrary
A class that contains the blueprints provided for actor spawning. Its main application is to return [carla.ActorBlueprint](#carla.ActorBlueprint) objects needed to spawn actors. Each blueprint has an identifier and attributes that may or may not be modifiable. The library is automatically created by the server and can be accessed through [carla.World](#carla.World).
[Here](bp_library.md) is a reference containing every available blueprint and its specifics.
### Methods
- **filter**(**self**, **wildcard_pattern**)
Filters a list of blueprints matching the `wildcard_pattern` against the id and tags of every blueprint contained in this library and returns the result as a new one. Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
- **Parameters:**
- `wildcard_pattern` (_str_)
- **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_
- **filter_by_attribute**(**self**, **name**, **value**)
Filters a list of blueprints with a given attribute matching the `value` against every blueprint contained in this library and returns the result as a new one. Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
- **Parameters:**
- `name` (_str_)
- `value` (_str_)
- **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_
- **find**(**self**, **id**)
Returns the blueprint corresponding to that identifier.
- **Parameters:**
- `id` (_str_)
- **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_
##### Dunder methods
- **\__getitem__**(**self**, **pos**=int)
Returns the blueprint stored in `pos` position inside the data structure containing them.
- **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_
- **\__iter__**(**self**)
Iterate over the [carla.ActorBlueprint](#carla.ActorBlueprint) stored in the library.
- **\__len__**(**self**)
Returns the amount of blueprints comprising the library.
- **Return:** _int_
- **\__str__**(**self**)
Parses the identifiers for every blueprint to string.
- **Return:** _string_
---
## carla.BoundingBox
Bounding boxes contain the geometry of an actor or an element in the scene. They can be used by [carla.DebugHelper](#carla.DebugHelper) or a [carla.Client](#carla.Client) to draw their shapes for debugging. Check out the snipet in [carla.DebugHelper.draw_box](#carla.DebugHelper.draw_box) where a snapshot of the world is used to draw bounding boxes for traffic lights.
### Instance Variables
- **extent** (_[carla.Vector3D](#carla.Vector3D) - meters_)
Vector from the center of the box to one vertex. The value in each axis equals half the size of the box for that axis.
`extent.x * 2` would return the size of the box in the X-axis.
- **location** (_[carla.Location](#carla.Location) - meters_)
The center of the bounding box.
- **rotation** (_[carla.Rotation](#carla.Rotation)_)
The orientation of the bounding box.
### Methods
- **\__init__**(**self**, **location**, **extent**)
- **Parameters:**
- `location` (_[carla.Location](#carla.Location)_) - Center of the box, relative to its parent.
- `extent` (_[carla.Vector3D](#carla.Vector3D) - meters_) - Vector containing half the size of the box for every axis.
- **contains**(**self**, **world_point**, **transform**)
Returns **True** if a point passed in world space is inside this bounding box.
- **Parameters:**
- `world_point` (_[carla.Location](#carla.Location) - meters_) - The point in world space to be checked.
- `transform` (_[carla.Transform](#carla.Transform)_) - Contains location and rotation needed to convert this object's local space to world space.
- **Return:** _bool_
##### Getters
- **get_local_vertices**(**self**)
Returns a list containing the locations of this object's vertices in local space.
- **Return:** _list([carla.Location](#carla.Location))_
- **get_world_vertices**(**self**, **transform**)
Returns a list containing the locations of this object's vertices in world space.
- **Parameters:**
- `transform` (_[carla.Transform](#carla.Transform)_) - Contains location and rotation needed to convert this object's local space to world space.
- **Return:** _list([carla.Location](#carla.Location))_
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.BoundingBox](#carla.BoundingBox))
Returns true if both location and extent are equal for this and `other`.
- **Return:** _bool_
- **\__ne__**(**self**, **other**=[carla.BoundingBox](#carla.BoundingBox))
Returns true if either location or extent are different for this and `other`.
- **Return:** _bool_
- **\__str__**(**self**)
Parses the location and extent of the bounding box to string.
- **Return:** _str_
---
## carla.CityObjectLabel
Enum declaration that contains the different tags available to filter the bounding boxes returned by [carla.World.get_level_bbs](#carla.World.get_level_bbs)(). These values correspond to the [semantic tag](ref_sensors.md#semantic-segmentation-camera) that the elements in the scene have.
### Instance Variables
- **None**
- **Buildings**
- **Fences**
- **Other**
- **Pedestrians**
- **Poles**
- **RoadLines**
- **Roads**
- **Sidewalks**
- **TrafficSigns**
- **Vegetation**
- **Vehicles**
- **Walls**
- **Sky**
- **Ground**
- **Bridge**
- **RailTrack**
- **GuardRail**
- **TrafficLight**
- **Static**
- **Dynamic**
- **Water**
- **Terrain**
- **Any**
---
## carla.Client
The Client connects CARLA to the server which runs the simulation. Both server and client contain a CARLA library (libcarla) with some differences that allow communication between them. Many clients can be created and each of these will connect to the RPC server inside the simulation to send commands. The simulation runs server-side. Once the connection is established, the client will only receive data retrieved from the simulation. Walkers are the exception. The client is in charge of managing pedestrians so, if you are running a simulation with multiple clients, some issues may arise. For example, if you spawn walkers through different clients, collisions may happen, as each client is only aware of the ones it is in charge of.
The client also has a recording feature that saves all the information of a simulation while running it. This allows the server to replay it at will to obtain information and experiment with it. [Here](adv_recorder.md) is some information about how to use this recorder.
### Methods
- **\__init__**(**self**, **host**=127.0.0.1, **port**=2000, **worker_threads**=0)
Client constructor.
- **Parameters:**
- `host` (_str_) - IP address where a CARLA Simulator instance is running. Default is localhost (127.0.0.1).
- `port` (_int_) - TCP port where the CARLA Simulator instance is running. Default are 2000 and the subsequent 2001.
- `worker_threads` (_int_) - Number of working threads used for background updates. If 0, use all available concurrency.
- **apply_batch**(**self**, **commands**)
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __apply_batch_sync()__ method. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example on how to delete the actors that appear in [carla.ActorList](#carla.ActorList) all at once.
- **Parameters:**
- `commands` (_list_) - A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page.
- **apply_batch_sync**(**self**, **commands**, **due_tick_cue**=False)
Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of command.Response that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example of it being used to spawn actors.
- **Parameters:**
- `commands` (_list_) - A list of commands to execute in batch. The commands available are listed right above, in the method **apply_batch()**.
- `due_tick_cue` (_bool_) - A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. It is __False__ by default.
- **Return:** _list(command.Response)_
- **generate_opendrive_world**(**self**, **opendrive**, **parameters**=(2.0, 50.0, 1.0, 0.6, true, true), **reset_settings**=True)
Loads a new world with a basic 3D topology generated from the content of an OpenDRIVE file. This content is passed as a `string` parameter. It is similar to `client.load_world(map_name)` but allows for custom OpenDRIVE maps in server side. Cars can drive around the map, but there are no graphics besides the road and sidewalks.
- **Parameters:**
- `opendrive` (_str_) - Content of an ASAM OpenDRIVE file as `string`, __not the path to the `.xodr`__.
- `parameters` (_[carla.OpendriveGenerationParameters](#carla.OpendriveGenerationParameters)_) - Additional settings for the mesh generation. If none are provided, default values will be used.
- `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios.
- **load_world**(**self**, **map_name**, **reset_settings**=True, **map_layers**=[carla.MapLayer.All](#carla.MapLayer.All))
Creates a new world with default settings using `map_name` map. All actors in the current world will be destroyed.
- **Parameters:**
- `map_name` (_str_) - Name of the map to be used in this world. Accepts both full paths and map names, e.g. '/Game/Carla/Maps/Town01' or 'Town01'. Remember that these paths are dynamic.
- `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios.
- `map_layers` (_[carla.MapLayer](#carla.MapLayer)_) - Layers of the map that will be loaded. By default all layers are loaded. This parameter works like a flag mask.
- **Warning:** _`map_layers` are only available for "Opt" maps
_
- **reload_world**(**self**, **reset_settings**=True)
Reload the current world, note that a new world is created with default settings using the same map. All actors present in the world will be destroyed, __but__ traffic manager instances will stay alive.
- **Parameters:**
- `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios.
- **Raises:** RuntimeError when corresponding.
- **replay_file**(**self**, **name**, **start**, **duration**, **follow_id**, **replay_sensors**)
Load a new world with default settings using `map_name` map. All actors present in the current world will be destroyed, __but__ traffic manager instances will stay alive.
- **Parameters:**
- `name` (_str_) - Name of the file containing the information of the simulation.
- `start` (_float - seconds_) - Time where to start playing the simulation. Negative is read as beginning from the end, being -10 just 10 seconds before the recording finished.
- `duration` (_float - seconds_) - Time that will be reenacted using the information `name` file. If the end is reached, the simulation will continue.
- `follow_id` (_int_) - ID of the actor to follow. If this is 0 then camera is disabled.
- `replay_sensors` (_bool_) - Flag to enable or disable the spawn of sensors during playback.
- **request_file**(**self**, **name**)
Requests one of the required files returned by [carla.Client.get_required_files](#carla.Client.get_required_files).
- **Parameters:**
- `name` (_str_) - Name of the file you are requesting.
- **show_recorder_actors_blocked**(**self**, **filename**, **min_time**, **min_distance**)
The terminal will show the information registered for actors considered blocked. An actor is considered blocked when it does not move a minimum distance in a period of time, being these `min_distance` and `min_time`.
- **Parameters:**
- `filename` (_str_) - Name of the recorded file to load.
- `min_time` (_float - seconds_) - Minimum time the actor has to move a minimum distance before being considered blocked. Default is 60 seconds.
- `min_distance` (_float - centimeters_) - Minimum distance the actor has to move to not be considered blocked. Default is 100 centimeters.
- **Return:** _string_
- **show_recorder_collisions**(**self**, **filename**, **category1**, **category2**)
The terminal will show the collisions registered by the recorder. These can be filtered by specifying the type of actor involved. The categories will be specified in `category1` and `category2` as follows:
'h' = Hero, the one vehicle that can be controlled manually or managed by the user.
'v' = Vehicle
'w' = Walker
't' = Traffic light
'o' = Other
'a' = Any
If you want to see only collisions between a vehicles and a walkers, use for `category1` as 'v' and `category2` as 'w' or vice versa. If you want to see all the collisions (filter off) you can use 'a' for both parameters.
- **Parameters:**
- `filename` (_str_) - Name or absolute path of the file recorded, depending on your previous choice.
- `category1` (_single char_) - Character variable specifying a first type of actor involved in the collision.
- `category2` (_single char_) - Character variable specifying the second type of actor involved in the collision.
- **Return:** _string_
- **show_recorder_file_info**(**self**, **filename**, **show_all**)
The information saved by the recorder will be parsed and shown in your terminal as text (frames, times, events, state, positions...). The information shown can be specified by using the `show_all` parameter. [Here](ref_recorder_binary_file_format.md) is some more information about how to read the recorder file.
- **Parameters:**
- `filename` (_str_) - Name or absolute path of the file recorded, depending on your previous choice.
- `show_all` (_bool_) - If __True__, returns all the information stored for every frame (traffic light states, positions of all actors, orientation and animation data...). If __False__, returns a summary of key events and frames.
- **Return:** _string_
- **start_recorder**(**self**, **filename**, **additional_data**=False)
Enables the recording feature, which will start saving every information possible needed by the server to replay the simulation.
- **Parameters:**
- `filename` (_str_) - Name of the file to write the recorded data. A simple name will save the recording in 'CarlaUE4/Saved/recording.log'. Otherwise, if some folder appears in the name, it will be considered an absolute path.
- `additional_data` (_bool_) - Enables or disable recording non-essential data for reproducing the simulation (bounding box location, physics control parameters, etc).
- **stop_recorder**(**self**)
Stops the recording in progress. If you specified a path in `filename`, the recording will be there. If not, look inside `CarlaUE4/Saved/`.
- **stop_replayer**(**self**, **keep_actors**)
Stop current replayer.
- **Parameters:**
- `keep_actors` (_bool_) - True if you want autoremove all actors from the replayer, or False to keep them.
##### Getters
- **get_available_maps**(**self**)
Returns a list of strings containing the paths of the maps available on server. These paths are dynamic, they will be created during the simulation and so you will not find them when looking up in your files. One of the possible returns for this method would be:
['/Game/Carla/Maps/Town01',
'/Game/Carla/Maps/Town02',
'/Game/Carla/Maps/Town03',
'/Game/Carla/Maps/Town04',
'/Game/Carla/Maps/Town05',
'/Game/Carla/Maps/Town06',
'/Game/Carla/Maps/Town07'].
- **Return:** _list(str)_
- **get_client_version**(**self**)
Returns the client libcarla version by consulting it in the "Version.h" file. Both client and server can use different libcarla versions but some issues may arise regarding unexpected incompatibilities.
- **Return:** _str_
- **get_required_files**(**self**, **folder**, **download**=True)
Asks the server which files are required by the client to use the current map. Option to download files automatically if they are not already in the cache.
- **Parameters:**
- `folder` (_str_) - Folder where files required by the client will be downloaded to.
- `download` (_bool_) - If True, downloads files that are not already in cache.
- **get_server_version**(**self**)
Returns the server libcarla version by consulting it in the "Version.h" file. Both client and server should use the same libcarla version.
- **Return:** _str_
- **get_trafficmanager**(**self**, **client_connection**=8000)
Returns an instance of the traffic manager related to the specified port. If it does not exist, this will be created.
- **Parameters:**
- `client_connection` (_int_) - Port that will be used by the traffic manager. Default is `8000`.
- **Return:** _[carla.TrafficManager](#carla.TrafficManager)_
- **get_world**(**self**)
Returns the world object currently active in the simulation. This world will be later used for example to load maps.
- **Return:** _[carla.World](#carla.World)_
##### Setters
- **set_files_base_folder**(**self**, **path**)
- **Parameters:**
- `path` (_str_) - Specifies the base folder where the local cache for required files will be placed.
- **set_replayer_ignore_hero**(**self**, **ignore_hero**)
- **Parameters:**
- `ignore_hero` (_bool_) - Enables or disables playback of the hero vehicle during a playback of a recorded simulation.
- **set_replayer_ignore_spectator**(**self**, **ignore_spectator**)
- **Parameters:**
- `ignore_spectator` (_bool_) - Determines whether the recorded spectator movements will be replicated by the replayer.
- **set_replayer_time_factor**(**self**, **time_factor**=1.0)
When used, the time speed of the reenacted simulation is modified at will. It can be used several times while a playback is in curse.
- **Parameters:**
- `time_factor` (_float_) - 1.0 means normal time speed. Greater than 1.0 means fast motion (2.0 would be double speed) and lesser means slow motion (0.5 would be half speed).
- **set_timeout**(**self**, **seconds**)
Sets the maximum time a network call is allowed before blocking it and raising a timeout exceeded error.
- **Parameters:**
- `seconds` (_float - seconds_) - New timeout value. Default is 5 seconds.
---
## carla.CollisionEvent
Inherited from _[carla.SensorData](#carla.SensorData)_
Class that defines a collision data for sensor.other.collision. The sensor creates one of these for every collision detected. Each collision sensor produces one collision event per collision per frame. Multiple collision events may be produced in a single frame by collisions with multiple other actors. Learn more about this [here](ref_sensors.md#collision-detector).
### Instance Variables
- **actor** (_[carla.Actor](#carla.Actor)_)
The actor the sensor is attached to, the one that measured the collision.
- **other_actor** (_[carla.Actor](#carla.Actor)_)
The second actor involved in the collision.
- **normal_impulse** (_[carla.Vector3D](#carla.Vector3D) - N*s_)
Normal impulse resulting of the collision.
---
## carla.Color
Class that defines a 32-bit RGBA color.
### Instance Variables
- **r** (_int_)
Red color (0-255).
- **g** (_int_)
Green color (0-255).
- **b** (_int_)
Blue color (0-255).
- **a** (_int_)
Alpha channel (0-255).
### Methods
- **\__init__**(**self**, **r**=0, **g**=0, **b**=0, **a**=255)
Initializes a color, black by default.
- **Parameters:**
- `r` (_int_)
- `g` (_int_)
- `b` (_int_)
- `a` (_int_)
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.Color](#carla.Color))
- **\__ne__**(**self**, **other**=[carla.Color](#carla.Color))
- **\__str__**(**self**)
---
## carla.ColorConverter
Class that defines conversion patterns that can be applied to a [carla.Image](#carla.Image) in order to show information provided by [carla.Sensor](#carla.Sensor). Depth conversions cause a loss of accuracy, as sensors detect depth as float that is then converted to a grayscale value between 0 and 255. Take a look at the snipet in [carla.Sensor.listen](#carla.Sensor.listen) to see an example of how to create and save image data for sensor.camera.semantic_segmentation.
### Instance Variables
- **CityScapesPalette**
Converts the image to a segmented map using tags provided by the blueprint library. Used by the [semantic segmentation camera](ref_sensors.md#semantic-segmentation-camera).
- **Depth**
Converts the image to a linear depth map. Used by the [depth camera](ref_sensors.md#depth-camera).
- **LogarithmicDepth**
Converts the image to a depth map using a logarithmic scale, leading to better precision for small distances at the expense of losing it when further away.
- **Raw**
No changes applied to the image. Used by the [RGB camera](ref_sensors.md#rgb-camera).
---
## carla.DVSEvent
Class that defines a DVS event. An event is a quadruple, so a tuple of 4 elements, with `x`, `y` pixel coordinate location, timestamp `t` and polarity `pol` of the event. Learn more about them [here](ref_sensors.md).
### Instance Variables
- **x** (_int_)
X pixel coordinate.
- **y** (_int_)
Y pixel coordinate.
- **t** (_int_)
Timestamp of the moment the event happened.
- **pol** (_bool_)
Polarity of the event. __True__ for positive and __False__ for negative.
### Methods
##### Dunder methods
- **\__str__**(**self**)
---
## carla.DVSEventArray
Class that defines a stream of events in [carla.DVSEvent](#carla.DVSEvent). Such stream is an array of arbitrary size depending on the number of events. This class also stores the field of view, the height and width of the image and the timestamp from convenience. Learn more about them [here](ref_sensors.md).
### Instance Variables
- **fov** (_float - degrees_)
Horizontal field of view of the image.
- **height** (_int_)
Image height in pixels.
- **width** (_int_)
Image width in pixels.
- **raw_data** (_bytes_)
### Methods
- **to_array**(**self**)
Converts the stream of events to an array of int values in the following order [x, y, t, pol]
.
- **to_array_pol**(**self**)
Returns an array with the polarity of all the events in the stream.
- **to_array_t**(**self**)
Returns an array with the timestamp of all the events in the stream.
- **to_array_x**(**self**)
Returns an array with X pixel coordinate of all the events in the stream.
- **to_array_y**(**self**)
Returns an array with Y pixel coordinate of all the events in the stream.
- **to_image**(**self**)
Converts the image following this pattern: blue indicates positive events, red indicates negative events.
##### Dunder methods
- **\__getitem__**(**self**, **pos**=int)
- **\__iter__**(**self**)
Iterate over the [carla.DVSEvent](#carla.DVSEvent) retrieved as data.
- **\__len__**(**self**)
- **\__setitem__**(**self**, **pos**=int, **color**=[carla.Color](#carla.Color))
- **\__str__**(**self**)
---
## carla.DebugHelper
Helper class part of [carla.World](#carla.World) that defines methods for creating debug shapes. By default, shapes last one second. They can be permanent, but take into account the resources needed to do so. Take a look at the snipets available for this class to learn how to debug easily in CARLA.
### Methods
- **draw_arrow**(**self**, **begin**, **end**, **thickness**=0.1, **arrow_size**=0.1, **color**=(255,0,0), **life_time**=-1.0)
Draws an arrow from `begin` to `end` pointing in that direction.
- **Parameters:**
- `begin` (_[carla.Location](#carla.Location) - meters_) - Point in the coordinate system where the arrow starts.
- `end` (_[carla.Location](#carla.Location) - meters_) - Point in the coordinate system where the arrow ends and points towards to.
- `thickness` (_float - meters_) - Density of the line.
- `arrow_size` (_float - meters_) - Size of the tip of the arrow.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default.
- `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0
for permanent shapes.
- **draw_box**(**self**, **box**, **rotation**, **thickness**=0.1, **color**=(255,0,0), **life_time**=-1.0)
Draws a box, ussually to act for object colliders.
- **Parameters:**
- `box` (_[carla.BoundingBox](#carla.BoundingBox)_) - Object containing a location and the length of a box for every axis.
- `rotation` (_[carla.Rotation](#carla.Rotation) - degrees (pitch,yaw,roll)_) - Orientation of the box according to Unreal Engine's axis system.
- `thickness` (_float - meters_) - Density of the lines that define the box.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default.
- `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0
for permanent shapes.
- **draw_line**(**self**, **begin**, **end**, **thickness**=0.1, **color**=(255,0,0), **life_time**=-1.0)
Draws a line in between `begin` and `end`.
- **Parameters:**
- `begin` (_[carla.Location](#carla.Location) - meters_) - Point in the coordinate system where the line starts.
- `end` (_[carla.Location](#carla.Location) - meters_) - Spot in the coordinate system where the line ends.
- `thickness` (_float - meters_) - Density of the line.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default.
- `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0
for permanent shapes.
- **draw_point**(**self**, **location**, **size**=0.1, **color**=(255,0,0), **life_time**=-1.0)
Draws a point `location`.
- **Parameters:**
- `location` (_[carla.Location](#carla.Location) - meters_) - Spot in the coordinate system to center the object.
- `size` (_float - meters_) - Density of the point.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default.
- `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0
for permanent shapes.
- **draw_string**(**self**, **location**, **text**, **draw_shadow**=False, **color**=(255,0,0), **life_time**=-1.0)
Draws a string in a given location of the simulation which can only be seen server-side.
- **Parameters:**
- `location` (_[carla.Location](#carla.Location) - meters_) - Spot in the simulation where the text will be centered.
- `text` (_str_) - Text intended to be shown in the world.
- `draw_shadow` (_bool_) - Casts a shadow for the string that could help in visualization. It is disabled by default.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the string. Red by default.
- `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0
for permanent shapes.
---
## carla.EnvironmentObject
Class that represents a geometry in the level, this geometry could be part of an actor formed with other EnvironmentObjects (ie: buildings).
### Instance Variables
- **transform** (_[carla.Transform](#carla.Transform)_)
Contains the location and orientation of the EnvironmentObject in world space.
- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_)
Object containing a location, rotation and the length of a box for every axis in world space.
- **id** (_int_)
Unique ID to identify the object in the level.
- **name** (_string_)
Name of the EnvironmentObject.
- **type** (_[carla.CityObjectLabel](#carla.CityObjectLabel)_)
Semantic tag.
### Methods
##### Dunder methods
- **\__str__**(**self**)
Parses the EnvironmentObject to a string and shows them in command line.
- **Return:** _str_
---
## carla.FloatColor
Class that defines a float RGBA color.
### Instance Variables
- **r** (_float_)
Red color.
- **g** (_float_)
Green color.
- **b** (_float_)
Blue color.
- **a** (_float_)
Alpha channel.
### Methods
- **\__init__**(**self**, **r**=0, **g**=0, **b**=0, **a**=1.0)
Initializes a color, black by default.
- **Parameters:**
- `r` (_float_)
- `g` (_float_)
- `b` (_float_)
- `a` (_float_)
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.FloatColor](#carla.FloatColor))
- **\__ne__**(**self**, **other**=[carla.FloatColor](#carla.FloatColor))
---
## carla.GBufferTextureID
Defines the identifiers of each GBuffer texture (See the method `[carla.Sensor.listen_to_gbuffer](#carla.Sensor.listen_to_gbuffer)`).
### Instance Variables
- **SceneColor**
The texture "SceneColor" contains the final color of the image.
- **SceneDepth**
The texture "SceneDepth" contains the depth buffer - linear in world units.
- **SceneStencil**
The texture "SceneStencil" contains the stencil buffer.
- **GBufferA**
The texture "GBufferA" contains the world-space normal vectors in the RGB channels. The alpha channel contains "per-object data".
- **GBufferB**
The texture "GBufferB" contains the metallic, specular and roughness in the RGB channels, respectively. The alpha channel contains a mask where the lower 4 bits indicate the shading model and the upper 4 bits contain the selective output mask.
- **GBufferC**
The texture "GBufferC" contains the diffuse color in the RGB channels, with the indirect irradiance in the alpha channel..osm
file (OpenStreetMap format) and returns the content of the .xodr
(OpenDRIVE format) describing said map. Some parameterization is passed to do the conversion.
- **Parameters:**
- `osm_file` (_str_) - The content of the input OpenStreetMap file parsed as string.
- `settings` (_[carla.OSM2ODRSettings](#carla.OSM2ODRSettings)_) - Parameterization for the conversion.
- **Return:** _str_
---
## carla.Osm2OdrSettings
Helper class that contains the parameterization that will be used by [carla.Osm2Odr](#carla.Osm2Odr) to convert an OpenStreetMap map to OpenDRIVE format. Find out more about this feature in the [docs](tuto_G_openstreetmap.md).
### Instance Variables
- **use_offsets** (_bool_)
Enables the use of offset for the conversion. The offset will move the origin position of the map. Default value is __False__.
- **offset_x** (_float - meters_)
Offset in the X axis. Default value is __0.0__.
- **offset_y** (_float - meters_)
Offset in the Y axis. Default value is __0.0__.
- **default_lane_width** (_float - meters_)
Width of the lanes described in the resulting XODR map. Default value is __4.0__.
- **elevation_layer_height** (_float - meters_)
Defines the height separating two different [OpenStreetMap layers](https://wiki.openstreetmap.org/wiki/Key:layer). Default value is __0.0__.
- **center_map** (_bool_)
When this option is enabled, the geometry of the map will be displaced so that the origin of coordinates matches the center of the bounding box of the entire road map.
- **proj_string** (_str_)
Defines the [proj4](https://github.com/OSGeo/proj.4) string that will be used to compute the projection from geocoordinates to cartesian coordinates. This string will be written in the resulting OpenDRIVE unless the options `use_offsets` or `center_map` are enabled as these options override some of the definitions in the string.
- **generate_traffic_lights** (_bool_)
Indicates wether to generate traffic light data in the OpenDRIVE. Road types defined by `set_traffic_light_excluded_way_types(way_types)` will not generate traffic lights.
- **all_junctions_with_traffic_lights** (_bool_)
When disabled, the converter will generate traffic light data from the OpenStreetMaps data only. When enabled, all junctions will generate traffic lights.
### Methods
##### Setters
- **set_osm_way_types**(**self**, **way_types**)
Defines the OpenStreetMaps road types that will be imported to OpenDRIVE. By default the road types imported are `motorway, motorway_link, trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link, unclassified, residential`. For a full list of road types check [here](https://wiki.openstreetmap.org/wiki/Main_Page).
- **Parameters:**
- `way_types` (_list(str)_) - The list of road types.
- **set_traffic_light_excluded_way_types**(**self**, **way_types**)
Defines the OpenStreetMaps road types that will not generate traffic lights even if `generate_traffic_lights` is enabled. By default the road types excluded are `motorway_link, primary_link, secondary_link, tertiary_link`.
- **Parameters:**
- `way_types` (_list(str)_) - The list of road types.
---
## carla.RadarDetection
Data contained inside a [carla.RadarMeasurement](#carla.RadarMeasurement). Each of these represents one of the points in the cloud that a sensor.other.radar registers and contains the distance, angle and velocity in relation to the radar.
### Instance Variables
- **altitude** (_float - radians_)
Altitude angle of the detection.
- **azimuth** (_float - radians_)
Azimuth angle of the detection.
- **depth** (_float - meters_)
Distance from the sensor to the detection position.
- **velocity** (_float - m/s_)
The velocity of the detected object towards the sensor.
### Methods
##### Dunder methods
- **\__str__**(**self**)
---
## carla.RadarMeasurement
Inherited from _[carla.SensorData](#carla.SensorData)_
Class that defines and gathers the measures registered by a sensor.other.radar, representing a wall of points in front of the sensor with a distance, angle and velocity in relation to it. The data consists of a [carla.RadarDetection](#carla.RadarDetection) array. Learn more about this [here](ref_sensors.md#radar-sensor).
### Instance Variables
- **raw_data** (_bytes_)
The complete information of the [carla.RadarDetection](#carla.RadarDetection) the radar has registered.
### Methods
##### Getters
- **get_detection_count**(**self**)
Retrieves the number of entries generated, same as **\__str__()**.
##### Dunder methods
- **\__getitem__**(**self**, **pos**=int)
- **\__iter__**(**self**)
Iterate over the [carla.RadarDetection](#carla.RadarDetection) retrieved as data.
- **\__len__**(**self**)
- **\__setitem__**(**self**, **pos**=int, **detection**=[carla.RadarDetection](#carla.RadarDetection))
- **\__str__**(**self**)
---
## carla.Rotation
Class that represents a 3D rotation and therefore, an orientation in space. CARLA uses the Unreal Engine coordinates system. This is a Z-up left-handed system. (pitch,yaw,roll)
, and in the Unreal Engine Editor (roll,pitch,yaw)
. When working in a build from source, don't mix up the axes' rotations._
##### Getters
- **get_forward_vector**(**self**)
Computes the vector pointing forward according to the rotation of the object.
- **Return:** _[carla.Vector3D](#carla.Vector3D)_
- **get_right_vector**(**self**)
Computes the vector pointing to the right according to the rotation of the object.
- **Return:** _[carla.Vector3D](#carla.Vector3D)_
- **get_up_vector**(**self**)
Computes the vector pointing upwards according to the rotation of the object.
- **Return:** _[carla.Vector3D](#carla.Vector3D)_
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.Rotation](#carla.Rotation))
Returns __True__ if both rotations represent the same orientation for every axis.
- **Return:** _bool_
- **\__ne__**(**self**, **other**=[carla.Rotation](#carla.Rotation))
Returns __True__ if both rotations represent the same orientation for every axis.
- **Return:** _bool_
- **\__str__**(**self**)
Parses the axis' orientations to string.
---
## carla.RssActorConstellationData
Data structure that is provided within the callback registered by RssSensor.register_actor_constellation_callback().
### Instance Variables
- **ego_match_object** (_ad.map.match.Object_)
The ego map matched information.
- **ego_route** (_ad.map.route.FullRoute_)
The ego route.
- **ego_dynamics_on_route** (_[carla.RssEgoDynamicsOnRoute](#carla.RssEgoDynamicsOnRoute)_)
Current ego vehicle dynamics regarding the route.
- **other_match_object** (_ad.map.match.Object_)
The other object's map matched information. This is only valid if 'other_actor' is not 'None'.
- **other_actor** (_[carla.Actor](#carla.Actor)_)
The other actor. This is 'None' in case of query of default parameters or articial objects of kind ad.rss.world.ObjectType.ArtificialObject with no dedicated '[carla.Actor](#carla.Actor)' (as e.g. for the [road boundaries](ref_sensors.md#rss-sensor) at the moment).
### Methods
##### Dunder methods
- **\__str__**(**self**)
---
## carla.RssActorConstellationResult
Data structure that should be returned by the callback registered by RssSensor.register_actor_constellation_callback().
### Instance Variables
- **rss_calculation_mode** (_ad.rss.map.RssMode_)
The calculation mode to be applied with the actor.
- **restrict_speed_limit_mode** (_ad.rss.map.RestrictSpeedLimitMode_)
The mode for restricting speed limit.
- **ego_vehicle_dynamics** (_ad.rss.world.RssDynamics_)
The RSS dynamics to be applied for the ego vehicle.
- **actor_object_type** (_ad.rss.world.ObjectType_)
The RSS object type to be used for the actor.
- **actor_dynamics** (_ad.rss.world.RssDynamics_)
The RSS dynamics to be applied for the actor.
### Methods
##### Dunder methods
- **\__str__**(**self**)
---
## carla.RssEgoDynamicsOnRoute
Part of the data contained inside a [carla.RssResponse](#carla.RssResponse) describing the state of the vehicle. The parameters include its current dynamics, and how it is heading regarding the target route.
### Instance Variables
- **ego_speed** (_ad.physics.Speed_)
The ego vehicle's speed.
- **min_stopping_distance** (_ad.physics.Distance_)
The current minimum stopping distance.
- **ego_center** (_ad.map.point.ENUPoint_)
The considered enu position of the ego vehicle.
- **ego_heading** (_ad.map.point.ENUHeading_)
The considered heading of the ego vehicle.
- **ego_center_within_route** (_bool_)
States if the ego vehicle's center is within the route.
- **crossing_border** (_bool_)
States if the vehicle is already crossing one of the lane borders.
- **route_heading** (_ad.map.point.ENUHeading_)
The considered heading of the route.
- **route_nominal_center** (_ad.map.point.ENUPoint_)
The considered nominal center of the current route.
- **heading_diff** (_ad.map.point.ENUHeading_)
The considered heading diff towards the route.
- **route_speed_lat** (_ad.physics.Speed_)
The ego vehicle's speed component _lat_ regarding the route.
- **route_speed_lon** (_ad.physics.Speed_)
The ego vehicle's speed component _lon_ regarding the route.
- **route_accel_lat** (_ad.physics.Acceleration_)
The ego vehicle's acceleration component _lat_ regarding the route.
- **route_accel_lon** (_ad.physics.Acceleration_)
The ego vehicle's acceleration component _lon_ regarding the route.
- **avg_route_accel_lat** (_ad.physics.Acceleration_)
The ego vehicle's acceleration component _lat_ regarding the route smoothened by an average filter.
- **avg_route_accel_lon** (_ad.physics.Acceleration_)
The ego acceleration component _lon_ regarding the route smoothened by an average filter.
### Methods
##### Dunder methods
- **\__str__**(**self**)
---
## carla.RssLogLevel
Enum declaration used in [carla.RssSensor](#carla.RssSensor) to set the log level.
### Instance Variables
- **trace**
- **debug**
- **info**
- **warn**
- **err**
- **critical**
- **off**
---
## carla.RssResponse
Inherited from _[carla.SensorData](#carla.SensorData)_
Class that contains the output of a [carla.RssSensor](#carla.RssSensor). This is the result of the RSS calculations performed for the parent vehicle of the sensor.
A [carla.RssRestrictor](#carla.RssRestrictor) will use the data to modify the [carla.VehicleControl](#carla.VehicleControl) of the vehicle.
### Instance Variables
- **response_valid** (_bool_)
States if the response is valid. It is __False__ if calculations failed or an exception occured.
- **proper_response** (_ad.rss.state.ProperResponse_)
The proper response that the RSS calculated for the vehicle.
- **rss_state_snapshot** (_ad.rss.state.RssStateSnapshot_)
Detailed RSS states at the current moment in time.
- **ego_dynamics_on_route** (_[carla.RssEgoDynamicsOnRoute](#carla.RssEgoDynamicsOnRoute)_)
Current ego vehicle dynamics regarding the route.
- **world_model** (_ad.rss.world.WorldModel_)
World model used for calculations.
- **situation_snapshot** (_ad.rss.situation.SituationSnapshot_)
Detailed RSS situations extracted from the world model.
### Methods
##### Dunder methods
- **\__str__**(**self**)
---
## carla.RssRestrictor
These objects apply restrictions to a [carla.VehicleControl](#carla.VehicleControl). It is part of the CARLA implementation of the [C++ Library for Responsibility Sensitive Safety](https://github.com/intel/ad-rss-lib). This class works hand in hand with a [rss sensor](ref_sensors.md#rss-sensor), which provides the data of the restrictions to be applied.
### Methods
- **restrict_vehicle_control**(**self**, **vehicle_control**, **proper_response**, **ego_dynamics_on_route**, **vehicle_physics**)
Applies the safety restrictions given by a [carla.RssSensor](#carla.RssSensor) to a [carla.VehicleControl](#carla.VehicleControl).
- **Parameters:**
- `vehicle_control` (_[carla.VehicleControl](#carla.VehicleControl)_) - The input vehicle control to be restricted.
- `proper_response` (_ad.rss.state.ProperResponse_) - Part of the response generated by the sensor. Contains restrictions to be applied to the acceleration of the vehicle.
- `ego_dynamics_on_route` (_[carla.RssEgoDynamicsOnRoute](#carla.RssEgoDynamicsOnRoute)_) - Part of the response generated by the sensor. Contains dynamics and heading of the vehicle regarding its route.
- `vehicle_physics` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) - The current physics of the vehicle. Used to apply the restrictions properly.
- **Return:** _[carla.VehicleControl](#carla.VehicleControl)_
##### Setters
- **set_log_level**(**self**, **log_level**)
Sets the log level.
- **Parameters:**
- `log_level` (_[carla.RssLogLevel](#carla.RssLogLevel)_) - New log level.
---
## carla.RssRoadBoundariesMode
Enum declaration used in [carla.RssSensor](#carla.RssSensor) to enable or disable the [stay on road](https://intel.github.io/ad-rss-lib/ad_rss_map_integration/HandleRoadBoundaries/) feature. In summary, this feature considers the road boundaries as virtual objects. The minimum safety distance check is applied to these virtual walls, in order to make sure the vehicle does not drive off the road.
### Instance Variables
- **On**
Enables the _stay on road_ feature.
- **Off**
Disables the _stay on road_ feature.
---
## carla.RssSensor
Inherited from _[carla.Sensor](#carla.Sensor)_
This sensor works a bit differently than the rest. Take look at the [specific documentation](adv_rss.md), and the [rss sensor reference](ref_sensors.md#rss-sensor) to gain full understanding of it.
The RSS sensor uses world information, and a [RSS library](https://github.com/intel/ad-rss-lib) to make safety checks on a vehicle. The output retrieved by the sensor is a [carla.RssResponse](#carla.RssResponse). This will be used by a [carla.RssRestrictor](#carla.RssRestrictor) to modify a [carla.VehicleControl](#carla.VehicleControl) before applying it to a vehicle.
### Instance Variables
- **ego_vehicle_dynamics** (_ad.rss.world.RssDynamics_)
States the [RSS parameters](https://intel.github.io/ad-rss-lib/ad_rss/Appendix-ParameterDiscussion/) that the sensor will consider for the ego vehicle if no actor constellation callback is registered.
- **other_vehicle_dynamics** (_ad.rss.world.RssDynamics_)
States the [RSS parameters](https://intel.github.io/ad-rss-lib/ad_rss/Appendix-ParameterDiscussion/) that the sensor will consider for the rest of vehicles if no actor constellation callback is registered.
- **pedestrian_dynamics** (_ad.rss.world.RssDynamics_)
States the [RSS parameters](https://intel.github.io/ad-rss-lib/ad_rss/Appendix-ParameterDiscussion/) that the sensor will consider for pedestrians if no actor constellation callback is registered.
- **road_boundaries_mode** (_[carla.RssRoadBoundariesMode](#carla.RssRoadBoundariesMode)_)
Switches the [stay on road](https://intel.github.io/ad-rss-lib/ad_rss_map_integration/HandleRoadBoundaries/) feature. By default is __Off__.
- **routing_targets** (_vector<[carla.Transform](#carla.Transform)>_)
The current list of targets considered to route the vehicle. If no routing targets are defined, a route is generated at random.
### Methods
- **append_routing_target**(**self**, **routing_target**)
Appends a new target position to the current route of the vehicle.
- **Parameters:**
- `routing_target` (_[carla.Transform](#carla.Transform)_) - New target point for the route. Choose these after the intersections to force the route to take the desired turn.
- **drop_route**(**self**)
Discards the current route. If there are targets remaining in **routing_targets**, creates a new route using those. Otherwise, a new route is created at random.
- **register_actor_constellation_callback**(**self**, **callback**)
Register a callback to customize a [carla.RssActorConstellationResult](#carla.RssActorConstellationResult). By this callback the settings of RSS parameters are done per actor constellation and the settings (ego_vehicle_dynamics, other_vehicle_dynamics and pedestrian_dynamics) have no effect.
- **Parameters:**
- `callback` - The function to be called whenever a RSS situation is about to be calculated.
- **reset_routing_targets**(**self**)
Erases the targets that have been appended to the route.
##### Setters
- **set_log_level**(**self**, **log_level**)
Sets the log level.
- **Parameters:**
- `log_level` (_[carla.RssLogLevel](#carla.RssLogLevel)_) - New log level.
- **set_map_log_level**(**self**, **log_level**)
Sets the map log level.
- **Parameters:**
- `log_level` (_[carla.RssLogLevel](#carla.RssLogLevel)_) - New map log level.
##### Dunder methods
- **\__str__**(**self**)
---
## carla.SemanticLidarDetection
Data contained inside a [carla.SemanticLidarMeasurement](#carla.SemanticLidarMeasurement). Each of these represents one of the points in the cloud with its location, the cosine of the incident angle, index of the object hit, and its semantic tag.
### Instance Variables
- **point** (_[carla.Location](#carla.Location) - meters_)
[x,y,z] coordinates of the point.
- **cos_inc_angle** (_float_)
Cosine of the incident angle between the ray, and the normal of the hit object.
- **object_idx** (_uint_)
ID of the actor hit by the ray.
- **object_tag** (_uint_)
[Semantic tag](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/ref_sensors/#semantic-segmentation-camera) of the component hit by the ray.
### Methods
##### Dunder methods
- **\__str__**(**self**)
---
## carla.SemanticLidarMeasurement
Inherited from _[carla.SensorData](#carla.SensorData)_
Class that defines the semantic LIDAR data retrieved by a sensor.lidar.ray_cast_semantic. This essentially simulates a rotating LIDAR using ray-casting. Learn more about this [here](ref_sensors.md#semanticlidar-raycast-sensor).
### Instance Variables
- **channels** (_int_)
Number of lasers shot.
- **horizontal_angle** (_float - radians_)
Horizontal angle the LIDAR is rotated at the time of the measurement.
- **raw_data** (_bytes_)
Received list of raw detection points. Each point consists of [x,y,z] coordinates plus the cosine of the incident angle, the index of the hit actor, and its semantic tag.
### Methods
- **save_to_disk**(**self**, **path**)
Saves the point cloud to disk as a .ply file describing data from 3D scanners. The files generated are ready to be used within [MeshLab](http://www.meshlab.net/), an open-source system for processing said files. Just take into account that axis may differ from Unreal Engine and so, need to be reallocated.
- **Parameters:**
- `path` (_str_)
##### Getters
- **get_point_count**(**self**, **channel**)
Retrieves the number of points sorted by channel that are generated by this measure. Sorting by channel allows to identify the original channel for every point.
- **Parameters:**
- `channel` (_int_)
##### Dunder methods
- **\__getitem__**(**self**, **pos**=int)
- **\__iter__**(**self**)
Iterate over the [carla.SemanticLidarDetection](#carla.SemanticLidarDetection) retrieved as data.
- **\__len__**(**self**)
- **\__setitem__**(**self**, **pos**=int, **detection**=[carla.SemanticLidarDetection](#carla.SemanticLidarDetection))
- **\__str__**(**self**)
---
## carla.Sensor
Inherited from _[carla.Actor](#carla.Actor)_
Sensors compound a specific family of actors quite diverse and unique. They are normally spawned as attachment/sons of a vehicle (take a look at [carla.World](#carla.World) to learn about actor spawning). Sensors are thoroughly designed to retrieve different types of data that they are listening to. The data they receive is shaped as different subclasses inherited from [carla.SensorData](#carla.SensorData) (depending on the sensor).
Most sensors can be divided in two groups: those receiving data on every tick (cameras, point clouds and some specific sensors) and those who only receive under certain circumstances (trigger detectors). CARLA provides a specific set of sensors and their blueprint can be found in [carla.BlueprintLibrary](#carla.BlueprintLibrary). All the information on their preferences and settlement can be found [here](ref_sensors.md), but the list of those available in CARLA so far goes as follow.
10.0
by default.
- **Return:** _int_
- **Note:** _If no tick is received in synchronous mode, the simulation will freeze. Also, if many ticks are received from different clients, there may be synchronization issues. Please read the docs about [synchronous mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/) to learn more.
_
- **try_spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid)
Same as __spawn_actor()__ but returns None on failure instead of throwing an exception.
- **Parameters:**
- `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) - The reference from which the actor will be created.
- `transform` (_[carla.Transform](#carla.Transform)_) - Contains the location and orientation the actor will be spawned with.
- `attach_to` (_[carla.Actor](#carla.Actor)_) - The parent object that the spawned actor will follow around.
- `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) - Determines how fixed and rigorous should be the changes in position according to its parent object.
- **Return:** _[carla.Actor](#carla.Actor)_
- **unload_map_layer**(**self**, **map_layers**)
Unloads the selected layers to the level. If the layer is already unloaded the call has no effect.
- **Parameters:**
- `map_layers` (_[carla.MapLayer](#carla.MapLayer)_) - Mask of level layers to be unloaded.
- **Warning:** _This only affects "Opt" maps. The minimum layout includes roads, sidewalks, traffic lights and traffic signs._
- **wait_for_tick**(**self**, **seconds**=10.0)
This method is used in [__asynchronous__ mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/). It makes the client wait for a server tick. When the next frame is computed, the server will tick and return a snapshot describing the new state of the world.
- **Parameters:**
- `seconds` (_float - seconds_) - Maximum time the server should wait for a tick. It is set to 10.0
by default.
- **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_
##### Getters
- **get_actor**(**self**, **actor_id**)
Looks up for an actor by ID and returns None if not found.
- **Parameters:**
- `actor_id` (_int_)
- **Return:** _[carla.Actor](#carla.Actor)_
- **get_actors**(**self**, **actor_ids**=None)
Retrieves a list of [carla.Actor](#carla.Actor) elements, either using a list of IDs provided or just listing everyone on stage. If an ID does not correspond with any actor, it will be excluded from the list returned, meaning that both the list of IDs and the list of actors may have different lengths.
- **Parameters:**
- `actor_ids` (_list_) - The IDs of the actors being searched. By default it is set to None and returns every actor on scene.
- **Return:** _[carla.ActorList](#carla.ActorList)_
- **get_blueprint_library**(**self**)
Returns a list of actor blueprints available to ease the spawn of these into the world.
- **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_
- **get_environment_objects**(**self**, **object_type**=Any)
Returns a list of EnvironmentObject with the requested semantic tag. The method returns all the EnvironmentObjects in the level by default, but the query can be filtered by semantic tags with the argument `object_type`.
- **Parameters:**
- `object_type` (_[carla.CityObjectLabel](#carla.CityObjectLabel)_) - Semantic tag of the EnvironmentObjects that are returned.
- **Return:** _array([carla.EnvironmentObject](#carla.EnvironmentObject))_
- **get_level_bbs**(**self**, **actor_type**=Any)
Returns an array of bounding boxes with location and rotation in world space. The method returns all the bounding boxes in the level by default, but the query can be filtered by semantic tags with the argument `actor_type`.
- **Parameters:**
- `actor_type` (_[carla.CityObjectLabel](#carla.CityObjectLabel)_) - Semantic tag of the elements contained in the bounding boxes that are returned.
- **Return:** _array([carla.BoundingBox](#carla.BoundingBox))_
- **get_lightmanager**(**self**)
Returns an instance of [carla.LightManager](#carla.LightManager) that can be used to handle the lights in the scene.
- **Return:** _[carla.LightManager](#carla.LightManager)_
- **get_map**(**self**)
Asks the server for the XODR containing the map file, and returns this parsed as a [carla.Map](#carla.Map).
- **Return:** _[carla.Map](#carla.Map)_
- **Warning:** _This method does call the simulation. It is expensive, and should only be called once.
_
- **get_names_of_all_objects**(**self**)
Returns a list of the names of all objects in the scene that can be painted with the apply texture functions.
- **Return:** _list(str)_
- **get_random_location_from_navigation**(**self**)
This can only be used with walkers. It retrieves a random location to be used as a destination using the __go_to_location()__ method in [carla.WalkerAIController](#carla.WalkerAIController). This location will be part of a sidewalk. Roads, crosswalks and grass zones are excluded. The method does not take into consideration locations of existing actors so if a collision happens when trying to spawn an actor, it will return an error. Take a look at [`generate_traffic.py`](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) for an example.
- **Return:** _[carla.Location](#carla.Location)_
- **get_settings**(**self**)
Returns an object containing some data about the simulation such as synchrony between client and server or rendering mode.
- **Return:** _[carla.WorldSettings](#carla.WorldSettings)_
- **get_snapshot**(**self**)
Returns a snapshot of the world at a certain moment comprising all the information about the actors.
- **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_
- **get_spectator**(**self**)
Returns the spectator actor. The spectator is a special type of actor created by Unreal Engine, usually with ID=0, that acts as a camera and controls the view in the simulator window.
- **Return:** _[carla.Actor](#carla.Actor)_
- **get_traffic_light**(**self**, **landmark**)
Provided a landmark, returns the traffic light object it describes.
- **Parameters:**
- `landmark` (_[carla.Landmark](#carla.Landmark)_) - The landmark object describing a traffic light.
- **Return:** _[carla.TrafficLight](#carla.TrafficLight)_
- **get_traffic_light_from_opendrive_id**(**self**, **traffic_light_id**)
Returns the traffic light actor corresponding to the indicated OpenDRIVE id.
- **Parameters:**
- `traffic_light_id` (_str_) - The OpenDRIVE id.
- **Return:** _[carla.TrafficLight](#carla.TrafficLight)_
- **get_traffic_lights_from_waypoint**(**self**, **waypoint**, **distance**)
This function performs a search along the road in front of the specified waypoint and returns a list of traffic light actors found in the specified search distance.
- **Parameters:**
- `waypoint` (_[carla.Waypoint](#carla.Waypoint)_) - The input waypoint.
- `distance` (_float_) - Search distance.
- **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_
- **get_traffic_lights_in_junction**(**self**, **junction_id**)
Returns the list of traffic light actors affecting the junction indicated in `junction_id`.
- **Parameters:**
- `junction_id` (_int_) - The id of the junction.
- **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_
- **get_traffic_sign**(**self**, **landmark**)
Provided a landmark, returns the traffic sign object it describes.
- **Parameters:**
- `landmark` (_[carla.Landmark](#carla.Landmark)_) - The landmark object describing a traffic sign.
- **Return:** _[carla.TrafficSign](#carla.TrafficSign)_
- **get_vehicles_light_states**(**self**)
Returns a dict where the keys are [carla.Actor](#carla.Actor) IDs and the values are [carla.VehicleLightState](#carla.VehicleLightState) of that vehicle.
- **Return:** _dict_
- **get_weather**(**self**)
Retrieves an object containing weather parameters currently active in the simulation, mainly cloudiness, precipitation, wind and sun position.
- **Return:** _[carla.WeatherParameters](#carla.WeatherParameters)_
- **Setter:** _[carla.World.set_weather](#carla.World.set_weather)_
##### Setters
- **set_pedestrians_cross_factor**(**self**, **percentage**)
- **Parameters:**
- `percentage` (_float_) - Sets the percentage of pedestrians that can walk on the road or cross at any point on the road. Value should be between `0.0` and `1.0`. For example, a value of `0.1` would allow 10% of pedestrians to walk on the road. __Default is `0.0`__.
- **Note:** _Should be set before pedestrians are spawned.
_
- **set_pedestrians_seed**(**self**, **seed**)
- **Parameters:**
- `seed` (_int_) - Sets the seed to use for any random number generated in relation to pedestrians.
- **Note:** _Should be set before pedestrians are spawned. If you want to repeat the same exact bodies (blueprint) for each pedestrian, then use the same seed in the Python code (where the blueprint is choosen randomly) and here, otherwise the pedestrians will repeat the same paths but the bodies will be different.
_
- **set_weather**(**self**, **weather**)
Changes the weather parameteres ruling the simulation to another ones defined in an object.
- **Parameters:**
- `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) - New conditions to be applied.
- **Getter:** _[carla.World.get_weather](#carla.World.get_weather)_
##### Dunder methods
- **\__str__**(**self**)
The content of the world is parsed and printed as a brief report of its current state.
- **Return:** _string_
---
## carla.WorldSettings
The simulation has some advanced configuration options that are contained in this class and can be managed using [carla.World](#carla.World) and its methods. These allow the user to choose between client-server synchrony/asynchrony, activation of "no rendering mode" and either if the simulation should run with a fixed or variable time-step. Check [this](adv_synchrony_timestep.md) out if you want to learn about it.
### Instance Variables
- **synchronous_mode** (_bool_)
States the synchrony between client and server. When set to true, the server will wait for a client tick in order to move forward. It is false by default.
- **no_rendering_mode** (_bool_)
When enabled, the simulation will run no rendering at all. This is mainly used to avoid overhead during heavy traffic simulations. It is false by default.
- **fixed_delta_seconds** (_float_)
Ensures that the time elapsed between two steps of the simulation is fixed. Set this to 0.0 to work with a variable time-step, as happens by default.
- **substepping** (_bool_)
Enable the physics substepping. This option allows computing some physics substeps between two render frames. If synchronous mode is set, the number of substeps and its time interval are fixed and computed are so they fulfilled the requirements of [carla.WorldSettings.max_substep](#carla.WorldSettings.max_substep) and [carla.WorldSettings.max_substep_delta_time](#carla.WorldSettings.max_substep_delta_time). These last two parameters need to be compatible with [carla.WorldSettings.fixed_delta_seconds](#carla.WorldSettings.fixed_delta_seconds). Enabled by default.
- **max_substep_delta_time** (_float_)
Maximum delta time of the substeps. If the [carla.WorldSettingsmax_substep](#carla.WorldSettingsmax_substep) is high enough, the substep delta time would be always below or equal to this value. By default, the value is set to 0.01.
- **max_substeps** (_int_)
The maximum number of physics substepping that are allowed. By default, the value is set to 10.
- **max_culling_distance** (_float_)
Configure the max draw distance for each mesh of the level.
- **deterministic_ragdolls** (_bool_)
Defines wether to use deterministic physics for pedestrian death animations or physical ragdoll simulation. When enabled, pedestrians have less realistic death animation but ensures determinism. When disabled, pedestrians are simulated as ragdolls with more realistic simulation and collision but no determinsm can be ensured.
- **tile_stream_distance** (_float_)
Used for large maps only. Configures the maximum distance from the hero vehicle to stream tiled maps. Regions of the map within this range will be visible (and capable of simulating physics). Regions outside this region will not be loaded.
- **actor_active_distance** (_float_)
Used for large maps only. Configures the distance from the hero vehicle to convert actors to dormant. Actors within this range will be active, and actors outside will become dormant.
- **spectator_as_ego** (_bool_)
Used for large maps only. Defines the influence of the spectator on tile loading in Large Maps. By default, the spectator will provoke loading of neighboring tiles in the absence of an ego actor. This might be inconvenient for applications that immediately spawn an ego actor.
### Methods
- **\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0, **max_culling_distance**=0.0, **deterministic_ragdolls**=False, **tile_stream_distance**=3000, **actor_active_distance**=2000, **spectator_as_ego**=True)
Creates an object containing desired settings that could later be applied through [carla.World](#carla.World) and its method __apply_settings()__.
- **Parameters:**
- `synchronous_mode` (_bool_) - Set this to true to enable client-server synchrony.
- `no_rendering_mode` (_bool_) - Set this to true to completely disable rendering in the simulation.
- `fixed_delta_seconds` (_float - seconds_) - Set a fixed time-step in between frames. 0.0
means variable time-step and it is the default mode.
- `max_culling_distance` (_float - meters_) - Configure the max draw distance for each mesh of the level.
- `deterministic_ragdolls` (_bool_) - Defines wether to use deterministic physics or ragdoll simulation for pedestrian deaths.
- `tile_stream_distance` (_float - meters_) - Used for large maps only. Configures the maximum distance from the hero vehicle to stream tiled maps.
- `actor_active_distance` (_float - meters_) - Used for large maps only. Configures the distance from the hero vehicle to convert actors to dormant.
- `spectator_as_ego` (_bool_) - Used for large maps only. Defines the influence of the spectator on tile loading in Large Maps.
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.WorldSettings](#carla.WorldSettings))
Returns True if both objects' variables are the same.
- **Return:** _bool_
- **\__ne__**(**self**, **other**=[carla.WorldSettings](#carla.WorldSettings))
Returns True if both objects' variables are different.
- **Return:** _bool_
- **\__str__**(**self**)
Parses the established settings to a string and shows them in command line.
- **Return:** _str_
---
## carla.WorldSnapshot
This snapshot comprises all the information for every actor on scene at a certain moment of time. It creates and gives acces to a data structure containing a series of [carla.ActorSnapshot](#carla.ActorSnapshot). The client recieves a new snapshot on every tick that cannot be stored.
### Instance Variables
- **id** (_int_)
A value unique for every snapshot to differentiate them.
- **frame** (_int_)
Simulation frame in which the snapshot was taken.
- **timestamp** (_[carla.Timestamp](#carla.Timestamp) - seconds_)
Precise moment in time when snapshot was taken. This class works in seconds as given by the operative system.
### Methods
- **find**(**self**, **actor_id**)
Given a certain actor ID, returns its corresponding snapshot or None if it is not found.
- **Parameters:**
- `actor_id` (_int_)
- **Return:** _[carla.ActorSnapshot](#carla.ActorSnapshot)_
- **has_actor**(**self**, **actor_id**)
Given a certain actor ID, checks if there is a snapshot corresponding it and so, if the actor was present at that moment.
- **Parameters:**
- `actor_id` (_int_)
- **Return:** _bool_
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.WorldSnapshot](#carla.WorldSnapshot))
Returns __True__ if both **timestamp** are the same.
- **Return:** _bool_
- **\__iter__**(**self**)
Iterate over the [carla.ActorSnapshot](#carla.ActorSnapshot) stored in the snapshot.
- **\__len__**(**self**)
Returns the amount of [carla.ActorSnapshot](#carla.ActorSnapshot) present in this snapshot.
- **Return:** _int_
- **\__ne__**(**self**, **other**=[carla.WorldSnapshot](#carla.WorldSnapshot))
Returns True if both **timestamp** are different.
- **Return:** _bool_
---
## command.ApplyAngularImpulse
Command adaptation of __add_angular_impulse()__ in [carla.Actor](#carla.Actor). Applies an angular impulse to an actor.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **impulse** (_[carla.Vector3D](#carla.Vector3D) - degrees*s_)
Angular impulse applied to the actor.
### Methods
- **\__init__**(**self**, **actor**, **impulse**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `impulse` (_[carla.Vector3D](#carla.Vector3D) - degrees*s_)
---
## command.ApplyForce
Command adaptation of __add_force()__ in [carla.Actor](#carla.Actor). Applies a force to an actor.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **force** (_[carla.Vector3D](#carla.Vector3D) - N_)
Force applied to the actor over time.
### Methods
- **\__init__**(**self**, **actor**, **force**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `force` (_[carla.Vector3D](#carla.Vector3D) - N_)
---
## command.ApplyImpulse
Command adaptation of __add_impulse()__ in [carla.Actor](#carla.Actor). Applies an impulse to an actor.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **impulse** (_[carla.Vector3D](#carla.Vector3D) - N*s_)
Impulse applied to the actor.
### Methods
- **\__init__**(**self**, **actor**, **impulse**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `impulse` (_[carla.Vector3D](#carla.Vector3D) - N*s_)
---
## command.ApplyTargetAngularVelocity
Command adaptation of __set_target_angular_velocity()__ in [carla.Actor](#carla.Actor). Sets the actor's angular velocity vector.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **angular_velocity** (_[carla.Vector3D](#carla.Vector3D) - deg/s_)
The 3D angular velocity that will be applied to the actor.
### Methods
- **\__init__**(**self**, **actor**, **angular_velocity**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `angular_velocity` (_[carla.Vector3D](#carla.Vector3D) - deg/s_) - Angular velocity vector applied to the actor.
---
## command.ApplyTargetVelocity
Command adaptation of __set_target_velocity()__ in [carla.Actor](#carla.Actor).
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **velocity** (_[carla.Vector3D](#carla.Vector3D) - m/s_)
The 3D velocity applied to the actor.
### Methods
- **\__init__**(**self**, **actor**, **velocity**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `velocity` (_[carla.Vector3D](#carla.Vector3D) - m/s_) - Velocity vector applied to the actor.
---
## command.ApplyTorque
Command adaptation of __add_torque()__ in [carla.Actor](#carla.Actor). Applies a torque to an actor.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **torque** (_[carla.Vector3D](#carla.Vector3D) - degrees_)
Torque applied to the actor over time.
### Methods
- **\__init__**(**self**, **actor**, **torque**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `torque` (_[carla.Vector3D](#carla.Vector3D) - degrees_)
---
## command.ApplyTransform
Command adaptation of __set_transform()__ in [carla.Actor](#carla.Actor). Sets a new transform to an actor.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **transform** (_[carla.Transform](#carla.Transform)_)
Transformation to be applied.
### Methods
- **\__init__**(**self**, **actor**, **transform**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `transform` (_[carla.Transform](#carla.Transform)_)
---
## command.ApplyVehicleAckermannControl
Command adaptation of __apply_ackermann_control()__ in [carla.Vehicle](#carla.Vehicle). Applies a certain akermann control to a vehicle.
### Instance Variables
- **actor_id** (_int_)
Vehicle actor affected by the command.
- **control** (_[carla.AckermannVehicleControl](#carla.AckermannVehicleControl)_)
Vehicle ackermann control to be applied.
### Methods
- **\__init__**(**self**, **actor**, **control**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.AckermannVehicleControl](#carla.AckermannVehicleControl)_)
---
## command.ApplyVehicleControl
Command adaptation of __apply_control()__ in [carla.Vehicle](#carla.Vehicle). Applies a certain control to a vehicle.
### Instance Variables
- **actor_id** (_int_)
Vehicle actor affected by the command.
- **control** (_[carla.VehicleControl](#carla.VehicleControl)_)
Vehicle control to be applied.
### Methods
- **\__init__**(**self**, **actor**, **control**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.VehicleControl](#carla.VehicleControl)_)
---
## command.ApplyVehiclePhysicsControl
Command adaptation of __apply_physics_control()__ in [carla.Vehicle](#carla.Vehicle). Applies a new physics control to a vehicle, modifying its physical parameters.
### Instance Variables
- **actor_id** (_int_)
Vehicle actor affected by the command.
- **physics_control** (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
Physics control to be applied.
### Methods
- **\__init__**(**self**, **actor**, **physics_control**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `physics_control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
---
## command.ApplyWalkerControl
Command adaptation of __apply_control()__ in [carla.Walker](#carla.Walker). Applies a control to a walker.
### Instance Variables
- **actor_id** (_int_)
Walker actor affected by the command.
- **control** (_[carla.WalkerControl](#carla.WalkerControl)_)
Walker control to be applied.
### Methods
- **\__init__**(**self**, **actor**, **control**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.WalkerControl](#carla.WalkerControl)_)
---
## command.ApplyWalkerState
Apply a state to the walker actor. Specially useful to initialize an actor them with a specific location, orientation and speed.
### Instance Variables
- **actor_id** (_int_)
Walker actor affected by the command.
- **transform** (_[carla.Transform](#carla.Transform)_)
Transform to be applied.
- **speed** (_float - m/s_)
Speed to be applied.
### Methods
- **\__init__**(**self**, **actor**, **transform**, **speed**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `transform` (_[carla.Transform](#carla.Transform)_)
- `speed` (_float - m/s_)
---
## command.DestroyActor
Command adaptation of __destroy()__ in [carla.Actor](#carla.Actor) that tells the simulator to destroy this actor. It has no effect if the actor was already destroyed. When executed with __apply_batch_sync()__ in [carla.Client](#carla.Client) there will be a command.Response that will return a boolean stating whether the actor was successfully destroyed.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
### Methods
- **\__init__**(**self**, **actor**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
---
## command.Response
States the result of executing a command as either the ID of the actor to whom the command was applied to (when succeeded) or an error string (when failed). actor ID, depending on whether or not the command succeeded. The method __apply_batch_sync()__ in [carla.Client](#carla.Client) returns a list of these to summarize the execution of a batch.
### Instance Variables
- **actor_id** (_int_)
Actor to whom the command was applied to. States that the command was successful.
- **error** (_str_)
A string stating the command has failed.
### Methods
- **has_error**(**self**)
Returns True if the command execution fails, and False if it was successful.
- **Return:** _bool_
---
## command.SetAutopilot
Command adaptation of __set_autopilot()__ in [carla.Vehicle](#carla.Vehicle). Turns on/off the vehicle's autopilot mode.
### Instance Variables
- **actor_id** (_int_)
Actor that is affected by the command.
- **enabled** (_bool_)
If autopilot should be activated or not.
- **port** (_uint16_)
Port of the Traffic Manager where the vehicle is to be registered or unlisted.
### Methods
- **\__init__**(**self**, **actor**, **enabled**, **port**=8000)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `enabled` (_bool_)
- `port` (_uint16_) - The Traffic Manager port where the vehicle is to be registered or unlisted. If __None__ is passed, it will consider a TM at default port `8000`.
---
## command.SetEnableGravity
Command adaptation of __set_enable_gravity()__ in [carla.Actor](#carla.Actor). Enables or disables gravity on an actor.
### Instance Variables
- **actor_id** (_[carla.Actor](#carla.Actor) or int_)
Actor that is affected by the command.
- **enabled** (_bool_)
### Methods
- **\__init__**(**self**, **actor**, **enabled**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or Actor ID to which the command will be applied to.
- `enabled` (_bool_)
---
## command.SetSimulatePhysics
Command adaptation of __set_simulate_physics()__ in [carla.Actor](#carla.Actor). Determines whether an actor will be affected by physics or not.
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
- **enabled** (_bool_)
If physics should be activated or not.
### Methods
- **\__init__**(**self**, **actor**, **enabled**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `enabled` (_bool_)
---
## command.SetVehicleLightState
Command adaptation of __set_light_state()__ in [carla.Vehicle](#carla.Vehicle). Sets the light state of a vehicle.
### Instance Variables
- **actor_id** (_int_)
Actor that is affected by the command.
- **light_state** (_[carla.VehicleLightState](#carla.VehicleLightState)_)
Defines the light state of a vehicle.
### Methods
- **\__init__**(**self**, **actor**, **light_state**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `light_state` (_[carla.VehicleLightState](#carla.VehicleLightState)_) - Recaps the state of the lights of a vehicle, these can be used as a flags.
---
## command.ShowDebugTelemetry
Command adaptation of __show_debug_telemetry()__ in [carla.Actor](#carla.Actor). Displays vehicle control telemetry data.
### Instance Variables
- **actor_id** (_[carla.Actor](#carla.Actor) or int_)
Actor that is affected by the command.
- **enabled** (_bool_)
### Methods
- **\__init__**(**self**, **actor**, **enabled**)
- **Parameters:**
- `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or Actor ID to which the command will be applied to.
- `enabled` (_bool_)
---
## command.SpawnActor
Command adaptation of __spawn_actor()__ in [carla.World](#carla.World). Spawns an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to it.
### Instance Variables
- **transform** (_[carla.Transform](#carla.Transform)_)
Transform to be applied.
- **parent_id** (_int_)
Identificator of the parent actor.
### Methods
- **\__init__**(**self**)
- **\__init__**(**self**, **blueprint**, **transform**)
- **Parameters:**
- `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_)
- `transform` (_[carla.Transform](#carla.Transform)_)
- **\__init__**(**self**, **blueprint**, **transform**, **parent**)
- **Parameters:**
- `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_)
- `transform` (_[carla.Transform](#carla.Transform)_)
- `parent` (_[carla.Actor](#carla.Actor) or int_)
- **then**(**self**, **command**)
Links another command to be executed right after. It allows to ease very common flows such as spawning a set of vehicles by command and then using this method to set them to autopilot automatically.
- **Parameters:**
- `command` (_any carla Command_) - a Carla command.
---
[comment]: <> (=========================)
[comment]: <> (PYTHON API SCRIPT SNIPETS)
[comment]: <> (=========================)