0
for permanent shapes.
+ - `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.
+ - `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.
+ - `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.
+ - `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.
+ - `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.
---
@@ -730,6 +742,34 @@ Parses the EnvironmentObject to a string and shows them in command line.
---
+## 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.GearPhysicsControl
Class that provides access to vehicle transmission details by defining a gear and when to run on it. This will be later used by [carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl) to help simulate physics.
@@ -759,19 +799,19 @@ Quotient between current RPM and MaxRPM where the autonomous gear box should shi
Class that contains geographical coordinates simulated data. The [carla.Map](#carla.Map) can convert simulation locations by using the .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.
+ - `osm_file` (_str_) - The content of the input OpenStreetMap file parsed as string.
+ - `settings` (_[carla.OSM2ODRSettings](#carla.OSM2ODRSettings)_) - Parameterization for the conversion.
- **Return:** _str_
---
@@ -1646,13 +1701,13 @@ Helper class that contains the parameterization that will be used by [carla.Osm2
### 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_x** (_float - meters_)
Offset in the X axis. Default value is __0.0__.
-- **offset_y** (_float – meters_)
+- **offset_y** (_float - meters_)
Offset in the Y axis. Default value is __0.0__.
-- **default_lane_width** (_float – meters_)
+- **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_)
+- **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.
@@ -1669,11 +1724,11 @@ When disabled, the converter will generate traffic light data from the OpenStree
- **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.
+ - `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.
+ - `way_types` (_list(str)_) - The list of road types.
---
@@ -1681,13 +1736,13 @@ Defines the OpenStreetMaps road types that will not generate traffic lights even
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** (_float - radians_)
Altitude angle of the detection.
-- **azimuth** (_float – radians_)
+- **azimuth** (_float - radians_)
Azimuth angle of the detection.
-- **depth** (_float – meters_)
+- **depth** (_float - meters_)
Distance from the sensor to the detection position.
-- **velocity** (_float – m/s_)
+- **velocity** (_float - m/s_)
The velocity of the detected object towards the sensor.
### Methods
@@ -1726,19 +1781,19 @@ Class that represents a 3D rotation and therefore, an orientation in space. CARL
(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
@@ -1898,12 +1953,18 @@ These objects apply restrictions to a [carla.VehicleControl](#carla.VehicleContr
- **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.
+ - `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
@@ -1939,13 +2000,13 @@ The current list of targets considered to route the vehicle. If no routing targe
- **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.
+ - `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.
+ - `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.
@@ -1953,11 +2014,11 @@ Erases the targets that have been appended to the route.
- **set_log_level**(**self**, **log_level**)
Sets the log level.
- **Parameters:**
- - `log_level` (_[carla.RssLogLevel](#carla.RssLogLevel)_) – New log level.
+ - `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.
+ - `log_level` (_[carla.RssLogLevel](#carla.RssLogLevel)_) - New map log level.
##### Dunder methods
- **\__str__**(**self**)
@@ -1968,7 +2029,7 @@ Sets the map log level.
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_)
+- **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.
@@ -1991,7 +2052,7 @@ Class that defines the semantic LIDAR data retrieved by a sensor.lidar.ray_ca
### Instance Variables
- **channels** (_int_)
Number of lasers shot.
-- **horizontal_angle** (_float – radians_)
+- **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.
@@ -2046,7 +2107,7 @@ When True the sensor will be waiting for data.
- **listen**(**self**, **callback**)
The function the sensor will be calling to every time a new measurement is received. This function needs for an argument containing an object type [carla.SensorData](#carla.SensorData) to work with.
- **Parameters:**
- - `callback` (_function_) – The called function with one argument containing the sensor data.
+ - `callback` (_function_) - The called function with one argument containing the sensor data.
- **stop**(**self**)
Commands the sensor to stop listening for data.
@@ -2071,33 +2132,107 @@ Base class for all the objects containing data generated by a [carla.Sensor](#ca
### Instance Variables
- **frame** (_int_)
Frame count when the data was generated.
-- **timestamp** (_float – seconds_)
+- **timestamp** (_float - seconds_)
Simulation-time when the data was generated.
- **transform** (_[carla.Transform](#carla.Transform)_)
Sensor's transform when the data was generated.
---
+## carla.TextureColor
+Class representing a texture object to be uploaded to the server. Pixel format is RGBA, uint8 per channel.
+
+### Instance Variables
+- **width** (_int_)
+X-coordinate size of the texture.
+- **height** (_int_)
+Y-coordinate size of the texture.
+
+### Methods
+- **\__init__**(**self**, **width**, **height**)
+Initializes a the texture with a (`width`, `height`) size.
+ - **Parameters:**
+ - `width` (_int_)
+ - `height` (_int_)
+- **get**(**self**, **x**, **y**)
+Get the (x,y) pixel data.
+ - **Parameters:**
+ - `x` (_int_)
+ - `y` (_int_)
+ - **Return:** _[carla.Color](#carla.Color)_
+- **set**(**self**, **x**, **y**, **value**)
+Sets the (x,y) pixel data with `value`.
+ - **Parameters:**
+ - `x` (_int_)
+ - `y` (_int_)
+ - `value` (_[carla.Color](#carla.Color)_)
+
+##### Setters
+- **set_dimensions**(**self**, **width**, **height**)
+Resizes the texture to te specified dimensions.
+ - **Parameters:**
+ - `width` (_int_)
+ - `height` (_int_)
+
+---
+
+## carla.TextureFloatColor
+Class representing a texture object to be uploaded to the server. Pixel format is RGBA, float per channel.
+
+### Instance Variables
+- **width** (_int_)
+X-coordinate size of the texture.
+- **height** (_int_)
+Y-coordinate size of the texture.
+
+### Methods
+- **\__init__**(**self**, **width**, **height**)
+Initializes a the texture with a (`width`, `height`) size.
+ - **Parameters:**
+ - `width` (_int_)
+ - `height` (_int_)
+- **get**(**self**, **x**, **y**)
+Get the (x,y) pixel data.
+ - **Parameters:**
+ - `x` (_int_)
+ - `y` (_int_)
+ - **Return:** _[carla.FloatColor](#carla.FloatColor)_
+- **set**(**self**, **x**, **y**, **value**)
+Sets the (x,y) pixel data with `value`.
+ - **Parameters:**
+ - `x` (_int_)
+ - `y` (_int_)
+ - `value` (_[carla.FloatColor](#carla.FloatColor)_)
+
+##### Setters
+- **set_dimensions**(**self**, **width**, **height**)
+Resizes the texture to te specified dimensions.
+ - **Parameters:**
+ - `width` (_int_)
+ - `height` (_int_)
+
+---
+
## carla.Timestamp
Class that contains time information for simulated data. This information is automatically retrieved as part of the [carla.WorldSnapshot](#carla.WorldSnapshot) the client gets on every frame, but might also be used in many other situations such as a [carla.Sensor](#carla.Sensor) retrieveing data.
### Instance Variables
- **frame** (_int_)
The number of frames elapsed since the simulator was launched.
-- **elapsed_seconds** (_float – seconds_)
+- **elapsed_seconds** (_float - seconds_)
Simulated seconds elapsed since the beginning of the current episode.
-- **delta_seconds** (_float – seconds_)
+- **delta_seconds** (_float - seconds_)
Simulated seconds elapsed since the previous frame.
-- **platform_timestamp** (_float – seconds_)
+- **platform_timestamp** (_float - seconds_)
Time register of the frame at which this measurement was taken given by the OS in seconds.
### Methods
- **\__init__**(**self**, **frame**, **elapsed_seconds**, **delta_seconds**, **platform_timestamp**)
- **Parameters:**
- `frame` (_int_)
- - `elapsed_seconds` (_float – seconds_)
- - `delta_seconds` (_float – seconds_)
- - `platform_timestamp` (_float – seconds_)
+ - `elapsed_seconds` (_float - seconds_)
+ - `delta_seconds` (_float - seconds_)
+ - `platform_timestamp` (_float - seconds_)
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.Timestamp](#carla.Timestamp))
@@ -2135,10 +2270,10 @@ Returns a list of waypoints indicating the positions and lanes where the traffic
- **Return:** _list([carla.Waypoint](#carla.Waypoint))_
- **get_elapsed_time**(**self**)
The client returns the time in seconds since current light state started according to last tick. The method does not call the simulator.
- - **Return:** _float – seconds_
+ - **Return:** _float - seconds_
- **get_green_time**(**self**)
The client returns the time set for the traffic light to be green, according to last tick. The method does not call the simulator.
- - **Return:** _float – seconds_
+ - **Return:** _float - seconds_
- **Setter:** _[carla.TrafficLight.set_green_time](#carla.TrafficLight.set_green_time)_
- **get_group_traffic_lights**(**self**)
Returns all traffic lights in the group this one belongs to.
@@ -2156,7 +2291,7 @@ Returns the index of the pole that identifies it as part of the traffic light gr
- **Return:** _int_
- **get_red_time**(**self**)
The client returns the time set for the traffic light to be red, according to last tick. The method does not call the simulator.
- - **Return:** _float – seconds_
+ - **Return:** _float - seconds_
- **Setter:** _[carla.TrafficLight.set_red_time](#carla.TrafficLight.set_red_time)_
- **get_state**(**self**)
The client returns the state of the traffic light according to last tick. The method does not call the simulator.
@@ -2167,18 +2302,18 @@ Returns a list of waypoints indicating the stop position for the traffic light.
- **Return:** _list([carla.Waypoint](#carla.Waypoint))_
- **get_yellow_time**(**self**)
The client returns the time set for the traffic light to be yellow, according to last tick. The method does not call the simulator.
- - **Return:** _float – seconds_
+ - **Return:** _float - seconds_
- **Setter:** _[carla.TrafficLight.set_yellow_time](#carla.TrafficLight.set_yellow_time)_
##### Setters
- **set_green_time**(**self**, **green_time**)
- **Parameters:**
- - `green_time` (_float – seconds_) – Sets a given time for the green light to be active.
+ - `green_time` (_float - seconds_) - Sets a given time for the green light to be active.
- **Getter:** _[carla.TrafficLight.get_green_time](#carla.TrafficLight.get_green_time)_
- **set_red_time**(**self**, **red_time**)
Sets a given time for the red state to be active.
- **Parameters:**
- - `red_time` (_float – seconds_)
+ - `red_time` (_float - seconds_)
- **Getter:** _[carla.TrafficLight.get_red_time](#carla.TrafficLight.get_red_time)_
- **set_state**(**self**, **state**)
Sets a given state to a traffic light actor.
@@ -2188,7 +2323,7 @@ Sets a given state to a traffic light actor.
- **set_yellow_time**(**self**, **yellow_time**)
Sets a given time for the yellow light to be active.
- **Parameters:**
- - `yellow_time` (_float – seconds_)
+ - `yellow_time` (_float - seconds_)
- **Getter:** _[carla.TrafficLight.get_yellow_time](#carla.TrafficLight.get_yellow_time)_
##### Dunder methods
@@ -2216,55 +2351,61 @@ In order to learn more, visit the [documentation](adv_traffic_manager.md) regard
- **auto_lane_change**(**self**, **actor**, **enable**)
Turns on or off lane changing behaviour for a vehicle.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – The vehicle whose settings are changed.
- - `enable` (_bool_) – __True__ is default and enables lane changes. __False__ will disable them.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - The vehicle whose settings are changed.
+ - `enable` (_bool_) - __True__ is default and enables lane changes. __False__ will disable them.
+- **auto_update_lights**(**self**, **actor**, **do_update**)
+Sets if the Traffic Manager is responsible of updating the vehicle lights, or not.
+Default is __False__. The traffic manager will not change the vehicle light status of a vehicle, unless its auto_update_status is st to __True__.
+ - **Parameters:**
+ - `actor` (_[carla.Actor](#carla.Actor)_) - Vehicle whose lights status is being changed.
+ - `do_update` (_bool_) - If __True__ the traffic manager will manage the vehicle lights for the specified vehicle.
- **collision_detection**(**self**, **reference_actor**, **other_actor**, **detect_collision**)
Tunes on/off collisions between a vehicle and another specific actor. In order to ignore all other vehicles, traffic lights or walkers, use the specific __ignore__ methods described in this same section.
- **Parameters:**
- - `reference_actor` (_[carla.Actor](#carla.Actor)_) – Vehicle that is going to ignore collisions.
- - `other_actor` (_[carla.Actor](#carla.Actor)_) – The actor that `reference_actor` is going to ignore collisions with.
- - `detect_collision` (_bool_) – __True__ is default and enables collisions. __False__ will disable them.
+ - `reference_actor` (_[carla.Actor](#carla.Actor)_) - Vehicle that is going to ignore collisions.
+ - `other_actor` (_[carla.Actor](#carla.Actor)_) - The actor that `reference_actor` is going to ignore collisions with.
+ - `detect_collision` (_bool_) - __True__ is default and enables collisions. __False__ will disable them.
- **distance_to_leading_vehicle**(**self**, **actor**, **distance**)
Sets the minimum distance in meters that a vehicle has to keep with the others. The distance is in meters and will affect the minimum moving distance. It is computed from front to back of the vehicle objects.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – Vehicle whose minimum distance is being changed.
- - `distance` (_float – meters_) – Meters between both vehicles.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - Vehicle whose minimum distance is being changed.
+ - `distance` (_float - meters_) - Meters between both vehicles.
- **force_lane_change**(**self**, **actor**, **direction**)
Forces a vehicle to change either to the lane on its left or right, if existing, as indicated in `direction`. This method applies the lane change no matter what, disregarding possible collisions.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – Vehicle being forced to change lanes.
- - `direction` (_bool_) – Destination lane. __True__ is the one on the right and __False__ is the left one.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - Vehicle being forced to change lanes.
+ - `direction` (_bool_) - Destination lane. __True__ is the one on the right and __False__ is the left one.
- **global_percentage_speed_difference**(**self**, **percentage**)
Sets the difference the vehicle's intended speed and its current speed limit. Speed limits can be exceeded by setting the `perc` to a negative value.
Default is 30. Exceeding a speed limit can be done using negative percentages.
- **Parameters:**
- - `percentage` (_float_) – Percentage difference between intended speed and the current limit.
+ - `percentage` (_float_) - Percentage difference between intended speed and the current limit.
- **ignore_lights_percentage**(**self**, **actor**, **perc**)
During the traffic light stage, which runs every frame, this method sets the percent chance that traffic lights will be ignored for a vehicle.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – The actor that is going to ignore traffic lights.
- - `perc` (_float_) – Between 0 and 100. Amount of times traffic lights will be ignored.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - The actor that is going to ignore traffic lights.
+ - `perc` (_float_) - Between 0 and 100. Amount of times traffic lights will be ignored.
- **ignore_signs_percentage**(**self**, **actor**, **perc**)
During the traffic light stage, which runs every frame, this method sets the percent chance that stop signs will be ignored for a vehicle.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – The actor that is going to ignore stop signs.
- - `perc` (_float_) – Between 0 and 100. Amount of times stop signs will be ignored.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - The actor that is going to ignore stop signs.
+ - `perc` (_float_) - Between 0 and 100. Amount of times stop signs will be ignored.
- **ignore_vehicles_percentage**(**self**, **actor**, **perc**)
During the collision detection stage, which runs every frame, this method sets a percent chance that collisions with another vehicle will be ignored for a vehicle.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – The vehicle that is going to ignore other vehicles.
- - `perc` (_float_) – Between 0 and 100. Amount of times collisions will be ignored.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - The vehicle that is going to ignore other vehicles.
+ - `perc` (_float_) - Between 0 and 100. Amount of times collisions will be ignored.
- **ignore_walkers_percentage**(**self**, **actor**, **perc**)
During the collision detection stage, which runs every frame, this method sets a percent chance that collisions with walkers will be ignored for a vehicle.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – The vehicle that is going to ignore walkers on scene.
- - `perc` (_float_) – Between 0 and 100. Amount of times collisions will be ignored.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - The vehicle that is going to ignore walkers on scene.
+ - `perc` (_float_) - Between 0 and 100. Amount of times collisions will be ignored.
- **vehicle_percentage_speed_difference**(**self**, **actor**, **percentage**)
Sets the difference the vehicle's intended speed and its current speed limit. Speed limits can be exceeded by setting the `perc` to a negative value.
Default is 30. Exceeding a speed limit can be done using negative percentages.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – Vehicle whose speed behaviour is being changed.
- - `percentage` (_float_) – Percentage difference between intended speed and the current limit.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - Vehicle whose speed behaviour is being changed.
+ - `percentage` (_float_) - Percentage difference between intended speed and the current limit.
##### Getters
- **get_port**(**self**)
@@ -2275,35 +2416,35 @@ Returns the port where the Traffic Manager is connected. If the object is a TM-C
- **set_boundaries_respawn_dormant_vehicles**(**self**, **lower_bound**=25.0, **upper_bound**=actor_active_distance)
Sets the upper and lower boundaries for dormant actors to be respawned near the hero vehicle.
- **Parameters:**
- - `lower_bound` (_float_) – The minimum distance in meters from the hero vehicle that a dormant actor will be respawned.
- - `upper_bound` (_float_) – The maximum distance in meters from the hero vehicle that a dormant actor will be respawned.
+ - `lower_bound` (_float_) - The minimum distance in meters from the hero vehicle that a dormant actor will be respawned.
+ - `upper_bound` (_float_) - The maximum distance in meters from the hero vehicle that a dormant actor will be respawned.
- **Warning:** _The `upper_bound` cannot be higher than the `actor_active_distance`. The `lower_bound` cannot be less than 25.
_
- **set_global_distance_to_leading_vehicle**(**self**, **distance**)
Sets the minimum distance in meters that vehicles have to keep with the rest. The distance is in meters and will affect the minimum moving distance. It is computed from center to center of the vehicle objects.
- **Parameters:**
- - `distance` (_float – meters_) – Meters between vehicles.
+ - `distance` (_float - meters_) - Meters between vehicles.
- **set_hybrid_physics_mode**(**self**, **enabled**=False)
Enables or disables the hybrid physics mode. In this mode, vehicle's farther than a certain radius from the ego vehicle will have their physics disabled. Computation cost will be reduced by not calculating vehicle dynamics. Vehicles will be teleported.
- **Parameters:**
- - `enabled` (_bool_) – If __True__, enables the hybrid physics.
+ - `enabled` (_bool_) - If __True__, enables the hybrid physics.
- **set_hybrid_physics_radius**(**self**, **r**=50.0)
With hybrid physics on, changes the radius of the area of influence where physics are enabled.
- **Parameters:**
- - `r` (_float – meters_) – New radius where physics are enabled.
+ - `r` (_float - meters_) - New radius where physics are enabled.
- **set_osm_mode**(**self**, **mode_switch**=True)
Enables or disables the OSM mode. This mode allows the user to run TM in a map created with the [OSM feature](tuto_G_openstreetmap.md). These maps allow having dead-end streets. Normally, if vehicles cannot find the next waypoint, TM crashes. If OSM mode is enabled, it will show a warning, and destroy vehicles when necessary.
- **Parameters:**
- `mode_switch` (_bool_) – If __True__, the OSM mode is enabled.
-- **set_percentage_keep_right_rule**(**self**, **actor**, **perc**)
+- **keep_right_rule_percentage**(**self**, **actor**, **perc**)
During the localization stage, this method sets a percent chance that vehicle will follow the *keep right* rule, and stay in the right lane.
- **Parameters:**
- - `actor` (_[carla.Actor](#carla.Actor)_) – Vehicle whose behaviour is being changed.
- - `perc` (_float_) – Between 0 and 100. Amount of times the vehicle will follow the keep right rule.
+ - `actor` (_[carla.Actor](#carla.Actor)_) - Vehicle whose behaviour is being changed.
+ - `perc` (_float_) - Between 0 and 100. Amount of times the vehicle will follow the keep right rule.
- **set_random_device_seed**(**self**, **value**)
Sets a specific random seed for the Traffic Manager, thereby setting it to be deterministic.
- **Parameters:**
- - `value` (_int_) – Seed value for the random number generation of the Traffic Manager.
+ - `value` (_int_) - Seed value for the random number generation of the Traffic Manager.
- **set_respawn_dormant_vehicles**(**self**, **mode_switch**=False)
If __True__, vehicles in large maps will respawn near the hero vehicle when they become dormant. Otherwise, they will stay dormant until they are within `actor_active_distance` of the hero vehicle again.
- **Parameters:**
@@ -2311,7 +2452,7 @@ If __True__, vehicles in large maps will respawn near the hero vehicle when they
- **set_synchronous_mode**(**self**, **mode_switch**=True)
Sets the Traffic Manager to [synchronous mode](adv_traffic_manager.md#synchronous-mode). In a [multiclient situation](adv_traffic_manager.md#multiclient), only the TM-Server can tick. Similarly, in a [multiTM situation](adv_traffic_manager.md#multitm), only one TM-Server must tick. Use this method in the client that does the world tick, and right after setting the world to synchronous mode, to set which TM will be the master while in sync.
- **Parameters:**
- - `mode_switch` (_bool_) – If __True__, the TM synchronous mode is enabled.
+ - `mode_switch` (_bool_) - If __True__, the TM synchronous mode is enabled.
- **Warning:** _If the server is set to synchronous mode, the TM must be set to synchronous mode too in the same client that does the tick.
_
@@ -2333,18 +2474,18 @@ Class that defines a transformation, a combination of location and rotation, wit
### Instance Variables
- **location** (_[carla.Location](#carla.Location)_)
Describes a point in the coordinate system.
-- **rotation** (_[carla.Rotation](#carla.Rotation) – degrees (pitch, yaw, roll)_)
+- **rotation** (_[carla.Rotation](#carla.Rotation) - degrees (pitch, yaw, roll)_)
Describes a rotation for an object according to Unreal Engine's axis system.
### Methods
- **\__init__**(**self**, **location**, **rotation**)
- **Parameters:**
- `location` (_[carla.Location](#carla.Location)_)
- - `rotation` (_[carla.Rotation](#carla.Rotation) – degrees (pitch, yaw, roll)_)
+ - `rotation` (_[carla.Rotation](#carla.Rotation) - degrees (pitch, yaw, roll)_)
- **transform**(**self**, **in_point**)
Translates a 3D point from local to global coordinates using the current transformation as frame of reference.
- **Parameters:**
- - `in_point` (_[carla.Location](#carla.Location)_) – Location in the space to which the transformation will be applied.
+ - `in_point` (_[carla.Location](#carla.Location)_) - Location in the space to which the transformation will be applied.
##### Getters
- **get_forward_vector**(**self**)
@@ -2390,6 +2531,15 @@ Y-axis value.
- **Parameters:**
- `x` (_float_)
- `y` (_float_)
+- **length**(**self**)
+Computes the length of the vector.
+ - **Return:** _float_
+- **make_unit_vector**(**self**)
+Returns a vector with the same direction and unitary length.
+ - **Return:** _[carla.Vector3D](#carla.Vector3D)_
+- **squared_length**(**self**)
+Computes the squared length of the vector.
+ - **Return:** _float_
##### Dunder methods
- **\__add__**(**self**, **other**=[carla.Vector2D](#carla.Vector2D))
@@ -2425,6 +2575,50 @@ Z-axis value.
- `x` (_float_)
- `y` (_float_)
- `z` (_float_)
+- **cross**(**self**, **vector**)
+Computes the cross product between two vectors.
+ - **Parameters:**
+ - `vector` (_[carla.Vector3D](#carla.Vector3D)_)
+ - **Return:** _[carla.Vector3D](#carla.Vector3D)_
+- **distance**(**self**, **vector**)
+Computes the distance between two vectors.
+ - **Parameters:**
+ - `vector` (_[carla.Vector3D](#carla.Vector3D)_)
+ - **Return:** _float_
+- **distance_2d**(**self**, **vector**)
+Computes the 2-dimensional distance between two vectors.
+ - **Parameters:**
+ - `vector` (_[carla.Vector3D](#carla.Vector3D)_)
+ - **Return:** _float_
+- **distance_squared**(**self**, **vector**)
+Computes the squared distance between two vectors.
+ - **Parameters:**
+ - `vector` (_[carla.Vector3D](#carla.Vector3D)_)
+ - **Return:** _float_
+- **distance_squared_2d**(**self**, **vector**)
+Computes the 2-dimensional squared distance between two vectors.
+ - **Parameters:**
+ - `vector` (_[carla.Vector3D](#carla.Vector3D)_)
+ - **Return:** _float_
+- **dot**(**self**, **vector**)
+Computes the dot product between two vectors.
+ - **Parameters:**
+ - `vector` (_[carla.Vector3D](#carla.Vector3D)_)
+ - **Return:** _float_
+- **dot_2d**(**self**, **vector**)
+Computes the 2-dimensional dot product between two vectors.
+ - **Parameters:**
+ - `vector` (_[carla.Vector3D](#carla.Vector3D)_)
+ - **Return:** _float_
+- **length**(**self**)
+Computes the length of the vector.
+ - **Return:** _float_
+- **make_unit_vector**(**self**)
+Returns a vector with the same direction and unitary length.
+ - **Return:** _[carla.Vector3D](#carla.Vector3D)_
+- **squared_length**(**self**)
+Computes the squared length of the vector.
+ - **Return:** _float_
##### Dunder methods
- **\__abs__**(**self**)
@@ -2466,7 +2660,7 @@ Applies a physics control object in the next tick containing the parameters that
- **enable_carsim**(**self**, **simfile_path**)
Enables the CarSim physics solver for this particular vehicle. In order for this function to work, there needs to be a valid license manager running on the server side. The control inputs are redirected to CarSim which will provide the position and orientation of the vehicle for every frame.
- **Parameters:**
- - `simfile_path` (_str_) – Path to the `.simfile` file with the parameters of the simulation.
+ - `simfile_path` (_str_) - Path to the `.simfile` file with the parameters of the simulation.
- **is_at_traffic_light**(**self**)
Vehicles will be affected by a traffic light when the light is red and the vehicle is inside its bounding box. The client returns whether a traffic light is affecting this vehicle according to last tick (it does not call the simulator).
- **Return:** _bool_
@@ -2489,7 +2683,7 @@ The simulator returns the last physics control applied to this vehicle.
- **Warning:** _This method does call the simulator to retrieve the value._
- **get_speed_limit**(**self**)
The client returns the speed limit affecting this vehicle according to last tick (it does not call the simulator). The speed limit is updated when passing by a speed limit signal, so a vehicle might have none right after spawning.
- - **Return:** _float – m/s_
+ - **Return:** _float - m/s_
- **get_traffic_light**(**self**)
Retrieves the traffic light actor affecting this vehicle (if any) according to last tick. The method does not call the simulator.
- **Return:** _[carla.TrafficLight](#carla.TrafficLight)_
@@ -2509,7 +2703,7 @@ _
Registers or deletes the vehicle from a Traffic Manager's list. When __True__, the Traffic Manager passed as parameter will move the vehicle around. The autopilot takes place client-side.
- **Parameters:**
- `enabled` (_bool_)
- - `port` (_uint16_) – The port of the TM-Server where the vehicle is to be registered or unlisted. If __None__ is passed, it will consider a TM at default port `8000`.
+ - `port` (_uint16_) - The port of the TM-Server where the vehicle is to be registered or unlisted. If __None__ is passed, it will consider a TM at default port `8000`.
- **set_light_state**(**self**, **light_state**)
Sets the light state of a vehicle using a flag that represents the lights that are on and off.
- **Parameters:**
@@ -2550,9 +2744,9 @@ States which gear is the vehicle running on.
### Methods
- **\__init__**(**self**, **throttle**=0.0, **steer**=0.0, **brake**=0.0, **hand_brake**=False, **reverse**=False, **manual_gear_shift**=False, **gear**=0)
- **Parameters:**
- - `throttle` (_float_) – Scalar value between [0.0,1.0].
- - `steer` (_float_) – Scalar value between [0.0,1.0].
- - `brake` (_float_) – Scalar value between [0.0,1.0].
+ - `throttle` (_float_) - Scalar value between [0.0,1.0].
+ - `steer` (_float_) - Scalar value between [0.0,1.0].
+ - `brake` (_float_) - Scalar value between [0.0,1.0].
- `hand_brake` (_bool_)
- `reverse` (_bool_)
- `manual_gear_shift` (_bool_)
@@ -2565,6 +2759,23 @@ States which gear is the vehicle running on.
---
+## carla.VehicleDoor
+Possible index representing the possible doors that can be open. Notice that not all possible doors are able to open in some vehicles.
+
+### Instance Variables
+- **FL**
+Front left door.
+- **FR**
+Front right door.
+- **RL**
+Back left door.
+- **RR**
+Back right door.
+- **All**
+Represents all doors.
+
+---
+
## carla.VehicleLightState
Class that recaps the state of the lights of a vehicle, these can be used as a flags. E.g: `VehicleLightState.HighBeam & VehicleLightState.Brake` will return `True` when both are active. Lights are off by default in any situation and should be managed by the user via script. The blinkers blink automatically. _Warning: Right now, not all vehicles have been prepared to work with this functionality, this will be added to all of them in later updates_.
@@ -2597,7 +2808,7 @@ Summarizes the parameters that will be used to simulate a [carla.Vehicle](#carla
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 – kg*m2_)
+- **moi** (_float - kg*m2_)
The moment of inertia of the vehicle's engine.
- **damping_rate_full_throttle** (_float_)
Damping ratio when the throttle is maximum.
@@ -2607,19 +2818,19 @@ Damping ratio when the throttle is zero with clutch engaged.
Damping ratio 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 – seconds_)
+- **gear_switch_time** (_float - seconds_)
Switching time between gears.
-- **clutch_strength** (_float – kg*m2/s_)
+- **clutch_strength** (_float - kg*m2/s_)
Clutch strength of the vehicle.
- **final_ratio** (_float_)
Fixed ratio from transmission to wheels.
- **forward_gears** (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_)
List of objects defining the vehicle's gears.
-- **mass** (_float – kilograms_)
+- **mass** (_float - kilograms_)
Mass of the vehicle.
- **drag_coefficient** (_float_)
Drag coefficient of the vehicle's chassis.
-- **center_of_mass** (_[carla.Vector3D](#carla.Vector3D) – meters_)
+- **center_of_mass** (_[carla.Vector3D](#carla.Vector3D) - meters_)
Center of mass of the vehicle.
- **steering_curve** (_list([carla.Vector2D](#carla.Vector2D))_)
Curve that indicates the maximum steering for a specific forward speed.
@@ -2634,13 +2845,13 @@ VehiclePhysicsControl constructor.
- **Parameters:**
- `torque_curve` (_list([carla.Vector2D](#carla.Vector2D))_)
- `max_rpm` (_float_)
- - `moi` (_float – kg*m2_)
+ - `moi` (_float - kg*m2_)
- `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 – seconds_)
- - `clutch_strength` (_float – kg*m2/s_)
+ - `gear_switch_time` (_float - seconds_)
+ - `clutch_strength` (_float - kg*m2/s_)
- `final_ratio` (_float_)
- `forward_gears` (_list([carla.GearPhysicsControl](#carla.GearPhysicsControl))_)
- `drag_coefficient` (_float_)
@@ -2648,7 +2859,7 @@ VehiclePhysicsControl constructor.
- `steering_curve` (_[carla.Vector2D](#carla.Vector2D)_)
- `wheels` (_list([carla.WheelPhysicsControl](#carla.WheelPhysicsControl))_)
- `use_sweep_wheel_collision` (_bool_)
- - `mass` (_float – kilograms_)
+ - `mass` (_float - kilograms_)
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl))
@@ -2689,15 +2900,41 @@ Bounding box containing the geometry of the walker. Its location and rotation ar
On the next tick, the control will move the walker in a certain direction with a certain speed. Jumps can be commanded too.
- **Parameters:**
- `control` (_[carla.WalkerControl](#carla.WalkerControl)_)
-- **apply_control**(**self**, **control**)
-On the next tick, the control defines a list of bone transformations that will be applied to the walker's skeleton.
- - **Parameters:**
- - `control` (_[carla.WalkerBoneControl](#carla.WalkerBoneControl)_)
+- **blend_pose**(**self**, **blend_value**)
+Set the blending value of the custom pose with the animation. The values can be:
+ - 0: will show only the animation
+ - 1: will show only the custom pose (set by the user with set_bones())
+ - any other: will interpolate all the bone positions between animation and the custom pose.
+ - **Parameters:**
+ - `blend_value` (_float - value from 0 to 1 with the blend percentage_)
+- **hide_pose**(**self**)
+Hide the custom pose and show the animation (same as calling blend_pose(0)).
+- **show_pose**(**self**)
+Show the custom pose and hide the animation (same as calling blend_pose(1)).
##### Getters
+- **get_bones**(**self**)
+Return the structure with all the bone transformations from the actor. For each bone, we get the name and its transform in three different spaces:
+ - name: bone name
+ - world: transform in world coordinates
+ - component: transform based on the pivot of the actor
+ - relative: transform based on the bone parent.
+ - **Return:** _[carla.WalkerBoneControlOut](#carla.WalkerBoneControlOut)_
+ - **Setter:** _[carla.Walker.set_bones](#carla.Walker.set_bones)_
- **get_control**(**self**)
The client returns the control applied to this walker during last tick. The method does not call the simulator.
- **Return:** _[carla.WalkerControl](#carla.WalkerControl)_
+- **get_pose_from_animation**(**self**)
+Make a copy of the current animation frame as the custom pose. Initially the custom pose is the neutral pedestrian pose.
+
+##### Setters
+- **set_bones**(**self**, **bones**)
+Set the bones of the actor. For each bone we want to set we use a relative transform. Only the bones in this list will be set. For each bone you need to setup this info:
+ - name: bone name
+ - relative: transform based on the bone parent.
+ - **Parameters:**
+ - `bones` (_[carla.WalkerBoneControlIn](#carla.WalkerBoneControlIn) - list of pairs (bone_name, transform) for the bones that we want to set_)
+ - **Getter:** _[carla.Walker.get_bones](#carla.Walker.get_bones)_
##### Dunder methods
- **\__str__**(**self**)
@@ -2712,7 +2949,7 @@ Class that conducts AI control for a walker. The controllers are defined as acto
- **go_to_location**(**self**, **destination**)
Sets the destination that the pedestrian will reach.
- **Parameters:**
- - `destination` (_[carla.Location](#carla.Location) – meters_)
+ - `destination` (_[carla.Location](#carla.Location) - meters_)
- **start**(**self**)
Enables AI control for its parent walker.
- **stop**(**self**)
@@ -2722,40 +2959,60 @@ Disables AI control for its parent walker.
- **set_max_speed**(**self**, **speed**=1.4)
Sets a speed for the walker in meters per second.
- **Parameters:**
- - `speed` (_float – m/s_) – An easy walking speed is set by default.
+ - `speed` (_float - m/s_) - An easy walking speed is set by default.
##### Dunder methods
- **\__str__**(**self**)
---
-## carla.WalkerBoneControl
+## carla.WalkerBoneControlIn
This class grants bone specific manipulation for walker. The skeletons of walkers have been unified for clarity and the transform applied to each bone are always relative to its parent. Take a look [here](tuto_G_control_walker_skeletons.md) to learn more on how to create a walker and define its movement.
### Instance Variables
-- **bone_transforms** (_list([name,transform])_)
-List of tuples where the first value is the bone's name and the second value stores the transformation (changes in location and rotation) that will be applied to it.
+- **bone_transforms** (_list([name,transform])_)
+List with the data for each bone we want to set:
+ - name: bone name
+ - relative: transform based on the bone parent.
### Methods
-- **\__init__**(**self**, **list(name,transform)**)
+- **\__init__**(**self**, **list(name,transform)**)
Initializes an object containing moves to be applied on tick. These are listed with the name of the bone and the transform that will be applied to it.
- **Parameters:**
- `list(name,transform)` (_tuple_)
##### Dunder methods
-- **\__str__**(**self**)
+- **\__str__**(**self**)
+
+---
+
+## carla.WalkerBoneControlOut
+This class is used to return all bone positions of a pedestrian. For each bone we get its _name_ and its transform in three different spaces (world, actor and relative).
+
+### Instance Variables
+- **bone_transforms** (_list([name,world, actor, relative])_)
+List of one entry per bone with this information:
+ - name: bone name
+ - world: transform in world coordinates
+ - component: transform based on the pivot of the actor
+ - relative: transform based on the bone parent.
+
+### Methods
+
+##### Dunder methods
+- **\__str__**(**self**)
---
## carla.WalkerControl
-This class defines specific directions that can be commanded to a [carla.Walker](#carla.Walker) to control it via script. The walker's animations will blend automatically with the parameters defined in this class when applied, though specific skeleton moves can be obtained through class.WalkerBoneControl.
+This class defines specific directions that can be commanded to a [carla.Walker](#carla.Walker) to control it via script.
AI control can be settled for walkers, but the control used to do so is [carla.WalkerAIController](#carla.WalkerAIController).
### Instance Variables
- **direction** (_[carla.Vector3D](#carla.Vector3D)_)
Vector using global coordinates that will correspond to the direction of the walker.
-- **speed** (_float – m/s_)
+- **speed** (_float - m/s_)
A scalar value to control the walker's speed.
- **jump** (_bool_)
If True, the walker will perform a jump.
@@ -2764,7 +3021,7 @@ If True, the walker will perform a jump.
- **\__init__**(**self**, **direction**=[1.0, 0.0, 0.0], **speed**=0.0, **jump**=False)
- **Parameters:**
- `direction` (_[carla.Vector3D](#carla.Vector3D)_)
- - `speed` (_float – m/s_)
+ - `speed` (_float - m/s_)
- `jump` (_bool_)
##### Dunder methods
@@ -2810,23 +3067,23 @@ The left lane marking information based on the direction of the Waypoint.
Returns a list of waypoints at a certain approximate `distance` from the current one. It takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option.
The list may be empty if the lane is not connected to any other at the specified distance.
- **Parameters:**
- - `distance` (_float – meters_) – The approximate distance where to get the next waypoints.
+ - `distance` (_float - meters_) - The approximate distance where to get the next waypoints.
- **Return:** _list([carla.Waypoint](#carla.Waypoint))_
- **next_until_lane_end**(**self**, **distance**)
Returns a list of waypoints from this to the end of the lane separated by a certain `distance`.
- **Parameters:**
- - `distance` (_float – meters_) – The approximate distance between waypoints.
+ - `distance` (_float - meters_) - The approximate distance between waypoints.
- **Return:** _list([carla.Waypoint](#carla.Waypoint))_
- **previous**(**self**, **distance**)
This method does not return the waypoint previously visited by an actor, but a list of waypoints at an approximate `distance` but in the opposite direction of the lane. Similarly to **next()**, it takes into account the road and its possible deviations without performing any lane change and returns one waypoint per option.
The list may be empty if the lane is not connected to any other at the specified distance.
- **Parameters:**
- - `distance` (_float – meters_) – The approximate distance where to get the previous waypoints.
+ - `distance` (_float - meters_) - The approximate distance where to get the previous waypoints.
- **Return:** _list([carla.Waypoint](#carla.Waypoint))_
- **previous_until_lane_start**(**self**, **distance**)
Returns a list of waypoints from this to the start of the lane separated by a certain `distance`.
- **Parameters:**
- - `distance` (_float – meters_) – The approximate distance between waypoints.
+ - `distance` (_float - meters_) - The approximate distance between waypoints.
- **Return:** _list([carla.Waypoint](#carla.Waypoint))_
##### Getters
@@ -2836,15 +3093,15 @@ If the waypoint belongs to a junction this method returns the asociated junction
- **get_landmarks**(**self**, **distance**, **stop_at_junction**=False)
Returns a list of landmarks in the road from the current waypoint until the specified distance.
- **Parameters:**
- - `distance` (_float – meters_) – The maximum distance to search for landmarks from the current waypoint.
- - `stop_at_junction` (_bool_) – Enables or disables the landmark search through junctions.
+ - `distance` (_float - meters_) - The maximum distance to search for landmarks from the current waypoint.
+ - `stop_at_junction` (_bool_) - Enables or disables the landmark search through junctions.
- **Return:** _list([carla.Landmark](#carla.Landmark))_
- **get_landmarks_of_type**(**self**, **distance**, **type**, **stop_at_junction**=False)
Returns a list of landmarks in the road of a specified type from the current waypoint until the specified distance.
- **Parameters:**
- - `distance` (_float – meters_) – The maximum distance to search for landmarks from the current waypoint.
- - `type` (_str_) – The type of landmarks to search.
- - `stop_at_junction` (_bool_) – Enables or disables the landmark search through junctions.
+ - `distance` (_float - meters_) - The maximum distance to search for landmarks from the current waypoint.
+ - `type` (_str_) - The type of landmarks to search.
+ - `stop_at_junction` (_bool_) - Enables or disables the landmark search through junctions.
- **Return:** _list([carla.Landmark](#carla.Landmark))_
- **get_left_lane**(**self**)
Generates a Waypoint at the center of the left lane based on the direction of the current Waypoint, taking into account if the lane change is allowed in this location.
@@ -2873,13 +3130,13 @@ Rain intensity values range from 0 to 100, being 0 none at all and 100 a heavy r
Determines the creation of puddles. Values range from 0 to 100, being 0 none at all and 100 a road completely capped with water. Puddles are created with static noise, meaning that they will always appear at the same locations.
- **wind_intensity** (_float_)
Controls the strenght of the wind with values from 0, no wind at all, to 100, a strong wind. The wind does affect rain direction and leaves from trees, so this value is restricted to avoid animation issues.
-- **sun_azimuth_angle** (_float – degrees_)
+- **sun_azimuth_angle** (_float - degrees_)
The azimuth angle of the sun. Values range from 0 to 360. Zero is an origin point in a sphere determined by Unreal Engine.
-- **sun_altitude_angle** (_float – degrees_)
+- **sun_altitude_angle** (_float - degrees_)
Altitude angle of the sun. Values range from -90 to 90 corresponding to midnight and midday each.
- **fog_density** (_float_)
Fog concentration or thickness. It only affects the RGB camera sensor. Values range from 0 to 100.
-- **fog_distance** (_float – meters_)
+- **fog_distance** (_float - meters_)
Fog start distance. Values range from 0 to infinite.
- **wetness** (_float_)
Wetness intensity. It only affects the RGB camera sensor. Values range from 0 to 100.
@@ -2896,19 +3153,19 @@ Controls interaction of light with small particles like air molecules. Dependent
- **\__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, **fog_density**=0.0, **fog_distance**=0.0, **wetness**=0.0, **fog_falloff**=0.0, **scattering_intensity**=0.0, **mie_scattering_scale**=0.0, **rayleigh_scattering_scale**=0.0331)
Method to initialize an object defining weather conditions. This class has some presets for different noon and sunset conditions listed in a note below.
- **Parameters:**
- - `cloudiness` (_float_) – 0 is a clear sky, 100 complete overcast.
- - `precipitation` (_float_) – 0 is no rain at all, 100 a heavy rain.
- - `precipitation_deposits` (_float_) – 0 means no puddles on the road, 100 means roads completely capped by rain.
- - `wind_intensity` (_float_) – 0 is calm, 100 a strong wind.
- - `sun_azimuth_angle` (_float – degrees_) – 0 is an arbitrary North, 180 its corresponding South.
- - `sun_altitude_angle` (_float – degrees_) – 90 is midday, -90 is midnight.
- - `fog_density` (_float_) – Concentration or thickness of the fog, from 0 to 100.
- - `fog_distance` (_float – meters_) – Distance where the fog starts in meters.
- - `wetness` (_float_) – Humidity percentages of the road, from 0 to 100.
- - `fog_falloff` (_float_) – Density (specific mass) of the fog, from 0 to infinity.
- - `scattering_intensity` (_float_) – Controls how much the light will contribute to volumetric fog. When set to 0, there is no contribution.
- - `mie_scattering_scale` (_float_) – Controls interaction of light with large particles like pollen or air pollution resulting in a hazy sky with halos around the light sources. When set to 0, there is no contribution.
- - `rayleigh_scattering_scale` (_float_) – Controls interaction of light with small particles like air molecules. Dependent on light wavelength, resulting in a blue sky in the day or red sky in the evening.
+ - `cloudiness` (_float_) - 0 is a clear sky, 100 complete overcast.
+ - `precipitation` (_float_) - 0 is no rain at all, 100 a heavy rain.
+ - `precipitation_deposits` (_float_) - 0 means no puddles on the road, 100 means roads completely capped by rain.
+ - `wind_intensity` (_float_) - 0 is calm, 100 a strong wind.
+ - `sun_azimuth_angle` (_float - degrees_) - 0 is an arbitrary North, 180 its corresponding South.
+ - `sun_altitude_angle` (_float - degrees_) - 90 is midday, -90 is midnight.
+ - `fog_density` (_float_) - Concentration or thickness of the fog, from 0 to 100.
+ - `fog_distance` (_float - meters_) - Distance where the fog starts in meters.
+ - `wetness` (_float_) - Humidity percentages of the road, from 0 to 100.
+ - `fog_falloff` (_float_) - Density (specific mass) of the fog, from 0 to infinity.
+ - `scattering_intensity` (_float_) - Controls how much the light will contribute to volumetric fog. When set to 0, there is no contribution.
+ - `mie_scattering_scale` (_float_) - Controls interaction of light with large particles like pollen or air pollution resulting in a hazy sky with halos around the light sources. When set to 0, there is no contribution.
+ - `rayleigh_scattering_scale` (_float_) - Controls interaction of light with small particles like air molecules. Dependent on light wavelength, resulting in a blue sky in the day or red sky in the evening.
- **Note:** _ClearNoon, CloudyNoon, WetNoon, WetCloudyNoon, SoftRainNoon, MidRainyNoon, HardRainNoon, ClearSunset, CloudySunset, WetSunset, WetCloudySunset, SoftRainSunset, MidRainSunset, HardRainSunset.
_
@@ -2931,17 +3188,17 @@ Class that defines specific physical parameters for wheel objects that will be p
A scalar value that indicates the friction of the wheel.
- **damping_rate** (_float_)
Damping rate of the wheel.
-- **max_steer_angle** (_float – degrees_)
+- **max_steer_angle** (_float - degrees_)
Maximum angle that the wheel can steer.
-- **radius** (_float – centimeters_)
+- **radius** (_float - centimeters_)
Radius of the wheel.
-- **max_brake_torque** (_float – N*m_)
+- **max_brake_torque** (_float - N*m_)
Maximum brake torque.
-- **max_handbrake_torque** (_float – N*m_)
+- **max_handbrake_torque** (_float - N*m_)
Maximum handbrake torque.
- **position** (_[carla.Vector3D](#carla.Vector3D)_)
World position of the wheel. This is a read-only parameter.
-- **long_stiff_value** (_float – kg per radian_)
+- **long_stiff_value** (_float - kg per radian_)
Tire longitudinal stiffness per unit gravitational acceleration. Each vehicle has a custom value.
- **lat_stiff_max_load** (_float_)
Maximum normalized tire load at which the tire can deliver no more lateral stiffness no matter how much extra load is applied to the tire. Each vehicle has a custom value.
@@ -2953,11 +3210,11 @@ Maximum stiffness per unit of lateral slip. Each vehicle has a custom value.
- **Parameters:**
- `tire_friction` (_float_)
- `damping_rate` (_float_)
- - `max_steer_angle` (_float – degrees_)
- - `radius` (_float – centimerers_)
- - `max_brake_torque` (_float – N*m_)
- - `max_handbrake_torque` (_float – N*m_)
- - `position` (_[carla.Vector3D](#carla.Vector3D) – meters_)
+ - `max_steer_angle` (_float - degrees_)
+ - `radius` (_float - centimerers_)
+ - `max_brake_torque` (_float - N*m_)
+ - `max_handbrake_torque` (_float - N*m_)
+ - `position` (_[carla.Vector3D](#carla.Vector3D) - meters_)
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.WheelPhysicsControl](#carla.WheelPhysicsControl))
@@ -2976,6 +3233,30 @@ The ID of the episode associated with this world. Episodes are different session
Responsible for creating different shapes for debugging. Take a look at its class to learn more about it.
### Methods
+- **apply_color_texture_to_object**(**self**, **object_name**, **material_parameter**, **texture**)
+Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
+ - **Parameters:**
+ - `object_name` (_str_)
+ - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
+ - `texture` (_TextureColor_)
+- **apply_color_texture_to_objects**(**self**, **objects_name_list**, **material_parameter**, **texture**)
+Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to all objects in `objects_name_list`.
+ - **Parameters:**
+ - `objects_name_list` (_list(str)_)
+ - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
+ - `texture` (_TextureColor_)
+- **apply_float_color_texture_to_object**(**self**, **object_name**, **material_parameter**, **texture**)
+Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
+ - **Parameters:**
+ - `object_name` (_str_)
+ - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
+ - `texture` (_TextureFloatColor_)
+- **apply_float_color_texture_to_objects**(**self**, **objects_name_list**, **material_parameter**, **texture**)
+Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to all objects in `objects_name_list`.
+ - **Parameters:**
+ - `objects_name_list` (_list(str)_)
+ - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
+ - `texture` (_TextureFloatColor_)
- **apply_settings**(**self**, **world_settings**)
This method applies settings contained in an object to the simulation running and returns the ID of the frame they were implemented.
- **Parameters:**
@@ -2983,17 +3264,33 @@ This method applies settings contained in an object to the simulation running an
- **Return:** _int_
- **Warning:** _If synchronous mode is enabled, and there is a Traffic Manager running, this must be set to sync mode too. Read [this](adv_traffic_manager.md#synchronous-mode) to learn how to do it.
_
+- **apply_textures_to_object**(**self**, **object_name**, **diffuse_texture**, **emissive_texture**, **normal_texture**, **ao_roughness_metallic_emissive_texture**)
+Applies all texture fields in [carla.MaterialParameter](#carla.MaterialParameter) to the object `object_name`. Empty textures here will not be applied.
+ - **Parameters:**
+ - `object_name` (_str_)
+ - `diffuse_texture` (_TextureColor_)
+ - `emissive_texture` (_TextureFloatColor_)
+ - `normal_texture` (_TextureFloatColor_)
+ - `ao_roughness_metallic_emissive_texture` (_TextureFloatColor_)
+- **apply_textures_to_objects**(**self**, **objects_name_list**, **diffuse_texture**, **emissive_texture**, **normal_texture**, **ao_roughness_metallic_emissive_texture**)
+Applies all texture fields in [carla.MaterialParameter](#carla.MaterialParameter) to all objects in `objects_name_list`. Empty textures here will not be applied.
+ - **Parameters:**
+ - `objects_name_list` (_list(str)_)
+ - `diffuse_texture` (_TextureColor_)
+ - `emissive_texture` (_TextureFloatColor_)
+ - `normal_texture` (_TextureFloatColor_)
+ - `ao_roughness_metallic_emissive_texture` (_TextureFloatColor_)
- **cast_ray**(**self**, **initial_location**, **final_location**)
Casts a ray from the specified initial_location to final_location. The function then detects all geometries intersecting the ray and returns a list of [carla.LabelledPoint](#carla.LabelledPoint) in order.
- **Parameters:**
- - `initial_location` (_[carla.Location](#carla.Location)_) – The initial position of the ray.
- - `final_location` (_[carla.Location](#carla.Location)_) – The final position of the ray.
+ - `initial_location` (_[carla.Location](#carla.Location)_) - The initial position of the ray.
+ - `final_location` (_[carla.Location](#carla.Location)_) - The final position of the ray.
- **Return:** _list([carla.LabelledPoint](#carla.LabelledPoint))_
- **enable_environment_objects**(**self**, **env_objects_ids**, **enable**)
Enable or disable a set of EnvironmentObject identified by their id. These objects will appear or disappear from the level.
- **Parameters:**
- - `env_objects_ids` (_set(int)_) – Set of EnvironmentObject ids to change.
- - `enable` (_bool_) – State to be applied to all the EnvironmentObject of the set.
+ - `env_objects_ids` (_set(int)_) - Set of EnvironmentObject ids to change.
+ - `enable` (_bool_) - State to be applied to all the EnvironmentObject of the set.
- **freeze_all_traffic_lights**(**self**, **frozen**)
Freezes or unfreezes all traffic lights in the scene. Frozen traffic lights can be modified by the user but the time will not update them until unfrozen.
- **Parameters:**
@@ -3001,64 +3298,64 @@ Freezes or unfreezes all traffic lights in the scene. Frozen traffic lights can
- **ground_projection**(**self**, **location**, **search_distance**)
Projects the specified point downwards in the scene. The functions casts a ray from location in the direction (0,0,-1) (downwards) and returns a [carla.Labelled](#carla.Labelled) object with the first geometry this ray intersects (usually the ground). If no geometry is found in the search_distance range the function returns `None`.
- **Parameters:**
- - `location` (_[carla.Location](#carla.Location)_) – The point to be projected.
- - `search_distance` (_float_) – The maximum distance to perform the projection.
+ - `location` (_[carla.Location](#carla.Location)_) - The point to be projected.
+ - `search_distance` (_float_) - The maximum distance to perform the projection.
- **Return:** _[carla.LabelledPoint](#carla.LabelledPoint)_
- **load_map_layer**(**self**, **map_layers**)
Loads the selected layers to the level. If the layer is already loaded the call has no effect.
- **Parameters:**
- - `map_layers` (_[carla.MapLayer](#carla.MapLayer)_) – Mask of level layers to be loaded.
+ - `map_layers` (_[carla.MapLayer](#carla.MapLayer)_) - Mask of level layers to be loaded.
- **Warning:** _This only affects "Opt" maps. The minimum layout includes roads, sidewalks, traffic lights and traffic signs._
- **on_tick**(**self**, **callback**)
This method is used in [__asynchronous__ mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/). It starts callbacks from the client for the function defined as `callback`, and returns the ID of the callback. The function will be called everytime the server ticks. It requires a [carla.WorldSnapshot](#carla.WorldSnapshot) as argument, which can be retrieved from __wait_for_tick()__. Use __remove_on_tick()__ to stop the callbacks.
- **Parameters:**
- - `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) – Function with a snapshot as compulsory parameter that will be called when the client receives a tick.
+ - `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) - Function with a snapshot as compulsory parameter that will be called when the client receives a tick.
- **Return:** _int_
- **project_point**(**self**, **location**, **direction**, **search_distance**)
Projects the specified point to the desired direction in the scene. The functions casts a ray from location in a direction and returns a [carla.Labelled](#carla.Labelled) object with the first geometry this ray intersects. If no geometry is found in the search_distance range the function returns `None`.
- **Parameters:**
- - `location` (_[carla.Location](#carla.Location)_) – The point to be projected.
- - `direction` (_[carla.Vector3D](#carla.Vector3D)_) – The direction of projection.
- - `search_distance` (_float_) – The maximum distance to perform the projection.
+ - `location` (_[carla.Location](#carla.Location)_) - The point to be projected.
+ - `direction` (_[carla.Vector3D](#carla.Vector3D)_) - The direction of projection.
+ - `search_distance` (_float_) - The maximum distance to perform the projection.
- **Return:** _[carla.LabelledPoint](#carla.LabelledPoint)_
- **remove_on_tick**(**self**, **callback_id**)
Stops the callback for `callback_id` started with __on_tick()__.
- **Parameters:**
- - `callback_id` (_callback_) – The callback to be removed. The ID is returned when creating the callback.
+ - `callback_id` (_callback_) - The callback to be removed. The ID is returned when creating the callback.
- **reset_all_traffic_lights**(**self**)
Resets the cycle of all traffic lights in the map to the initial state.
- **spawn_actor**(**self**, **blueprint**, **transform**, **attach_to**=None, **attachment**=Rigid)
The method will create, return and spawn an actor into the world. The actor will need an available blueprint to be created and a transform (location and rotation). It can also be attached to a parent with a certain attachment type.
- **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.
+ - `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)_
- **tick**(**self**, **seconds**=10.0)
This method is used in [__synchronous__ mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/), when the server waits for a client tick before computing the next frame. This method will send the tick, and give way to the server. It returns the ID of the new frame computed by the server.
- **Parameters:**
- - `seconds` (_float – seconds_) – Maximum time the server should wait for a tick. It is set to 10.0
by default.
+ - `seconds` (_float - seconds_) - Maximum time the server should wait for a tick. It is set to 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.
+ - `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.
+ - `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.
+ - `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
@@ -3070,7 +3367,7 @@ Looks up for an actor by ID and returns None if not found.
- **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.
+ - `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.
@@ -3078,12 +3375,12 @@ Returns a list of actor blueprints available to ease the spawn of these into the
- **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.
+ - `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.
+ - `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.
@@ -3093,6 +3390,9 @@ Asks the server for the XODR containing the map file, and returns this parsed as
- **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)_
@@ -3108,28 +3408,28 @@ Returns the spectator actor. The spectator is a special type of actor created by
- **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.
+ - `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.
+ - `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.
+ - `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.
+ - `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.
+ - `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.
@@ -3142,13 +3442,18 @@ Retrieves an object containing weather parameters currently active in the simula
##### 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`__.
+ - `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.
+ - `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) - New conditions to be applied.
- **Getter:** _[carla.World.get_weather](#carla.World.get_weather)_
##### Dunder methods
@@ -3187,9 +3492,9 @@ Used for large maps only. Configures the distance from the hero vehicle to conve
- **\__init__**(**self**, **synchronous_mode**=False, **no_rendering_mode**=False, **fixed_delta_seconds**=0.0)
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.
+ - `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.
##### Dunder methods
- **\__eq__**(**self**, **other**=[carla.WorldSettings](#carla.WorldSettings))
@@ -3212,7 +3517,7 @@ This snapshot comprises all the information for every actor on scene at a certai
A value unique for every snapshot to differenciate them.
- **frame** (_int_)
Simulation frame in which the snapshot was taken.
-- **timestamp** (_[carla.Timestamp](#carla.Timestamp) – seconds_)
+- **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
@@ -3248,14 +3553,14 @@ Command adaptation of __add_angular_impulse()__ in
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
-- **impulse** (_[carla.Vector3D](#carla.Vector3D) – degrees*s_)
+- **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_)
+ - `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_)
---
@@ -3265,14 +3570,14 @@ Command adaptation of __add_force()__ in [carla.Act
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
-- **force** (_[carla.Vector3D](#carla.Vector3D) – N_)
+- **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_)
+ - `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_)
---
@@ -3282,14 +3587,14 @@ Command adaptation of __add_impulse()__ in [carla.A
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
-- **impulse** (_[carla.Vector3D](#carla.Vector3D) – N*s_)
+- **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_)
+ - `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_)
---
@@ -3299,14 +3604,14 @@ Command adaptation of __set_target_angular_velocity()**actor_id** (_int_)
Actor affected by the command.
-- **angular_velocity** (_[carla.Vector3D](#carla.Vector3D) – deg/s_)
+- **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.
+ - `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.
---
@@ -3316,14 +3621,14 @@ Command adaptation of __set_target_velocity()__ in
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
-- **velocity** (_[carla.Vector3D](#carla.Vector3D) – m/s_)
+- **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.
+ - `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.
---
@@ -3333,14 +3638,14 @@ Command adaptation of __add_torque()__ in [carla.Ac
### Instance Variables
- **actor_id** (_int_)
Actor affected by the command.
-- **torque** (_[carla.Vector3D](#carla.Vector3D) – degrees_)
+- **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_)
+ - `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_)
---
@@ -3356,7 +3661,7 @@ 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `transform` (_[carla.Transform](#carla.Transform)_)
---
@@ -3373,7 +3678,7 @@ 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.VehicleControl](#carla.VehicleControl)_)
---
@@ -3390,7 +3695,7 @@ Physics 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.VehiclePhysicsControl](#carla.VehiclePhysicsControl)_)
---
@@ -3407,7 +3712,7 @@ 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `control` (_[carla.WalkerControl](#carla.WalkerControl)_)
---
@@ -3420,15 +3725,15 @@ Apply a state to the walker actor. Specially useful to initialize an actor them
Walker actor affected by the command.
- **transform** (_[carla.Transform](#carla.Transform)_)
Transform to be applied.
-- **speed** (_float – m/s_)
+- **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.
+ - `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_)
+ - `speed` (_float - m/s_)
---
@@ -3442,7 +3747,7 @@ 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
---
@@ -3476,9 +3781,9 @@ 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.
+ - `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`.
+ - `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`.
---
@@ -3493,7 +3798,7 @@ Actor that is affected by the command.
### 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or Actor ID to which the command will be applied to.
- `enabled` (_bool_)
---
@@ -3510,7 +3815,7 @@ 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or its ID to whom the command will be applied to.
- `enabled` (_bool_)
---
@@ -3527,8 +3832,8 @@ 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.
+ - `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.
---
@@ -3543,7 +3848,7 @@ Actor that is affected by the command.
### 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.
+ - `actor` (_[carla.Actor](#carla.Actor) or int_) - Actor or Actor ID to which the command will be applied to.
- `enabled` (_bool_)
---
@@ -3571,7 +3876,7 @@ Identificator of the parent actor.
- **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.
+ - `command` (_any carla Command_) - a Carla command.
---
[comment]: <> (=========================)
@@ -3628,146 +3933,37 @@ world.load_map_layer(carla.MapLayer.ParkedVehicles)
-