Compare commits

...

72 Commits

Author SHA1 Message Date
Daraan 5ab4425403
Merge branch 'dev' into doc-fixes 2024-10-14 15:30:26 +02:00
MattRoweEAIF 2a2cc5f1be
added unreal coord system, fixed v2x (#8251) 2024-10-07 15:27:01 +02:00
Daraan 0a095b948d
Merge branch 'dev' into doc-fixes 2024-10-05 16:39:25 +02:00
MattRoweEAIF f7ed6c25e9
fix typo in title (#8225) 2024-09-30 13:45:22 +02:00
Blyron 4feeb77b2b Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-09-25 08:26:25 +02:00
Daniel dad5f5dc7b Added and fixed Client.apply_batch signature 2024-09-23 19:34:28 +02:00
Daniel 944d0e225e Better clarification of WorldSnapshot
- removed deprecated frame_count from example
- also exposed WorldSnapshot.elapsed_seconds
2024-09-23 19:34:28 +02:00
Daniel cdb2664350 Added inverse_transform and fixes for Transform
inverse_transform from #7999
highlighted in-place character
2024-09-23 19:34:28 +02:00
Daniel e9d9a1cd36 corrected World.spaw_actor wrong parameter name 2024-09-23 19:34:28 +02:00
Daniel 9bb1e52581 Missing default value 2024-09-23 19:34:28 +02:00
Daniel dee22b138d Added OpendriveGenerationParameters.__init__ 2024-09-23 19:34:28 +02:00
Daniel a74476e9eb Added space between # and first heading in python_api.md 2024-09-23 19:34:28 +02:00
Daniel fd8d6122dd Apply changes to .md output 2024-09-23 19:34:28 +02:00
Daniel fa0b470a78 Removed reintroduced code of overwritten property 2024-09-23 19:34:28 +02:00
Daniel b5b1168892 Fix Spelling mistakes 2024-09-23 19:34:28 +02:00
Daniel db2697108a Fixed wrong `literal` in doc generation 2024-09-23 19:34:28 +02:00
Ylmdrin 92a6e71c6b
Correcting makefile typo to avoid override warning for target "downloadplugins" (#8167)
The downloadplugins target is already defined below (line 162).
2024-09-20 10:53:29 +02:00
Sergio Paniego Blanco c7339367b9
Fixed typo in CityScapes palette (#8137) 2024-09-13 21:07:25 +02:00
Jorge Virgos 4d09f0a660 Porting the changes done to UE5 to fix the recording leak to UE4
The slowdown is considerably more noticeable here since the engine runs much smoother. This makes evident that this is a stopgap measure, and should be looked into further down the line.
2024-09-12 14:26:28 +02:00
AreopagX 9e94feb3a5 navigation information is now loaded when changing maps 2024-09-11 22:01:15 +02:00
Blyron 00df447670 Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-09-02 10:50:07 +02:00
MattRoweEAIF c097d7acf1
added digital twins video (#8090) 2024-08-29 14:58:48 +02:00
Daniel 334740ae53 Fixed Vector arithmetic 2024-08-28 12:58:24 +02:00
Daniel 7633334063 Corrections and additions
more setters
missing, wrong types corrected
spelling
2024-08-28 12:58:24 +02:00
Daniel 2b465bcd66 Improved Callable and callbacks signature 2024-08-28 12:58:24 +02:00
Daniel aec0b261af Added Transform.inverse_transform and corrected signature
parameter is called in_point not in_vector
2024-08-28 12:58:24 +02:00
Daniel 58e0374f4f Corrected [try_]spawn_actor keyword name 2024-08-28 12:58:24 +02:00
Daniel 26dc386724 Improved get_waypoints and Literal type hints 2024-08-28 12:58:24 +02:00
Daniel 798c9e144c Added setters for VehicleControl 2024-08-28 12:58:24 +02:00
Daniel 77856f467c Various fixes
- wrong signatures
- wrong names
2024-08-28 12:58:24 +02:00
Daniel ca81e35d59 Added self parameter to property signatures 2024-08-28 12:58:24 +02:00
Daniel da80757e27 Fixes for wrong stubs
- OpendriveGenerationParameter had no init
- missing @property
- wrong signatures
2024-08-28 12:58:24 +02:00
Daniel 453ceca112 Fix: Enum values were tuples. Added Flag or Int to Enums 2024-08-28 12:58:24 +02:00
Daniel a959577ccf Better usage of Enum if typing.Self is availiable
Using Self will not report an override / incompatible error.
2024-08-28 12:58:24 +02:00
Daniel b061f9e951 Fix spelling mistakes 2024-08-28 12:58:24 +02:00
Daniel f797e1593a Improved get_waypoint disambiguation
correctly added two overload function
2024-08-28 12:58:24 +02:00
Daniel 41e595c056 Corrected and more precise type-hints
- fixed carla.Waypoint.next_until_lane_end
2024-08-28 12:58:24 +02:00
Daniel d9c217ee3c Added stubs for HUD drawing
Functions from #7168
2024-08-28 12:58:24 +02:00
Daniel a089c3b800 Formatted some docstring to be shorter 2024-08-28 12:58:24 +02:00
Daniel 19b892f76b Fix missing @property 2024-08-28 12:58:24 +02:00
Daniel 8df99c0414 Fix intendation shadowing methods 2024-08-28 12:58:24 +02:00
Daniel 2935897950 Added type hints for `values` attribute on enums 2024-08-28 12:58:24 +02:00
Daniel ddb5834e38 Corrected Sensor.is_listening
Was changed to a function in 0.9.15. More info see: https://github.com/carla-simulator/carla/pull/7439
2024-08-28 12:58:24 +02:00
Daniel e765559384 Added undocumented variables
FutureActor
laod_world_if_different
2024-08-28 12:58:24 +02:00
Daniel df1eb25721 Disambiguated get_waypoint signature
Syntax fix (squased)
2024-08-28 12:58:24 +02:00
Daniel caac503fdb Fixed CityObjectLabels 2024-08-28 12:58:24 +02:00
Daniel 4c086ad7d9 ActorList.filter actually returns ActorList 2024-08-28 12:58:24 +02:00
Daniel 1d4450b026 Filled in missing information and types. 2024-08-28 12:58:24 +02:00
Daniel 0197e0ae5b FIX: added ApplyTransform, fixed ApplyTorque 2024-08-28 12:58:24 +02:00
Daniel de33210abd FIX: __init__ methods do not return 2024-08-28 12:58:24 +02:00
Daniel a0cff71434 Added missing return value to reload_world 2024-08-28 12:58:24 +02:00
Daniel 232cb8c250 Added missing -> World to load_world 2024-08-28 12:58:24 +02:00
Daniel 755c0d827d Removed wrong unit indication 2024-08-28 12:58:24 +02:00
Daniel 4c1104dc47 Fixed spelling misstakes 2024-08-28 12:58:24 +02:00
Daniel f275e47f4e Added missing type for Labelled Point 2024-08-28 12:58:24 +02:00
Daniel 7b2c1db39b Added DSVEventArray iterator 2024-08-28 12:58:24 +02:00
Daniel 251b293d61 Updated changelog
needs merge with dev version
2024-08-28 12:58:24 +02:00
Daniel bc6e7cd5ea Fixed missing return types 2024-08-28 12:58:24 +02:00
Daraan be8735fc28 Fixed Actor.parent
Can be None or an Actor
2024-08-28 12:58:24 +02:00
Daniel 951fcc4cc9 Fixes and missing Iterators 2024-08-28 12:58:24 +02:00
Minokori fd44ea0ca1 Add a `*.pyi` file for auto-completion & hints.
To enable auto-completion and hints in code editors such as VScode, create a `*.pyi` file. This feature is compatible with `python 3.9` and later versions.
2024-08-28 12:58:24 +02:00
Blyron e83b79be74 Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-07-31 11:47:56 +02:00
Blyron 32f97eae66 Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-07-19 09:33:24 +02:00
Blyron c83c045ada Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-07-10 10:01:02 +02:00
Blyron 7c47e7db37 Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-07-08 08:36:42 +02:00
Blyron 17963902e5 Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-05-30 14:58:53 +02:00
Blyron 5043ad73fc Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-05-28 11:49:41 +02:00
Blyron b86b1997fc Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-05-21 11:38:39 +02:00
Blyron 2a507990d3 Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-05-15 08:55:48 +02:00
Blyron d854ab5f89 Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-05-14 12:40:04 +02:00
Blyron 649e2aa56b Merge branch 'dev' of https://github.com/carla-simulator/carla into dev 2024-05-13 16:07:17 +02:00
Blyron 5be0e2fd17 Fix OSM2ODR build 2024-05-06 16:29:17 +02:00
33 changed files with 5952 additions and 138 deletions

View File

@ -1,4 +1,5 @@
## Latest Changes ## Latest Changes
* Fixed a bug that caused navigation information not to be loaded when switching maps
* Prevent from segfault on failing SignalReference identification when loading OpenDrive files * Prevent from segfault on failing SignalReference identification when loading OpenDrive files
* Added vehicle doors to the recorder * Added vehicle doors to the recorder
* Added functions to get actor' components transform * Added functions to get actor' components transform
@ -18,6 +19,7 @@
* PythonAPI `Sensor.is_listening` was defined twice (property and method), cleaned and clarified it as a method. * PythonAPI `Sensor.is_listening` was defined twice (property and method), cleaned and clarified it as a method.
* Added V2X sensors for cooperative awareness message and custom user-defined messages to support vehicle-to-vehicle communication * Added V2X sensors for cooperative awareness message and custom user-defined messages to support vehicle-to-vehicle communication
* Added named tuples for BasicAgent.py's detection result to allow for type-hints and better semantics. * Added named tuples for BasicAgent.py's detection result to allow for type-hints and better semantics.
* Added type-hint support for the PythonAPI
## CARLA 0.9.15 ## CARLA 0.9.15

View File

@ -15,6 +15,8 @@
The __Digital Twin Tool__ enables procedural generation of unique 3D environments based on road networks derived from the [OpenStreetMap](https://www.openstreetmap.org) (OSM) service. Through the Digital Twin Tool interface in CARLA's Unreal Engine editor a user can select a region of map from OSM and download the road network as the basis for a new CARLA map. The tool then fills the spaces between the roads with procedurally generated 3D buildings that adjust to the layout of the road, creating a realistic 3D road environment with high variability. The __Digital Twin Tool__ enables procedural generation of unique 3D environments based on road networks derived from the [OpenStreetMap](https://www.openstreetmap.org) (OSM) service. Through the Digital Twin Tool interface in CARLA's Unreal Engine editor a user can select a region of map from OSM and download the road network as the basis for a new CARLA map. The tool then fills the spaces between the roads with procedurally generated 3D buildings that adjust to the layout of the road, creating a realistic 3D road environment with high variability.
<iframe width="100%" height="400px" src="https://www.youtube.com/embed/gTutXdS2UkQ?si=hssM3YRCAjSIzdXM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
## Building the OSM renderer ## Building the OSM renderer
If you are using Linux, you have the option of using the OSM renderer in the CARLA interface to navigate a large OSM map region that you have downloaded. You first need to build the OSM renderer before proceeding to build CARLA. Run `make osmrenderer` inside the CARLA root directory. You may need to upgrade your version of CMake to v3.2 or above in order for this to work. This will create two folders in your build directory called `libosmcout-source` and `libosmcout-build`. Before proceeding to build CARLA, you need to then edit the `Build.sh` file in the directory `$CARLA_ROOT/Build/libosmcout-source/maps` like so, to ensure the executable is found: If you are using Linux, you have the option of using the OSM renderer in the CARLA interface to navigate a large OSM map region that you have downloaded. You first need to build the OSM renderer before proceeding to build CARLA. Run `make osmrenderer` inside the CARLA root directory. You may need to upgrade your version of CMake to v3.2 or above in order for this to work. This will create two folders in your build directory called `libosmcout-source` and `libosmcout-build`. Before proceeding to build CARLA, you need to then edit the `Build.sh` file in the directory `$CARLA_ROOT/Build/libosmcout-source/maps` like so, to ensure the executable is found:

BIN
Docs/img/unreal_lhcs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -95,21 +95,21 @@ _</font>
##### Getters ##### Getters
- <a name="carla.Actor.get_acceleration"></a>**<font color="#7fb800">get_acceleration</font>**(<font color="#00a6ed">**self**</font>) - <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>_ - **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>) - <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>_ - **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>) - <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>_ - **Return:** _[carla.Location](#carla.Location)<small> - meters</small>_
- **Setter:** _[carla.Actor.set_location](#carla.Actor.set_location)_ - **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>) - <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)_ - **Return:** _[carla.Transform](#carla.Transform)_
- **Setter:** _[carla.Actor.set_transform](#carla.Actor.set_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>) - <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>_ - **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>) - <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. Returns the world this actor belongs to.
@ -505,15 +505,16 @@ Client constructor.
- `host` (_str_) - IP address where a CARLA Simulator instance is running. Default is localhost (127.0.0.1). - `host` (_str_) - IP address where a CARLA Simulator instance is running. Default is localhost (127.0.0.1).
- `port` (_int_) - TCP port where the CARLA Simulator instance is running. Default are 2000 and the subsequent 2001. - `port` (_int_) - TCP port where the CARLA Simulator instance is running. Default are 2000 and the subsequent 2001.
- `worker_threads` (_int_) - Number of working threads used for background updates. If 0, use all available concurrency. - `worker_threads` (_int_) - Number of working threads used for background updates. If 0, use all available concurrency.
- <a name="carla.Client.apply_batch"></a>**<font color="#7fb800">apply_batch</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**commands**</font>) - <a name="carla.Client.apply_batch"></a>**<font color="#7fb800">apply_batch</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**commands**</font>, <font color="#00a6ed">**do_tick**=False</font>)
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __<font color="#7fb800">apply_batch_sync()</font>__ method. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example on how to delete the actors that appear in [carla.ActorList](#carla.ActorList) all at once. Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __<font color="#7fb800">apply_batch_sync()</font>__ method. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example on how to delete the actors that appear in [carla.ActorList](#carla.ActorList) all at once.
- **Parameters:** - **Parameters:**
- `commands` (_list_) - A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page. - `commands` (_list_) - A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page.
- <a name="carla.Client.apply_batch_sync"></a>**<font color="#7fb800">apply_batch_sync</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**commands**</font>, <font color="#00a6ed">**due_tick_cue**=False</font>)<button class="SnipetButton" id="carla.Client.apply_batch_sync-snipet_button">snippet &rarr;</button> - `do_tick` (_bool_) - A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. Defaults to __False__.
- <a name="carla.Client.apply_batch_sync"></a>**<font color="#7fb800">apply_batch_sync</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**commands**</font>, <font color="#00a6ed">**do_tick**=False</font>)<button class="SnipetButton" id="carla.Client.apply_batch_sync-snipet_button">snippet &rarr;</button>
Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of <b>command.Response</b> that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example of it being used to spawn actors. Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of <b>command.Response</b> that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example of it being used to spawn actors.
- **Parameters:** - **Parameters:**
- `commands` (_list_) - A list of commands to execute in batch. The commands available are listed right above, in the method **<font color="#7fb800">apply_batch()</font>**. - `commands` (_list_) - A list of commands to execute in batch. The commands available are listed right above, in the method **<font color="#7fb800">apply_batch()</font>**.
- `due_tick_cue` (_bool_) - A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. It is __False__ by default. - `do_tick` (_bool_) - A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. Defaults to __False__.
- **Return:** _list(command.Response)_ - **Return:** _list(command.Response)_
- <a name="carla.Client.generate_opendrive_world"></a>**<font color="#7fb800">generate_opendrive_world</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**opendrive**</font>, <font color="#00a6ed">**parameters**=(2.0, 50.0, 1.0, 0.6, true, true)</font>, <font color="#00a6ed">**reset_settings**=True</font>) - <a name="carla.Client.generate_opendrive_world"></a>**<font color="#7fb800">generate_opendrive_world</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**opendrive**</font>, <font color="#00a6ed">**parameters**=(2.0, 50.0, 1.0, 0.6, true, true)</font>, <font color="#00a6ed">**reset_settings**=True</font>)
Loads a new world with a basic 3D topology generated from the content of an OpenDRIVE file. This content is passed as a `string` parameter. It is similar to `client.load_world(map_name)` but allows for custom OpenDRIVE maps in server side. Cars can drive around the map, but there are no graphics besides the road and sidewalks. Loads a new world with a basic 3D topology generated from the content of an OpenDRIVE file. This content is passed as a `string` parameter. It is similar to `client.load_world(map_name)` but allows for custom OpenDRIVE maps in server side. Cars can drive around the map, but there are no graphics besides the road and sidewalks.
@ -545,7 +546,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. - `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)_ - **Return:** _[carla.World](#carla.World)_
- **Raises:** RuntimeError when corresponding. - **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. 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:** - **Parameters:**
- `name` (_str_) - Name of the file containing the information of the simulation. - `name` (_str_) - Name of the file containing the information of the simulation.
@ -931,7 +932,7 @@ Initializes a color, black by default.
--- ---
## carla.GBufferTextureID<a name="carla.GBufferTextureID"></a> ## 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 ### Instance Variables
- <a name="carla.GBufferTextureID.SceneColor"></a>**<font color="#f8805a">SceneColor</font>** - <a name="carla.GBufferTextureID.SceneColor"></a>**<font color="#f8805a">SceneColor</font>**
@ -1845,7 +1846,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_) - <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`__. 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_) - <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_)
--- ---
@ -1999,7 +2012,7 @@ Iterate over the [carla.RadarDetection](#carla.RadarDetection) retrieved as data
## carla.Rotation<a name="carla.Rotation"></a> ## carla.Rotation<a name="carla.Rotation"></a>
Class that represents a 3D rotation and therefore, an orientation in space. CARLA uses the Unreal Engine coordinates system. This is a Z-up left-handed system. <br> Class that represents a 3D rotation and therefore, an orientation in space. CARLA uses the Unreal Engine coordinates system. This is a Z-up left-handed system. <br>
<br>The constructor method follows a specific order of declaration: `(pitch, yaw, roll)`, which corresponds to `(Y-rotation,Z-rotation,X-rotation)`. <br> <br>![UE4_Rotation](https://d26ilriwvtzlb.cloudfront.net/8/83/BRMC_9.jpg) *Unreal Engine's coordinates system*. <br>The constructor method follows a specific order of declaration: `(pitch, yaw, roll)`, which corresponds to `(Y-rotation,Z-rotation,X-rotation)`. <br> <br>![UE4_Rotation](/img/unreal_lhcs.png) *Unreal Engine's coordinates system*.
### Instance Variables ### Instance Variables
- <a name="carla.Rotation.pitch"></a>**<font color="#f8805a">pitch</font>** (_float<small> - degrees</small>_) - <a name="carla.Rotation.pitch"></a>**<font color="#f8805a">pitch</font>** (_float<small> - degrees</small>_)
@ -2321,10 +2334,6 @@ Sensors compound a specific family of actors quite diverse and unique. They are
- [Obstacle detector](ref_sensors.md#obstacle-detector)<br> - [Obstacle detector](ref_sensors.md#obstacle-detector)<br>
- [V2X sensor](ref_sensors.md#v2x-sensor). - [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 ### Methods
- <a name="carla.Sensor.disable_for_ros"></a>**<font color="#7fb800">disable_for_ros</font>**(<font color="#00a6ed">**self**</font>) - <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. Commands the sensor to not be processed for publishing in ROS2 if there is no any listen to it.
@ -2495,7 +2504,7 @@ Time register of the frame at which this measurement was taken given by the OS i
## carla.TrafficLight<a name="carla.TrafficLight"></a> ## carla.TrafficLight<a name="carla.TrafficLight"></a>
<small style="display:block;margin-top:-20px;">Inherited from _[carla.TrafficSign](#carla.TrafficSign)_</small></br> <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. 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.
@ -2786,14 +2795,18 @@ Describes a rotation for an object according to Unreal Engine's axis system.
- **Parameters:** - **Parameters:**
- `location` (_[carla.Location](#carla.Location)_) - `location` (_[carla.Location](#carla.Location)_)
- `rotation` (_[carla.Rotation](#carla.Rotation)<small> - degrees (pitch, yaw, roll)</small>_) - `rotation` (_[carla.Rotation](#carla.Rotation)<small> - degrees (pitch, yaw, roll)</small>_)
- <a name="carla.Transform.inverse_transform"></a>**<font color="#7fb800">inverse_transform</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**in_point**</font>)
Applies the inverse of `transform` by translating a 3D point in place from global to local coordinates using the current transformation as frame of reference.
- **Parameters:**
- `in_point` (_[carla.Vector3D](#carla.Vector3D)_) - Location in the space to which the inverse transformation will be applied.
- <a name="carla.Transform.transform"></a>**<font color="#7fb800">transform</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**in_point**</font>) - <a name="carla.Transform.transform"></a>**<font color="#7fb800">transform</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**in_point**</font>)
Translates a 3D point from local to global coordinates using the current transformation as frame of reference. Translates a 3D point in place from local to global coordinates using the current transformation as frame of reference.
- **Parameters:** - **Parameters:**
- `in_point` (_[carla.Location](#carla.Location)_) - Location in the space to which the transformation will be applied. - `in_point` (_[carla.Vector3D](#carla.Vector3D)_) - Location in the space to which the transformation will be applied.
- <a name="carla.Transform.transform_vector"></a>**<font color="#7fb800">transform_vector</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**in_vector**</font>) - <a name="carla.Transform.transform_vector"></a>**<font color="#7fb800">transform_vector</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**in_point**</font>)
Rotates a vector using the current transformation as frame of reference, without applying translation. Use this to transform, for example, a velocity. Rotates a vector in place using the current transformation as frame of reference, without applying translation. Use this to transform, for example, a velocity.
- **Parameters:** - **Parameters:**
- `in_vector` (_[carla.Vector3D](#carla.Vector3D)_) - Vector to which the transformation will be applied. - `in_point` (_[carla.Vector3D](#carla.Vector3D)_) - Vector to which the transformation will be applied.
##### Getters ##### Getters
- <a name="carla.Transform.get_forward_vector"></a>**<font color="#7fb800">get_forward_vector</font>**(<font color="#00a6ed">**self**</font>) - <a name="carla.Transform.get_forward_vector"></a>**<font color="#7fb800">get_forward_vector</font>**(<font color="#00a6ed">**self**</font>)
@ -2957,7 +2970,7 @@ Returns the axis values for the vector parsed as string.
## carla.Vehicle<a name="carla.Vehicle"></a> ## carla.Vehicle<a name="carla.Vehicle"></a>
<small style="display:block;margin-top:-20px;">Inherited from _[carla.Actor](#carla.Actor)_</small></br> <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 ### Instance Variables
- <a name="carla.Vehicle.bounding_box"></a>**<font color="#f8805a">bounding_box</font>** (_[carla.BoundingBox](#carla.BoundingBox)_) - <a name="carla.Vehicle.bounding_box"></a>**<font color="#f8805a">bounding_box</font>** (_[carla.BoundingBox](#carla.BoundingBox)_)
@ -3515,7 +3528,7 @@ Will return <b>None</b> if the lane does not exist.
## carla.WeatherParameters<a name="carla.WeatherParameters"></a> ## 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. 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 ### Instance Variables
- <a name="carla.WeatherParameters.cloudiness"></a>**<font color="#f8805a">cloudiness</font>** (_float_) - <a name="carla.WeatherParameters.cloudiness"></a>**<font color="#f8805a">cloudiness</font>** (_float_)
@ -3632,25 +3645,25 @@ Responsible for creating different shapes for debugging. Take a look at its clas
### Methods ### 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>) - <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:** - **Parameters:**
- `object_name` (_str_) - `object_name` (_str_)
- `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_) - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
- `texture` (_TextureColor_) - `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>) - <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:** - **Parameters:**
- `objects_name_list` (_list(str)_) - `objects_name_list` (_list(str)_)
- `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_) - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
- `texture` (_TextureColor_) - `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>) - <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:** - **Parameters:**
- `object_name` (_str_) - `object_name` (_str_)
- `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_) - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
- `texture` (_TextureFloatColor_) - `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>) - <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:** - **Parameters:**
- `objects_name_list` (_list(str)_) - `objects_name_list` (_list(str)_)
- `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_) - `material_parameter` (_[carla.MaterialParameter](#carla.MaterialParameter)_)
@ -3722,13 +3735,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. - `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>) - <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. 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. 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:** - **Parameters:**
- `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) - The reference from which the actor will be created. - `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. - `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. - `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)_ - **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>) - <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. 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 +3750,13 @@ This method is used in [__synchronous__ mode](https://[carla.readthedocs.io](#ca
- **Return:** _int_ - **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. - **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> _</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. Same as __<font color="#7fb800">spawn_actor()</font>__ but returns <b>None</b> on failure instead of throwing an exception.
- **Parameters:** - **Parameters:**
- `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) - The reference from which the actor will be created. - `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. - `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. - `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)_ - **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> - <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. Unloads the selected layers to the level. If the layer is already unloaded the call has no effect.
@ -3846,10 +3859,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>) - <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:** - **Parameters:**
- `seed` (_int_) - Sets the seed to use for any random number generated in relation to pedestrians. - `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> _</font>
- <a name="carla.World.set_weather"></a>**<font color="#7fb800">set_weather</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**weather**</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:** - **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)_ - **Getter:** _[carla.World.get_weather](#carla.World.get_weather)_
@ -3880,7 +3893,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_) - <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. 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_) - <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_) - <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. 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_) - <a name="carla.WorldSettings.actor_active_distance"></a>**<font color="#f8805a">actor_active_distance</font>** (_float_)
@ -3922,6 +3935,8 @@ This snapshot comprises all the information for every actor on scene at a certai
A value unique for every snapshot to differentiate them. A value unique for every snapshot to differentiate them.
- <a name="carla.WorldSnapshot.frame"></a>**<font color="#f8805a">frame</font>** (_int_) - <a name="carla.WorldSnapshot.frame"></a>**<font color="#f8805a">frame</font>** (_int_)
Simulation frame in which the snapshot was taken. Simulation frame in which the snapshot was taken.
- <a name="carla.WorldSnapshot.elapsed_seconds"></a>**<font color="#f8805a">elapsed_seconds</font>** (_float<small> - seconds</small>_)
Simulated seconds elapsed since the beginning of the current episode.
- <a name="carla.WorldSnapshot.timestamp"></a>**<font color="#f8805a">timestamp</font>** (_[carla.Timestamp](#carla.Timestamp)<small> - seconds</small>_) - <a name="carla.WorldSnapshot.timestamp"></a>**<font color="#f8805a">timestamp</font>** (_[carla.Timestamp](#carla.Timestamp)<small> - seconds</small>_)
Precise moment in time when snapshot was taken. This class works in seconds as given by the operative system. Precise moment in time when snapshot was taken. This class works in seconds as given by the operative system.

View File

@ -736,7 +736,7 @@ The following tags are currently available (Note, tags changed from version 0.9.
| `14` | Car | `(0, 0, 142)` | Cars, vans | | `14` | Car | `(0, 0, 142)` | Cars, vans |
| `15` | Truck | `(0, 0, 70)` | Trucks | | `15` | Truck | `(0, 0, 70)` | Trucks |
| `16` | Bus | `(0, 60, 100)` | Busses | | `16` | Bus | `(0, 60, 100)` | Busses |
| `17` | Train | `(0, 60, 100)` | Trains | | `17` | Train | `(0, 80, 100)` | Trains |
| `18` | Motorcycle | `(0, 0, 230)` | Motorcycle, Motorbike | | `18` | Motorcycle | `(0, 0, 230)` | Motorcycle, Motorbike |
| `19` | Bicycle | `(119, 11, 32)` | Bicylces | | `19` | Bicycle | `(119, 11, 32)` | Bicylces |
| `20` | Static | `(110, 190, 160)` | Elements in the scene and props that are immovable. <br> E.g. fire hydrants, fixed benches, fountains, bus stops, etc. | | `20` | Static | `(110, 190, 160)` | Elements in the scene and props that are immovable. <br> E.g. fire hydrants, fixed benches, fountains, bus stops, etc. |
@ -940,21 +940,19 @@ While the visibility is simulated within CARLA, the scenario can be configured b
* __Output:__ [carla.CAMData](python_api.md#carla.CAMData), triggered according to the ETSI CAM standard, unless configured otherwise * __Output:__ [carla.CAMData](python_api.md#carla.CAMData), triggered according to the ETSI CAM standard, unless configured otherwise
Triggering conditions according to ETSI standard: Triggering conditions according to ETSI standard:
- Heading angle change > $4$° - Heading angle change > 4°
- Position difference > $4$ m - Position difference > 4 m
- Speed change > $5$ m/s - Speed change > 5 m/s
- Time elapsed > CAM Generation time (configurable) - Time elapsed > CAM Generation time (configurable)
- Low Frequency Container Time Elapsed $> 500$ ms - Low Frequency Container Time Elapsed > 500 ms
For the CAM V2X sensor, additional blueprint attributes apply: For the CAM V2X sensor, additional blueprint attributes apply:
| Blueprint attribute | Type | Default | Description | | Blueprint attribute | Type | Default | Description |
|-------------------------|--------|-------------------------|------------------------------------| |-------------------------|--------|-------------------------|------------------------------------|
| <td colspan=4> Message generation | | gen\_cam\_min | float | 0.1 | Minimum elapsed time between two successive CAMs in seconds (s) |
| gen\_cam\_min | float | $0.1$ | Minimum elapsed time between two successive CAMs in seconds (s) | | gen\_cam\_max | float | 1.0 | Maximum elapsed time between two successive CAMs in seconds (s) |
| gen\_cam\_max | float | $1.0$ | Maximum elapsed time between two successive CAMs in seconds (s) |
| fixed\_rate | bool | false [true] | Generate a CAM in every CARLA tick (only for debug purposes, will result in slowdown) | | fixed\_rate | bool | false [true] | Generate a CAM in every CARLA tick (only for debug purposes, will result in slowdown) |
| <td colspan=4> Data generation |
| `noise_vel_stddev_x` | float | 0\.0 | Standard deviation parameter in the noise model for velocity (X axis). | | `noise_vel_stddev_x` | float | 0\.0 | Standard deviation parameter in the noise model for velocity (X axis). |
| `noise_accel_stddev_x` | float | 0\.0 | Standard deviation parameter in the noise model for acceleration (X axis). | | `noise_accel_stddev_x` | float | 0\.0 | Standard deviation parameter in the noise model for acceleration (X axis). |
| `noise_accel_stddev_y` | float | 0\.0 | Standard deviation parameter in the noise model for acceleration (Y axis). | | `noise_accel_stddev_y` | float | 0\.0 | Standard deviation parameter in the noise model for acceleration (Y axis). |
@ -993,14 +991,14 @@ Example:
| Blueprint attribute | Type | Default | Description | | Blueprint attribute | Type | Default | Description |
|-------------------------|--------|-------------------------|------------------------------------| |-------------------------|--------|-------------------------|------------------------------------|
| transmit\_power | float | $21.5$ | Sender transmission power in dBm | | transmit\_power | float | 21.5 | Sender transmission power in dBm |
| receiver\_sensitivity | float | $-99$ | Receiver sensitivity in dBm | | receiver\_sensitivity | float | -99 | Receiver sensitivity in dBm |
| frequency\_ghz | float | $5.9$ | Transmission frequency in GHz. 5.9 GHz is standard for several physical channels. | | frequency\_ghz | float | 5.9 | Transmission frequency in GHz. 5.9 GHz is standard for several physical channels. |
| noise\_seed | int | $0$ | Random parameter for initialization of noise | | noise\_seed | int | 0 | Random parameter for initialization of noise |
| filter\_distance | float | $500$ | Maximum transmission distance in meter, path loss calculations above are skipped for simulation speed | | filter\_distance | float | 500 | Maximum transmission distance in meter, path loss calculations above are skipped for simulation speed |
| <td colspan=4> __Path loss model parameters__ | | __Path loss model parameters__ | | | |
| combined\_antenna\_gain | float | $10.0$ | Combined gain of sender and receiver antennas in dBi, parameter for radiation efficiency and directivity | | combined\_antenna\_gain | float | 10.0 | Combined gain of sender and receiver antennas in dBi, parameter for radiation efficiency and directivity |
| d\_ref | float | $ 1.0 $ | reference distance for Log-distance path loss model in meter | | d\_ref | float | 1.0 | reference distance for Log-distance path loss model in meter |
| path\_loss\_exponent | float | 2.7 | Loss parameter for non-line of sight due to building obstruction | | path\_loss\_exponent | float | 2.7 | Loss parameter for non-line of sight due to building obstruction |
| scenario | string | urban | Options: [urban, rural, highway], defines the fading noise parameters | | scenario | string | urban | Options: [urban, rural, highway], defines the fading noise parameters |
| path\_loss\_model | string | geometric | general path loss model to be used. Options: [geometric, winner] | | path\_loss\_model | string | geometric | general path loss model to be used. Options: [geometric, winner] |

View File

@ -88,6 +88,12 @@ namespace detail {
const auto id = GetCurrentEpisode().GetId(); const auto id = GetCurrentEpisode().GetId();
_client.LoadEpisode(std::move(map_name), reset_settings, map_layers); _client.LoadEpisode(std::move(map_name), reset_settings, map_layers);
// delete the pointer to _episode so that the Navigation information
// will be loaded for the correct map
assert(_episode.use_count() == 1);
_episode.reset();
GetReadyCurrentEpisode();
// We are waiting 50ms for the server to reload the episode. // We are waiting 50ms for the server to reload the episode.
// If in this time we have not detected a change of episode, we try again // If in this time we have not detected a change of episode, we try again
// 'number_of_attempts' times. // 'number_of_attempts' times.

View File

@ -15,7 +15,6 @@
#include <boost/asio/connect.hpp> #include <boost/asio/connect.hpp>
#include <boost/asio/read.hpp> #include <boost/asio/read.hpp>
#include <boost/asio/write.hpp> #include <boost/asio/write.hpp>
#include <boost/asio/post.hpp>
#include <boost/asio/bind_executor.hpp> #include <boost/asio/bind_executor.hpp>
#include <exception> #include <exception>
@ -86,7 +85,6 @@ namespace tcp {
void Client::Connect() { void Client::Connect() {
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [this, self]() {
if (_done) { if (_done) {
return; return;
} }
@ -139,18 +137,15 @@ namespace tcp {
log_debug("streaming client: connecting to", ep); log_debug("streaming client: connecting to", ep);
_socket.async_connect(ep, boost::asio::bind_executor(_strand, handle_connect)); _socket.async_connect(ep, boost::asio::bind_executor(_strand, handle_connect));
});
} }
void Client::Stop() { void Client::Stop() {
_connection_timer.cancel(); _connection_timer.cancel();
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [this, self]() {
_done = true; _done = true;
if (_socket.is_open()) { if (_socket.is_open()) {
_socket.close(); _socket.close();
} }
});
} }
void Client::Reconnect() { void Client::Reconnect() {
@ -165,7 +160,6 @@ namespace tcp {
void Client::ReadData() { void Client::ReadData() {
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [this, self]() {
if (_done) { if (_done) {
return; return;
} }
@ -182,7 +176,7 @@ namespace tcp {
// Move the buffer to the callback function and start reading the next // Move the buffer to the callback function and start reading the next
// piece of data. // piece of data.
// log_debug("streaming client: success reading data, calling the callback"); // log_debug("streaming client: success reading data, calling the callback");
boost::asio::post(_strand, [self, message]() { self->_callback(message->pop()); }); self->_callback(message->pop());
ReadData(); ReadData();
} else { } else {
// As usual, if anything fails start over from the very top. // As usual, if anything fails start over from the very top.
@ -219,7 +213,6 @@ namespace tcp {
_socket, _socket,
message->size_as_buffer(), message->size_as_buffer(),
boost::asio::bind_executor(_strand, handle_read_header)); boost::asio::bind_executor(_strand, handle_read_header));
});
} }
} // namespace tcp } // namespace tcp

View File

@ -79,7 +79,6 @@ namespace tcp {
DEBUG_ASSERT(message != nullptr); DEBUG_ASSERT(message != nullptr);
DEBUG_ASSERT(!message->empty()); DEBUG_ASSERT(!message->empty());
auto self = shared_from_this(); auto self = shared_from_this();
boost::asio::post(_strand, [=]() {
if (!_socket.is_open()) { if (!_socket.is_open()) {
return; return;
} }
@ -111,11 +110,8 @@ namespace tcp {
log_debug("session", _session_id, ": sending message of", message->size(), "bytes"); log_debug("session", _session_id, ": sending message of", message->size(), "bytes");
_deadline.expires_from_now(_timeout); _deadline.expires_from_now(_timeout);
boost::asio::async_write( boost::asio::async_write(_socket, message->GetBufferSequence(),
_socket, boost::asio::bind_executor(_strand, handle_sent));
message->GetBufferSequence(),
handle_sent);
});
} }
void ServerSession::Close() { void ServerSession::Close() {

View File

@ -6,7 +6,7 @@
""" """
This module implements an agent that roams around a track following random This module implements an agent that roams around a track following random
waypoints and avoiding other vehicles. The agent also responds to traffic lights. 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 import carla
@ -31,7 +31,7 @@ class BasicAgent(object):
def __init__(self, vehicle, target_speed=20, opt_dict={}, map_inst=None, grp_inst=None): 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 vehicle: actor to apply to agent logic onto
:param target_speed: speed (in Km/h) at which the vehicle will move :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 # Get the static elements of the scene
self._lights_list = self._world.get_actors().filter("*traffic_light*") 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): 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. 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 If None, all vehicle in the scene are used
:param max_distance: max freespace to check for obstacles. :param max_distance: max freespace to check for obstacles.
If None, the base threshold value is used 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 This module implements an agent that roams around a track following random
waypoints and avoiding other vehicles. The agent also responds to traffic lights. 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 import carla

View File

@ -199,7 +199,7 @@ class PIDLateralController():
def run_step(self, waypoint): def run_step(self, waypoint):
""" """
Execute one step of lateral control to steer Execute one step of lateral control to steer
the vehicle towards a certain waypoin. the vehicle towards a certain waypoint.
:param waypoint: target waypoint :param waypoint: target waypoint
:return: steering control in the range [-1, 1] where: :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): 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 :param value: bool
:return: :return:
@ -316,7 +316,7 @@ def _retrieve_options(list_waypoints, current_waypoint):
options = [] options = []
for next_waypoint in list_waypoints: for next_waypoint in list_waypoints:
# this is needed because something we are linking to # 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 # variation in angle is small
next_next_waypoint = next_waypoint.next(3.0)[0] next_next_waypoint = next_waypoint.next(3.0)[0]
link = _compute_connection(current_waypoint, next_next_waypoint) link = _compute_connection(current_waypoint, next_next_waypoint)

File diff suppressed because it is too large Load Diff

View File

@ -120,30 +120,30 @@
return: carla.Vector3D return: carla.Vector3D
return_units: m/s<sup>2</sup> return_units: m/s<sup>2</sup>
doc: > 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 - def_name: get_angular_velocity
return: carla.Vector3D return: carla.Vector3D
return_units: deg/s return_units: deg/s
doc: > 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 - def_name: get_location
return: carla.Location return: carla.Location
return_units: meters return_units: meters
doc: > 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 - def_name: get_transform
return: carla.Transform return: carla.Transform
doc: > 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 - def_name: get_velocity
return: carla.Vector3D return: carla.Vector3D
return_units: m/s return_units: m/s
doc: > 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 - def_name: get_world
return: carla.World return: carla.World
@ -252,7 +252,7 @@
parent: carla.Actor parent: carla.Actor
# - DESCRIPTION ------------------------ # - DESCRIPTION ------------------------
doc: > 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 ------------------------- # - PROPERTIES -------------------------
instance_variables: instance_variables:
- var_name: bounding_box - var_name: bounding_box
@ -591,7 +591,7 @@
parent: carla.TrafficSign parent: carla.TrafficSign
# - DESCRIPTION ------------------------ # - DESCRIPTION ------------------------
doc: > 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. 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 ------------------------- # - PROPERTIES -------------------------

View File

@ -23,7 +23,7 @@ except IndexError:
print(" .---------------------------------------------------.") print(" .---------------------------------------------------.")
print(" | Make sure the python client is compiled! |") print(" | Make sure the python client is compiled! |")
print(" '---------------------------------------------------'\n") 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) sys.exit(0)
import carla import carla

View File

@ -41,6 +41,11 @@
type: list type: list
doc: > doc: >
A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page. A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page.
- param_name: do_tick
type: bool
default: false
doc: >
A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. Defaults to __False__.
doc: > doc: >
Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __<font color="#7fb800">apply_batch_sync()</font>__ method. Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __<font color="#7fb800">apply_batch_sync()</font>__ method.
[Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example on how to delete the actors that appear in carla.ActorList all at once. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example on how to delete the actors that appear in carla.ActorList all at once.
@ -51,11 +56,11 @@
type: list type: list
doc: > doc: >
A list of commands to execute in batch. The commands available are listed right above, in the method **<font color="#7fb800">apply_batch()</font>**. A list of commands to execute in batch. The commands available are listed right above, in the method **<font color="#7fb800">apply_batch()</font>**.
- param_name: due_tick_cue - param_name: do_tick
type: bool type: bool
default: false default: false
doc: > doc: >
A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. It is __False__ by default. A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. Defaults to __False__.
return: list(command.Response) return: list(command.Response)
doc: > doc: >
Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of <b>command.Response</b> that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example of it being used to spawn actors. Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of <b>command.Response</b> that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example of it being used to spawn actors.
@ -169,6 +174,7 @@
ID of the actor to follow. If this is 0 then camera is disabled. ID of the actor to follow. If this is 0 then camera is disabled.
- param_name: replay_sensors - param_name: replay_sensors
type: bool type: bool
default: false
doc: > doc: >
Flag to enable or disable the spawn of sensors during playback. Flag to enable or disable the spawn of sensors during playback.
doc: > doc: >
@ -793,4 +799,36 @@
- var_name: enable_pedestrian_navigation - var_name: enable_pedestrian_navigation
type: bool type: bool
doc: > 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

@ -328,7 +328,7 @@
Class that represents a 3D rotation and therefore, an orientation in space. CARLA uses the Unreal Engine coordinates system. This is a Z-up left-handed system. <br> Class that represents a 3D rotation and therefore, an orientation in space. CARLA uses the Unreal Engine coordinates system. This is a Z-up left-handed system. <br>
<br>The constructor method follows a specific order of declaration: `(pitch, yaw, roll)`, which corresponds to `(Y-rotation,Z-rotation,X-rotation)`. <br> <br>The constructor method follows a specific order of declaration: `(pitch, yaw, roll)`, which corresponds to `(Y-rotation,Z-rotation,X-rotation)`. <br>
<br>![UE4_Rotation](https://d26ilriwvtzlb.cloudfront.net/8/83/BRMC_9.jpg) <br>![UE4_Rotation](/img/unreal_lhcs.png)
*Unreal Engine's coordinates system* *Unreal Engine's coordinates system*
# - PROPERTIES ------------------------- # - PROPERTIES -------------------------
instance_variables: instance_variables:
@ -438,20 +438,29 @@
- def_name: transform - def_name: transform
params: params:
- param_name: in_point - param_name: in_point
type: carla.Location type: carla.Vector3D
doc: > doc: >
Location in the space to which the transformation will be applied. Location in the space to which the transformation will be applied.
doc: > doc: >
Translates a 3D point from local to global coordinates using the current transformation as frame of reference. Translates a 3D point in place from local to global coordinates using the current transformation as frame of reference.
# --------------------------------------
- def_name: inverse_transform
params:
- param_name: in_point
type: carla.Vector3D
doc: >
Location in the space to which the inverse transformation will be applied.
doc: >
Applies the inverse of `transform` by translating a 3D point in place from global to local coordinates using the current transformation as frame of reference.
# -------------------------------------- # --------------------------------------
- def_name: transform_vector - def_name: transform_vector
params: params:
- param_name: in_vector - param_name: in_point
type: carla.Vector3D type: carla.Vector3D
doc: > doc: >
Vector to which the transformation will be applied. Vector to which the transformation will be applied.
doc: > doc: >
Rotates a vector using the current transformation as frame of reference, without applying translation. Use this to transform, for example, a velocity. Rotates a vector in place using the current transformation as frame of reference, without applying translation. Use this to transform, for example, a velocity.
# -------------------------------------- # --------------------------------------
- def_name: get_forward_vector - def_name: get_forward_vector
return: carla.Vector3D return: carla.Vector3D

View File

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

View File

@ -880,7 +880,7 @@
- class_name: GBufferTextureID - class_name: GBufferTextureID
# - DESCRIPTION ------------------------ # - DESCRIPTION ------------------------
doc: > 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 ------------------------- # - PROPERTIES -------------------------
instance_variables: instance_variables:
- var_name: SceneColor - var_name: SceneColor

View File

@ -17,6 +17,11 @@
type: int type: int
doc: > doc: >
Simulation frame in which the snapshot was taken. Simulation frame in which the snapshot was taken.
- var_name: elapsed_seconds
type: float
var_units: seconds
doc: >
Simulated seconds elapsed since the beginning of the current episode.
- var_name: timestamp - var_name: timestamp
type: carla.Timestamp type: carla.Timestamp
var_units: seconds var_units: seconds

View File

@ -7,7 +7,7 @@
# - DESCRIPTION ------------------------ # - DESCRIPTION ------------------------
doc: > 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. 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 ------------------------- # - PROPERTIES -------------------------
instance_variables: instance_variables:
- var_name: cloudiness - var_name: cloudiness

View File

@ -143,7 +143,7 @@
doc: > doc: >
Defines wether to use deterministic physics for pedestrian death animations or physical ragdoll simulation. 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 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 - var_name: tile_stream_distance
type: float type: float
doc: > doc: >
@ -538,7 +538,7 @@
default: None default: None
doc: > doc: >
The parent object that the spawned actor will follow around. The parent object that the spawned actor will follow around.
- param_name: attachment - param_name: attachment_type
type: carla.AttachmentType type: carla.AttachmentType
default: Rigid default: Rigid
doc: > doc: >
@ -562,7 +562,7 @@
default: None default: None
doc: > doc: >
The parent object that the spawned actor will follow around. The parent object that the spawned actor will follow around.
- param_name: attachment - param_name: attachment_type
type: carla.AttachmentType type: carla.AttachmentType
default: Rigid default: Rigid
doc: > doc: >
@ -744,7 +744,7 @@
doc: > doc: >
New conditions to be applied. New conditions to be applied.
doc: > 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 - def_name: cast_ray
return: list(carla.LabelledPoint) return: list(carla.LabelledPoint)
@ -831,7 +831,7 @@
Sets the seed to use for any random number generated in relation to pedestrians. Sets the seed to use for any random number generated in relation to pedestrians.
note: > note: >
Should be set before pedestrians are spawned. 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 - def_name: apply_color_texture_to_object
params: params:
@ -842,7 +842,7 @@
- param_name: texture - param_name: texture
type: TextureColor type: TextureColor
doc: > 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 - def_name: apply_float_color_texture_to_object
params: params:
@ -853,7 +853,7 @@
- param_name: texture - param_name: texture
type: TextureFloatColor type: TextureFloatColor
doc: > 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 - def_name: apply_textures_to_object
params: params:
@ -879,7 +879,7 @@
- param_name: texture - param_name: texture
type: TextureColor type: TextureColor
doc: > 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 - def_name: apply_float_color_texture_to_objects
params: params:
@ -890,7 +890,7 @@
- param_name: texture - param_name: texture
type: TextureFloatColor type: TextureFloatColor
doc: > 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 - def_name: apply_textures_to_objects
params: params:

View File

@ -685,11 +685,11 @@ class HUD(object):
self._show_ackermann_info = False self._show_ackermann_info = False
self._ackermann_control = carla.VehicleAckermannControl() self._ackermann_control = carla.VehicleAckermannControl()
def on_world_tick(self, timestamp): def on_world_tick(self, world_snapshot):
self._server_clock.tick() self._server_clock.tick()
self.server_fps = self._server_clock.get_fps() self.server_fps = self._server_clock.get_fps()
self.frame = timestamp.frame self.frame = world_snapshot.frame
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def tick(self, world, clock): def tick(self, world, clock):
self._notifications.tick(world, clock) self._notifications.tick(world, clock)

View File

@ -282,12 +282,12 @@ class HUD(object):
self._info_text = [] self._info_text = []
self._server_clock = pygame.time.Clock() self._server_clock = pygame.time.Clock()
def on_world_tick(self, timestamp): def on_world_tick(self, world_snapshot):
"""Gets informations from the world at every tick""" """Gets information from the world at every tick"""
self._server_clock.tick() self._server_clock.tick()
self.server_fps = self._server_clock.get_fps() self.server_fps = self._server_clock.get_fps()
self.frame = timestamp.frame_count self.frame = world_snapshot.frame
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def tick(self, world, clock): def tick(self, world, clock):
"""HUD method for every tick""" """HUD method for every tick"""

View File

@ -685,11 +685,12 @@ class HUD(object):
self._show_ackermann_info = False self._show_ackermann_info = False
self._ackermann_control = carla.VehicleAckermannControl() self._ackermann_control = carla.VehicleAckermannControl()
def on_world_tick(self, timestamp): def on_world_tick(self, world_snapshot):
"""Gets information from the world at every tick"""
self._server_clock.tick() self._server_clock.tick()
self.server_fps = self._server_clock.get_fps() self.server_fps = self._server_clock.get_fps()
self.frame = timestamp.frame self.frame = world_snapshot.frame
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def tick(self, world, clock): def tick(self, world, clock):
self._notifications.tick(world, clock) self._notifications.tick(world, clock)

View File

@ -575,11 +575,12 @@ class HUD(object):
self._info_text = [] self._info_text = []
self._server_clock = pygame.time.Clock() self._server_clock = pygame.time.Clock()
def on_world_tick(self, timestamp): def on_world_tick(self, world_snapshot):
"""Gets information from the world at every tick"""
self._server_clock.tick() self._server_clock.tick()
self.server_fps = self._server_clock.get_fps() self.server_fps = self._server_clock.get_fps()
self.frame = timestamp.frame self.frame = world_snapshot.frame
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def tick(self, world, clock): def tick(self, world, clock):
self._notifications.tick(world, clock) self._notifications.tick(world, clock)

View File

@ -594,11 +594,12 @@ class HUD(object):
self._info_text = [] self._info_text = []
self._server_clock = pygame.time.Clock() self._server_clock = pygame.time.Clock()
def on_world_tick(self, timestamp): def on_world_tick(self, world_snapshot):
"""Gets information from the world at every tick"""
self._server_clock.tick() self._server_clock.tick()
self.server_fps = self._server_clock.get_fps() self.server_fps = self._server_clock.get_fps()
self.frame = timestamp.frame self.frame = world_snapshot.frame
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def tick(self, world, clock): def tick(self, world, clock):
self._notifications.tick(world, clock) self._notifications.tick(world, clock)

View File

@ -399,11 +399,12 @@ class HUD(object):
self._info_text = [] self._info_text = []
self._server_clock = pygame.time.Clock() self._server_clock = pygame.time.Clock()
def on_world_tick(self, timestamp): def on_world_tick(self, world_snapshot):
"""Gets information from the world at every tick"""
self._server_clock.tick() self._server_clock.tick()
self.server_fps = self._server_clock.get_fps() self.server_fps = self._server_clock.get_fps()
self.frame = timestamp.frame self.frame = world_snapshot.frame
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def tick(self, world, clock): def tick(self, world, clock):
self._notifications.tick(world, clock) self._notifications.tick(world, clock)

View File

@ -993,7 +993,7 @@ class World(object):
# Register event for receiving server tick # Register event for receiving server tick
weak_self = weakref.ref(self) weak_self = weakref.ref(self)
self.world.on_tick(lambda timestamp: World.on_world_tick(weak_self, timestamp)) self.world.on_tick(lambda world_snapshot: World.on_world_tick(weak_self, world_snapshot))
def select_hero_actor(self): def select_hero_actor(self):
"""Selects only one hero actor if there are more than one. If there are not any, it will spawn one.""" """Selects only one hero actor if there are more than one. If there are not any, it will spawn one."""
@ -1081,7 +1081,7 @@ class World(object):
self._hud.add_info('HERO', hero_mode_text) self._hud.add_info('HERO', hero_mode_text)
@staticmethod @staticmethod
def on_world_tick(weak_self, timestamp): def on_world_tick(weak_self, world_snapshot):
"""Updates the server tick""" """Updates the server tick"""
self = weak_self() self = weak_self()
if not self: if not self:
@ -1089,7 +1089,7 @@ class World(object):
self.server_clock.tick() self.server_clock.tick()
self.server_fps = self.server_clock.get_fps() self.server_fps = self.server_clock.get_fps()
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def _show_nearby_vehicles(self, vehicles): def _show_nearby_vehicles(self, vehicles):
"""Shows nearby vehicles of the hero actor""" """Shows nearby vehicles of the hero actor"""

View File

@ -616,11 +616,12 @@ class HUD(object):
self._server_clock = pygame.time.Clock() self._server_clock = pygame.time.Clock()
self.rss_state_visualizer = RssStateVisualizer(self.dim, self._font_mono, self._world) self.rss_state_visualizer = RssStateVisualizer(self.dim, self._font_mono, self._world)
def on_world_tick(self, timestamp): def on_world_tick(self, world_snapshot):
"""Gets information from the world at every tick"""
self._server_clock.tick() self._server_clock.tick()
self.server_fps = self._server_clock.get_fps() self.server_fps = self._server_clock.get_fps()
self.frame = timestamp.frame self.frame = world_snapshot.frame
self.simulation_time = timestamp.elapsed_seconds self.simulation_time = world_snapshot.elapsed_seconds
def tick(self, player, clock): def tick(self, player, clock):
self._notifications.tick(clock) self._notifications.tick(clock)

View File

@ -138,7 +138,7 @@ LibCarla.client.rss.release: setup ad-rss
plugins: plugins:
@${CARLA_BUILD_TOOLS_FOLDER}/Plugins.sh $(ARGS) @${CARLA_BUILD_TOOLS_FOLDER}/Plugins.sh $(ARGS)
setup downloadplugins: setup: downloadplugins
@${CARLA_BUILD_TOOLS_FOLDER}/Setup.sh $(ARGS) @${CARLA_BUILD_TOOLS_FOLDER}/Setup.sh $(ARGS)
ad-rss: ad-rss: