129 KiB
carla.ActorAttributeType class
Class that defines the type of attribute of a carla.ActorAttribute.
Instance Variables
- **Bool** - **Int** - **Float** - **String** - **RGBColor**carla.ActorList class
Class that provides access to actors.
Methods
- **find**(**self**, **actor_id**) Find an actor by ID. - **Parameters:** - `actor_id` (_int_) - **filter**(**self**, **wildcard_pattern**) Filters a list of Actors with type_id matching wildcard_pattern. - **Parameters:** - `wildcard_pattern` (_str_) - **Note:** _The wildcard_pattern follows Unix shell-style wildcards (fnmatch). _ - **\__getitem__**(**self**, **pos**) - **Parameters:** - `pos` (_int_) - **\__len__**(**self**) - **\__iter__**(**self**) - **\__str__**(**self**)carla.AttachmentType class
Class that defines the attachment options. See carla.World.spawn_actor.
Check out this recipe
!
Instance Variables
- **Rigid** Standard fixed attachment. - **SpringArm** Attachment that expands or retracts based on camera situation.carla.BlueprintLibrary class
Class that provides access to blueprints.
Methods
- **find**(**self**, **id**) Returns a [carla.ActorBlueprint](#carla.ActorBlueprint) through its id. - **Parameters:** - `id` (_str_) - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ - **filter**(**self**, **wildcard_pattern**) Filters a list of ActorBlueprint with id or tags matching wildcard_pattern. The pattern is matched against each blueprint's id and tags. - **Parameters:** - `wildcard_pattern` (_str_) - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ - **Note:** _The wildcard_pattern follows Unix shell-style wildcards (fnmatch). _ - **\__getitem__**(**self**, **pos**) - **Parameters:** - `pos` (_int_) - **Return:** _[carla.ActorBlueprint](#carla.ActorBlueprint)_ - **\__len__**(**self**) - **\__iter__**(**self**) - **\__str__**(**self**)carla.ColorConverter class
Class that defines the color converter options. Check out this recipe
!
Instance Variables
- **Raw** - **Depth** - **LogarithmicDepth** - **CityScapesPalette**carla.DebugHelper class
Class that provides drawing debug shapes. Check out this example
.
Methods
- **draw_point**(**self**, **location**, **size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) Draws a point in the given location. - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) - `size` (_float_) - `color` (_[carla.Color](#carla.Color)_) - `life_time` (_float_) - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. - **draw_line**(**self**, **begin**, **end**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) Draws a line between two given locations. - **Parameters:** - `begin` (_[carla.Location](#carla.Location)_) - `end` (_[carla.Location](#carla.Location)_) - `thickness` (_float_) - `color` (_[carla.Color](#carla.Color)_) - `life_time` (_float_) - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. - **draw_arrow**(**self**, **begin**, **end**, **thickness**=0.1f, **arrow_size**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) Draws an arrow between two given locations. - **Parameters:** - `begin` (_[carla.Location](#carla.Location)_) - `end` (_[carla.Location](#carla.Location)_) - `thickness` (_float_) - `arrow_size` (_float_) - `color` (_[carla.Color](#carla.Color)_) - `life_time` (_float_) - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. - **draw_box**(**self**, **box**, **rotation**, **thickness**=0.1f, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) Draws the [carla.BoundingBox](#carla.BoundingBox) of a given bounding_box.Check out this [`recipe`](../python_cookbook/#debug-bounding-box-recipe)! - **Parameters:** - `box` (_[carla.BoundingBox](#carla.BoundingBox)_) - `rotation` (_[carla.Rotation](#carla.Rotation)_) - `thickness` (_float_) - `color` (_[carla.Color](#carla.Color)_) - `life_time` (_float_) - `persistent_lines` (_bool_) – _Deprecated, use `life_time = 0` instead_. - **draw_string**(**self**, **location**, **text**, **draw_shadow**=False, **color**=(255,0,0), **life_time**=-1.0f, **persistent_lines**=True) Draws a string in a given location. - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) - `text` (_str_) - `draw_shadow` (_bool_) - `color` (_[carla.Color](#carla.Color)_) - `life_time` (_float_) - `persistent_lines` (_bool_) – _Deprecated, set a high `life_time` instead_. - **Note:** _Strings can only be seen on the server-side. _
carla.LaneChange class
Class that defines the lane change options. Check out this recipe
!
Instance Variables
- **NONE** Traffic rules do not allow turning right or left, only going straight. - **Right** Traffic rules allow turning right. - **Left** Traffic rules allow turning left. - **Both** Traffic rules allow turning right or left.carla.LaneMarking class
Class that defines a lane marking.
Instance Variables
- **type** (_[carla.LaneMarkingType](#carla.LaneMarkingType)_) Lane marking type. - **color** (_[carla.Color](#carla.Color)_) Actual color of the marking. - **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) Lane change availability. - **width** (_float_) Horizontal lane marking thickness.carla.LaneMarkingColor class
Class that defines the lane marking colors.
Instance Variables
- **Standard** White by default. - **Blue** - **Green** - **Red** - **White** - **Yellow** - **Other**carla.LaneMarkingType class
Class that defines the lane marking types accepted by OpenDRIVE. Check out this recipe
!
Instance Variables
- **NONE** - **Other** - **Broken** - **Solid** - **SolidSolid** For double solid line. - **SolidBroken** From inside to outside except for center lane which is from left to right. - **BrokenSolid** From inside to outside except for center lane which is from left to right. - **BrokenBroken** From inside to outside except for center lane which is from left to right. - **BottsDots** - **Grass** Grass edge. - **Curb**carla.LaneType class
All the possible lane types accepted by OpenDRIVE. Check out this recipe
!
Instance Variables
- **NONE** - **Driving** - **Stop** - **Shoulder** - **Biking** - **Sidewalk** - **Border** - **Restricted** - **Parking** - **Bidirectional** - **Median** - **Special1** - **Special2** - **Special3** - **RoadWorks** - **Tram** - **Rail** - **Entry** - **Exit** - **OffRamp** - **OnRamp** - **Any**carla.SensorData class
Base class for all the objects containing data generated by a sensor.
Instance Variables
- **frame** (_int_) Frame count when the data was generated. - **timestamp** (_float_) Simulation-time when the data was generated. - **transform** (_[carla.Transform](#carla.Transform)_) Sensor's transform when the data was generated.carla.TrafficLightState class
All possible states for traffic lights. Check out this recipe
!
Instance Variables
- **Red** - **Yellow** - **Green** - **Off** - **Unknown**carla.Actor class
Base class for all actors. Actor is anything that plays a role in the simulation and can be moved around, examples of actors are vehicles, pedestrians, and sensors.
Instance Variables
- **id** (_int_) Unique id identifying this actor. Note ids are unique during a given episode. - **type_id** (_str_) Id of the blueprint that created this actor, e.g. "vehicle.ford.mustang". - **parent** (_[carla.Actor](#carla.Actor)_) Parent actor of this instance, None if this instance is not attached to another actor. - **semantic_tags** (_list(int)_) List of semantic tags of all components of this actor, see semantic segmentation sensor for the list of available tags. E.g., a traffic light actor could contain "pole" and "traffic light" tags. - **is_alive** (_bool_) Returns whether this object was destroyed using this actor handle. - **attributes** (_dict_) Dictionary of attributes of the blueprint that created this actor.Methods
- **destroy**(**self**) Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed. It has no effect if the Actor was already successfully destroyed. - **Return:** _bool_ - **Warning:** _This function blocks until the destruction operation is completed by the simulator. _ - **get_world**(**self**) Returns the world this actor belongs to. - **Return:** _[carla.World](#carla.World)_ - **get_location**(**self**) Returns the actor's current location. - **Return:** _[carla.Location](#carla.Location)_ - **Note:** _This function does not call the simulator, it returns the location received in the last tick. _ - **get_transform**(**self**) Returns the actor's current transform. - **Return:** _[carla.Transform](#carla.Transform)_ - **Note:** _This function does not call the simulator, it returns the transform received in the last tick. _ - **get_velocity**(**self**) Returns the actor's current 3D velocity. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **Note:** _This function does not call the simulator, it returns the velocity received in the last tick. _ - **get_angular_velocity**(**self**) Returns the actor's current 3D angular velocity. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **Note:** _This function does not call the simulator, it returns the angular velocity received in the last tick. _ - **get_acceleration**(**self**) Returns the actor's current 3D acceleration. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **Note:** _This function does not call the simulator, it returns the acceleration received in the last tick. _ - **set_location**(**self**, **location**) Teleport the actor to a given location. - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) - **set_transform**(**self**, **transform**) Teleport the actor to a given transform. - **Parameters:** - `transform` (_[carla.Transform](#carla.Transform)_) - **set_velocity**(**self**, **velocity**) Set the actor's velocity. - **Parameters:** - `velocity` (_[carla.Vector3D](#carla.Vector3D)_) - **set_angular_velocity**(**self**, **angular_velocity**) Set the actor's angular velocity. - **Parameters:** - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_) - **add_impulse**(**self**, **impulse**) Add impulse to the actor. - **Parameters:** - `impulse` (_[carla.Vector3D](#carla.Vector3D)_) - **set_simulate_physics**(**self**, **enabled**=True) Enable or disable physics simulation on this actor. - **Parameters:** - `enabled` (_bool_) - **\__str__**(**self**) - **Return:** _str_carla.ActorAttribute class
Class that defines an attribute of a carla.ActorBlueprint.
Instance Variables
- **id** (_str_) The attribute's identifier. - **type** (_[carla.ActorAttributeType](#carla.ActorAttributeType)_) The attribute parameter type. - **recommended_values** (_list(str)_) List of recommended values that the attribute may have. - **is_modifiable** (_bool_) True if the attribute is modifiable.Methods
- **as_bool**(**self**) - **as_int**(**self**) - **as_float**(**self**) - **as_str**(**self**) - **as_color**(**self**) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_bool / int / float / str / [carla.Color](#carla.Color) / [carla.ActorAttribute](#carla.ActorAttribute)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_bool / int / float / str / [carla.Color](#carla.Color) / [carla.ActorAttribute](#carla.ActorAttribute)_) - **\__nonzero__**(**self**) - **\__bool__**(**self**) - **\__int__**(**self**) - **\__float__**(**self**) - **\__str__**(**self**) - **\__str__**(**self**)carla.ActorBlueprint class
Class that contains all the necessary information for spawning an Actor.
Instance Variables
- **id** (_str_) Actor blueprint identifier, e.g. `walker.pedestrian.0001`. - **tags** (_list(str)_) List of tags of an actor blueprint e.g. `['0001', 'pedestrian', 'walker']`.Methods
- **has_tag**(**self**, **tag**) Returns `true` if an actor blueprint has the tag. - **Parameters:** - `tag` (_str_) – e.g. 'walker'. - **Return:** _bool_ - **match_tags**(**self**, **wildcard_pattern**) Test if any of the flags or id matches wildcard_pattern. - **Parameters:** - `wildcard_pattern` (_str_) - **Return:** _bool_ - **Note:** _The wildcard_pattern follows Unix shell-style wildcards. _ - **has_attribute**(**self**, **id**) Returns `true` if the blueprint contains the specified attribute. - **Parameters:** - `id` (_str_) – e.g 'gender'. - **Return:** _bool_ - **get_attribute**(**self**, **id**) Returns the current actor attribute through its id. - **Parameters:** - `id` (_str_) - **Return:** _[carla.ActorAttribute](#carla.ActorAttribute)_ - **set_attribute**(**self**, **id**, **value**) Sets an existing attribute to the actor's blueprint. - **Parameters:** - `id` (_str_) - `value` (_str_) - **Note:** _Attribute can only be set or changed if it is modifiable _ - **\__len__**(**self**) - **\__iter__**(**self**) - **\__str__**(**self**)carla.ActorSnapshot class
Class that provides access to the data of a carla.Actor in a carla.WorldSnapshot.
Instance Variables
- **id** (_int_) The ActorSnapshot's identifier.Methods
- **get_transform**(**self**) Returns the actor's current transform. - **Return:** _[carla.Transform](#carla.Transform)_ - **get_velocity**(**self**) Returns the actor's current 3D velocity. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **get_angular_velocity**(**self**) Returns the actor's current 3D angular velocity. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **get_acceleration**(**self**) Returns the actor's current 3D acceleration. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **\__self__**(**self**)carla.BoundingBox class
Bounding box helper class.
Instance Variables
- **location** (_[carla.Location](#carla.Location)_) The center of the bounding box relative to its parent actor. - **extent** (_[carla.Vector3D](#carla.Vector3D)_) It contains the vector from the center of the bounding box to one of the vertex of the box. So, if you want to know the _X bounding box size_, you can just do `extent.x * 2`.Methods
- **\__init__**(**self**, **location**, **extent**) - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) - `extent` (_[carla.Vector3D](#carla.Vector3D)_) - **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)_) – 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_ - **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))_ - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.BoundingBox](#carla.BoundingBox)_) - **\__str__**(**self**)carla.Client class
Client used to connect to a Carla server.
Methods
- **\__init__**(**self**, **host**, **port**, **worker_threads**=0) Client constructor. - **Parameters:** - `host` (_str_) – IP address where a CARLA Simulator instance is running. - `port` (_int_) – TCP port where the CARLA Simulator instance is running. - `worker_threads` (_int_) – Number of working threads used for background updates. If 0, use all available concurrency. - **set_timeout**(**self**, **seconds**) Set the timeout in seconds allowed to block when doing networking calls. - **Parameters:** - `seconds` (_float_) – New timeout value in seconds. - **get_client_version**(**self**) Get the client version as a string. - **Return:** _str_ - **get_server_version**(**self**) Get the server version as a string. - **Return:** _str_ - **get_world**(**self**) Get the world currently active in the simulation. - **Return:** _[carla.World](#carla.World)_ - **get_available_maps**(**self**) Get a list of strings of the maps available on server. The result can be something like: '/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)_ - **reload_world**(**self**) 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. - **Raises:** RuntimeError - **load_world**(**self**, **map_name**) Load a new world with default settings using `map_name` map. All actors present in the current world will be destroyed. - **Parameters:** - `map_name` (_str_) – Name of the map to load, accepts both full paths and map names, e.g. '/Game/Carla/Maps/Town01' or 'Town01'. - **start_recorder**(**self**, **filename**) If we use a simple name like 'recording.log' then it will be saved at server folder 'CarlaUE4/Saved/recording.log'. If we use some folder in the name, then it will be considered to be an absolute path, like '/home/carla/recording.log'. - **Parameters:** - `filename` (_str_) – Name of the file to write the recorded data. - **stop_recorder**(**self**) Stops the recording in progress. - **show_recorder_file_info**(**self**, **filename**, **show_all**) Will show info about the recorded file (frames, times, events, state, positions...) We have the option to show all the details per frame, that includes all the traffic light states, position of all actors, and animations data. - **Parameters:** - `filename` (_str_) – Name of the recorded file to load. - `show_all` (_bool_) – Show all detailed info, or just a summary. - **show_recorder_collisions**(**self**, **filename**, **category1**, **category2**) This will show which collisions were recorded in the file. We can use a filter for the collisions we want, using two categories. The categories can be: 'h' = Hero 'v' = Vehicle 'w' = Walker 't' = Traffic light 'o' = Other 'a' = Any So, if you want to see only collisions about a vehicle and a walker, we would use for category1 'v' and category2 'w'. Or if you want all the collisions (filter off) you can use 'a' as both categories. - **Parameters:** - `filename` (_str_) – Name of the recorded file to load. - `category1` (_single char_) – Character specifying the category of the first actor. - `category2` (_single char_) – Character specifying the category of the second actor. - **show_recorder_actors_blocked**(**self**, **filename**, **min_time**, **min_distance**) Shows which actors seem blocked by some reason. The idea is to calculate which actors are not moving as much as 'min_distance' for a period of 'min_time'. By default min_time = 60 seconds (1 min) and min_distance = 100 centimeters (1 m). - **Parameters:** - `filename` (_str_) – Name of the recorded file to load. - `min_time` (_float_) – How many seconds has to be stoped an actor to be considered as blocked. - `min_distance` (_float_) – How many centimeters needs to move the actor in order to be considered as moving, and not blocked. - **replay_file**(**self**, **name**, **start**, **duration**, **follow_id**) Playback a file. - **Parameters:** - `name` (_str_) – Name of the file. - `start` (_float_) – Time in seconds where to start the playback. If it is negative, then it starts from the end. - `duration` (_float_) – Id of the actor to follow. If this is 0 then camera is disabled. - `follow_id` (_int_) - **set_replayer_time_factor**(**self**, **time_factor**) Apply a different playback speed to current playback. Can be used several times while a playback is in curse. - **Parameters:** - `time_factor` (_float_) – A value of 1.0 means normal time factor. A value < 1.0 means slow motion (for example 0.5 is half speed) A value > 1.0 means fast motion (for example 2.0 is double speed). - **apply_batch**(**self**, **commands**) This function executes the whole list of commands on a single simulation step. For example, to set autopilot on some actors, we could use: [sample_code](10c5f6a482/PythonAPI/examples/spawn_npc.py (L126)
). We don't have control about the response of each command. If we need that, we can use `apply_batch_sync()`.
- **Parameters:**
- `commands` (_list_) – A list of commands to execute in batch. Each command has a different number of parameters. Currently, we can use these [commands](#command.ApplyAngularVelocity):
SpawnActor
DestroyActor
ApplyVehicleControl
ApplyWalkerControl
ApplyTransform
ApplyVelocity
AplyAngularVelocity
ApplyImpulse
SetSimulatePhysics
SetAutopilot.
- **apply_batch_sync**(**self**, **commands**, **due_tick_cue**)
This function executes the whole list of commands on a single simulation step, blocks until the commands are executed, and returns a list of [`command.Response`](#command.Response) that can be used to determine whether a single command succeeded or not. [sample_code](10c5f6a482/PythonAPI/examples/spawn_npc.py (L112-L116)
).
- **Parameters:**
- `commands` (_list_) – A list of commands to execute in batch. For a list of commands available see function above 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_.
- **Return:** _list_
carla.CollisionEvent(carla.SensorData) class
Class that defines a registered collision.
Instance Variables
- **actor** (_[carla.Actor](#carla.Actor)_) Get "self" actor. Actor that measured the collision. - **other_actor** (_[carla.Actor](#carla.Actor)_) Get the actor to which we collided. - **normal_impulse** (_[carla.Vector3D](#carla.Vector3D)_) Normal impulse result of the collision.carla.Color class
Class that defines a 32-bit BGRA 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) Client constructor. - **Parameters:** - `r` (_int_) - `g` (_int_) - `b` (_int_) - `a` (_int_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Color](#carla.Color)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Color](#carla.Color)_) - **\__str__**(**self**)carla.GearPhysicsControl class
Class that provides access to vehicle transmission details.
Instance Variables
- **ratio** (_float_) The transmission ratio of the gear. - **down_ratio** (_float_) The level of RPM (in relation to MaxRPM) where the gear autobox initiates shifting down. - **up_ratio** (_float_) The level of RPM (in relation to MaxRPM) where the gear autobox initiates shifting up.Methods
- **\__init__**(**self**, **ratio**=1.0, **down_ratio**=0.5, **up_ratio**=0.65) - **Parameters:** - `ratio` (_float_) - `down_ratio` (_float_) - `up_ratio` (_float_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.GearPhysicsControl](#carla.GearPhysicsControl)_) - **\__str__**(**self**)carla.GeoLocation class
Class that contains geolocation simulated data.
Instance Variables
- **latitude** (_float_) North/South value of a point on the map. - **longitude** (_float_) West/East value of a point on the map. - **altitude** (_float_) Height regarding ground level.Methods
- **\__init__**(**self**, **latitude**=0.0, **longitude**=0.0, **altitude**=0.0) - **Parameters:** - `latitude` (_float_) - `longitude` (_float_) - `altitude` (_float_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.GeoLocation](#carla.GeoLocation)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.GeoLocation](#carla.GeoLocation)_) - **\__str__**(**self**)carla.Map class
Map description that provides a Waypoint query system, that extracts the information from the OpenDRIVE file.
Instance Variables
- **name** (_str_) Map name. Comes from the Unreal's UMap name if loaded from a Carla server.Methods
- **\__init__**(**self**, **name**, **xodr_content**) Constructor for this class useful if you want to use a `XODR` (OpenDRIVE) file without importing it from any Carla server running. - **Parameters:** - `name` (_str_) – Name of the current map. - `xodr_content` (_str_) – XODR content as string. - **Return:** _list([carla.Transform](#carla.Transform))_ - **get_spawn_points**(**self**) Returns a list of transformations corresponding to the recommended spawn points over the map. - **Return:** _list([carla.Transform](#carla.Transform))_ - **get_waypoint**(**self**, **location**, **project_to_road**=True, **lane_type**=[carla.LaneType.Driving](#carla.LaneType.Driving)) - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) – Location where you want to get the [carla.Waypoint](#carla.Waypoint). - `project_to_road` (_bool_) – If **True**, the waypoint will be at the center of the nearest lane. If **False**, the waypoint will be at the given location. Also, in this second case, the result may be `None` if the waypoint is not found. - `lane_type` (_[carla.LaneType](#carla.LaneType)_) – This parameter is used to limit the search on a certain lane type. This can be used like a flag: `LaneType.Driving & LaneType.Shoulder`. - **Return:** _[carla.Waypoint](#carla.Waypoint)_ - **get_topology**(**self**) It provides a minimal graph of the topology of the current OpenDRIVE file. It is constituted by a list of pairs of waypoints, where the first waypoint is the origin and the second one is the destination. It can be loaded into [NetworkX](https://networkx.github.io/). A valid output could be: `[ (w0, w1), (w0, w2), (w1, w3), (w2, w3), (w0, w4) ]`. - **Return:** _list(tuple([carla.Waypoint](#carla.Waypoint), [carla.Waypoint](#carla.Waypoint)))_ - **generate_waypoints**(**self**, **distance**) Returns a list of waypoints positioned on the center of the lanes all over the map with an approximate distance between them. - **Parameters:** - `distance` (_float_) – Approximate distance between the waypoints. - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ - **transform_to_geolocation**(**self**, **location**) Converts a given [carla.Location](#carla.Location) `(x, y, z)` to a [carla.GeoLocation](#carla.GeoLocation) `(lat, lon, alt)`. - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) – Location to convert. - **Return:** _[carla.GeoLocation](#carla.GeoLocation)_ - **to_opendrive**(**self**) Returns the OpenDRIVE of the current map as string. - **Return:** _str_ - **save_to_disk**(**self**, **path**) Save the OpenDRIVE of the current map to disk. - **Parameters:** - `path` – Path where it will be saved. - **\__str__**(**self**)carla.RadarDetection class
Data contained by a carla.RadarMeasurement. Represents an object detection produced by the Radar sensor.
Instance Variables
- **velocity** (_float_) The velocity of the detected object towards the sensor in meters per second. - **azimuth** (_float_) Azimuth angle of the detection in radians. - **altitude** (_float_) Altitude angle of the detection in radians. - **depth** (_float_) Distance in meters from the sensor to the detection position.Methods
- **\__str__**(**self**)carla.Rotation class
Class that represents a 3D rotation. All rotation angles are stored in degrees.
Unreal Engine's standard (from UE4 docs).
Instance Variables
- **pitch** (_float_) Rotation about Y-axis. - **yaw** (_float_) Rotation about Z-axis. - **roll** (_float_) Rotation about X-axis.Methods
- **\__init__**(**self**, **pitch**=0.0, **yaw**=0.0, **roll**=0.0) - **Parameters:** - `pitch` (_float_) - `yaw` (_float_) - `roll` (_float_) - **get_forward_vector**(**self**) Computes a forward vector using the current rotation. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Rotation](#carla.Rotation)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Rotation](#carla.Rotation)_) - **\__str__**(**self**)carla.Timestamp class
Class that contains Timestamp simulated data.
Instance Variables
- **frame** (_int_) The number of frames elapsed since the simulator was launched. - **elapsed_seconds** (_float_) Simulated seconds elapsed since the beginning of the current episode. - **delta_seconds** (_float_) Simulated seconds elapsed since the previous frame. - **platform_timestamp** (_float_) Time-stamp of the frame at which this measurement was taken, in seconds as given by the OS.Methods
- **\__init__**(**self**, **frame**, **elapsed_seconds**, **delta_seconds**, **platform_timestamp**) - **Parameters:** - `frame` (_int_) - `elapsed_seconds` (_float_) - `delta_seconds` (_float_) - `platform_timestamp` (_float_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Timestamp](#carla.Timestamp)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Timestamp](#carla.Timestamp)_) - **\__str__**(**self**)carla.TrafficSign(carla.Actor) class
A traffic sign actor.
Instance Variables
- **trigger_volume** A [carla.BoundingBox](#carla.BoundingBox) situated near a traffic sign where the [carla.Actor](#carla.Actor) who is inside can know about its state.carla.Transform class
Class that defines a transformation without scaling.
Instance Variables
- **location** (_[carla.Location](#carla.Location)_) - **rotation** (_[carla.Rotation](#carla.Rotation)_)Methods
- **\__init__**(**self**, **location**, **rotation**) - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) - `rotation` (_[carla.Rotation](#carla.Rotation)_) - **transform**(**self**, **in_point**) Transform a 3D point using the current transformation. - **Parameters:** - `in_point` (_[carla.Location](#carla.Location)_) – Location in the space to which the transformation will be applied. - **get_forward_vector**(**self**) Computes a forward vector using the rotation of the current transformation. - **Return:** _[carla.Vector3D](#carla.Vector3D)_ - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Transform](#carla.Transform)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Transform](#carla.Transform)_) - **\__str__**(**self**)carla.Vector2D class
Vector 2D helper class.
Instance Variables
- **x** (_float_) - **y** (_float_)Methods
- **\__init__**(**self**, **x**=0.0, **y**=0.0) - **Parameters:** - `x` (_float_) - `y` (_float_) - **\__add__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector2D](#carla.Vector2D)_) - **\__mul__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector2D](#carla.Vector2D)_) - **\__sub__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector2D](#carla.Vector2D)_) - **\__truediv__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector2D](#carla.Vector2D)_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector2D](#carla.Vector2D)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector2D](#carla.Vector2D)_) - **\__self__**(**self**)carla.Vector3D class
Vector 3D helper class.
Instance Variables
- **x** (_float_) - **y** (_float_) - **z** (_float_)Methods
- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) - **Parameters:** - `x` (_float_) - `y` (_float_) - `z` (_float_) - **\__add__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector3D](#carla.Vector3D)_) - **\__mul__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector3D](#carla.Vector3D)_) - **\__sub__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector3D](#carla.Vector3D)_) - **\__truediv__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector3D](#carla.Vector3D)_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector3D](#carla.Vector3D)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Vector3D](#carla.Vector3D)_) - **\__str__**(**self**)carla.VehicleControl class
VehicleControl is used for controlling the basic movement of a vehicle.
Instance Variables
- **throttle** (_float_) A scalar value to control the vehicle throttle [0.0, 1.0]. - **steer** (_float_) A scalar value to control the vehicle steering [-1.0, 1.0]. - **brake** (_float_) A scalar value to control the vehicle brake [0.0, 1.0]. - **hand_brake** (_bool_) If true, hand brake will be used. - **reverse** (_bool_) If true, the vehicle will move reverse. - **manual_gear_shift** (_bool_) If true, the vehicle will be controlled by changing gears manually. - **gear** (_int_) Controls the gear value of the vehicle.Methods
- **\__init__**(**self**, **throttle**=0.0, **steer**=0.0, **brake**=0.0, **hand_brake**=True, **reverse**=True, **manual_gear_shift**=True, **gear**=0) VehicleControl constructor. - **Parameters:** - `throttle` (_float_) - `steer` (_float_) - `brake` (_float_) - `hand_brake` (_bool_) - `reverse` (_bool_) - `manual_gear_shift` (_bool_) - `gear` (_int_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.VehicleControl](#carla.VehicleControl)_) - **\__str__**(**self**)carla.VehiclePhysicsControl class
VehiclePhysicsControl is used for controlling the physics parameters of a vehicle.
Instance Variables
- **torque_curve** (_list([carla.Vector2D](#carla.Vector2D))_) Curve that indicates the torque measured in Nm for a specific RPM of the vehicle's engine. - **max_rpm** (_float_) The maximum RPM of the vehicle's engine. - **moi** (_float_) The moment of inertia of the vehicle's engine. - **damping_rate_full_throttle** (_float_) Damping rate when the throttle is maximum. - **damping_rate_zero_throttle_clutch_engaged** (_float_) Damping rate when the throttle is zero with clutch engaged. - **damping_rate_zero_throttle_clutch_disengaged** (_float_) Damping rate when the throttle is zero with clutch disengaged. - **use_gear_autobox** (_bool_) If true, the vehicle will have an automatic transmission. - **gear_switch_time** (_float_) Switching time between gears. - **clutch_strength** (_float_) The clutch strength of the vehicle. Measured in Kgm^2/s. - **final_ratio** (_float_) The fixed ratio from transmission to wheels. - **forward_gears** (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_) List of GearPhysicsControl objects. - **mass** (_float_) The mass of the vehicle measured in Kg. - **drag_coefficient** (_float_) Drag coefficient of the vehicle's chassis. - **center_of_mass** (_[carla.Vector3D](#carla.Vector3D)_) The center of mass of the vehicle. - **steering_curve** (_list([carla.Vector2D](#carla.Vector2D))_) Curve that indicates the maximum steering for a specific forward speed. - **wheels** (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) List of [carla.WheelPhysicsControl](#carla.WheelPhysicsControl) objects. This list should have 4 elements, where index 0 corresponds to the front left wheel, index 1 corresponds to the front right wheel, index 2 corresponds to the back left wheel and index 3 corresponds to the back right wheel. For 2 wheeled vehicles, set the same values for both front and back wheels.Methods
- **\__init__**(**self**, **torque_curve**=0.0, 500.0], [5000.0, 500.0, **max_rpm**=5000.0, **moi**=1.0, **damping_rate_full_throttle**=0.15, **damping_rate_zero_throttle_clutch_engaged**=2.0, **damping_rate_zero_throttle_clutch_disengaged**=0.35, **use_gear_autobox**=True, **gear_switch_time**=0.5, **clutch_strength**=10.0, **final_ratio**=4.0, **forward_gears**=list(), **mass**=1000.0, **drag_coefficient**=0.3, **center_of_mass**=[0.0, 0.0, 0.0], **steering_curve**=0.0, 1.0], [10.0, 0.5, **wheels**=list()) VehiclePhysicsControl constructor. - **Parameters:** - `torque_curve` (_list([carla.Vector2D](#carla.Vector2D))_) - `max_rpm` (_float_) - `moi` (_float_) - `damping_rate_full_throttle` (_float_) - `damping_rate_zero_throttle_clutch_engaged` (_float_) - `damping_rate_zero_throttle_clutch_disengaged` (_float_) - `use_gear_autobox` (_bool_) - `gear_switch_time` (_float_) - `clutch_strength` (_float_) - `final_ratio` (_float_) - `forward_gears` (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_) - `drag_coefficient` (_float_) - `center_of_mass` (_[carla.Vector3D](#carla.Vector3D)_) - `steering_curve` (_[carla.Vector2D](#carla.Vector2D)_) - `wheels` (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) - **\__str__**(**self**)carla.WalkerAIController(carla.Actor) class
Class used for controlling the automation of a pedestrian.
Methods
- **start**(**self**) Initializes walker controller. - **stop**(**self**) Stops walker controller. - **go_to_location**(**self**, **destination**) Sets the destination that the pedestrian will reach. - **Parameters:** - `destination` (_[carla.Location](#carla.Location)_) - **set_max_speed**(**self**, **speed**=1.4) Sets the speed of the pedestrian. - **Parameters:** - `speed` (_float_) – Speed is in m/s. - **\__str__**(**self**)carla.WalkerBoneControl class
Class used for controlling the skeleton of a walker. See walker bone control.
Instance Variables
- **bone_transforms** (_list([name,transform])_) List of pairs where the first value is the bone name and the second value is the bone transform.Methods
- **\__init__**(**self**, **list(name,transform)**) - **Parameters:** - `list(name,transform)` (_tuple_) - **\__str__**(**self**)carla.WalkerControl class
WalkerControl is used for controlling the basic movement of a walker.
Instance Variables
- **direction** (_[carla.Vector3D](#carla.Vector3D)_) Vector that controls the direction of the walker. - **speed** (_float_) A scalar value to control the walker speed. - **jump** (_bool_) If true, the walker will perform a jump.Methods
- **\__init__**(**self**, **direction**=[1.0, 0.0, 0.0], **speed**=0.0, **jump**=False) WalkerControl constructor. - **Parameters:** - `direction` (_[carla.Vector3D](#carla.Vector3D)_) - `speed` (_float_) - `jump` (_bool_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.WalkerControl](#carla.WalkerControl)_) - **\__str__**(**self**)carla.Waypoint class
3D directed point that stores information about the road definition provided by OpenDRIVE.
Instance Variables
- **id** (_int_) Waypoint id, it's generated using a hash combination of its `road_id`, `section_id`, `lane_id` and `s` values, all them come from the OpenDRIVE. The `s` precision is set to 2 centimeters, so 2 waypoints at a distance `s` less than 2 centimeters in the same road, section and lane, will have the same `id`. - **transform** (_[carla.Transform](#carla.Transform)_) Transform indicating it's position and orientation according to the current lane information. - **is_intersection** (_bool_) _Deprecated, use is_junction instead_. - **is_junction** (_bool_) True if the current Waypoint is on a junction. - **lane_width** (_float_) Horizontal size of the road at current `s`. - **road_id** (_int_) OpenDRIVE road's id. - **section_id** (_int_) OpenDRIVE section's id, based on the order that they are originally defined. - **lane_id** (_int_) OpenDRIVE lane's id, this value can be positive or negative which represents the direction of the current lane with respect to the road. For more information refer to OpenDRIVE [documentation](http://www.opendrive.org/docs/OpenDRIVEFormatSpecRev1.4H.pdf#page=20). - **s** (_float_) OpenDRIVE `s` value of the current position. - **lane_change** (_[carla.LaneChange](#carla.LaneChange)_) Lane change definition of the current Waypoint's location, based on the traffic rules defined in the OpenDRIVE file. Basically, it tells you if a lane change can be done and in which direction. - **lane_type** (_[carla.LaneType](#carla.LaneType)_) The lane type of the current Waypoint, based on OpenDRIVE types. - **right_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) The right lane marking information based on the direction of the Waypoint. - **left_lane_marking** (_[carla.LaneMarking](#carla.LaneMarking)_) The left lane marking information based on the direction of the Waypoint.Methods
- **next**(**self**, **distance**) Returns a list of Waypoints at a certain approximate distance from the current Waypoint, taking into account the shape of the road and its possible deviations, without performing any lane change. The list may be empty if the road ends before the specified distance, for instance, a lane ending with the only option of incorporating to another road. - **Parameters:** - `distance` (_float_) – The approximate distance where to get the next Waypoints. - **Return:** _list([carla.Waypoint](#carla.Waypoint))_ - **get_right_lane**(**self**) Generates a Waypoint at the center of the right lane based on the direction of the current Waypoint, regardless if the lane change is allowed in this location. Can return `None` if the lane does not exist. - **Return:** _[carla.Waypoint](#carla.Waypoint)_ - **get_left_lane**(**self**) Generates a Waypoint at the center of the left lane based on the direction of the current Waypoint, regardless if the lane change is allowed in this location. Can return `None` if the lane does not exist. - **Return:** _[carla.Waypoint](#carla.Waypoint)_ - **\__str__**(**self**)carla.WeatherParameters class
WeatherParameters class is used for requesting and changing the lighting and weather conditions inside the world.
Instance Variables
- **cloudiness** (_float_) Weather cloudiness. Values range from 0 to 100. - **precipitation** (_float_) Precipitation amount for controlling rain intensity. Values range from 0 to 100. - **precipitation_deposits** (_float_) Precipitation deposits for controlling the area of puddles on roads. Values range from 0 to 100. - **wind_intensity** (_float_) Wind intensity. Values range from 0 to 100. - **sun_azimuth_angle** (_float_) The azimuth angle of the sun in degrees. Values range from 0 to 360. - **sun_altitude_angle** (_float_) Altitude angle of the sun in degrees. Values range from -90 to 90.Methods
- **\__init__**(**self**, **cloudiness**=0.0, **precipitation**=0.0, **precipitation_deposits**=0.0, **wind_intensity**=0.0, **sun_azimuth_angle**=0.0, **sun_altitude_angle**=0.0) WeatherParameters constructor. - **Parameters:** - `cloudiness` (_float_) - `precipitation` (_float_) - `precipitation_deposits` (_float_) - `wind_intensity` (_float_) - `sun_azimuth_angle` (_float_) - `sun_altitude_angle` (_float_) - **\__eq__**(**self**, **other**) Returns True if `self` and `other` are equal. - **Return:** _bool_ - **\__ne__**(**self**, **other**) Returns True if `self` and `other` are not equal. - **Return:** _bool_ - **\__str__**(**self**)carla.WheelPhysicsControl class
WheelPhysicsControl is used for controlling the physics parameters of a vehicle's wheel.
Instance Variables
- **tire_friction** (_float_) A scalar value that indicates the friction of the wheel. - **damping_rate** (_float_) The damping rate of the wheel. - **max_steer_angle** (_float_) The maximum angle in degrees that the wheel can steer. - **radius** (_float_) The radius of the wheel in centimeters. - **max_brake_torque** (_float_) The maximum brake torque in Nm. - **max_handbrake_torque** (_float_) The maximum handbrake torque in Nm. - **position** (_[carla.Vector3D](#carla.Vector3D)_) World position of the wheel. Note that it is a read-only parameter.Methods
- **\__init__**(**self**, **tire_friction**=2.0, **damping_rate**=0.25, **max_steer_angle**=70.0, **radius**=30.0, **max_brake_torque**=1500.0, **max_handbrake_torque**=3000.0, **position**=(0.0,0.0,0.0)) WheelPhysicsControl constructor. - **Parameters:** - `tire_friction` (_float_) - `damping_rate` (_float_) - `max_steer_angle` (_float_) - `radius` (_float_) - `max_brake_torque` (_float_) - `max_handbrake_torque` (_float_) - `position` (_[carla.Vector3D](#carla.Vector3D)_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.WheelPhysicsControl](#carla.WheelPhysicsControl)_) - **\__str__**(**self**)carla.World class
Class that contains the current loaded map.
Instance Variables
- **id** (_int_) The id of the episode associated with this world. - **debug** (_[carla.DebugHelper](#carla.DebugHelper)_)Methods
- **get_blueprint_library**(**self**) Return the list of blueprints available in this world. These blueprints can be used to spawn actors into the world. - **Return:** _[carla.BlueprintLibrary](#carla.BlueprintLibrary)_ - **get_map**(**self**) Return the map that describes this world. - **Return:** _[carla.Map](#carla.Map)_ - **get_spectator**(**self**) Return the spectator actor. The spectator controls the view in the simulator window. - **Return:** _[carla.Actor](#carla.Actor)_ - **get_settings**(**self**) - **Return:** _[carla.WorldSettings](#carla.WorldSettings)_ - **apply_settings**(**self**, **world_settings**) Returns the id of the frame when the settings took effect. - **Parameters:** - `world_settings` (_[carla.WorldSettings](#carla.WorldSettings)_) - **Return:** _int_ - **get_weather**(**self**) Retrieve the weather parameters currently active in the world. - **Return:** _[carla.WeatherParameters](#carla.WeatherParameters)_ - **set_weather**(**self**, **weather**) Change the weather in the simulation. - **Parameters:** - `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) - **get_snapshot**(**self**) Return a snapshot of the world at this moment. - **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_ - **get_actor**(**self**, **actor_id**) Find actor by id, return None if not found. - **Parameters:** - `actor_id` (_int_) - **Return:** _[carla.Actor](#carla.Actor)_ - **get_random_location_from_navigation**(**self**) Retrieve a random location to be used as a destination for walkers in [carla.WalkerAIController.go_to_location](#carla.WalkerAIController.go_to_location). See [`spawn_npc.py`](e73ad54d18/PythonAPI/examples/spawn_npc.py (L179)
) for an example.
- **Return:** _[carla.Location](#carla.Location)_
- **get_actors**(**self**)
By default it returns a list with every actor present in the world. _A list of ids can be used as a parameter_.
- **Return:** _[carla.ActorList](#carla.ActorList)_
- **spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid)
Spawn an actor into the world based on the blueprint provided at transform. If a parent is provided, the actor is attached to parent.
- **Parameters:**
- `blueprint` (_[carla.BlueprintLibrary](#carla.BlueprintLibrary)_)
- `transform` (_[carla.Transform](#carla.Transform)_) – If attached to parent, transform acts like a relative_transform to the parent actor.
- `attach_to` (_[carla.Actor](#carla.Actor)_)
- `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_)
- **Return:** _[carla.Actor](#carla.Actor)_
- **try_spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid)
Same as SpawnActor but return none on failure instead of throwing an exception.
- **Parameters:**
- `blueprint` (_[carla.BlueprintLibrary](#carla.BlueprintLibrary)_)
- `transform` (_[carla.Transform](#carla.Transform)_) – If attached to parent, transform acts like a relative_transform to the parent actor.
- `attach_to` (_[carla.Actor](#carla.Actor)_)
- `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_)
- **Return:** _[carla.Actor](#carla.Actor)_
- **wait_for_tick**(**self**, **seconds**=10.0)
Block calling thread until a world tick is received.
- **Parameters:**
- `seconds` (_float_)
- **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_
- **on_tick**(**self**, **callback**)
Returns the ID of the callback so it can be removed with `remove_on_tick`.
- **Parameters:**
- `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_)
- **Return:** _int_
- **remove_on_tick**(**self**, **callback_id**)
Removes on tick callbacks.
- **tick**(**self**)
Synchronizes with the simulator and returns the id of the newly started frame (only has effect on synchronous mode).
- **Return:** _int_
- **\__str__**(**self**)
carla.WorldSettings class
Class that provides access to modifiable world settings. Check it out in our section.
Instance Variables
- **synchronous_mode** (_bool_) - **no_rendering_mode** (_bool_) - **fixed_delta_seconds** (_float_)Methods
- **\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0) - **Parameters:** - `synchronous_mode` (_bool_) - `no_rendering_mode` (_bool_) - `fixed_delta_seconds` (_float_) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Timestamp](#carla.Timestamp)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Timestamp](#carla.Timestamp)_) - **\__str__**(**self**)carla.WorldSnapshot class
Class that represents the state of every actor in the simulation at a single frame.
Instance Variables
- **id** (_int_) The WorldSnapshot's identifier. - **frame** (_int_) Frame number. - **timestamp** (_[carla.Timestamp](#carla.Timestamp)_) Timestamp simulated data.Methods
- **has_actor**(**self**, **actor_id**) Check if an actor is present in this snapshot. - **Parameters:** - `actor_id` (_int_) - **find**(**self**, **actor_id**) Find an ActorSnapshot by id, return None if the actor is not found. - **Parameters:** - `actor_id` (_int_) - **\__len__**(**self**) Return number of [carla.ActorSnapshot](#carla.ActorSnapshot) present in this [carla.WorldSnapshot](#carla.WorldSnapshot). - **Return:** _int_ - **\__iter__**(**self**) - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) - **\__self__**(**self**)carla.GnssMeasurement(carla.SensorData) class
Gnss sensor data.
Instance Variables
- **latitude** (_float_) North/South value of a point on the map. - **longitude** (_float_) West/East value of a point on the map. - **altitude** (_float_) Height regarding ground level.Methods
- **\__str__**(**self**)carla.IMUMeasurement(carla.SensorData) class
IMU sensor data regarding the sensor World's transformation.
Instance Variables
- **accelerometer** (_[carla.Vector3D](#carla.Vector3D)_) Measures linear acceleration in `m/s^2`. - **gyroscope** (_[carla.Vector3D](#carla.Vector3D)_) Measures angular velocity in `rad/sec`. - **compass** (_float_) Orientation with respect to the North (`(0.0, -1.0, 0.0)` in Unreal) in radians.Methods
- **\__str__**(**self**)carla.Image(carla.SensorData) class
Class that defines an image of 32-bit BGRA colors.
Instance Variables
- **width** (_int_) Image width in pixels. - **height** (_int_) Image height in pixels. - **fov** (_float_) Horizontal field of view of the image in degrees. - **raw_data** (_bytes_)Methods
- **convert**(**self**, **color_converter**) Convert the image with the applied conversion. - **Parameters:** - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) - **save_to_disk**(**self**, **path**, **color_converter**=Raw) Save the image to disk. - **Parameters:** - `path` (_str_) – Path where it will be saved. - `color_converter` (_[carla.ColorConverter](#carla.ColorConverter)_) - **\__len__**(**self**) - **\__iter__**(**self**) - **\__getitem__**(**self**, **pos**) - **Parameters:** - `pos` (_int_) - **\__setitem__**(**self**, **pos**, **color**) - **Parameters:** - `pos` (_int_) - `color` (_[carla.Color](#carla.Color)_) - **\__str__**(**self**)carla.LaneInvasionEvent(carla.SensorData) class
Lane invasion sensor data.
Instance Variables
- **actor** (_[carla.Actor](#carla.Actor)_) Get "self" actor. Actor that invaded another lane. - **crossed_lane_markings** (_list([carla.LaneMarking](#carla.LaneMarking))_) List of lane markings that have been crossed.Methods
- **\__str__**(**self**)carla.LidarMeasurement(carla.SensorData) class
Lidar sensor measurement data.
Instance Variables
- **horizontal_angle** (_float_) Horizontal angle that the Lidar has rotated at the time of the measurement (in radians). - **channels** (_int_) Number of lasers. - **raw_data** (_bytes_) List of 3D points.Methods
- **get_point_count**(**self**, **channel**) Retrieve the number of points that are generated by this channel. - **Parameters:** - `channel` (_int_) - **Note:** _Points are sorted by channel, so this method allows to identify the channel that generated each point. _ - **save_to_disk**(**self**, **path**) Save point cloud to disk. - **Parameters:** - `path` (_str_) - **\__len__**(**self**) - **\__iter__**(**self**) - **\__getitem__**(**self**, **pos**) - **Parameters:** - `pos` (_int_) - **\__setitem__**(**self**, **pos**, **location**) - **Parameters:** - `pos` (_int_) - `location` (_[carla.Location](#carla.Location)_) - **\__str__**(**self**)carla.Location(carla.Vector3D) class
Represents a location in the world (in meters).
Instance Variables
- **x** (_float_) - **y** (_float_) - **z** (_float_)Methods
- **\__init__**(**self**, **x**=0.0, **y**=0.0, **z**=0.0) - **Parameters:** - `x` (_float_) - `y` (_float_) - `z` (_float_) - **distance**(**self**, **location**) Computes the Euclidean distance in meters from this location to another one. - **Parameters:** - `location` (_[carla.Location](#carla.Location)_) – The Location from where to compute the distance. - **Return:** _float_ - **\__eq__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Location](#carla.Location)_) - **\__ne__**(**self**, **other**) - **Parameters:** - `other` (_[carla.Location](#carla.Location)_) - **\__str__**(**self**)carla.ObstacleDetectionEvent(carla.SensorData) class
Obstacle detection sensor data.
Instance Variables
- **actor** (_[carla.Actor](#carla.Actor)_) Get "self" actor. Actor that measured the collision. - **other_actor** (_[carla.Actor](#carla.Actor)_) Get the actor to which we collided. - **distance** (_float_) Get obstacle distance.Methods
- **\__str__**(**self**)carla.RadarMeasurement(carla.SensorData) class
Measurement produced by a Radar. Consists of an array of carla.RadarDetection.
Instance Variables
- **raw_data** (_bytes_) List of [carla.RadarDetection](#carla.RadarDetection).Methods
- **get_detection_count**(**self**) Retrieve the number of [carla.RadarDetection](#carla.RadarDetection) that are generated. - **\__len__**(**self**) - **\__iter__**(**self**) - **\__getitem__**(**self**, **pos**) - **Parameters:** - `pos` (_int_) - **\__setitem__**(**self**, **pos**, **detection**) - **Parameters:** - `pos` (_int_) - `detection` (_[carla.RadarDetection](#carla.RadarDetection)_) - **\__str__**(**self**)carla.Sensor(carla.Actor) class
A sensor actor.
Instance Variables
- **is_listening** (_boolean_) Is true if the sensor is listening for data.Methods
- **listen**(**self**, **callback**) - **Parameters:** - `callback` (_function_) – Register a callback to be executed each time a new measurement is received. The callback must accept a single argument containing the sensor data; the type of this object varies depending on the type of sensor, but they all derive from [carla.SensorData](#carla.SensorData). - **stop**(**self**) Stops listening for data. - **\__str__**(**self**)carla.TrafficLight(carla.TrafficSign) class
A traffic light actor. Check out this recipe
!
Instance Variables
- **state** (_[carla.TrafficLightState](#carla.TrafficLightState)_) Current traffic light state.Methods
- **set_state**(**self**, **state**) Sets a given state to a traffic light actor. - **Parameters:** - `state` (_[carla.TrafficLightState](#carla.TrafficLightState)_) - **get_state**(**self**) Returns the current state of the traffic light. - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **set_green_time**(**self**, **green_time**) - **Parameters:** - `green_time` (_float_) – Sets a given time (in seconds) to the green state to be active. - **get_green_time**(**self**) Returns the current time set for the green light to be active. - **Return:** _float_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **set_yellow_time**(**self**, **yellow_time**) Sets a given time (in seconds) to the yellow state to be active. - **Parameters:** - `yellow_time` (_float_) - **get_yellow_time**(**self**) Returns the current time set for the yellow light to be active. - **Return:** _float_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **set_red_time**(**self**, **red_time**) Sets a given time (in seconds) to the red state to be active. - **Parameters:** - `red_time` (_float_) - **get_red_time**(**self**) Returns the current time set for the red light to be active. - **Return:** _float_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **get_elapsed_time**(**self**) Returns the current countdown of the state of a traffic light. - **Return:** _float_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **freeze**(**self**, **freeze**) Stops the traffic light at its current state. - **Parameters:** - `freeze` (_bool_) - **is_frozen**(**self**) Returns `True` if a traffic light is frozen. - **Return:** _bool_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **get_pole_index**(**self**) Returns the index of the pole in the traffic light group. - **Return:** _int_ - **get_group_traffic_lights**(**self**) Returns all traffic lights in the group this one belongs to. - **Return:** _list([carla.TrafficLight](#carla.TrafficLight))_ - **Note:** _This function calls the simulator. _ - **\__str__**(**self**)carla.Vehicle(carla.Actor) class
A vehicle actor.
Instance Variables
- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) The vehicle's bounding box.Methods
- **apply_control**(**self**, **control**) Apply control to this vehicle. The control will take effect on next tick. - **Parameters:** - `control` (_[carla.VehicleControl](#carla.VehicleControl)_) - **get_control**(**self**) Returns the control last applied to this vehicle. - **Return:** _[carla.VehicleControl](#carla.VehicleControl)_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **apply_physics_control**(**self**, **physics_control**) Apply physics control to this vehicle. The control will take effect on the next tick. - **Parameters:** - `physics_control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_) - **get_physics_control**(**self**) Returns the physics control last applied to this vehicle. - **Return:** _[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_ - **Warning:** _This function does call the simulator to retrieve the value._ - **set_autopilot**(**self**, **enabled**=True) Switch on/off this vehicle's server-side autopilot. - **Parameters:** - `enabled` (_bool_) - **get_speed_limit**(**self**) Returns the speed limit currently affecting this vehicle. Note that the speed limit is only updated when passing by a speed limit signal, right after spawning a vehicle it might not reflect the actual speed limit of the current road. - **Return:** _float_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **get_traffic_light_state**(**self**) Returns the state of the traffic light currently affecting this vehicle. If no traffic light is currently affecting the vehicle, return Green. - **Return:** _[carla.TrafficLightState](#carla.TrafficLightState)_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **is_at_traffic_light**(**self**) Returns whether a traffic light is affecting this vehicle. - **Return:** _bool_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **get_traffic_light**(**self**) Retrieve the traffic light actor currently affecting this vehicle. - **Return:** _[carla.TrafficLight](#carla.TrafficLight)_ - **\__str__**(**self**) - **Return:** _str_carla.Walker(carla.Actor) class
A walking actor, pedestrian.
Instance Variables
- **bounding_box** (_[carla.BoundingBox](#carla.BoundingBox)_) The walker's bounding box.Methods
- **apply_control**(**self**, **control**) Apply control to this walker. - **Parameters:** - `control` (_[carla.WalkerControl](#carla.WalkerControl)_) - **Note:** _The control will take effect on the next tick. _ - **apply_control**(**self**, **control**) Apply bone control to this walker. - **Parameters:** - `control` (_[carla.WalkerBoneControl](#carla.WalkerBoneControl)_) - **Note:** _The control will take effect on the next tick. _ - **get_control**(**self**) Returns the control last applied to this walker. - **Return:** _[carla.WalkerControl](#carla.WalkerControl)_ - **Note:** _This function does not call the simulator, it returns the data received in the last tick. _ - **\__str__**(**self**) - **Return:** _str_command.ApplyAngularVelocity class
Set the actor's angular velocity.
Instance Variables
- **actor_id** (_int_) Actor affected by the command. - **angular_velocity** (_[carla.Vector3D](#carla.Vector3D)_) 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_) - `angular_velocity` (_[carla.Vector3D](#carla.Vector3D)_)command.ApplyImpulse class
Adds impulse to the actor.
Instance Variables
- **actor_id** (_int_) Actor affected by the command. - **impulse** (_[carla.Vector3D](#carla.Vector3D)_) Impulse applied to the actor.Methods
- **\__init__**(**self**, **actor**, **impulse**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) - `impulse` (_[carla.Vector3D](#carla.Vector3D)_)command.ApplyTransform class
Sets a new transform to the 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_) - `transform` (_[carla.Transform](#carla.Transform)_)command.ApplyVehicleControl class
Apply control to the 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_) - `control` (_[carla.VehicleControl](#carla.VehicleControl)_)command.ApplyVelocity class
Sets actor's velocity.
Instance Variables
- **actor_id** (_int_) Actor affected by the command. - **velocity** (_[carla.Vector3D](#carla.Vector3D)_) The 3D velocity applied to the actor.Methods
- **\__init__**(**self**, **actor**, **velocity**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) - `velocity` (_[carla.Vector3D](#carla.Vector3D)_)command.ApplyWalkerControl class
Apply control to the walker.
Instance Variables
- **actor_id** (_int_) Walker actor affected by the command. - **control** (_[carla.VehicleControl](#carla.VehicleControl)_) Walker control to be applied.Methods
- **\__init__**(**self**, **actor**, **control**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) - `control` (_[carla.WalkerControl](#carla.WalkerControl)_)command.ApplyWalkerState class
Apply a state to the walker actor.
Instance Variables
- **actor_id** (_int_) Walker actor affected by the command. - **transform** (_[carla.Transform](#carla.Transform)_) Transform to be applied. - **speed** (_float_) Speed to be applied.Methods
- **\__init__**(**self**, **actor**, **transform**, **speed**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) - `transform` (_[carla.Transform](#carla.Transform)_) - `speed` (_float_)command.DestroyActor class
Tell the simulator to destroy this Actor, and return whether the actor was successfully destroyed. It has no effect if the Actor was already successfully destroyed.
Instance Variables
- **actor_id** (_int_) Actor affected by the command.Methods
- **\__init__**(**self**, **actor**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_)command.Response class
Execution result of a command, contains either an error string or an actor ID, depending on whether or not the command succeeded. See carla.Client.apply_batch_sync.
Instance Variables
- **actor_id** (_int_) Actor affected by the command. - **error** (_str_)Methods
- **has_error**(**self**)command.SetAutopilot class
Switch on/off vehicle's server-side autopilot.
Instance Variables
- **actor_id** (_int_) Actor that is affected by the command. - **enabled** (_bool_) If the autopilot is enabled or not.Methods
- **\__init__**(**self**, **actor**, **enabled**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) - `enabled` (_bool_)command.SetSimulatePhysics class
Whether an actor will be affected by physics or not.
Instance Variables
- **actor_id** (_int_) Actor affected by the command. - **enabled** (_bool_) If physics will affect the actor.Methods
- **\__init__**(**self**, **actor**, **enabled**) - **Parameters:** - `actor` (_[carla.Actor](#carla.Actor) or int_) - `enabled` (_bool_)command.SpawnActor class
Spawn an actor into the world based on the blueprint provided and the transform. If a parent is provided, the actor is attached to parent.