diff --git a/CHANGELOG.md b/CHANGELOG.md index 92cc84046..de1bff42f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,18 @@ * Added vehicle doors to the recorder * Adjusted vehicle BoundingBox when the vehicle opens the doors. * Added functions to get actor' components transform + * Added posibility to Digital Twins to work with local files (osm and xodr) + * Enable proper material merging for Building in Digital Twins + * Added functions to get actor' bones transforms + * Added functions to get actor' bones and components names + * Added functions to get actor' sockets transforms + * make PythonAPI Windows: Fixed incompatibility issue with Anaconda due `py` command. + * Added function to get actor' sockets names + * Fixed bug in python agents when vehicle list was empty causing a check on all vehicles (BasicAgent.py) and detected pedestrians as vehicles if no pedestrains are present (BehaviourAgent.py) + * Extended debug drawing functions to allow drawing primitives on HUD layer + * Added possibility to change gravity variable in imui sensor for the accelerometer + * Fixed ROS2 native extension build error when ROS2 is installed in the system. + * ROS2Native: Force fast-dds dependencies download to avoid build crash when boost_asio and tinyxml2 are not installed in Linux. ## CARLA 0.9.15 @@ -31,6 +43,8 @@ * Fixed bug causing the `FPixelReader::SavePixelsToDisk(PixelData, FilePath)` function to crash due to pixel array not set correctly. * Fixed segfaults in Python API due to incorrect GIL locking under Python 3.10. * Fixed the import script, where could use any other TilesInfo.txt if the destination folder has many + * Fixed PythonAPI not installing on Debian due to deprecated function of distro in setup.py. Less ambiguous error for other posix platforms. + ## CARLA 0.9.14 diff --git a/Co-Simulation/Sumo/sumo_integration/sumo_simulation.py b/Co-Simulation/Sumo/sumo_integration/sumo_simulation.py index 7756ff80a..22aeb7474 100644 --- a/Co-Simulation/Sumo/sumo_integration/sumo_simulation.py +++ b/Co-Simulation/Sumo/sumo_integration/sumo_simulation.py @@ -301,7 +301,7 @@ def _get_sumo_net(cfg_file): net_file = os.path.join(os.path.dirname(cfg_file), tag.get('value')) logging.debug('Reading net file: %s', net_file) - sumo_net = traci.sumolib.net.readNet(net_file) + sumo_net = sumolib.net.readNet(net_file) return sumo_net class SumoSimulation(object): diff --git a/Docs/3rd_party_integrations.md b/Docs/3rd_party_integrations.md index 3cc66f839..87e5133e8 100644 --- a/Docs/3rd_party_integrations.md +++ b/Docs/3rd_party_integrations.md @@ -8,7 +8,7 @@ CARLA has been developed to integrate with several 3rd party applications in ord - [__Scenic__](tuto_G_scenic.md) - [__CarSIM__](tuto_G_carsim_integration.md) - [__Chrono__](tuto_G_chrono.md) -- [__OpenDRIVE__](adv_opendrive.md) +- [__ASAM OpenDRIVE__](adv_opendrive.md) - [__PTV Vissim__](adv_ptv.md) - [__RSS__](adv_rss.md) - [__AWS and RLlib__](tuto_G_rllib_integration.md) @@ -59,9 +59,9 @@ CARLA's integration with CarSim allows vehicle controls in CARLA to be forwarded Learn how to use CARLA alongside CarSIM [here](tuto_G_carsim_integration.md). -## OpenDRIVE +## ASAM OpenDRIVE -[__OpenDRIVE__](https://www.asam.net/standards/detail/opendrive/) is an open format specification used to describe the logic of a road network intended to standardise the discription of road networks in digital format and allow different applications to exchange data on road networks. Please refer to the full documentation [__here__](adv_opendrive.md) +[__ASAM OpenDRIVE__](https://www.asam.net/standards/detail/opendrive/) is an open format specification used to describe the logic of a road network intended to standardise the discription of road networks in digital format and allow different applications to exchange data on road networks. Please refer to the full documentation [__here__](adv_opendrive.md) ## RSS - Responsibility Sensitive Safety diff --git a/Docs/adv_digital_twin.md b/Docs/adv_digital_twin.md index d46177fac..8c06a4013 100644 --- a/Docs/adv_digital_twin.md +++ b/Docs/adv_digital_twin.md @@ -17,7 +17,26 @@ The __Digital Twin Tool__ enables procedural generation of unique 3D environment ## 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. 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`. Windows users do not have the option of using the OSM renderer and must use directly a URL. +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: + +```bash +if [[ -x ../Import/src/Import ]]; then + importExe=../Import/src/Import +elif [[ -x ../debug/Import/Import ]]; then + importExe=../debug/Import/Import +elif [[ -x ../build/Import/Import ]]; then + importExe=../build/Import/Import +################### Add this line #################### +elif [ -x ../../libosmscout-build/Import/Import ]; then + importExe=../../libosmscout-build/Import/Import +####################################################### +else + echo "Cannot find Import executable!" + exit 1 +fi +``` + +Then continue to build CARLA in the normal way. Windows users do not have the option of using the OSM renderer and must directly the URL. ## Downloading and preparing OSM map data diff --git a/Docs/adv_multigpu.md b/Docs/adv_multigpu.md index 52b312ee9..c764075bb 100644 --- a/Docs/adv_multigpu.md +++ b/Docs/adv_multigpu.md @@ -16,11 +16,11 @@ The parameters we can use are: For example -**./CarlaUE4.sh --nullrhi** +**./CarlaUE4.sh -nullrhi** The primary server will use by default the port 2002 to listen for secondary servers. If you need to listen on another port, then you can change it with the flag -**./CarlaUE4.sh --nullrhi -carla-primary-port=3002** +**./CarlaUE4.sh -nullrhi -carla-primary-port=3002** ## Secondary servers diff --git a/Docs/adv_opendrive.md b/Docs/adv_opendrive.md index eda1d1ef6..7e3575c9c 100644 --- a/Docs/adv_opendrive.md +++ b/Docs/adv_opendrive.md @@ -1,6 +1,6 @@ -# OpenDRIVE standalone mode +# ASAM OpenDRIVE standalone mode -This feature allows users to ingest any OpenDRIVE file as a CARLA map out-of-the-box. In order to do so, the simulator will automatically generate a road mesh for actors to navigate through. +This feature allows users to ingest any ASAM OpenDRIVE file as a CARLA map out-of-the-box. In order to do so, the simulator will automatically generate a road mesh for actors to navigate through. * [__Overview__](#overview) * [__Run a standalone map__](#run-a-standalone-map) @@ -26,9 +26,9 @@ Traffic lights, stops and yields will be generated on the fly. Pedestrians will --- ## Run a standalone map -Open an OpenDRIVE file is just a matter of calling [`client.generate_opendrive_world()`](python_api.md#carla.Client.generate_opendrive_world) through the API. This will generate the new map, and block the simulation until it is ready. The method needs for two parameters. +Open an ASAM OpenDRIVE file is just a matter of calling [`client.generate_opendrive_world()`](python_api.md#carla.Client.generate_opendrive_world) through the API. This will generate the new map, and block the simulation until it is ready. The method needs for two parameters. -* __`opendrive`__ is the content of the OpenDRIVE file parsed as a string. +* __`opendrive`__ is the content of the ASAM OpenDRIVE file parsed as a string. * __`parameters`__ is a [carla.OpendriveGenerationParameters](python_api.md#carla.OpendriveGenerationParameters) containing settings for the generation of the mesh. __This argument is optional__. * __`vertex_distance`__ *(default 2.0 meters)* — Distance between the vertices of the mesh. The bigger, the distance, the more inaccurate the mesh will be. However, if the distance is too small, the resulting mesh will be too heavy to work with. diff --git a/Docs/build_faq.md b/Docs/build_faq.md index 27ce114dc..5007e8b6f 100644 --- a/Docs/build_faq.md +++ b/Docs/build_faq.md @@ -76,7 +76,7 @@ CARLA forum > CARLA is a performance demanding software. At the very minimum it requires a 6GB GPU or, even better, a dedicated GPU capable of running Unreal Engine. > -> Take a look at [Unreal Engine's recommended hardware](https://www.ue4community.wiki/recommended-hardware-x1p9qyg0). +> Take a look at [Unreal Engine's recommended hardware](https://dev.epicgames.com/documentation/en-us/unreal-engine/hardware-and-software-specifications-for-unreal-engine). --- @@ -365,7 +365,7 @@ CARLA forum >In Windows it will be the default Python version for: -> py -3 --version +> python --version >Make sure you are running your scripts with the version of Python that corresponds to your `.egg` file. >In Linux, you may also need to set your Python path to point to the CARLA `.egg`. To do this, run the following command: diff --git a/Docs/core_concepts.md b/Docs/core_concepts.md index 047588653..895647273 100644 --- a/Docs/core_concepts.md +++ b/Docs/core_concepts.md @@ -37,7 +37,7 @@ __Blueprints__ are already-made actor layouts necessary to spawn an actor. Basic ### 3rd- Maps and navigation -__The map__ is the object representing the simulated world, the town mostly. There are eight maps available. All of them use OpenDRIVE 1.4 standard to describe the roads. +__The map__ is the object representing the simulated world, the town mostly. There are eight maps available. All of them use ASAM OpenDRIVE 1.4 standard to describe the roads. __Roads, lanes and junctions__ are managed by the [Python API](python_api.md) to be accessed from the client. These are used along with the __waypoint__ class to provide vehicles with a navigation path. diff --git a/Docs/core_map.md b/Docs/core_map.md index d15b6c9d5..e59f9f473 100644 --- a/Docs/core_map.md +++ b/Docs/core_map.md @@ -23,6 +23,7 @@ After discussing about the world and its actors, it is time to put everything in - [Add map package](tuto_M_add_map_package.md) - [Add map source](tuto_M_add_map_source.md) - [Alternative methods](tuto_M_add_map_alternative.md) +- [__Additional maps__](#additional-maps) --- @@ -257,6 +258,9 @@ Non-layered maps are shown in the table below (click the town name to see an ove | [__Town11__](map_town11.md) | A Large Map that is undecorated. Serves as a proof of concept for the Large Maps feature. | | [__Town12__](map_town12.md) | A Large Map with numerous different regions, including high-rise, residential and rural environments.| +!!! note + Town06 and Town07 are additional content which does not come with the standard CARLA package. Please see the [additional maps section](#additional-maps) for details on how to import these. + ### Layered maps The layout of layered maps is the same as non-layered maps but it is possible to toggle off and on the layers of the map. There is a minimum layout that cannot be toggled off and consists of roads, sidewalks, traffic lights and traffic signs. Layered maps can be identified by the suffix `_Opt`, for example, `Town01_Opt`. With these maps it is possible to [load][load_layer] and [unload][unload_layer] layers via the Python API: @@ -291,3 +295,27 @@ CARLA is designed to be extensible and highly customisable for specialist applic * [__Add map package__](tuto_M_add_map_package.md) * [__Add map source__](tuto_M_add_map_source.md) * [__Alternative methods__](tuto_M_add_map_alternative.md) + +## Additional maps + +Each release has it's own additional package of extra assets and maps. This additional package includes the maps __Town06__ and __Town07__. These are stored separately to reduce the size of the build, so they can only be imported after the main package has been installed. + +__1.__ [Download](https://github.com/carla-simulator/carla/blob/master/Docs/download.md) the appropriate package for your desired version of CARLA. + +__2.__ Extract the package: + +- __On Linux__: + + - move the package to the _Import_ folder and run the following script to extract the contents: + +```sh + cd path/to/carla/root + + ./ImportAssets.sh +``` + +- __On Windows__: + + - Extract the contents directly in the root folder. + +--- diff --git a/Docs/python_api.md b/Docs/python_api.md index 31d387b71..3cf5203b7 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -434,7 +434,13 @@ Enum declaration that contains the different tags available to filter the boundi - **Sidewalks** - **TrafficSigns** - **Vegetation** -- **Vehicles** +- **Car** +- **Bus** +- **Truck** +- **Motorcycle** +- **Bicycle** +- **Rider** +- **Train** - **Walls** - **Sky** - **Ground** @@ -475,7 +481,7 @@ Executes a list of commands on a single simulation step, blocks until the comman - **generate_opendrive_world**(**self**, **opendrive**, **parameters**=(2.0, 50.0, 1.0, 0.6, true, true), **reset_settings**=True) Loads a new world with a basic 3D topology generated from the content of an OpenDRIVE file. This content is passed as a `string` parameter. It is similar to `client.load_world(map_name)` but allows for custom OpenDRIVE maps in server side. Cars can drive around the map, but there are no graphics besides the road and sidewalks. - **Parameters:** - - `opendrive` (_str_) - Content of an OpenDRIVE file as `string`, __not the path to the `.xodr`__. + - `opendrive` (_str_) - Content of an ASAM OpenDRIVE file as `string`, __not the path to the `.xodr`__. - `parameters` (_[carla.OpendriveGenerationParameters](#carla.OpendriveGenerationParameters)_) - Additional settings for the mesh generation. If none are provided, default values will be used. - `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios. - **load_world**(**self**, **map_name**, **reset_settings**=True, **map_layers**=[carla.MapLayer.All](#carla.MapLayer.All)) @@ -484,12 +490,23 @@ Creates a new world with default settings using `map_name` map. All actors in th - `map_name` (_str_) - Name of the map to be used in this world. Accepts both full paths and map names, e.g. '/Game/Carla/Maps/Town01' or 'Town01'. Remember that these paths are dynamic. - `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios. - `map_layers` (_[carla.MapLayer](#carla.MapLayer)_) - Layers of the map that will be loaded. By default all layers are loaded. This parameter works like a flag mask. + - **Return:** _[carla.World](#carla.World)_ + - **Warning:** _`map_layers` are only available for "Opt" maps +_ +- **load_world_if_different**(**self**, **map_name**, **reset_settings**=True, **map_layers**=[carla.MapLayer.All](#carla.MapLayer.All)) +Creates a new world with default settings using `map_name` map only if it is a different map from the currently loaded map. Otherwise this function returns `None`. All actors in the current world will be destroyed. + - **Parameters:** + - `map_name` (_str_) - Name of the map to be used in this world. Accepts both full paths and map names, e.g. '/Game/Carla/Maps/Town01' or 'Town01'. Remember that these paths are dynamic. + - `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios. + - `map_layers` (_[carla.MapLayer](#carla.MapLayer)_) - Layers of the map that will be loaded. By default all layers are loaded. This parameter works like a flag mask. + - **Return:** _[carla.World](#carla.World)_ - **Warning:** _`map_layers` are only available for "Opt" maps _ - **reload_world**(**self**, **reset_settings**=True) Reload the current world, note that a new world is created with default settings using the same map. All actors present in the world will be destroyed, __but__ traffic manager instances will stay alive. - **Parameters:** - `reset_settings` (_bool_) - Option to reset the episode setting to default values, set to false to keep the current settings. This is useful to keep sync mode when changing map and to keep deterministic scenarios. + - **Return:** _[carla.World](#carla.World)_ - **Raises:** RuntimeError when corresponding. - **replay_file**(**self**, **name**, **start**, **duration**, **follow_id**, **replay_sensors**) Load a new world with default settings using `map_name` map. All actors present in the current world will be destroyed, __but__ traffic manager instances will stay alive. @@ -722,13 +739,45 @@ Draws an arrow from `begin` to `end` pointing in that direction. - `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default. - `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes. - **draw_box**(**self**, **box**, **rotation**, **thickness**=0.1, **color**=(255,0,0), **life_time**=-1.0) -Draws a box, ussually to act for object colliders. +Draws a box, usually to act for object colliders. - **Parameters:** - `box` (_[carla.BoundingBox](#carla.BoundingBox)_) - Object containing a location and the length of a box for every axis. - `rotation` (_[carla.Rotation](#carla.Rotation) - degrees (pitch,yaw,roll)_) - Orientation of the box according to Unreal Engine's axis system. - `thickness` (_float - meters_) - Density of the lines that define the box. - `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default. - `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_hud_arrow**(**self**, **begin**, **end**, **thickness**=0.1, **arrow_size**=0.1, **color**=(255,0,0), **life_time**=-1.0) +Draws an arrow on the HUD from `begin` to `end` which can only be seen server-side. + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location) - meters_) - Point in the coordinate system where the arrow starts. + - `end` (_[carla.Location](#carla.Location) - meters_) - Point in the coordinate system where the arrow ends and points towards to. + - `thickness` (_float - meters_) - Density of the line. + - `arrow_size` (_float - meters_) - Size of the tip of the arrow. + - `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default. + - `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_hud_box**(**self**, **box**, **rotation**, **thickness**=0.1, **color**=(255,0,0), **life_time**=-1.0) +Draws a box on the HUD, usually to act for object colliders. The box can only be seen server-side. + - **Parameters:** + - `box` (_[carla.BoundingBox](#carla.BoundingBox)_) - Object containing a location and the length of a box for every axis. + - `rotation` (_[carla.Rotation](#carla.Rotation) - degrees (pitch,yaw,roll)_) - Orientation of the box according to Unreal Engine's axis system. + - `thickness` (_float - meters_) - Density of the lines that define the box. + - `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default. + - `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_hud_line**(**self**, **begin**, **end**, **thickness**=0.1, **color**=(255,0,0), **life_time**=-1.0) +Draws a line on the HUD in between `begin` and `end`. The line can only be seen server-side. + - **Parameters:** + - `begin` (_[carla.Location](#carla.Location) - meters_) - Point in the coordinate system where the line starts. + - `end` (_[carla.Location](#carla.Location) - meters_) - Spot in the coordinate system where the line ends. + - `thickness` (_float - meters_) - Density of the line. + - `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default. + - `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes. +- **draw_hud_point**(**self**, **location**, **size**=0.1, **color**=(255,0,0), **life_time**=-1.0) +Draws a point on the HUD at `location`. The point can only be seen server-side. + - **Parameters:** + - `location` (_[carla.Location](#carla.Location) - meters_) - Spot in the coordinate system to center the object. + - `size` (_float - meters_) - Density of the point. + - `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default. + - `life_time` (_float - seconds_) - Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes. - **draw_line**(**self**, **begin**, **end**, **thickness**=0.1, **color**=(255,0,0), **life_time**=-1.0) Draws a line in between `begin` and `end`. - **Parameters:** @@ -1706,7 +1755,7 @@ Distance between `actor` and `other`. --- ## carla.OpendriveGenerationParameters -This class defines the parameters used when generating a world using an OpenDRIVE file. +This class defines the parameters used when generating a world using an ASAM OpenDRIVE file. ### Instance Variables - **vertex_distance** (_float_) @@ -2202,6 +2251,12 @@ Sensors compound a specific family of actors quite diverse and unique. They are When True the sensor will be waiting for data. ### Methods +- **disable_for_ros**(**self**) +Commands the sensor to not be processed for publishing in ROS2 if there is no any listen to it. +- **enable_for_ros**(**self**) +Commands the sensor to be processed to be able to publish in ROS2 without any listen to it. +- **is_enabled_for_ros**(**self**) +Returns if the sensor is enabled or not to publish in ROS2 if there is no any listen to it. - **is_listening**(**self**) Returns whether the sensor is in a listening state. - **is_listening_gbuffer**(**self**, **gbuffer_id**) @@ -3733,9 +3788,9 @@ When enabled, the simulation will run no rendering at all. This is mainly used t - **fixed_delta_seconds** (_float_) Ensures that the time elapsed between two steps of the simulation is fixed. Set this to 0.0 to work with a variable time-step, as happens by default. - **substepping** (_bool_) -Enable the physics substepping. This option allows computing some physics substeps between two render frames. If synchronous mode is set, the number of substeps and its time interval are fixed and computed are so they fulfilled the requirements of [carla.WorldSettings.max_substep](#carla.WorldSettings.max_substep) and [carla.WorldSettings.max_substep_delta_time](#carla.WorldSettings.max_substep_delta_time). These last two parameters need to be compatible with [carla.WorldSettings.fixed_delta_seconds](#carla.WorldSettings.fixed_delta_seconds). Enabled by default. +Enable the physics substepping. This option allows computing some physics substeps between two render frames. If synchronous mode is set, the number of substeps and its time interval are fixed and computed are so they fulfilled the requirements of [carla.WorldSettings.max_substeps](#carla.WorldSettings.max_substeps) and [carla.WorldSettings.max_substep_delta_time](#carla.WorldSettings.max_substep_delta_time). These last two parameters need to be compatible with [carla.WorldSettings.fixed_delta_seconds](#carla.WorldSettings.fixed_delta_seconds). Enabled by default. - **max_substep_delta_time** (_float_) -Maximum delta time of the substeps. If the [carla.WorldSettingsmax_substep](#carla.WorldSettingsmax_substep) is high enough, the substep delta time would be always below or equal to this value. By default, the value is set to 0.01. +Maximum delta time of the substeps. If the [carla.WorldSettings.max_substeps](#carla.WorldSettings.max_substeps) is high enough, the substep delta time would be always below or equal to this value. By default, the value is set to 0.01. - **max_substeps** (_int_) The maximum number of physics substepping that are allowed. By default, the value is set to 10. - **max_culling_distance** (_float_) @@ -4034,6 +4089,11 @@ Actor affected by the command. --- +## command.FutureActor +A utility object used to reference an actor that will be created in the command in the previous step, it has no parameters or methods. + +--- + ## command.Response States the result of executing a command as either the ID of the actor to whom the command was applied to (when succeeded) or an error string (when failed). actor ID, depending on whether or not the command succeeded. The method __apply_batch_sync()__ in [carla.Client](#carla.Client) returns a list of these to summarize the execution of a batch. @@ -4188,33 +4248,29 @@ document.getElementById("snipets-container").innerHTML = null; } -