Compare commits

...

8 Commits

Author SHA1 Message Date
Daniel 9f33bafeee
corrected World.spaw_actor wrong parameter name 2024-08-01 16:13:56 +02:00
Daniel 1ee6813676
Missing default value 2024-08-01 16:13:55 +02:00
Daniel f7f42fcd85
Added OpendriveGenerationParameters.__init__ 2024-08-01 16:13:55 +02:00
Daniel 62e5187049
Added space between # and first heading in python_api.md 2024-08-01 16:13:54 +02:00
Daniel b393bc82d5
Apply changes to .md output 2024-08-01 16:13:53 +02:00
Daniel da78a44ff3
Removed reintroduced code of overwritten property 2024-08-01 16:13:52 +02:00
Daniel 1f6843e912
Fix Spelling mistakes 2024-08-01 16:13:51 +02:00
Daniel 323f90dfc7
Fixed wrong `literal` in doc generation 2024-08-01 16:13:51 +02:00
13 changed files with 101 additions and 64 deletions

View File

@ -1,4 +1,4 @@
#Python API reference
# Python API reference
This reference contains all the details the Python API. To consult a previous reference for a specific CARLA release, change the documentation version using the panel in the bottom right corner.<br>This will change the whole documentation to a previous state. Remember that the <i>latest</i> version is the `dev` branch and may show features not available in any packaged versions of CARLA.<hr>
## carla.AckermannControllerSettings<a name="carla.AckermannControllerSettings"></a>
@ -95,21 +95,21 @@ _</font>
##### Getters
- <a name="carla.Actor.get_acceleration"></a>**<font color="#7fb800">get_acceleration</font>**(<font color="#00a6ed">**self**</font>)
Returns the actor's 3D acceleration vector the client recieved during last tick. The method does not call the simulator.
Returns the actor's 3D acceleration vector the client received during last tick. The method does not call the simulator.
- **Return:** _[carla.Vector3D](#carla.Vector3D)<small> - m/s<sup>2</sup></small>_
- <a name="carla.Actor.get_angular_velocity"></a>**<font color="#7fb800">get_angular_velocity</font>**(<font color="#00a6ed">**self**</font>)
Returns the actor's angular velocity vector the client recieved during last tick. The method does not call the simulator.
Returns the actor's angular velocity vector the client received during last tick. The method does not call the simulator.
- **Return:** _[carla.Vector3D](#carla.Vector3D)<small> - deg/s</small>_
- <a name="carla.Actor.get_location"></a>**<font color="#7fb800">get_location</font>**(<font color="#00a6ed">**self**</font>)
Returns the actor's location the client recieved during last tick. The method does not call the simulator.
Returns the actor's location the client received during last tick. The method does not call the simulator.
- **Return:** _[carla.Location](#carla.Location)<small> - meters</small>_
- **Setter:** _[carla.Actor.set_location](#carla.Actor.set_location)_
- <a name="carla.Actor.get_transform"></a>**<font color="#7fb800">get_transform</font>**(<font color="#00a6ed">**self**</font>)
Returns the actor's transform (location and rotation) the client recieved during last tick. The method does not call the simulator.
Returns the actor's transform (location and rotation) the client received during last tick. The method does not call the simulator.
- **Return:** _[carla.Transform](#carla.Transform)_
- **Setter:** _[carla.Actor.set_transform](#carla.Actor.set_transform)_
- <a name="carla.Actor.get_velocity"></a>**<font color="#7fb800">get_velocity</font>**(<font color="#00a6ed">**self**</font>)
Returns the actor's velocity vector the client recieved during last tick. The method does not call the simulator.
Returns the actor's velocity vector the client received during last tick. The method does not call the simulator.
- **Return:** _[carla.Vector3D](#carla.Vector3D)<small> - m/s</small>_
- <a name="carla.Actor.get_world"></a>**<font color="#7fb800">get_world</font>**(<font color="#00a6ed">**self**</font>)
Returns the world this actor belongs to.
@ -545,7 +545,7 @@ Reload the current world, note that a new world is created with default settings
- `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios.
- **Return:** _[carla.World](#carla.World)_
- **Raises:** RuntimeError when corresponding.
- <a name="carla.Client.replay_file"></a>**<font color="#7fb800">replay_file</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**name**</font>, <font color="#00a6ed">**start**</font>, <font color="#00a6ed">**duration**</font>, <font color="#00a6ed">**follow_id**</font>, <font color="#00a6ed">**replay_sensors**</font>)
- <a name="carla.Client.replay_file"></a>**<font color="#7fb800">replay_file</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**name**</font>, <font color="#00a6ed">**start**</font>, <font color="#00a6ed">**duration**</font>, <font color="#00a6ed">**follow_id**</font>, <font color="#00a6ed">**replay_sensors**=False</font>)
Load a new world with default settings using `map_name` map. All actors present in the current world will be destroyed, __but__ traffic manager instances will stay alive.
- **Parameters:**
- `name` (_str_) - Name of the file containing the information of the simulation.
@ -931,7 +931,7 @@ Initializes a color, black by default.
---
## carla.GBufferTextureID<a name="carla.GBufferTextureID"></a>
Defines the of each GBuffer texture (See the method `[carla.Sensor.listen_to_gbuffer](#carla.Sensor.listen_to_gbuffer)`).
Defines the identifiers of each GBuffer texture (See the method [carla.Sensor.listen_to_gbuffer](#carla.Sensor.listen_to_gbuffer)).
### Instance Variables
- <a name="carla.GBufferTextureID.SceneColor"></a>**<font color="#f8805a">SceneColor</font>**
@ -1845,7 +1845,19 @@ If __True__, the mesh at junctions will be smoothed to prevent issues where road
- <a name="carla.OpendriveGenerationParameters.enable_mesh_visibility"></a>**<font color="#f8805a">enable_mesh_visibility</font>** (_bool_)
If __True__, the road mesh will be rendered. Setting this to __False__ should reduce the rendering overhead. __Default is `True`__.
- <a name="carla.OpendriveGenerationParameters.enable_pedestrian_navigation"></a>**<font color="#f8805a">enable_pedestrian_navigation</font>** (_bool_)
If __True__, Pedestrian navigation will be enabled using Recast tool. For very large maps it is recomended to disable this option. __Default is `True`__.
If __True__, Pedestrian navigation will be enabled using Recast tool. For very large maps it is recommended to disable this option. __Default is `True`__.
### Methods
- <a name="carla.OpendriveGenerationParameters.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**vertex_distance**=2.0</font>, <font color="#00a6ed">**max_road_length**=50.0</font>, <font color="#00a6ed">**wall_height**=1.0</font>, <font color="#00a6ed">**additional_width**=0.6</font>, <font color="#00a6ed">**smooth_junctions**=True</font>, <font color="#00a6ed">**enable_mesh_visibility**=True</font>, <font color="#00a6ed">**enable_pedestrian_navigation**=True</font>)
OpendriveGenerationParameters constructor.
- **Parameters:**
- `vertex_distance` (_float<small> - meters</small>_)
- `max_road_length` (_float<small> - meters</small>_)
- `wall_height` (_float<small> - meters</small>_)
- `additional_width` (_float<small> - meters</small>_)
- `smooth_junctions` (_bool_)
- `enable_mesh_visibility` (_bool_)
- `enable_pedestrian_navigation` (_bool_)
---
@ -2321,10 +2333,6 @@ Sensors compound a specific family of actors quite diverse and unique. They are
- [Obstacle detector](ref_sensors.md#obstacle-detector)<br>
- [V2X sensor](ref_sensors.md#v2x-sensor).
### Instance Variables
- <a name="carla.Sensor.is_listening"></a>**<font color="#f8805a">is_listening</font>** (_boolean_)
When **True** the sensor will be waiting for data.
### Methods
- <a name="carla.Sensor.disable_for_ros"></a>**<font color="#7fb800">disable_for_ros</font>**(<font color="#00a6ed">**self**</font>)
Commands the sensor to not be processed for publishing in ROS2 if there is no any listen to it.
@ -2495,7 +2503,7 @@ Time register of the frame at which this measurement was taken given by the OS i
## carla.TrafficLight<a name="carla.TrafficLight"></a>
<small style="display:block;margin-top:-20px;">Inherited from _[carla.TrafficSign](#carla.TrafficSign)_</small></br>
A traffic light actor, considered a specific type of traffic sign. As traffic lights will mostly appear at junctions, they belong to a group which contains the different traffic lights in it. Inside the group, traffic lights are differenciated by their pole index.
A traffic light actor, considered a specific type of traffic sign. As traffic lights will mostly appear at junctions, they belong to a group which contains the different traffic lights in it. Inside the group, traffic lights are differentiated by their pole index.
Within a group the state of traffic lights is changed in a cyclic pattern: one index is chosen and it spends a few seconds in green, yellow and eventually red. The rest of the traffic lights remain frozen in red this whole time, meaning that there is a gap in the last seconds of the cycle where all the traffic lights are red. However, the state of a traffic light can be changed manually.
@ -2957,7 +2965,7 @@ Returns the axis values for the vector parsed as string.
## carla.Vehicle<a name="carla.Vehicle"></a>
<small style="display:block;margin-top:-20px;">Inherited from _[carla.Actor](#carla.Actor)_</small></br>
One of the most important groups of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in [carla.BlueprintLibrary](#carla.BlueprintLibrary) to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
One of the most important groups of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bicycles and also official vehicles such as police cars. A wide set of these actors is provided in [carla.BlueprintLibrary](#carla.BlueprintLibrary) to facilitate different requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
### Instance Variables
- <a name="carla.Vehicle.bounding_box"></a>**<font color="#f8805a">bounding_box</font>** (_[carla.BoundingBox](#carla.BoundingBox)_)
@ -3515,7 +3523,7 @@ Will return <b>None</b> if the lane does not exist.
## carla.WeatherParameters<a name="carla.WeatherParameters"></a>
This class defines objects containing lighting and weather specifications that can later be applied in [carla.World](#carla.World). So far, these conditions only intervene with [sensor.camera.rgb](ref_sensors.md#rgb-camera). They neither affect the actor's physics nor other sensors.
Each of these parameters acts indepently from the rest. Increasing the rainfall will not automatically create puddles nor change the road's humidity. That makes for a better customization but means that realistic conditions need to be scripted. However an example of dynamic weather conditions working realistically can be found [here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/dynamic_weather.py).
Each of these parameters acts independently from the rest. Increasing the rainfall will not automatically create puddles nor change the road's humidity. That makes for a better customization but means that realistic conditions need to be scripted. However an example of dynamic weather conditions working realistically can be found [here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/dynamic_weather.py).
### Instance Variables
- <a name="carla.WeatherParameters.cloudiness"></a>**<font color="#f8805a">cloudiness</font>** (_float_)
@ -3626,31 +3634,31 @@ World objects are created by the client to have a place for the simulation to ha
### Instance Variables
- <a name="carla.World.id"></a>**<font color="#f8805a">id</font>** (_int_)
The ID of the episode associated with this world. Episodes are different sessions of a simulation. These change everytime a world is disabled or reloaded. Keeping track is useful to avoid possible issues.
The ID of the episode associated with this world. Episodes are different sessions of a simulation. These change every time a world is disabled or reloaded. Keeping track is useful to avoid possible issues.
- <a name="carla.World.debug"></a>**<font color="#f8805a">debug</font>** (_[carla.DebugHelper](#carla.DebugHelper)_)
Responsible for creating different shapes for debugging. Take a look at its class to learn more about it.
### Methods
- <a name="carla.World.apply_color_texture_to_object"></a>**<font color="#7fb800">apply_color_texture_to_object</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**object_name**</font>, <font color="#00a6ed">**material_parameter**</font>, <font color="#00a6ed">**texture**</font>)
Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
Applies a `texture` object in the field corresponding 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_)
- <a name="carla.World.apply_color_texture_to_objects"></a>**<font color="#7fb800">apply_color_texture_to_objects</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**objects_name_list**</font>, <font color="#00a6ed">**material_parameter**</font>, <font color="#00a6ed">**texture**</font>)
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`.
Applies a `texture` object in the field corresponding 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_)
- <a name="carla.World.apply_float_color_texture_to_object"></a>**<font color="#7fb800">apply_float_color_texture_to_object</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**object_name**</font>, <font color="#00a6ed">**material_parameter**</font>, <font color="#00a6ed">**texture**</font>)
Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
Applies a `texture` object in the field corresponding 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_)
- <a name="carla.World.apply_float_color_texture_to_objects"></a>**<font color="#7fb800">apply_float_color_texture_to_objects</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**objects_name_list**</font>, <font color="#00a6ed">**material_parameter**</font>, <font color="#00a6ed">**texture**</font>)
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`.
Applies a `texture` object in the field corresponding 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)_)
@ -3705,7 +3713,7 @@ Loads the selected layers to the level. If the layer is already loaded the call
- `map_layers` (_[carla.MapLayer](#carla.MapLayer)_) - Mask of level layers to be loaded.
- **Warning:** <font color="#ED2F2F">_This only affects "Opt" maps. The minimum layout includes roads, sidewalks, traffic lights and traffic signs._</font>
- <a name="carla.World.on_tick"></a>**<font color="#7fb800">on_tick</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**callback**</font>)
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 __<font color="#7fb800">wait_for_tick()</font>__. Use __<font color="#7fb800">remove_on_tick()</font>__ to stop the callbacks.
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 every time the server ticks. It requires a [carla.WorldSnapshot](#carla.WorldSnapshot) as argument, which can be retrieved from __<font color="#7fb800">wait_for_tick()</font>__. Use __<font color="#7fb800">remove_on_tick()</font>__ 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.
- **Return:** _int_
@ -3722,13 +3730,13 @@ Stops the callback for `callback_id` started with __<font color="#7fb800">on_tic
- `callback_id` (_callback_) - The callback to be removed. The ID is returned when creating the callback.
- <a name="carla.World.reset_all_traffic_lights"></a>**<font color="#7fb800">reset_all_traffic_lights</font>**(<font color="#00a6ed">**self**</font>)
Resets the cycle of all traffic lights in the map to the initial state.
- <a name="carla.World.spawn_actor"></a>**<font color="#7fb800">spawn_actor</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**blueprint**</font>, <font color="#00a6ed">**transform**</font>, <font color="#00a6ed">**attach_to**=None</font>, <font color="#00a6ed">**attachment**=Rigid</font>)<button class="SnipetButton" id="carla.World.spawn_actor-snipet_button">snippet &rarr;</button>
- <a name="carla.World.spawn_actor"></a>**<font color="#7fb800">spawn_actor</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**blueprint**</font>, <font color="#00a6ed">**transform**</font>, <font color="#00a6ed">**attach_to**=None</font>, <font color="#00a6ed">**attachment_type**=Rigid</font>)<button class="SnipetButton" id="carla.World.spawn_actor-snipet_button">snippet &rarr;</button>
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.
- `attachment_type` (_[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)_
- <a name="carla.World.tick"></a>**<font color="#7fb800">tick</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**seconds**=10.0</font>)
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.
@ -3737,13 +3745,13 @@ This method is used in [__synchronous__ mode](https://[carla.readthedocs.io](#ca
- **Return:** _int_
- **Note:** <font color="#8E8E8E">_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.
_</font>
- <a name="carla.World.try_spawn_actor"></a>**<font color="#7fb800">try_spawn_actor</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**blueprint**</font>, <font color="#00a6ed">**transform**</font>, <font color="#00a6ed">**attach_to**=None</font>, <font color="#00a6ed">**attachment**=Rigid</font>)
- <a name="carla.World.try_spawn_actor"></a>**<font color="#7fb800">try_spawn_actor</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**blueprint**</font>, <font color="#00a6ed">**transform**</font>, <font color="#00a6ed">**attach_to**=None</font>, <font color="#00a6ed">**attachment_type**=Rigid</font>)
Same as __<font color="#7fb800">spawn_actor()</font>__ but returns <b>None</b> 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.
- `attachment_type` (_[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)_
- <a name="carla.World.unload_map_layer"></a>**<font color="#7fb800">unload_map_layer</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**map_layers**</font>)<button class="SnipetButton" id="carla.World.unload_map_layer-snipet_button">snippet &rarr;</button>
Unloads the selected layers to the level. If the layer is already unloaded the call has no effect.
@ -3846,10 +3854,10 @@ _</font>
- <a name="carla.World.set_pedestrians_seed"></a>**<font color="#7fb800">set_pedestrians_seed</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**seed**</font>)
- **Parameters:**
- `seed` (_int_) - Sets the seed to use for any random number generated in relation to pedestrians.
- **Note:** <font color="#8E8E8E">_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.
- **Note:** <font color="#8E8E8E">_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 chosen randomly) and here, otherwise the pedestrians will repeat the same paths but the bodies will be different.
_</font>
- <a name="carla.World.set_weather"></a>**<font color="#7fb800">set_weather</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**weather**</font>)
Changes the weather parameteres ruling the simulation to another ones defined in an object.
Changes the weather parameters ruling the simulation to another ones defined in an object.
- **Parameters:**
- `weather` (_[carla.WeatherParameters](#carla.WeatherParameters)_) - New conditions to be applied.
- **Getter:** _[carla.World.get_weather](#carla.World.get_weather)_
@ -3880,7 +3888,7 @@ The maximum number of physics substepping that are allowed. By default, the valu
- <a name="carla.WorldSettings.max_culling_distance"></a>**<font color="#f8805a">max_culling_distance</font>** (_float_)
Configure the max draw distance for each mesh of the level.
- <a name="carla.WorldSettings.deterministic_ragdolls"></a>**<font color="#f8805a">deterministic_ragdolls</font>** (_bool_)
Defines wether to use deterministic physics for pedestrian death animations or physical ragdoll simulation. When enabled, pedestrians have less realistic death animation but ensures determinism. When disabled, pedestrians are simulated as ragdolls with more realistic simulation and collision but no determinsm can be ensured.
Defines wether to use deterministic physics for pedestrian death animations or physical ragdoll simulation. When enabled, pedestrians have less realistic death animation but ensures determinism. When disabled, pedestrians are simulated as ragdolls with more realistic simulation and collision but no determinism can be ensured.
- <a name="carla.WorldSettings.tile_stream_distance"></a>**<font color="#f8805a">tile_stream_distance</font>** (_float_)
Used for large maps only. Configures the maximum distance from the hero vehicle to stream tiled maps. Regions of the map within this range will be visible (and capable of simulating physics). Regions outside this region will not be loaded.
- <a name="carla.WorldSettings.actor_active_distance"></a>**<font color="#f8805a">actor_active_distance</font>** (_float_)

View File

@ -6,7 +6,7 @@
"""
This module implements an agent that roams around a track following random
waypoints and avoiding other vehicles. The agent also responds to traffic lights.
It can also make use of the global route planner to follow a specifed route
It can also make use of the global route planner to follow a specified route
"""
import carla
@ -31,7 +31,7 @@ class BasicAgent(object):
def __init__(self, vehicle, target_speed=20, opt_dict={}, map_inst=None, grp_inst=None):
"""
Initialization the agent paramters, the local and the global planner.
Initialization the agent parameters, the local and the global planner.
:param vehicle: actor to apply to agent logic onto
:param target_speed: speed (in Km/h) at which the vehicle will move
@ -102,7 +102,7 @@ class BasicAgent(object):
# Get the static elements of the scene
self._lights_list = self._world.get_actors().filter("*traffic_light*")
self._lights_map = {} # Dictionary mapping a traffic light to a wp corrspoing to its trigger volume location
self._lights_map = {} # Dictionary mapping a traffic light to a wp corresponding to its trigger volume location
def add_emergency_stop(self, control):
"""
@ -325,7 +325,7 @@ class BasicAgent(object):
"""
Method to check if there is a vehicle in front of the agent blocking its path.
:param vehicle_list (list of carla.Vehicle): list contatining vehicle objects.
:param vehicle_list (list of carla.Vehicle): list containing vehicle objects.
If None, all vehicle in the scene are used
:param max_distance: max freespace to check for obstacles.
If None, the base threshold value is used

View File

@ -6,7 +6,7 @@
"""
This module implements an agent that roams around a track following random
waypoints and avoiding other vehicles. The agent also responds to traffic lights.
It can also make use of the global route planner to follow a specifed route
It can also make use of the global route planner to follow a specified route
"""
import carla

View File

@ -199,7 +199,7 @@ class PIDLateralController():
def run_step(self, waypoint):
"""
Execute one step of lateral control to steer
the vehicle towards a certain waypoin.
the vehicle towards a certain waypoint.
:param waypoint: target waypoint
:return: steering control in the range [-1, 1] where:

View File

@ -151,7 +151,7 @@ class LocalPlanner(object):
def follow_speed_limits(self, value=True):
"""
Activates a flag that makes the max speed dynamically vary according to the spped limits
Activates a flag that makes the max speed dynamically vary according to the speed limits
:param value: bool
:return:
@ -316,7 +316,7 @@ def _retrieve_options(list_waypoints, current_waypoint):
options = []
for next_waypoint in list_waypoints:
# this is needed because something we are linking to
# the beggining of an intersection, therefore the
# the beginning of an intersection, therefore the
# variation in angle is small
next_next_waypoint = next_waypoint.next(3.0)[0]
link = _compute_connection(current_waypoint, next_next_waypoint)

View File

@ -120,30 +120,30 @@
return: carla.Vector3D
return_units: m/s<sup>2</sup>
doc: >
Returns the actor's 3D acceleration vector the client recieved during last tick. The method does not call the simulator.
Returns the actor's 3D acceleration vector the client received during last tick. The method does not call the simulator.
# --------------------------------------
- def_name: get_angular_velocity
return: carla.Vector3D
return_units: deg/s
doc: >
Returns the actor's angular velocity vector the client recieved during last tick. The method does not call the simulator.
Returns the actor's angular velocity vector the client received during last tick. The method does not call the simulator.
# --------------------------------------
- def_name: get_location
return: carla.Location
return_units: meters
doc: >
Returns the actor's location the client recieved during last tick. The method does not call the simulator.
Returns the actor's location the client received during last tick. The method does not call the simulator.
# --------------------------------------
- def_name: get_transform
return: carla.Transform
doc: >
Returns the actor's transform (location and rotation) the client recieved during last tick. The method does not call the simulator.
Returns the actor's transform (location and rotation) the client received during last tick. The method does not call the simulator.
# --------------------------------------
- def_name: get_velocity
return: carla.Vector3D
return_units: m/s
doc: >
Returns the actor's velocity vector the client recieved during last tick. The method does not call the simulator.
Returns the actor's velocity vector the client received during last tick. The method does not call the simulator.
# --------------------------------------
- def_name: get_world
return: carla.World
@ -252,7 +252,7 @@
parent: carla.Actor
# - DESCRIPTION ------------------------
doc: >
One of the most important groups of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bycicles and also official vehicles such as police cars. A wide set of these actors is provided in carla.BlueprintLibrary to facilitate differente requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
One of the most important groups of actors in CARLA. These include any type of vehicle from cars to trucks, motorbikes, vans, bicycles and also official vehicles such as police cars. A wide set of these actors is provided in carla.BlueprintLibrary to facilitate different requirements. Vehicles can be either manually controlled or set to an autopilot mode that will be conducted client-side by the <b>traffic manager</b>.
# - PROPERTIES -------------------------
instance_variables:
- var_name: bounding_box
@ -591,7 +591,7 @@
parent: carla.TrafficSign
# - DESCRIPTION ------------------------
doc: >
A traffic light actor, considered a specific type of traffic sign. As traffic lights will mostly appear at junctions, they belong to a group which contains the different traffic lights in it. Inside the group, traffic lights are differenciated by their pole index.
A traffic light actor, considered a specific type of traffic sign. As traffic lights will mostly appear at junctions, they belong to a group which contains the different traffic lights in it. Inside the group, traffic lights are differentiated by their pole index.
Within a group the state of traffic lights is changed in a cyclic pattern: one index is chosen and it spends a few seconds in green, yellow and eventually red. The rest of the traffic lights remain frozen in red this whole time, meaning that there is a gap in the last seconds of the cycle where all the traffic lights are red. However, the state of a traffic light can be changed manually.
# - PROPERTIES -------------------------

View File

@ -23,7 +23,7 @@ except IndexError:
print(" .---------------------------------------------------.")
print(" | Make sure the python client is compiled! |")
print(" '---------------------------------------------------'\n")
# We don't provide an error to prvent Travis checks failing
# We don't provide an error to prevent Travis checks failing
sys.exit(0)
import carla

View File

@ -169,6 +169,7 @@
ID of the actor to follow. If this is 0 then camera is disabled.
- param_name: replay_sensors
type: bool
default: false
doc: >
Flag to enable or disable the spawn of sensors during playback.
doc: >
@ -793,4 +794,36 @@
- var_name: enable_pedestrian_navigation
type: bool
doc: >
If __True__, Pedestrian navigation will be enabled using Recast tool. For very large maps it is recomended to disable this option. __Default is `True`__.
If __True__, Pedestrian navigation will be enabled using Recast tool. For very large maps it is recommended to disable this option. __Default is `True`__.
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: vertex_distance
type: float
param_units: meters
default: 2.0
- param_name: max_road_length
type: float
param_units: meters
default: 50.0
- param_name: wall_height
type: float
param_units: meters
default: 1.0
- param_name: additional_width
type: float
param_units: meters
default: 0.6
- param_name: smooth_junctions
type: bool
default: true
- param_name: enable_mesh_visibility
type: bool
default: true
- param_name: enable_pedestrian_navigation
type: bool
default: true
doc: >
OpendriveGenerationParameters constructor

View File

@ -75,7 +75,7 @@ class MarkdownFile:
def first_title(self):
self._data = join([
self._data, '#Python API reference\n'])
self._data, '# Python API reference\n'])
def title(self, strongness, buf):
self._data = join([

View File

@ -26,10 +26,6 @@
- [V2X sensor](ref_sensors.md#v2x-sensor)
# - PROPERTIES -------------------------
instance_variables:
- var_name: is_listening
type: boolean
doc: >
When **True** the sensor will be waiting for data.
# - METHODS ----------------------------
methods:
- def_name: listen

View File

@ -880,7 +880,7 @@
- class_name: GBufferTextureID
# - DESCRIPTION ------------------------
doc: >
Defines the of each GBuffer texture (See the method `carla.Sensor.listen_to_gbuffer`).
Defines the identifiers of each GBuffer texture (See the method carla.Sensor.listen_to_gbuffer).
# - PROPERTIES -------------------------
instance_variables:
- var_name: SceneColor

View File

@ -7,7 +7,7 @@
# - DESCRIPTION ------------------------
doc: >
This class defines objects containing lighting and weather specifications that can later be applied in carla.World. So far, these conditions only intervene with [sensor.camera.rgb](ref_sensors.md#rgb-camera). They neither affect the actor's physics nor other sensors.
Each of these parameters acts indepently from the rest. Increasing the rainfall will not automatically create puddles nor change the road's humidity. That makes for a better customization but means that realistic conditions need to be scripted. However an example of dynamic weather conditions working realistically can be found [here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/dynamic_weather.py).
Each of these parameters acts independently from the rest. Increasing the rainfall will not automatically create puddles nor change the road's humidity. That makes for a better customization but means that realistic conditions need to be scripted. However an example of dynamic weather conditions working realistically can be found [here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/dynamic_weather.py).
# - PROPERTIES -------------------------
instance_variables:
- var_name: cloudiness

View File

@ -143,7 +143,7 @@
doc: >
Defines wether to use deterministic physics for pedestrian death animations or physical ragdoll simulation.
When enabled, pedestrians have less realistic death animation but ensures determinism.
When disabled, pedestrians are simulated as ragdolls with more realistic simulation and collision but no determinsm can be ensured.
When disabled, pedestrians are simulated as ragdolls with more realistic simulation and collision but no determinism can be ensured.
- var_name: tile_stream_distance
type: float
doc: >
@ -460,7 +460,7 @@
- var_name: id
type: int
doc: >
The ID of the episode associated with this world. Episodes are different sessions of a simulation. These change everytime a world is disabled or reloaded. Keeping track is useful to avoid possible issues.
The ID of the episode associated with this world. Episodes are different sessions of a simulation. These change every time a world is disabled or reloaded. Keeping track is useful to avoid possible issues.
- var_name: debug
type: carla.DebugHelper
doc: >
@ -485,7 +485,7 @@
doc: >
Function with a snapshot as compulsory parameter that will be called when the client receives a tick.
doc: >
This method is used in [__asynchronous__ mode](https://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 as argument, which can be retrieved from __<font color="#7fb800">wait_for_tick()</font>__. Use __<font color="#7fb800">remove_on_tick()</font>__ to stop the callbacks.
This method is used in [__asynchronous__ mode](https://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 every time the server ticks. It requires a carla.WorldSnapshot as argument, which can be retrieved from __<font color="#7fb800">wait_for_tick()</font>__. Use __<font color="#7fb800">remove_on_tick()</font>__ to stop the callbacks.
# --------------------------------------
- def_name: remove_on_tick
params:
@ -538,7 +538,7 @@
default: None
doc: >
The parent object that the spawned actor will follow around.
- param_name: attachment
- param_name: attachment_type
type: carla.AttachmentType
default: Rigid
doc: >
@ -562,7 +562,7 @@
default: None
doc: >
The parent object that the spawned actor will follow around.
- param_name: attachment
- param_name: attachment_type
type: carla.AttachmentType
default: Rigid
doc: >
@ -744,7 +744,7 @@
doc: >
New conditions to be applied.
doc: >
Changes the weather parameteres ruling the simulation to another ones defined in an object.
Changes the weather parameters ruling the simulation to another ones defined in an object.
# --------------------------------------
- def_name: cast_ray
return: list(carla.LabelledPoint)
@ -831,7 +831,7 @@
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.
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 chosen randomly) and here, otherwise the pedestrians will repeat the same paths but the bodies will be different.
# --------------------------------------
- def_name: apply_color_texture_to_object
params:
@ -842,7 +842,7 @@
- param_name: texture
type: TextureColor
doc: >
Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
Applies a `texture` object in the field corresponding to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
# --------------------------------------
- def_name: apply_float_color_texture_to_object
params:
@ -853,7 +853,7 @@
- param_name: texture
type: TextureFloatColor
doc: >
Applies a `texture` object in the field corresponfing to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
Applies a `texture` object in the field corresponding to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to `object_name`.
# --------------------------------------
- def_name: apply_textures_to_object
params:
@ -879,7 +879,7 @@
- param_name: texture
type: TextureColor
doc: >
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`.
Applies a `texture` object in the field corresponding to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to all objects in `objects_name_list`.
# --------------------------------------
- def_name: apply_float_color_texture_to_objects
params:
@ -890,7 +890,7 @@
- param_name: texture
type: TextureFloatColor
doc: >
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`.
Applies a `texture` object in the field corresponding to `material_parameter` (normal, diffuse, etc) to the object in the scene corresponding to all objects in `objects_name_list`.
# --------------------------------------
- def_name: apply_textures_to_objects
params: