diff --git a/CHANGELOG.md b/CHANGELOG.md
index 92cc8404604..de1bff42f2d 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 7756ff80a3a..22aeb7474e9 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 3cc66f83908..87e5133e849 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 d46177face0..8c06a4013e7 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 52b312ee9f1..c764075bbf8 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 eda1d1ef6c6..7e3575c9ca2 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 27ce114dcda..5007e8b6f0f 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 0475886537a..895647273af 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 d15b6c9d5c3..e59f9f47377 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 31d387b7176..3cf5203b725 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;
}
-
+
-Snippet for carla.World.enable_environment_objects
+Snippet for carla.World.unload_map_layer
-
+
```py
-# This recipe turn visibility off and on for two specifc buildings on the map
+# This recipe toggles off several layers in our "_Opt" maps
-# Get the buildings in the world
-world = client.get_world()
-env_objs = world.get_environment_objects(carla.CityObjectLabel.Buildings)
+# Load town one with minimum layout (roads, sidewalks, traffic lights and traffic signs)
+# as well as buildings and parked vehicles
+world = client.load_world('Town01_Opt', carla.MapLayer.Buildings | carla.MapLayer.ParkedVehicles)
-# Access individual building IDs and save in a set
-building_01 = env_objs[0]
-building_02 = env_objs[1]
-objects_to_toggle = {building_01.id, building_02.id}
+# Toggle all buildings off
+world.unload_map_layer(carla.MapLayer.Buildings)
-# Toggle buildings off
-world.enable_environment_objects(objects_to_toggle, False)
-# Toggle buildings on
-world.enable_environment_objects(objects_to_toggle, True)
+# Toggle all parked vehicles off
+world.unload_map_layer(carla.MapLayer.ParkedVehicles)
```
-
+
@@ -4257,219 +4313,172 @@ while True:
-
+
-Snippet for carla.World.unload_map_layer
+Snippet for carla.ActorBlueprint.set_attribute
-
+
```py
-# This recipe toggles off several layers in our "_Opt" maps
-
-# Load town one with minimum layout (roads, sidewalks, traffic lights and traffic signs)
-# as well as buildings and parked vehicles
-world = client.load_world('Town01_Opt', carla.MapLayer.Buildings | carla.MapLayer.ParkedVehicles)
-# Toggle all buildings off
-world.unload_map_layer(carla.MapLayer.Buildings)
+# This recipe changes attributes of different type of blueprint actors.
-# Toggle all parked vehicles off
-world.unload_map_layer(carla.MapLayer.ParkedVehicles)
-
+# ...
+walker_bp = world.get_blueprint_library().filter('walker.pedestrian.0002')
+walker_bp.set_attribute('is_invincible', True)
-```
-
-
-
-
-
-
-Snippet for carla.Vehicle.set_wheel_steer_direction
-
-
+# ...
+# Changes attribute randomly by the recommended value
+vehicle_bp = wolrd.get_blueprint_library().filter('vehicle.bmw.*')
+color = random.choice(vehicle_bp.get_attribute('color').recommended_values)
+vehicle_bp.set_attribute('color', color)
-```py
-
-# Sets the appearance of the vehicles front wheels to 40°. Vehicle physics will not be affected.
+# ...
-vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FR_Wheel, 40.0)
-vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FL_Wheel, 40.0)
+camera_bp = world.get_blueprint_library().filter('sensor.camera.rgb')
+camera_bp.set_attribute('image_size_x', 600)
+camera_bp.set_attribute('image_size_y', 600)
+# ...
```
-
+
-
+
-Snippet for carla.Client.__init__
+Snippet for carla.World.get_spectator
-
+
```py
-# This recipe shows in every script provided in PythonAPI/Examples
-# and it is used to parse the client creation arguments when running the script.
-
- argparser = argparse.ArgumentParser(
- description=__doc__)
- argparser.add_argument(
- '--host',
- metavar='H',
- default='127.0.0.1',
- help='IP of the host server (default: 127.0.0.1)')
- argparser.add_argument(
- '-p', '--port',
- metavar='P',
- default=2000,
- type=int,
- help='TCP port to listen to (default: 2000)')
- argparser.add_argument(
- '-s', '--speed',
- metavar='FACTOR',
- default=1.0,
- type=float,
- help='rate at which the weather changes (default: 1.0)')
- args = argparser.parse_args()
-
- speed_factor = args.speed
- update_freq = 0.1 / speed_factor
-
- client = carla.Client(args.host, args.port)
+# This recipe spawns an actor and the spectator camera at the actor's location.
-
+# ...
+world = client.get_world()
+spectator = world.get_spectator()
-```
-
-
-
-
-
-
-Snippet for carla.Map.get_waypoint
-
-
+vehicle_bp = random.choice(world.get_blueprint_library().filter('vehicle.bmw.*'))
+transform = random.choice(world.get_map().get_spawn_points())
+vehicle = world.try_spawn_actor(vehicle_bp, transform)
-```py
-
+# Wait for world to get the vehicle actor
+world.tick()
-# This recipe shows the current traffic rules affecting the vehicle.
-# Shows the current lane type and if a lane change can be done in the actual lane or the surrounding ones.
+world_snapshot = world.wait_for_tick()
+actor_snapshot = world_snapshot.find(vehicle.id)
-# ...
-waypoint = world.get_map().get_waypoint(vehicle.get_location(),project_to_road=True, lane_type=(carla.LaneType.Driving | carla.LaneType.Shoulder | carla.LaneType.Sidewalk))
-print("Current lane type: " + str(waypoint.lane_type))
-# Check current lane change allowed
-print("Current Lane change: " + str(waypoint.lane_change))
-# Left and Right lane markings
-print("L lane marking type: " + str(waypoint.left_lane_marking.type))
-print("L lane marking change: " + str(waypoint.left_lane_marking.lane_change))
-print("R lane marking type: " + str(waypoint.right_lane_marking.type))
-print("R lane marking change: " + str(waypoint.right_lane_marking.lane_change))
+# Set spectator at given transform (vehicle transform)
+spectator.set_transform(actor_snapshot.get_transform())
# ...
```
-
-
-
-
+
-
+
-Snippet for carla.World.spawn_actor
+Snippet for carla.Sensor.listen
-
+
```py
-# This recipe attaches different camera / sensors to a vehicle with different attachments.
+# This recipe applies a color conversion to the image taken by a camera sensor,
+# so it is converted to a semantic segmentation image.
# ...
-camera = world.spawn_actor(rgb_camera_bp, transform, attach_to=vehicle, attachment_type=Attachment.Rigid)
-# Default attachment: Attachment.Rigid
-gnss_sensor = world.spawn_actor(sensor_gnss_bp, transform, attach_to=vehicle)
-collision_sensor = world.spawn_actor(sensor_collision_bp, transform, attach_to=vehicle)
-lane_invasion_sensor = world.spawn_actor(sensor_lane_invasion_bp, transform, attach_to=vehicle)
+camera_bp = world.get_blueprint_library().filter('sensor.camera.semantic_segmentation')
+# ...
+cc = carla.ColorConverter.CityScapesPalette
+camera.listen(lambda image: image.save_to_disk('output/%06d.png' % image.frame, cc))
# ...
```
-
+
-
+
-Snippet for carla.WalkerAIController.stop
+Snippet for carla.World.load_map_layer
-
+
```py
+# This recipe toggles on several layers in our "_Opt" maps
-#To destroy the pedestrians, stop them from the navigation, and then destroy the objects (actor and controller).
+# Load town one with only minimum layout (roads, sidewalks, traffic lights and traffic signs)
+world = client.load_world('Town01_Opt', carla.MapLayer.None)
-# stop pedestrians (list is [controller, actor, controller, actor ...])
-for i in range(0, len(all_id), 2):
- all_actors[i].stop()
+# Toggle all buildings on
+world.load_map_layer(carla.MapLayer.Buildings)
-# destroy pedestrian (actor and controller)
-client.apply_batch([carla.command.DestroyActor(x) for x in all_id])
+# Toggle all foliage on
+world.load_map_layer(carla.MapLayer.Foliage)
+
+# Toggle all parked vehicles on
+world.load_map_layer(carla.MapLayer.ParkedVehicles)
```
-
+
-
+
-Snippet for carla.DebugHelper.draw_box
+Snippet for carla.Map.get_waypoint
-
+
```py
-# This recipe shows how to draw traffic light actor bounding boxes from a world snapshot.
-
-# ....
-debug = world.debug
-world_snapshot = world.get_snapshot()
+# This recipe shows the current traffic rules affecting the vehicle.
+# Shows the current lane type and if a lane change can be done in the actual lane or the surrounding ones.
-for actor_snapshot in world_snapshot:
- actual_actor = world.get_actor(actor_snapshot.id)
- if actual_actor.type_id == 'traffic.traffic_light':
- debug.draw_box(carla.BoundingBox(actor_snapshot.get_transform().location,carla.Vector3D(0.5,0.5,2)),actor_snapshot.get_transform().rotation, 0.05, carla.Color(255,0,0,0),0)
# ...
-
+waypoint = world.get_map().get_waypoint(vehicle.get_location(),project_to_road=True, lane_type=(carla.LaneType.Driving | carla.LaneType.Shoulder | carla.LaneType.Sidewalk))
+print("Current lane type: " + str(waypoint.lane_type))
+# Check current lane change allowed
+print("Current Lane change: " + str(waypoint.lane_change))
+# Left and Right lane markings
+print("L lane marking type: " + str(waypoint.left_lane_marking.type))
+print("L lane marking change: " + str(waypoint.left_lane_marking.lane_change))
+print("R lane marking type: " + str(waypoint.right_lane_marking.type))
+print("R lane marking change: " + str(waypoint.right_lane_marking.lane_change))
+# ...
```
-
+
-
+
-
+
-Snippet for carla.World.get_spectator
+Snippet for carla.TrafficLight.set_state
-
+
```py
-# This recipe spawns an actor and the spectator camera at the actor's location.
+# This recipe changes from red to green the traffic light that affects the vehicle.
+# This is done by detecting if the vehicle actor is at a traffic light.
# ...
world = client.get_world()
@@ -4487,116 +4496,95 @@ actor_snapshot = world_snapshot.find(vehicle.id)
# Set spectator at given transform (vehicle transform)
spectator.set_transform(actor_snapshot.get_transform())
+# ...# ...
+if vehicle_actor.is_at_traffic_light():
+ traffic_light = vehicle_actor.get_traffic_light()
+ if traffic_light.get_state() == carla.TrafficLightState.Red:
+ # world.hud.notification("Traffic light changed! Good to go!")
+ traffic_light.set_state(carla.TrafficLightState.Green)
# ...
+
```
-
+
+
+
+
-
+
-Snippet for carla.Sensor.listen
+Snippet for carla.Vehicle.set_wheel_steer_direction
-
+
```py
+# Sets the appearance of the vehicles front wheels to 40°. Vehicle physics will not be affected.
-# This recipe applies a color conversion to the image taken by a camera sensor,
-# so it is converted to a semantic segmentation image.
-
-# ...
-camera_bp = world.get_blueprint_library().filter('sensor.camera.semantic_segmentation')
-# ...
-cc = carla.ColorConverter.CityScapesPalette
-camera.listen(lambda image: image.save_to_disk('output/%06d.png' % image.frame, cc))
-# ...
+vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FR_Wheel, 40.0)
+vehicle.set_wheel_steer_direction(carla.VehicleWheelLocation.FL_Wheel, 40.0)
```
-
+
-
+
-Snippet for carla.TrafficLight.set_state
+Snippet for carla.DebugHelper.draw_box
-
+
```py
-# This recipe changes from red to green the traffic light that affects the vehicle.
-# This is done by detecting if the vehicle actor is at a traffic light.
-
-# ...
-world = client.get_world()
-spectator = world.get_spectator()
-
-vehicle_bp = random.choice(world.get_blueprint_library().filter('vehicle.bmw.*'))
-transform = random.choice(world.get_map().get_spawn_points())
-vehicle = world.try_spawn_actor(vehicle_bp, transform)
-
-# Wait for world to get the vehicle actor
-world.tick()
+# This recipe shows how to draw traffic light actor bounding boxes from a world snapshot.
-world_snapshot = world.wait_for_tick()
-actor_snapshot = world_snapshot.find(vehicle.id)
+# ....
+debug = world.debug
+world_snapshot = world.get_snapshot()
-# Set spectator at given transform (vehicle transform)
-spectator.set_transform(actor_snapshot.get_transform())
-# ...# ...
-if vehicle_actor.is_at_traffic_light():
- traffic_light = vehicle_actor.get_traffic_light()
- if traffic_light.get_state() == carla.TrafficLightState.Red:
- # world.hud.notification("Traffic light changed! Good to go!")
- traffic_light.set_state(carla.TrafficLightState.Green)
+for actor_snapshot in world_snapshot:
+ actual_actor = world.get_actor(actor_snapshot.id)
+ if actual_actor.type_id == 'traffic.traffic_light':
+ debug.draw_box(carla.BoundingBox(actor_snapshot.get_transform().location,carla.Vector3D(0.5,0.5,2)),actor_snapshot.get_transform().rotation, 0.05, carla.Color(255,0,0,0),0)
# ...
```
-
+
-
+
-
+
-Snippet for carla.ActorBlueprint.set_attribute
+Snippet for carla.WalkerAIController.stop
-
+
```py
-# This recipe changes attributes of different type of blueprint actors.
-
-# ...
-walker_bp = world.get_blueprint_library().filter('walker.pedestrian.0002')
-walker_bp.set_attribute('is_invincible', True)
-
-# ...
-# Changes attribute randomly by the recommended value
-vehicle_bp = wolrd.get_blueprint_library().filter('vehicle.bmw.*')
-color = random.choice(vehicle_bp.get_attribute('color').recommended_values)
-vehicle_bp.set_attribute('color', color)
+#To destroy the pedestrians, stop them from the navigation, and then destroy the objects (actor and controller).
-# ...
+# stop pedestrians (list is [controller, actor, controller, actor ...])
+for i in range(0, len(all_id), 2):
+ all_actors[i].stop()
-camera_bp = world.get_blueprint_library().filter('sensor.camera.rgb')
-camera_bp.set_attribute('image_size_x', 600)
-camera_bp.set_attribute('image_size_y', 600)
-# ...
+# destroy pedestrian (actor and controller)
+client.apply_batch([carla.command.DestroyActor(x) for x in all_id])
```
-
+
@@ -4673,31 +4661,103 @@ for i in range(0, len(all_actors), 2):
-
+
-Snippet for carla.World.load_map_layer
+Snippet for carla.World.enable_environment_objects
-
+
```py
-# This recipe toggles on several layers in our "_Opt" maps
+# This recipe turn visibility off and on for two specifc buildings on the map
-# Load town one with only minimum layout (roads, sidewalks, traffic lights and traffic signs)
-world = client.load_world('Town01_Opt', carla.MapLayer.None)
+# Get the buildings in the world
+world = client.get_world()
+env_objs = world.get_environment_objects(carla.CityObjectLabel.Buildings)
-# Toggle all buildings on
-world.load_map_layer(carla.MapLayer.Buildings)
+# Access individual building IDs and save in a set
+building_01 = env_objs[0]
+building_02 = env_objs[1]
+objects_to_toggle = {building_01.id, building_02.id}
-# Toggle all foliage on
-world.load_map_layer(carla.MapLayer.Foliage)
+# Toggle buildings off
+world.enable_environment_objects(objects_to_toggle, False)
+# Toggle buildings on
+world.enable_environment_objects(objects_to_toggle, True)
+
+
+```
+
+
+
+
+
+
+Snippet for carla.Client.__init__
+
+
+
+```py
+
+
+# This recipe shows in every script provided in PythonAPI/Examples
+# and it is used to parse the client creation arguments when running the script.
+
+ argparser = argparse.ArgumentParser(
+ description=__doc__)
+ argparser.add_argument(
+ '--host',
+ metavar='H',
+ default='127.0.0.1',
+ help='IP of the host server (default: 127.0.0.1)')
+ argparser.add_argument(
+ '-p', '--port',
+ metavar='P',
+ default=2000,
+ type=int,
+ help='TCP port to listen to (default: 2000)')
+ argparser.add_argument(
+ '-s', '--speed',
+ metavar='FACTOR',
+ default=1.0,
+ type=float,
+ help='rate at which the weather changes (default: 1.0)')
+ args = argparser.parse_args()
+
+ speed_factor = args.speed
+ update_freq = 0.1 / speed_factor
+
+ client = carla.Client(args.host, args.port)
-# Toggle all parked vehicles on
-world.load_map_layer(carla.MapLayer.ParkedVehicles)
```
-
+
+
+
+
+
+
+Snippet for carla.World.spawn_actor
+
+
+
+```py
+
+
+# This recipe attaches different camera / sensors to a vehicle with different attachments.
+
+# ...
+camera = world.spawn_actor(rgb_camera_bp, transform, attach_to=vehicle, attachment_type=Attachment.Rigid)
+# Default attachment: Attachment.Rigid
+gnss_sensor = world.spawn_actor(sensor_gnss_bp, transform, attach_to=vehicle)
+collision_sensor = world.spawn_actor(sensor_collision_bp, transform, attach_to=vehicle)
+lane_invasion_sensor = world.spawn_actor(sensor_lane_invasion_bp, transform, attach_to=vehicle)
+# ...
+
+
+```
+
@@ -4737,4 +4797,4 @@ for (let i = 0; i < buttons.length; i++) {
buttons[i].addEventListener("click",function(){ButtonAction(buttons[i].id);},true);
}
window.onresize = WindowResize;
-
+
\ No newline at end of file
diff --git a/Docs/start_introduction.md b/Docs/start_introduction.md
index 5ba1ab1ba0b..afccf4b855e 100644
--- a/Docs/start_introduction.md
+++ b/Docs/start_introduction.md
@@ -6,7 +6,7 @@
This document refers to the latest version of CARLA. For documentation of previous versions, select the required version in the bottom right hand corner where you see this button: ![docs_version_panel](img/docs_version_panel.jpg)
-CARLA is an open-source autonomous driving simulator. It was built from scratch to serve as a modular and flexible API to address a range of tasks involved in the problem of autonomous driving. One of the main goals of CARLA is to help democratize autonomous driving R&D, serving as a tool that can be easily accessed and customized by users. To do so, the simulator has to meet the requirements of different use cases within the general problem of driving (e.g. learning driving policies, training perception algorithms, etc.). CARLA is grounded on Unreal Engine to run the simulation and uses the OpenDRIVE standard (1.4 as today) to define roads and urban settings. Control over the simulation is granted through an API handled in Python and C++ that is constantly growing as the project does.
+CARLA is an open-source autonomous driving simulator. It was built from scratch to serve as a modular and flexible API to address a range of tasks involved in the problem of autonomous driving. One of the main goals of CARLA is to help democratize autonomous driving R&D, serving as a tool that can be easily accessed and customized by users. To do so, the simulator has to meet the requirements of different use cases within the general problem of driving (e.g. learning driving policies, training perception algorithms, etc.). CARLA is grounded on Unreal Engine to run the simulation and uses the ASAM OpenDRIVE standard (1.4 as today) to define roads and urban settings. Control over the simulation is granted through an API handled in Python and C++ that is constantly growing as the project does.
In order to smooth the process of developing, training and validating driving systems, CARLA evolved to become an ecosystem of projects, built around the main platform by the community. In this context, it is important to understand some things about how does CARLA work, so as to fully comprehend its capabilities.
diff --git a/Docs/start_quickstart.md b/Docs/start_quickstart.md
index 0b0c59e6895..2690ecfee0a 100644
--- a/Docs/start_quickstart.md
+++ b/Docs/start_quickstart.md
@@ -106,7 +106,7 @@ The package is a compressed file named __CARLA_version.number__. Download and ex
---
## Import additional assets
-Each release has it's own additional package of extra assets and maps. This additional package includes the maps __Town06__, __Town07__, and __Town10__. These are stored separately to reduce the size of the build, so they can only be imported after the main package has been installed.
+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.
diff --git a/Docs/tuto_M_generate_map.md b/Docs/tuto_M_generate_map.md
index 208f4b40b65..bb1a3a4bc05 100644
--- a/Docs/tuto_M_generate_map.md
+++ b/Docs/tuto_M_generate_map.md
@@ -32,7 +32,7 @@ You will need to install RoadRunner. You can follow the [installation guide][rr_
## Build a map in RoadRunner
-The specifics of how to build a map in RoadRunner go beyond the scope of this guide, however, there are video tutorials available in the [RoadRunner documentation][rr_tutorials].
+The specifics of how to build a map in RoadRunner go beyond the scope of this guide, however, there is an introductory tutorial series available on the [MathWorks website][rr_intro_tutorials] and there are video tutorials for specific actions available in the [RoadRunner documentation][rr_tutorials].
__Keep in mind that a map heavy with props can slow the import process significantly.__ This is because Unreal Engine needs to convert every mesh to an Unreal asset. If you plan to import your map into a source build version of CARLA, we highly recommend that you only create the road layout in RoadRunner and leave any customization until after the map has been imported into Unreal Engine. CARLA provides several tools that you can use in the Unreal Engine editor to simplify the customization process.
@@ -41,6 +41,7 @@ __Keep in mind that a map heavy with props can slow the import process significa
## Export a map in RoadRunner
[rr_tutorials]: https://www.mathworks.com/support/search.html?fq=asset_type_name:video%20category:roadrunner/index&page=1&s_tid=CRUX_topnav
+[rr_intro_tutorials]: https://www.mathworks.com/solutions/automated-driving/roadrunner-tutorial.html
Below is a basic guideline to export your custom map from RoadRunner. You can find more detailed information about how to export to CARLA in [MathWorks' documentation][exportlink].
@@ -104,4 +105,4 @@ If you have any questions about the process, then you can ask in the [forum](htt
CARLA forum
-
\ No newline at end of file
+
diff --git a/Docs/tuto_M_generate_pedestrian_navigation.md b/Docs/tuto_M_generate_pedestrian_navigation.md
index 44c9657330d..734c13ed74b 100644
--- a/Docs/tuto_M_generate_pedestrian_navigation.md
+++ b/Docs/tuto_M_generate_pedestrian_navigation.md
@@ -78,6 +78,10 @@ __6.__ A `.bin` file will be created. This file contains the informatio
__7.__ Test the pedestrian navigation by starting a simulation and running the example script `generate_traffic.py` in `PythonAPI/examples`.
+!!! note
+ **If you need to rebuild the pedestrian navigation** after updating the map, ensure to delete the CARLA cache. This is normally found in the home directory in Ubuntu (i.e. `cd ~`), or in the user directory in Windows (the directory assigned to the environment variable `USERPROFILE`), remove the folder named `carlaCache` and all of its contents, it is likely to be large in size.
+
+
---
If you have any questions about the process, then you can ask in the [forum](https://github.com/carla-simulator/carla/discussions).
diff --git a/Jenkinsfile b/Jenkinsfile
index 640c5f94504..b7352cac921 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -24,6 +24,18 @@ pipeline
}
stages
{
+ stage('stash dependencies')
+ {
+ agent{ label 'cache' }
+ options{skipDefaultCheckout()}
+ steps
+ {
+ sh "echo ${BRANCH_NAME}"
+ sh "set"
+ sh "cp ../../Build_Linux.tar.gz ."
+ stash includes: 'Build_Linux.tar.gz', name: 'build_cache'
+ }
+ }
stage('prepare environment')
{
parallel
@@ -36,6 +48,8 @@ pipeline
{
steps
{
+ unstash name: 'build_cache'
+ sh 'tar -xvzf Build_Linux.tar.gz'
sh 'git update-index --skip-worktree Unreal/CarlaUE4/CarlaUE4.uproject'
sh 'make setup ARGS="--python-version=3.8,2 --target-wheel-platform=manylinux_2_27_x86_64 --chrono"'
}
@@ -155,7 +169,19 @@ pipeline
steps
{
sh 'make package ARGS="--python-version=3.8,2 --target-wheel-platform=manylinux_2_27_x86_64 --chrono"'
- sh 'make package ARGS="--packages=AdditionalMaps,Town06_Opt,Town07_Opt,Town11,Town12,Town13,Town15 --target-archive=AdditionalMaps --clean-intermediate --python-version=3.8,2 --target-wheel-platform=manylinux_2_27_x86_64"'
+ sh '''
+ prefix="PR-"
+ case "$BRANCH_NAME" in
+ ("$prefix"*)
+ echo "This is a pull request, skipping complete package"
+ ;;
+ (*)
+ echo "Generating complete package"
+ make package ARGS="--packages=AdditionalMaps,Town06_Opt,Town07_Opt,Town11,Town12,Town13,Town15 --target-archive=AdditionalMaps --clean-intermediate --python-version=3.8,2 --target-wheel-platform=manylinux_2_27_x86_64"
+ tar -czf CarlaUE4_logs.tar.gz Unreal/CarlaUE4/Saved/Logs/
+ ;;
+ esac
+ '''
sh 'make examples ARGS="localhost 3654"'
}
post
@@ -163,6 +189,8 @@ pipeline
always
{
archiveArtifacts 'Dist/*.tar.gz'
+ archiveArtifacts artifacts:'CarlaUE4_logs.tar.gz',
+ allowEmptyArchive: true
stash includes: 'Dist/CARLA*.tar.gz', name: 'ubuntu_package'
stash includes: 'Examples/', name: 'ubuntu_examples'
}
@@ -189,14 +217,12 @@ pipeline
sh 'DISPLAY= ./Dist/CarlaUE4.sh -nullrhi -RenderOffScreen --carla-rpc-port=3654 --carla-streaming-port=0 -nosound > CarlaUE4.log &'
sh 'make smoke_tests ARGS="--xml --python-version=3.8 --target-wheel-platform=manylinux_2_27_x86_64"'
sh 'make run-examples ARGS="localhost 3654"'
- sh 'tar -czf CarlaUE4_logs.tar.gz Unreal/CarlaUE4/Saved/Logs/'
}
post
{
always
{
archiveArtifacts 'CarlaUE4.log'
- archiveArtifacts 'CarlaUE4_logs.tar.gz'
junit 'Build/test-results/smoke-tests-*.xml'
}
}
diff --git a/LibCarla/source/carla/client/Actor.cpp b/LibCarla/source/carla/client/Actor.cpp
index cfddf041b43..497c99b0293 100644
--- a/LibCarla/source/carla/client/Actor.cpp
+++ b/LibCarla/source/carla/client/Actor.cpp
@@ -40,6 +40,34 @@ namespace client {
return GetEpisode().Lock()->GetActorComponentRelativeTransform(*this, componentName);
}
+ std::vector Actor::GetBoneWorldTransforms() const {
+ return GetEpisode().Lock()->GetActorBoneWorldTransforms(*this);
+ }
+
+ std::vector Actor::GetBoneRelativeTransforms() const {
+ return GetEpisode().Lock()->GetActorBoneRelativeTransforms(*this);
+ }
+
+ std::vector Actor::GetComponentNames() const {
+ return GetEpisode().Lock()->GetActorComponentNames(*this);
+ }
+
+ std::vector Actor::GetBoneNames() const {
+ return GetEpisode().Lock()->GetActorBoneNames(*this);
+ }
+
+ std::vector Actor::GetSocketWorldTransforms() const {
+ return GetEpisode().Lock()->GetActorSocketWorldTransforms(*this);
+ }
+
+ std::vector Actor::GetSocketRelativeTransforms() const {
+ return GetEpisode().Lock()->GetActorSocketRelativeTransforms(*this);
+ }
+
+ std::vector Actor::GetSocketNames() const {
+ return GetEpisode().Lock()->GetActorSocketNames(*this);
+ }
+
void Actor::SetLocation(const geom::Location &location) {
GetEpisode().Lock()->SetActorLocation(*this, location);
}
diff --git a/LibCarla/source/carla/client/Actor.h b/LibCarla/source/carla/client/Actor.h
index 79d75746832..c84d59798af 100644
--- a/LibCarla/source/carla/client/Actor.h
+++ b/LibCarla/source/carla/client/Actor.h
@@ -64,6 +64,20 @@ namespace client {
geom::Transform GetComponentRelativeTransform(const std::string componentName) const;
+ std::vector GetBoneWorldTransforms() const;
+
+ std::vector GetBoneRelativeTransforms() const;
+
+ std::vector GetComponentNames() const;
+
+ std::vector GetBoneNames() const;
+
+ std::vector GetSocketWorldTransforms() const;
+
+ std::vector GetSocketRelativeTransforms() const;
+
+ std::vector GetSocketNames() const;
+
/// Teleport the actor to @a location.
void SetLocation(const geom::Location &location);
diff --git a/LibCarla/source/carla/client/DebugHelper.cpp b/LibCarla/source/carla/client/DebugHelper.cpp
index 53a3868ce6d..c01c24b3121 100644
--- a/LibCarla/source/carla/client/DebugHelper.cpp
+++ b/LibCarla/source/carla/client/DebugHelper.cpp
@@ -35,6 +35,16 @@ namespace client {
DrawShape(_episode, point, color, life_time, persistent_lines);
}
+ void DebugHelper::DrawHUDPoint(
+ const geom::Location &location,
+ float size,
+ sensor::data::Color color,
+ float life_time,
+ bool persistent_lines) {
+ Shape::HUDPoint point{location, size};
+ DrawShape(_episode, point, color, life_time, persistent_lines);
+ }
+
void DebugHelper::DrawLine(
const geom::Location &begin,
const geom::Location &end,
@@ -46,6 +56,17 @@ namespace client {
DrawShape(_episode, line, color, life_time, persistent_lines);
}
+ void DebugHelper::DrawHUDLine(
+ const geom::Location &begin,
+ const geom::Location &end,
+ float thickness,
+ Color color,
+ float life_time,
+ bool persistent_lines) {
+ Shape::HUDLine line{begin, end, thickness};
+ DrawShape(_episode, line, color, life_time, persistent_lines);
+ }
+
void DebugHelper::DrawArrow(
const geom::Location &begin,
const geom::Location &end,
@@ -59,6 +80,19 @@ namespace client {
DrawShape(_episode, arrow, color, life_time, persistent_lines);
}
+ void DebugHelper::DrawHUDArrow(
+ const geom::Location &begin,
+ const geom::Location &end,
+ float thickness,
+ float arrow_size,
+ sensor::data::Color color,
+ float life_time,
+ bool persistent_lines) {
+ Shape::HUDLine line{begin, end, thickness};
+ Shape::HUDArrow arrow{line, arrow_size};
+ DrawShape(_episode, arrow, color, life_time, persistent_lines);
+ }
+
void DebugHelper::DrawBox(
const geom::BoundingBox &box,
const geom::Rotation &rotation,
@@ -70,6 +104,17 @@ namespace client {
DrawShape(_episode, the_box, color, life_time, persistent_lines);
}
+ void DebugHelper::DrawHUDBox(
+ const geom::BoundingBox &box,
+ const geom::Rotation &rotation,
+ float thickness,
+ sensor::data::Color color,
+ float life_time,
+ bool persistent_lines) {
+ Shape::HUDBox the_box{box, rotation, thickness};
+ DrawShape(_episode, the_box, color, life_time, persistent_lines);
+ }
+
void DebugHelper::DrawString(
const geom::Location &location,
const std::string &text,
diff --git a/LibCarla/source/carla/client/DebugHelper.h b/LibCarla/source/carla/client/DebugHelper.h
index dbd3f0a6c27..f28f19ab843 100644
--- a/LibCarla/source/carla/client/DebugHelper.h
+++ b/LibCarla/source/carla/client/DebugHelper.h
@@ -30,6 +30,13 @@ namespace client {
float life_time = -1.0f,
bool persistent_lines = true);
+ void DrawHUDPoint(
+ const geom::Location &location,
+ float size = 0.1f,
+ Color color = Color{255u, 0u, 0u},
+ float life_time = -1.0f,
+ bool persistent_lines = true);
+
void DrawLine(
const geom::Location &begin,
const geom::Location &end,
@@ -38,6 +45,14 @@ namespace client {
float life_time = -1.0f,
bool persistent_lines = true);
+ void DrawHUDLine(
+ const geom::Location &begin,
+ const geom::Location &end,
+ float thickness = 1.0f,
+ Color color = Color{225u, 0u, 0u},
+ float life_time = -1.0f,
+ bool presistent_lines = true);
+
void DrawArrow(
const geom::Location &begin,
const geom::Location &end,
@@ -47,6 +62,15 @@ namespace client {
float life_time = -1.0f,
bool persistent_lines = true);
+ void DrawHUDArrow(
+ const geom::Location &begin,
+ const geom::Location &end,
+ float thickness = 0.1f,
+ float arrow_size = 0.1f,
+ Color color = Color{255u, 0u, 0u},
+ float life_time = -1.0f,
+ bool persistent_lines = true);
+
void DrawBox(
const geom::BoundingBox &box,
const geom::Rotation &rotation,
@@ -55,6 +79,14 @@ namespace client {
float life_time = -1.0f,
bool persistent_lines = true);
+ void DrawHUDBox(
+ const geom::BoundingBox &box,
+ const geom::Rotation &rotation,
+ float thickness = 0.1f,
+ Color color = Color{255u, 0u, 0u},
+ float life_time = -1.0f,
+ bool persistent_lines = true);
+
void DrawString(
const geom::Location &location,
const std::string &text,
diff --git a/LibCarla/source/carla/client/FileTransfer.h b/LibCarla/source/carla/client/FileTransfer.h
index fd1c091621f..8bfa00ca17f 100644
--- a/LibCarla/source/carla/client/FileTransfer.h
+++ b/LibCarla/source/carla/client/FileTransfer.h
@@ -12,6 +12,7 @@
#include
#include
#include
+#include
namespace carla {
namespace client {
diff --git a/LibCarla/source/carla/client/Vehicle.cpp b/LibCarla/source/carla/client/Vehicle.cpp
index 2e93489100c..4a0c2ebd403 100644
--- a/LibCarla/source/carla/client/Vehicle.cpp
+++ b/LibCarla/source/carla/client/Vehicle.cpp
@@ -144,6 +144,10 @@ namespace client {
BaseJSONPath);
}
+ void Vehicle::RestorePhysXPhysics() {
+ GetEpisode().Lock()->RestorePhysXPhysics(*this);
+ }
+
rpc::VehicleFailureState Vehicle::GetFailureState() const {
return GetEpisode().Lock()->GetActorSnapshot(*this).state.vehicle_data.failure_state;
}
diff --git a/LibCarla/source/carla/client/Vehicle.h b/LibCarla/source/carla/client/Vehicle.h
index cf5a37a173d..2fb7c2925df 100644
--- a/LibCarla/source/carla/client/Vehicle.h
+++ b/LibCarla/source/carla/client/Vehicle.h
@@ -137,6 +137,8 @@ namespace client {
std::string TireJSON = "",
std::string BaseJSONPath = "");
+ void RestorePhysXPhysics();
+
/// Returns the failure state of the vehicle
rpc::VehicleFailureState GetFailureState() const;
diff --git a/LibCarla/source/carla/client/World.cpp b/LibCarla/source/carla/client/World.cpp
index 2855f7f1df5..f6beac4e891 100644
--- a/LibCarla/source/carla/client/World.cpp
+++ b/LibCarla/source/carla/client/World.cpp
@@ -90,6 +90,15 @@ namespace client {
void World::SetWeather(const rpc::WeatherParameters &weather) {
_episode.Lock()->SetWeatherParameters(weather);
}
+
+ float World::GetIMUISensorGravity() const {
+ return _episode.Lock()->GetIMUISensorGravity();
+ }
+
+ void World::SetIMUISensorGravity(float NewIMUISensorGravity) {
+ _episode.Lock()->SetIMUISensorGravity(NewIMUISensorGravity);
+ }
+
WorldSnapshot World::GetSnapshot() const {
return _episode.Lock()->GetWorldSnapshot();
@@ -119,17 +128,19 @@ namespace client {
const ActorBlueprint &blueprint,
const geom::Transform &transform,
Actor *parent_actor,
- rpc::AttachmentType attachment_type) {
- return _episode.Lock()->SpawnActor(blueprint, transform, parent_actor, attachment_type);
+ rpc::AttachmentType attachment_type,
+ const std::string& socket_name) {
+ return _episode.Lock()->SpawnActor(blueprint, transform, parent_actor, attachment_type, GarbageCollectionPolicy::Inherit, socket_name);
}
SharedPtr World::TrySpawnActor(
const ActorBlueprint &blueprint,
const geom::Transform &transform,
Actor *parent_actor,
- rpc::AttachmentType attachment_type) noexcept {
+ rpc::AttachmentType attachment_type,
+ const std::string& socket_name) noexcept {
try {
- return SpawnActor(blueprint, transform, parent_actor, attachment_type);
+ return SpawnActor(blueprint, transform, parent_actor, attachment_type, socket_name);
} catch (const std::exception &) {
return nullptr;
}
diff --git a/LibCarla/source/carla/client/World.h b/LibCarla/source/carla/client/World.h
index 003fadb26cc..0d2b2374c4d 100644
--- a/LibCarla/source/carla/client/World.h
+++ b/LibCarla/source/carla/client/World.h
@@ -29,6 +29,7 @@
#include "carla/rpc/Texture.h"
#include "carla/rpc/MaterialParameter.h"
+#include
#include
namespace carla {
@@ -93,6 +94,12 @@ namespace client {
/// Change the weather in the simulation.
void SetWeather(const rpc::WeatherParameters &weather);
+ /// Get Gravity value used for IMUI Sensor accelerometer calculation
+ float GetIMUISensorGravity() const;
+
+ /// Set Gravity value used for IMUI Sensor accelerometer calculation
+ void SetIMUISensorGravity(float NewIMUISensorGravity);
+
/// Return a snapshot of the world at this moment.
WorldSnapshot GetSnapshot() const;
@@ -112,7 +119,8 @@ namespace client {
const ActorBlueprint &blueprint,
const geom::Transform &transform,
Actor *parent = nullptr,
- rpc::AttachmentType attachment_type = rpc::AttachmentType::Rigid);
+ rpc::AttachmentType attachment_type = rpc::AttachmentType::Rigid,
+ const std::string& socket_name = "");
/// Same as SpawnActor but return nullptr on failure instead of throwing an
/// exception.
@@ -120,7 +128,8 @@ namespace client {
const ActorBlueprint &blueprint,
const geom::Transform &transform,
Actor *parent = nullptr,
- rpc::AttachmentType attachment_type = rpc::AttachmentType::Rigid) noexcept;
+ rpc::AttachmentType attachment_type = rpc::AttachmentType::Rigid,
+ const std::string& socket_name = "") noexcept;
/// Block calling thread until a world tick is received.
WorldSnapshot WaitForTick(time_duration timeout) const;
diff --git a/LibCarla/source/carla/client/detail/Client.cpp b/LibCarla/source/carla/client/detail/Client.cpp
index 2cf28c7ef18..fe5c327f0ee 100644
--- a/LibCarla/source/carla/client/detail/Client.cpp
+++ b/LibCarla/source/carla/client/detail/Client.cpp
@@ -267,6 +267,14 @@ namespace detail {
_pimpl->AsyncCall("set_weather_parameters", weather);
}
+ float Client::GetIMUISensorGravity() const {
+ return _pimpl->CallAndWait("get_imui_gravity");
+ }
+
+ void Client::SetIMUISensorGravity(float NewIMUISensorGravity) {
+ _pimpl->AsyncCall("set_imui_gravity", NewIMUISensorGravity);
+ }
+
std::vector Client::GetActorsById(
const std::vector &ids) {
using return_t = std::vector;
@@ -326,11 +334,12 @@ namespace detail {
return _pimpl->CallAndWait("spawn_actor", description, transform);
}
- rpc::Actor Client::SpawnActorWithParent(
+ rpc::Actor Client::SpawnActorWithParent(
const rpc::ActorDescription &description,
const geom::Transform &transform,
rpc::ActorId parent,
- rpc::AttachmentType attachment_type) {
+ rpc::AttachmentType attachment_type,
+ const std::string& socket_name) {
if (attachment_type == rpc::AttachmentType::SpringArm ||
attachment_type == rpc::AttachmentType::SpringArmGhost)
@@ -348,7 +357,8 @@ namespace detail {
description,
transform,
parent,
- attachment_type);
+ attachment_type,
+ socket_name);
}
bool Client::DestroyActor(rpc::ActorId actor) {
@@ -416,6 +426,41 @@ namespace detail {
return _pimpl->CallAndWait("get_actor_component_relative_transform", actor, componentName);
}
+ std::vector Client::GetActorBoneWorldTransforms(rpc::ActorId actor) {
+ using return_t = std::vector;
+ return _pimpl->CallAndWait("get_actor_bone_world_transforms", actor);
+ }
+
+ std::vector Client::GetActorBoneRelativeTransforms(rpc::ActorId actor) {
+ using return_t = std::vector;
+ return _pimpl->CallAndWait("get_actor_bone_relative_transforms", actor);
+ }
+
+ std::vector Client::GetActorComponentNames(rpc::ActorId actor) {
+ using return_t = std::vector;
+ return _pimpl->CallAndWait("get_actor_component_names", actor);
+ }
+
+ std::vector Client::GetActorBoneNames(rpc::ActorId actor) {
+ using return_t = std::vector;
+ return _pimpl->CallAndWait("get_actor_bone_names", actor);
+ }
+
+ std::vector Client::GetActorSocketWorldTransforms(rpc::ActorId actor) {
+ using return_t = std::vector;
+ return _pimpl->CallAndWait("get_actor_socket_world_transforms", actor);
+ }
+
+ std::vector Client::GetActorSocketRelativeTransforms(rpc::ActorId actor) {
+ using return_t = std::vector;
+ return _pimpl->CallAndWait("get_actor_socket_relative_transforms", actor);
+ }
+
+ std::vector Client::GetActorSocketNames(rpc::ActorId actor) {
+ using return_t = std::vector;
+ return _pimpl->CallAndWait("get_actor_socket_names", actor);
+ }
+
void Client::SetActorSimulatePhysics(rpc::ActorId actor, const bool enabled) {
_pimpl->CallAndWait("set_actor_simulate_physics", actor, enabled);
}
@@ -483,6 +528,10 @@ namespace detail {
BaseJSONPath);
}
+ void Client::RestorePhysXPhysics(rpc::ActorId vehicle) {
+ _pimpl->AsyncCall("restore_physx_physics", vehicle);
+ }
+
void Client::ApplyControlToWalker(rpc::ActorId walker, const rpc::WalkerControl &control) {
_pimpl->AsyncCall("apply_control_to_walker", walker, control);
}
diff --git a/LibCarla/source/carla/client/detail/Client.h b/LibCarla/source/carla/client/detail/Client.h
index 0327adbb69e..73f8cdb8534 100644
--- a/LibCarla/source/carla/client/detail/Client.h
+++ b/LibCarla/source/carla/client/detail/Client.h
@@ -88,7 +88,6 @@ namespace detail {
void DestroyTrafficManager(uint16_t port) const;
-
void SetTimeout(time_duration timeout);
time_duration GetTimeout() const;
@@ -150,6 +149,10 @@ namespace detail {
void SetWeatherParameters(const rpc::WeatherParameters &weather);
+ float GetIMUISensorGravity() const;
+
+ void SetIMUISensorGravity( float NewIMUISensorGravity );
+
std::vector GetActorsById(const std::vector &ids);
rpc::VehiclePhysicsControl GetVehiclePhysicsControl(rpc::ActorId vehicle) const;
@@ -180,7 +183,8 @@ namespace detail {
const rpc::ActorDescription &description,
const geom::Transform &transform,
rpc::ActorId parent,
- rpc::AttachmentType attachment_type);
+ rpc::AttachmentType attachment_type,
+ const std::string& socket_name = "");
bool DestroyActor(rpc::ActorId actor);
@@ -241,6 +245,27 @@ namespace detail {
rpc::ActorId actor,
const std::string componentName);
+ std::vector GetActorBoneWorldTransforms(
+ rpc::ActorId actor);
+
+ std::vector GetActorBoneRelativeTransforms(
+ rpc::ActorId actor);
+
+ std::vector GetActorComponentNames(
+ rpc::ActorId actor);
+
+ std::vector GetActorBoneNames(
+ rpc::ActorId actor);
+
+ std::vector GetActorSocketWorldTransforms(
+ rpc::ActorId actor);
+
+ std::vector GetActorSocketRelativeTransforms(
+ rpc::ActorId actor);
+
+ std::vector GetActorSocketNames(
+ rpc::ActorId actor);
+
void SetActorSimulatePhysics(
rpc::ActorId actor,
bool enabled);
@@ -306,6 +331,8 @@ namespace detail {
std::string TireJSON,
std::string BaseJSONPath);
+ void RestorePhysXPhysics(rpc::ActorId vehicle);
+
void ApplyControlToWalker(
rpc::ActorId walker,
const rpc::WalkerControl &control);
diff --git a/LibCarla/source/carla/client/detail/Simulator.cpp b/LibCarla/source/carla/client/detail/Simulator.cpp
index ec2fbfae358..28eb8be6845 100644
--- a/LibCarla/source/carla/client/detail/Simulator.cpp
+++ b/LibCarla/source/carla/client/detail/Simulator.cpp
@@ -342,19 +342,21 @@ EpisodeProxy Simulator::GetCurrentEpisode() {
// -- General operations with actors -----------------------------------------
// ===========================================================================
- SharedPtr Simulator::SpawnActor(
+ SharedPtr Simulator::SpawnActor(
const ActorBlueprint &blueprint,
const geom::Transform &transform,
Actor *parent,
rpc::AttachmentType attachment_type,
- GarbageCollectionPolicy gc) {
+ GarbageCollectionPolicy gc,
+ const std::string& socket_name) {
rpc::Actor actor;
if (parent != nullptr) {
actor = _client.SpawnActorWithParent(
blueprint.MakeActorDescription(),
transform,
parent->GetId(),
- attachment_type);
+ attachment_type,
+ socket_name);
} else {
actor = _client.SpawnActor(
blueprint.MakeActorDescription(),
diff --git a/LibCarla/source/carla/client/detail/Simulator.h b/LibCarla/source/carla/client/detail/Simulator.h
index 76981d4e3df..6f5d950c341 100644
--- a/LibCarla/source/carla/client/detail/Simulator.h
+++ b/LibCarla/source/carla/client/detail/Simulator.h
@@ -259,6 +259,14 @@ namespace detail {
_client.SetWeatherParameters(weather);
}
+ float GetIMUISensorGravity() const {
+ return _client.GetIMUISensorGravity();
+ }
+
+ void SetIMUISensorGravity(float NewIMUISensorGravity) {
+ _client.SetIMUISensorGravity(NewIMUISensorGravity);
+ }
+
rpc::VehiclePhysicsControl GetVehiclePhysicsControl(const Vehicle &vehicle) const {
return _client.GetVehiclePhysicsControl(vehicle.GetId());
}
@@ -357,7 +365,8 @@ namespace detail {
const geom::Transform &transform,
Actor *parent = nullptr,
rpc::AttachmentType attachment_type = rpc::AttachmentType::Rigid,
- GarbageCollectionPolicy gc = GarbageCollectionPolicy::Inherit);
+ GarbageCollectionPolicy gc = GarbageCollectionPolicy::Inherit,
+ const std::string& socket_name = "");
bool DestroyActor(Actor &actor);
@@ -446,6 +455,34 @@ namespace detail {
return _client.GetActorComponentRelativeTransform(actor.GetId(), componentName);
}
+ std::vector GetActorBoneWorldTransforms(const Actor &actor) {
+ return _client.GetActorBoneWorldTransforms(actor.GetId());
+ }
+
+ std::vector GetActorBoneRelativeTransforms(const Actor &actor) {
+ return _client.GetActorBoneRelativeTransforms(actor.GetId());
+ }
+
+ std::vector GetActorComponentNames(const Actor &actor) {
+ return _client.GetActorComponentNames(actor.GetId());
+ }
+
+ std::vector GetActorBoneNames(const Actor &actor) {
+ return _client.GetActorBoneNames(actor.GetId());
+ }
+
+ std::vector GetActorSocketWorldTransforms(const Actor &actor) {
+ return _client.GetActorSocketWorldTransforms(actor.GetId());
+ }
+
+ std::vector GetActorSocketRelativeTransforms(const Actor &actor) {
+ return _client.GetActorSocketRelativeTransforms(actor.GetId());
+ }
+
+ std::vector GetActorSocketNames(const Actor &actor) {
+ return _client.GetActorSocketNames(actor.GetId());
+ }
+
void SetActorLocation(Actor &actor, const geom::Location &location) {
_client.SetActorLocation(actor.GetId(), location);
}
@@ -580,6 +617,10 @@ namespace detail {
BaseJSONPath);
}
+ void RestorePhysXPhysics(Vehicle &vehicle) {
+ _client.RestorePhysXPhysics(vehicle.GetId());
+ }
+
/// @}
// =========================================================================
/// @name Operations with the recorder
diff --git a/LibCarla/source/carla/road/Map.cpp b/LibCarla/source/carla/road/Map.cpp
index 70bedbeee2d..282452c66e3 100644
--- a/LibCarla/source/carla/road/Map.cpp
+++ b/LibCarla/source/carla/road/Map.cpp
@@ -1238,7 +1238,11 @@ namespace road {
geom::Transform lanetransform = lane->ComputeTransform(s_current);
geom::Transform treeTransform(treeposition, lanetransform.rotation);
const carla::road::element::RoadInfoSpeed* roadinfo = lane->GetInfo(s_current);
- transforms.push_back(std::make_pair(treeTransform,roadinfo->GetType()));
+ if(roadinfo){
+ transforms.push_back(std::make_pair(treeTransform, roadinfo->GetType()));
+ }else{
+ transforms.push_back(std::make_pair(treeTransform, "urban"));
+ }
}
s_current += distancebetweentrees;
}
diff --git a/LibCarla/source/carla/rpc/Command.h b/LibCarla/source/carla/rpc/Command.h
index 299c8ad0b89..663654e88a1 100644
--- a/LibCarla/source/carla/rpc/Command.h
+++ b/LibCarla/source/carla/rpc/Command.h
@@ -10,6 +10,7 @@
#include "carla/MsgPackAdaptors.h"
#include "carla/geom/Transform.h"
#include "carla/rpc/ActorDescription.h"
+#include "carla/rpc/AttachmentType.h"
#include "carla/rpc/ActorId.h"
#include "carla/rpc/TrafficLightState.h"
#include "carla/rpc/VehicleAckermannControl.h"
@@ -18,6 +19,8 @@
#include "carla/rpc/VehicleLightState.h"
#include "carla/rpc/WalkerControl.h"
+#include
+
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4583)
@@ -59,11 +62,19 @@ namespace rpc {
: description(std::move(description)),
transform(transform),
parent(parent) {}
+ SpawnActor(ActorDescription description, const geom::Transform &transform, ActorId parent, AttachmentType attachment_type, const std::string& bone)
+ : description(std::move(description)),
+ transform(transform),
+ parent(parent),
+ attachment_type(attachment_type),
+ socket_name(bone) {}
ActorDescription description;
geom::Transform transform;
boost::optional parent;
+ AttachmentType attachment_type;
+ std::string socket_name;
std::vector do_after;
- MSGPACK_DEFINE_ARRAY(description, transform, parent, do_after);
+ MSGPACK_DEFINE_ARRAY(description, transform, parent, attachment_type, socket_name, do_after);
};
struct DestroyActor : CommandBase {
diff --git a/LibCarla/source/carla/rpc/DebugShape.h b/LibCarla/source/carla/rpc/DebugShape.h
index 0e5b281ecfa..9c2c006dbef 100644
--- a/LibCarla/source/carla/rpc/DebugShape.h
+++ b/LibCarla/source/carla/rpc/DebugShape.h
@@ -35,6 +35,12 @@ namespace rpc {
MSGPACK_DEFINE_ARRAY(location, size);
};
+ struct HUDPoint {
+ geom::Location location;
+ float size;
+ MSGPACK_DEFINE_ARRAY(location, size);
+ };
+
struct Line {
geom::Location begin;
geom::Location end;
@@ -42,12 +48,25 @@ namespace rpc {
MSGPACK_DEFINE_ARRAY(begin, end, thickness);
};
+ struct HUDLine {
+ geom::Location begin;
+ geom::Location end;
+ float thickness;
+ MSGPACK_DEFINE_ARRAY(begin, end, thickness);
+ };
+
struct Arrow {
Line line;
float arrow_size;
MSGPACK_DEFINE_ARRAY(line, arrow_size);
};
+ struct HUDArrow {
+ HUDLine line;
+ float arrow_size;
+ MSGPACK_DEFINE_ARRAY(line, arrow_size);
+ };
+
struct Box {
geom::BoundingBox box;
geom::Rotation rotation;
@@ -55,6 +74,13 @@ namespace rpc {
MSGPACK_DEFINE_ARRAY(box, rotation, thickness);
};
+ struct HUDBox {
+ geom::BoundingBox box;
+ geom::Rotation rotation;
+ float thickness;
+ MSGPACK_DEFINE_ARRAY(box, rotation, thickness);
+ };
+
struct String {
geom::Location location;
std::string text;
@@ -62,7 +88,7 @@ namespace rpc {
MSGPACK_DEFINE_ARRAY(location, text, draw_shadow);
};
- boost::variant2::variant primitive;
+ boost::variant2::variant primitive;
Color color = {255u, 0u, 0u};
diff --git a/PythonAPI/carla/agents/navigation/basic_agent.py b/PythonAPI/carla/agents/navigation/basic_agent.py
index 093749d5afd..44e6d035111 100644
--- a/PythonAPI/carla/agents/navigation/basic_agent.py
+++ b/PythonAPI/carla/agents/navigation/basic_agent.py
@@ -345,12 +345,14 @@ def get_route_polygon():
return None
return Polygon(route_bb)
-
+
if self._ignore_vehicles:
return (False, None, -1)
- if not vehicle_list:
+ if vehicle_list is None:
vehicle_list = self._world.get_actors().filter("*vehicle*")
+ if len(vehicle_list) == 0:
+ return (False, None, -1)
if not max_distance:
max_distance = self._base_vehicle_threshold
diff --git a/PythonAPI/carla/setup.py b/PythonAPI/carla/setup.py
index 067e140a9c9..1e4b86b7b25 100755
--- a/PythonAPI/carla/setup.py
+++ b/PythonAPI/carla/setup.py
@@ -33,9 +33,10 @@ def walk(folder, file_filter='*'):
if os.name == "posix":
import distro
-
- linux_distro = distro.linux_distribution()[0]
- if linux_distro.lower() in ["ubuntu", "debian", "deepin"]:
+ supported_dists = ["ubuntu", "debian", "deepin"]
+
+ linux_distro = distro.id().lower()
+ if linux_distro in supported_dists:
pwd = os.path.dirname(os.path.realpath(__file__))
pylib = "libboost_python%d%d.a" % (sys.version_info.major,
sys.version_info.minor)
@@ -101,7 +102,7 @@ def walk(folder, file_filter='*'):
# extra_link_args += ['/usr/lib/gcc/x86_64-linux-gnu/7/libstdc++.a']
extra_link_args += ['-lstdc++']
else:
- raise NotImplementedError
+ raise NotImplementedError(linux_distro + " not in supported posix platforms: " + str(supported_dists))
elif os.name == "nt":
pwd = os.path.dirname(os.path.realpath(__file__))
pylib = 'libboost_python%d%d' % (
diff --git a/PythonAPI/carla/source/libcarla/Actor.cpp b/PythonAPI/carla/source/libcarla/Actor.cpp
index 9686bb73542..26d678460c4 100644
--- a/PythonAPI/carla/source/libcarla/Actor.cpp
+++ b/PythonAPI/carla/source/libcarla/Actor.cpp
@@ -115,6 +115,13 @@ void export_actor() {
.def("get_acceleration", &cc::Actor::GetAcceleration)
.def("get_component_world_transform", &cc::Actor::GetComponentWorldTransform, (arg("component_name")))
.def("get_component_relative_transform", &cc::Actor::GetComponentRelativeTransform, (arg("component_name")))
+ .def("get_bone_world_transforms", CALL_RETURNING_LIST(cc::Actor,GetBoneWorldTransforms))
+ .def("get_bone_relative_transforms", CALL_RETURNING_LIST(cc::Actor,GetBoneRelativeTransforms))
+ .def("get_component_names", CALL_RETURNING_LIST(cc::Actor,GetComponentNames))
+ .def("get_bone_names", CALL_RETURNING_LIST(cc::Actor,GetBoneNames))
+ .def("get_socket_world_transforms", CALL_RETURNING_LIST(cc::Actor,GetSocketWorldTransforms))
+ .def("get_socket_relative_transforms", CALL_RETURNING_LIST(cc::Actor,GetSocketRelativeTransforms))
+ .def("get_socket_names", CALL_RETURNING_LIST(cc::Actor,GetSocketNames))
.def("set_location", &cc::Actor::SetLocation, (arg("location")))
.def("set_transform", &cc::Actor::SetTransform, (arg("transform")))
.def("set_target_velocity", &cc::Actor::SetTargetVelocity, (arg("velocity")))
@@ -196,6 +203,7 @@ void export_actor() {
.def("enable_carsim", &cc::Vehicle::EnableCarSim, (arg("simfile_path") = ""))
.def("use_carsim_road", &cc::Vehicle::UseCarSimRoad, (arg("enabled")))
.def("enable_chrono_physics", &cc::Vehicle::EnableChronoPhysics, (arg("max_substeps")=30, arg("max_substep_delta_time")=0.002, arg("vehicle_json")="", arg("powetrain_json")="", arg("tire_json")="", arg("base_json_path")=""))
+ .def("restore_physx_physics", &cc::Vehicle::RestorePhysXPhysics)
.def("get_failure_state", &cc::Vehicle::GetFailureState)
.def(self_ns::str(self_ns::self))
;
diff --git a/PythonAPI/carla/source/libcarla/Commands.cpp b/PythonAPI/carla/source/libcarla/Commands.cpp
index 7fd5166dafc..2e33c628c54 100644
--- a/PythonAPI/carla/source/libcarla/Commands.cpp
+++ b/PythonAPI/carla/source/libcarla/Commands.cpp
@@ -82,9 +82,15 @@ void export_commands() {
"__init__",
&command_impl::CustomSpawnActorInit,
(arg("blueprint"), arg("transform"), arg("parent")))
+ .def(
+ "__init__",
+ &command_impl::CustomSpawnActorInit,
+ (arg("blueprint"), arg("transform"), arg("parent"), arg("attachment_type"), arg("socket_name")))
.def(init())
.def_readwrite("transform", &cr::Command::SpawnActor::transform)
.def_readwrite("parent_id", &cr::Command::SpawnActor::parent)
+ .def_readwrite("attachment_type", &cr::Command::SpawnActor::attachment_type)
+ .def_readwrite("socket_name", &cr::Command::SpawnActor::socket_name)
.def("then", &command_impl::Then, (arg("command")))
;
diff --git a/PythonAPI/carla/source/libcarla/World.cpp b/PythonAPI/carla/source/libcarla/World.cpp
index 6f07518bad9..c465b412b7c 100644
--- a/PythonAPI/carla/source/libcarla/World.cpp
+++ b/PythonAPI/carla/source/libcarla/World.cpp
@@ -11,6 +11,8 @@
#include
#include
+#include
+
#include
namespace carla {
@@ -293,15 +295,17 @@ void export_world() {
const cc::ActorBlueprint &blueprint, \
const cg::Transform &transform, \
cc::Actor *parent, \
- cr::AttachmentType attachment_type) { \
+ cr::AttachmentType attachment_type, \
+ const std::string& bone) { \
carla::PythonUtil::ReleaseGIL unlock; \
- return self.fn(blueprint, transform, parent, attachment_type); \
+ return self.fn(blueprint, transform, parent, attachment_type, bone); \
}, \
( \
arg("blueprint"), \
arg("transform"), \
arg("attach_to")=carla::SharedPtr(), \
- arg("attachment_type")=cr::AttachmentType::Rigid)
+ arg("attachment_type")=cr::AttachmentType::Rigid, \
+ arg("bone")=std::string())
class_("World", no_init)
.add_property("id", &cc::World::GetId)
@@ -317,6 +321,8 @@ void export_world() {
.def("apply_settings", &ApplySettings, (arg("settings"), arg("seconds")=0.0))
.def("get_weather", CONST_CALL_WITHOUT_GIL(cc::World, GetWeather))
.def("set_weather", &cc::World::SetWeather)
+ .def("get_imui_sensor_gravity", CONST_CALL_WITHOUT_GIL(cc::World, GetIMUISensorGravity))
+ .def("set_imui_sensor_gravity", &cc::World::SetIMUISensorGravity, (arg("NewIMUISensorGravity")) )
.def("get_snapshot", &cc::World::GetSnapshot)
.def("get_actor", CONST_CALL_WITHOUT_GIL_1(cc::World, GetActor, carla::ActorId), (arg("actor_id")))
.def("get_actors", CONST_CALL_WITHOUT_GIL(cc::World, GetActors))
@@ -368,6 +374,12 @@ void export_world() {
arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
arg("life_time")=-1.0f,
arg("persistent_lines")=true))
+ .def("draw_hud_point", &cc::DebugHelper::DrawHUDPoint,
+ (arg("location"),
+ arg("size")=0.1f,
+ arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
+ arg("life_time")=-1.0f,
+ arg("persistent_lines")=true))
.def("draw_line", &cc::DebugHelper::DrawLine,
(arg("begin"),
arg("end"),
@@ -375,6 +387,13 @@ void export_world() {
arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
arg("life_time")=-1.0f,
arg("persistent_lines")=true))
+ .def("draw_hud_line", &cc::DebugHelper::DrawHUDLine,
+ (arg("begin"),
+ arg("end"),
+ arg("thickness")=0.1f,
+ arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
+ arg("life_time")=-1.0f,
+ arg("persistent_lines")=true))
.def("draw_arrow", &cc::DebugHelper::DrawArrow,
(arg("begin"),
arg("end"),
@@ -383,6 +402,14 @@ void export_world() {
arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
arg("life_time")=-1.0f,
arg("persistent_lines")=true))
+ .def("draw_hud_arrow", &cc::DebugHelper::DrawHUDArrow,
+ (arg("begin"),
+ arg("end"),
+ arg("thickness")=0.1f,
+ arg("arrow_size")=0.1f,
+ arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
+ arg("life_time")=-1.0f,
+ arg("persistent_lines")=true))
.def("draw_box", &cc::DebugHelper::DrawBox,
(arg("box"),
arg("rotation"),
@@ -390,6 +417,13 @@ void export_world() {
arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
arg("life_time")=-1.0f,
arg("persistent_lines")=true))
+ .def("draw_hud_box", &cc::DebugHelper::DrawHUDBox,
+ (arg("box"),
+ arg("rotation"),
+ arg("thickness")=0.1f,
+ arg("color")=cc::DebugHelper::Color(255u, 0u, 0u),
+ arg("life_time")=-1.0f,
+ arg("persistent_lines")=true))
.def("draw_string", &cc::DebugHelper::DrawString,
(arg("location"),
arg("text"),
@@ -398,4 +432,6 @@ void export_world() {
arg("life_time")=-1.0f,
arg("persistent_lines")=true))
;
+ // scope HUD = class_(
+
}
diff --git a/PythonAPI/docs/client.yml b/PythonAPI/docs/client.yml
index 71c076beecf..3f4e40388f1 100644
--- a/PythonAPI/docs/client.yml
+++ b/PythonAPI/docs/client.yml
@@ -65,7 +65,7 @@
- param_name: opendrive
type: str
doc: >
- Content of an OpenDRIVE file as `string`, __not the path to the `.xodr`__.
+ Content of an ASAM OpenDRIVE file as `string`, __not the path to the `.xodr`__.
- param_name: parameters
type: carla.OpendriveGenerationParameters
default: (2.0, 50.0, 1.0, 0.6, true, true)
@@ -101,6 +101,7 @@
doc: >
Layers of the map that will be loaded. By default all layers are loaded.
This parameter works like a flag mask.
+ return: carla.World
warning: >
`map_layers` are only available for "Opt" maps
doc: >
@@ -114,11 +115,37 @@
doc: >
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
raises: RuntimeError when corresponding.
doc: >
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.
+ # --------------------------------------
+ - def_name: load_world_if_different
+ params:
+ - param_name: map_name
+ type: str
+ doc: >
+ 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.
+ - param_name: reset_settings
+ type: bool
+ default: true
+ doc: >
+ 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.
+ - param_name: map_layers
+ type: carla.MapLayer
+ default: carla.MapLayer.All
+ doc: >
+ Layers of the map that will be loaded. By default all layers are loaded.
+ This parameter works like a flag mask.
+ return: carla.World
+ warning: >
+ `map_layers` are only available for "Opt" maps
+ doc: >
+ 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.
# --------------------------------------
- def_name: replay_file
params:
@@ -732,7 +759,7 @@
- class_name: OpendriveGenerationParameters
# - DESCRIPTION ------------------------
doc: >
- 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.
# - PROPERTIES -------------------------
instance_variables:
- var_name: vertex_distance
diff --git a/PythonAPI/docs/commands.yml b/PythonAPI/docs/commands.yml
index cf73076811f..f19a70f8e1b 100644
--- a/PythonAPI/docs/commands.yml
+++ b/PythonAPI/docs/commands.yml
@@ -69,7 +69,11 @@
doc: >
Links another command to be executed right after. It allows to ease very common flows such as spawning a set of vehicles by command and then using this method to set them to autopilot automatically.
# --------------------------------------
-
+ - class_name: FutureActor
+ # - DESCRIPTION ------------------------
+ doc: >
+ 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.
+ # --------------------------------------
- class_name: DestroyActor
# - DESCRIPTION ------------------------
doc: >
diff --git a/PythonAPI/docs/sensor_data.yml b/PythonAPI/docs/sensor_data.yml
index ab2a8fc3845..1e0e477e14a 100644
--- a/PythonAPI/docs/sensor_data.yml
+++ b/PythonAPI/docs/sensor_data.yml
@@ -70,7 +70,13 @@
- var_name: Sidewalks
- var_name: TrafficSigns
- var_name: Vegetation
- - var_name: Vehicles
+ - var_name: Car
+ - var_name: Bus
+ - var_name: Truck
+ - var_name: Motorcycle
+ - var_name: Bicycle
+ - var_name: Rider
+ - var_name: Train
- var_name: Walls
- var_name: Sky
- var_name: Ground
diff --git a/PythonAPI/docs/world.yml b/PythonAPI/docs/world.yml
index 42794028768..5edd3b60920 100644
--- a/PythonAPI/docs/world.yml
+++ b/PythonAPI/docs/world.yml
@@ -125,11 +125,11 @@
- var_name: substepping
type: bool
doc: >
- 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 and carla.WorldSettings.max_substep_delta_time. These last two parameters need to be compatible with 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 and carla.WorldSettings.max_substep_delta_time. These last two parameters need to be compatible with carla.WorldSettings.fixed_delta_seconds. Enabled by default.
- var_name: max_substep_delta_time
type: float
doc: >
- Maximum delta time of the substeps. If the 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 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.
- var_name: max_substeps
type: int
doc: >
@@ -993,8 +993,140 @@
doc: >
Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes.
doc: >
- Draws a box, ussually to act for object colliders.
-
+ Draws a box, usually to act for object colliders.
+
+ # --------------------------------------
+ - def_name: draw_hud_arrow
+ params:
+ - param_name: begin
+ type: carla.Location
+ param_units: meters
+ doc: >
+ Point in the coordinate system where the arrow starts.
+ - param_name: end
+ type: carla.Location
+ param_units: meters
+ doc: >
+ Point in the coordinate system where the arrow ends and points towards to.
+ - param_name: thickness
+ type: float
+ default: 0.1
+ param_units: meters
+ doc: >
+ Density of the line.
+ - param_name: arrow_size
+ type: float
+ default: 0.1
+ param_units: meters
+ doc: >
+ Size of the tip of the arrow.
+ - param_name: color
+ type: carla.Color
+ default: (255,0,0)
+ doc: >
+ RGB code to color the object. Red by default.
+ - param_name: life_time
+ type: float
+ default: -1.0
+ param_units: seconds
+ doc: >
+ Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes.
+ doc: >
+ Draws an arrow on the HUD from `begin` to `end` which can only be seen server-side.
+
+ # --------------------------------------
+ - def_name: draw_hud_box
+ params:
+ - param_name: box
+ type: carla.BoundingBox
+ doc: >
+ Object containing a location and the length of a box for every axis.
+ - param_name: rotation
+ type: carla.Rotation
+ param_units: degrees (pitch,yaw,roll)
+ doc: >
+ Orientation of the box according to Unreal Engine's axis system.
+ - param_name: thickness
+ type: float
+ default: 0.1
+ param_units: meters
+ doc: >
+ Density of the lines that define the box.
+ - param_name: color
+ type: carla.Color
+ default: (255,0,0)
+ doc: >
+ RGB code to color the object. Red by default.
+ - param_name: life_time
+ type: float
+ default: -1.0
+ param_units: seconds
+ doc: >
+ Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes.
+ doc: >
+ Draws a box on the HUD, usually to act for object colliders. The box can only be seen server-side.
+
+ # --------------------------------------
+ - def_name: draw_hud_line
+ params:
+ - param_name: begin
+ type: carla.Location
+ param_units: meters
+ doc: >
+ Point in the coordinate system where the line starts.
+ - param_name: end
+ type: carla.Location
+ param_units: meters
+ doc: >
+ Spot in the coordinate system where the line ends.
+ - param_name: thickness
+ type: float
+ default: 0.1
+ param_units: meters
+ doc: >
+ Density of the line.
+ - param_name: color
+ type: carla.Color
+ default: (255,0,0)
+ doc: >
+ RGB code to color the object. Red by default.
+ - param_name: life_time
+ type: float
+ default: -1.0
+ param_units: seconds
+ doc: >
+ Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes.
+ doc: >
+ Draws a line on the HUD in between `begin` and `end`. The line can only be seen server-side.
+
+ # --------------------------------------
+ - def_name: draw_hud_point
+ params:
+ - param_name: location
+ type: carla.Location
+ param_units: meters
+ doc: >
+ Spot in the coordinate system to center the object.
+ - param_name: size
+ type: float
+ default: 0.1
+ param_units: meters
+ doc: >
+ Density of the point.
+ - param_name: color
+ type: carla.Color
+ default: (255,0,0)
+ doc: >
+ RGB code to color the object. Red by default.
+ - param_name: life_time
+ type: float
+ default: -1.0
+ param_units: seconds
+ doc: >
+ Shape's lifespan. By default it only lasts one frame. Set this to 0 for permanent shapes.
+ doc: >
+ Draws a point on the HUD at `location`. The point can only be seen server-side.
+
# --------------------------------------
- def_name: draw_line
params:
diff --git a/PythonAPI/examples/manual_control_chrono.py b/PythonAPI/examples/manual_control_chrono.py
index ad453a6fe0c..f72bc7ecf02 100644
--- a/PythonAPI/examples/manual_control_chrono.py
+++ b/PythonAPI/examples/manual_control_chrono.py
@@ -324,6 +324,7 @@ class KeyboardControl(object):
def __init__(self, world, start_in_autopilot):
self._carsim_enabled = False
self._carsim_road = False
+ self._chrono_enabled = False
self._autopilot_enabled = start_in_autopilot
if isinstance(world.player, carla.Vehicle):
self._control = carla.VehicleControl()
@@ -417,14 +418,24 @@ def parse_events(self, client, world, clock):
world.camera_manager.set_sensor(current_index)
elif event.key == K_k and (pygame.key.get_mods() & KMOD_CTRL):
print("k pressed")
- world.player.enable_carsim()
+ if not self._carsim_enabled:
+ self._carsim_enabled = True
+ world.player.enable_carsim()
+ else:
+ self._carsim_enabled = False
+ world.player.restore_physx_physics()
elif event.key == K_o and (pygame.key.get_mods() & KMOD_CTRL):
print("o pressed")
- vehicle_json = "sedan/vehicle/Sedan_Vehicle.json"
- powertrain_json = "sedan/powertrain/Sedan_SimpleMapPowertrain.json"
- tire_json = "sedan/tire/Sedan_TMeasyTire.json"
- base_path = "~/carla/Build/chrono-install/share/chrono/data/vehicle/"
- world.player.enable_chrono_physics(5000, 0.002, vehicle_json, powertrain_json, tire_json, base_path)
+ if not self._chrono_enabled:
+ self._chrono_enabled = True
+ vehicle_json = "sedan/vehicle/Sedan_Vehicle.json"
+ powertrain_json = "sedan/powertrain/Sedan_SimpleMapPowertrain.json"
+ tire_json = "sedan/tire/Sedan_TMeasyTire.json"
+ base_path = "/home/adas/carla/Build/chrono-install/share/chrono/data/vehicle/"
+ world.player.enable_chrono_physics(5000, 0.002, vehicle_json, powertrain_json, tire_json, base_path)
+ else:
+ self._chrono_enabled = False
+ world.player.restore_physx_physics()
elif event.key == K_j and (pygame.key.get_mods() & KMOD_CTRL):
self._carsim_road = not self._carsim_road
world.player.use_carsim_road(self._carsim_road)
diff --git a/README.md b/README.md
index 0ab8fc1a1a6..8589994b068 100644
--- a/README.md
+++ b/README.md
@@ -54,7 +54,7 @@ Repositories associated with the CARLA simulation platform:
* [**Conditional Imitation-Learning**](https://github.com/felipecode/coiltraine): Training and testing Conditional Imitation Learning models in CARLA
* [**AutoWare AV stack**](https://github.com/carla-simulator/carla-autoware): Bridge to connect AutoWare AV stack to CARLA
* [**Reinforcement-Learning**](https://github.com/carla-simulator/reinforcement-learning): Code for running Conditional Reinforcement Learning models in CARLA
-* [**RoadRunner**](https://www.mathworks.com/products/roadrunner.html): MATLAB GUI based application to create road networks in OpenDrive format
+* [**RoadRunner**](https://www.mathworks.com/products/roadrunner.html): MATLAB GUI based application to create road networks in the ASAM OpenDRIVE format
* [**Map Editor**](https://github.com/carla-simulator/carla-map-editor): Standalone GUI application to enhance RoadRunner maps with traffic lights and traffic signs information
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.cpp
index f9dacdc9144..dfec0bc43f1 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.cpp
@@ -1055,6 +1055,28 @@ ECarlaServerResponse FVehicleActor::EnableChronoPhysics(
return ECarlaServerResponse::Success;
}
+ECarlaServerResponse FVehicleActor::RestorePhysXPhysics()
+{
+ if (IsDormant())
+ {
+ }
+ else
+ {
+ auto Vehicle = Cast(GetActor());
+ if (Vehicle == nullptr)
+ {
+ return ECarlaServerResponse::NotAVehicle;
+ }
+ UBaseCarlaMovementComponent* MovementComponent =
+ Vehicle->GetCarlaMovementComponent();
+ if(MovementComponent)
+ {
+ MovementComponent->DisableSpecialPhysics();
+ }
+ }
+ return ECarlaServerResponse::Success;
+}
+
// FSensorActor functions ---------------------
// FtrafficSignActor functions ---------------------
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.h
index ed3982727cf..f7edb4b4f97 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Actor/CarlaActor.h
@@ -343,6 +343,11 @@ class FCarlaActor
return ECarlaServerResponse::ActorTypeMismatch;
}
+ virtual ECarlaServerResponse RestorePhysXPhysics()
+ {
+ return ECarlaServerResponse::ActorTypeMismatch;
+ }
+
// Traffic light functions
virtual ECarlaServerResponse SetTrafficLightState(const ETrafficLightState&)
@@ -532,6 +537,8 @@ class FVehicleActor : public FCarlaActor
uint64_t MaxSubsteps, float MaxSubstepDeltaTime,
const FString& VehicleJSON, const FString& PowertrainJSON,
const FString& TireJSON, const FString& BaseJSONPath) final;
+
+ virtual ECarlaServerResponse RestorePhysXPhysics();
};
class FSensorActor : public FCarlaActor
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp
index f9b18dbb8c4..ce0dcdbabab 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Commandlet/PrepareAssetsForCookingCommandlet.cpp
@@ -34,6 +34,9 @@ static bool ValidateStaticMesh(UStaticMesh *Mesh)
for (int i = 0; i < Mesh->StaticMaterials.Num(); i++)
{
UMaterialInterface *Material = Mesh->GetMaterial(i);
+ if (!Material) {
+ Material = UMaterial::GetDefaultMaterial(MD_Surface);
+ }
const FString MaterialName = Material->GetName();
if (MaterialName.Contains(TEXT("light"), ESearchCase::IgnoreCase) ||
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp
index 5d2417ab1ba..2e495102113 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.cpp
@@ -105,7 +105,7 @@ bool UCarlaEpisode::LoadNewEpisode(const FString &MapString, bool ResetSettings)
UGameplayStatics::OpenLevel(GetWorld(), *FinalPath, true);
if (ResetSettings)
ApplySettings(FEpisodeSettings{});
-
+
// send 'LOAD_MAP' command to all secondary servers (if any)
if (bIsPrimaryServer)
{
@@ -114,7 +114,7 @@ bool UCarlaEpisode::LoadNewEpisode(const FString &MapString, bool ResetSettings)
{
FCarlaEngine *CarlaEngine = GameInstance->GetCarlaEngine();
auto SecondaryServer = CarlaEngine->GetSecondaryServer();
- if (SecondaryServer->HasClientsConnected())
+ if (SecondaryServer->HasClientsConnected())
{
SecondaryServer->GetCommander().SendLoadMap(std::string(TCHAR_TO_UTF8(*FinalPath)));
}
@@ -294,11 +294,12 @@ carla::rpc::Actor UCarlaEpisode::SerializeActor(AActor* Actor) const
void UCarlaEpisode::AttachActors(
AActor *Child,
AActor *Parent,
- EAttachmentType InAttachmentType)
+ EAttachmentType InAttachmentType,
+ const FString& SocketName)
{
Child->AddActorWorldOffset(FVector(CurrentMapOrigin));
- UActorAttacher::AttachActors(Child, Parent, InAttachmentType);
+ UActorAttacher::AttachActors(Child, Parent, InAttachmentType, SocketName);
if (bIsPrimaryServer)
{
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h
index 14d07881147..d1b820fea5b 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaEpisode.h
@@ -245,7 +245,8 @@ class CARLA_API UCarlaEpisode : public UObject
void AttachActors(
AActor *Child,
AActor *Parent,
- EAttachmentType InAttachmentType = EAttachmentType::Rigid);
+ EAttachmentType InAttachmentType = EAttachmentType::Rigid,
+ const FString& SocketName = "");
/// @copydoc FActorDispatcher::DestroyActor(AActor*)
UFUNCTION(BlueprintCallable)
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaGameModeBase.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaGameModeBase.h
index d0d6bc08472..c42a7c56b64 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaGameModeBase.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaGameModeBase.h
@@ -112,6 +112,10 @@ class CARLA_API ACarlaGameModeBase : public AGameModeBase
TArray GetNamesOfAllActors();
+ // Gravitational acceleration. Default is earth one, which is approximately 9.81 m/s^2
+ UPROPERTY(BlueprintReadOnly, EditAnywhere, Category="Sensor Gravity")
+ float IMUISensorGravity = 9.81f;
+
protected:
void InitGame(const FString &MapName, const FString &Options, FString &ErrorMessage) override;
@@ -176,6 +180,7 @@ class CARLA_API ACarlaGameModeBase : public AGameModeBase
UPROPERTY()
ATrafficLightManager* TrafficLightManager = nullptr;
+ UPROPERTY()
ALargeMapManager* LMManager = nullptr;
FDelegateHandle OnEpisodeSettingsChangeHandle;
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.cpp
index a6b04c07266..c1f041f67c1 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.cpp
@@ -33,7 +33,6 @@ void ACarlaHUD::DrawHUD()
FVector2D Screen;
if (Player->ProjectWorldLocationToScreen(StringList[i].Location, Screen, true))
{
- // draw text
DrawText(StringList[i].Str, StringList[i].Color, Screen.X, Screen.Y);
}
@@ -45,6 +44,25 @@ void ACarlaHUD::DrawHUD()
else
++i;
}
+
+ while (i < LineList.Num())
+ {
+ // project position from camera
+ FVector2D Begin, End;
+ if (Player->ProjectWorldLocationToScreen(LineList[i].Begin, Begin, true) &&
+ Player->ProjectWorldLocationToScreen(LineList[i].End, End, true))
+ {
+ DrawLine(Begin.X, Begin.Y, End.X, End.Y, LineList[i].Color, LineList[i].Thickness);
+ }
+
+ // check to remove the string
+ if (Now >= LineList[i].TimeToDie)
+ {
+ LineList.RemoveAt(i);
+ }
+ else
+ ++i;
+ }
}
void ACarlaHUD::AddHUDString(const FString Str, const FVector Location, const FColor Color, double LifeTime)
@@ -53,3 +71,10 @@ void ACarlaHUD::AddHUDString(const FString Str, const FVector Location, const FC
HUDString Obj { Str, Location, Color, Now + LifeTime };
StringList.Add(std::move(Obj));
}
+
+void ACarlaHUD::AddHUDLine(const FVector Begin, const FVector End, const float Thickness, const FColor Color, double LifeTime)
+{
+ double Now = FPlatformTime::Seconds();
+ HUDLine Obj { Begin, End, Thickness, Color, Now + LifeTime };
+ LineList.Add(std::move(Obj));
+}
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.h
index 79a3edc70ed..c76b5bc0e83 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Game/CarlaHUD.h
@@ -35,6 +35,15 @@ struct HUDString
double TimeToDie;
};
+struct HUDLine
+{
+ FVector Begin;
+ FVector End;
+ float Thickness;
+ FColor Color;
+ double TimeToDie;
+};
+
/// Class to draw on HUD
UCLASS()
class CARLA_API ACarlaHUD : public AHUD
@@ -55,7 +64,9 @@ class CARLA_API ACarlaHUD : public AHUD
void AddDebugVehicleForTelemetry(UWheeledVehicleMovementComponent* Veh) { DebugVehicle = Veh; }
void AddHUDString(const FString Str, const FVector Location, const FColor Color, double LifeTime);
+ void AddHUDLine(const FVector Begin, const FVector End, const float Thickness, const FColor Color, double LifeTime);
private:
TArray StringList;
+ TArray LineList;
};
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp
index 473aaa8441d..880b9f72dc1 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.cpp
@@ -1,11 +1,12 @@
-// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
+// Copyright (c) 2024 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
// For a copy, see .
-#include "Carla.h"
#include "Carla/Sensor/CollisionSensor.h"
+#include "Carla.h"
+#include "CoreMinimal.h"
#include "Carla/Actor/ActorBlueprintFunctionLibrary.h"
#include "Carla/Actor/ActorRegistry.h"
@@ -13,11 +14,13 @@
#include "Carla/Game/CarlaEngine.h"
#include "Carla/Game/CarlaGameInstance.h"
#include "Carla/Game/CarlaGameModeBase.h"
+#include "Carla/Vehicle/CarlaWheeledVehicle.h"
+#include "Carla/Walker/WalkerBase.h"
ACollisionSensor::ACollisionSensor(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
- PrimaryActorTick.bCanEverTick = false;
+ PrimaryActorTick.bCanEverTick = true;
}
FActorDefinition ACollisionSensor::GetSensorDefinition()
@@ -32,27 +35,37 @@ void ACollisionSensor::SetOwner(AActor *NewOwner)
Super::SetOwner(NewOwner);
/// @todo Deregister previous owner if there was one.
-
- if (NewOwner != nullptr)
+ if (IsValid(NewOwner))
{
- NewOwner->OnActorHit.AddDynamic(this, &ACollisionSensor::OnCollisionEvent);
+ ACarlaWheeledVehicle* Vehicle = Cast(NewOwner);
+ if(IsValid(Vehicle))
+ {
+ Vehicle->GetMesh()->OnComponentHit.AddDynamic(this, &ACollisionSensor::OnComponentCollisionEvent);
+ }
+ else
+ {
+ AWalkerBase* Walker = Cast(NewOwner);
+ if(IsValid(Walker))
+ {
+ Walker->GetMesh()->OnComponentHit.AddDynamic(this, &ACollisionSensor::OnComponentCollisionEvent);
+ }
+ else
+ {
+ OnActorHit.AddDynamic(this, &ACollisionSensor::OnActorCollisionEvent);
+ }
+ }
}
-}
-
-void ACollisionSensor::OnCollisionEvent(
- AActor *Actor,
- AActor *OtherActor,
- FVector NormalImpulse,
- const FHitResult &Hit)
-{
- if (Actor == nullptr || OtherActor == nullptr)
+ else
{
- return;
+ UE_LOG(LogCarla, Log, TEXT("ACollisionSensor::SetOwner New owner is not valid or you are destroying collision sensor") );
}
+}
- uint64_t CurrentFrame = FCarlaEngine::GetFrameCounter();
+void ACollisionSensor::PrePhysTick(float DeltaSeconds) {
+ Super::PrePhysTick(DeltaSeconds);
// remove all items from previous frames
+ uint64_t CurrentFrame = FCarlaEngine::GetFrameCounter();
CollisionRegistry.erase(
std::remove_if(
CollisionRegistry.begin(),
@@ -62,6 +75,29 @@ void ACollisionSensor::OnCollisionEvent(
return std::get<0>(Item) < CurrentFrame;
}),
CollisionRegistry.end());
+}
+
+void ACollisionSensor::OnCollisionEvent(
+ AActor *Actor,
+ AActor *OtherActor,
+ FVector NormalImpulse,
+ const FHitResult &Hit)
+{
+ if (!IsValid(OtherActor))
+ {
+ UE_LOG(LogCarla, Error, TEXT("ACollisionSensor::OnActorCollisionEvent Error with collided actor; Not valid.\n Collider actor %s"),
+ *(Actor->GetName()) );
+ return;
+ }
+
+ if (!IsValid(Actor))
+ {
+ UE_LOG(LogCarla, Error, TEXT("ACollisionSensor::OnActorCollisionEvent Error with collider actor; Not valid.\n Collided actor %s"),
+ *(OtherActor->GetName()) );
+ return;
+ }
+
+ uint64_t CurrentFrame = FCarlaEngine::GetFrameCounter();
// check if this collision has been procesed already in this frame
for (auto& Collision: CollisionRegistry)
@@ -74,23 +110,27 @@ void ACollisionSensor::OnCollisionEvent(
}
}
- const auto &Episode = GetEpisode();
+ const auto& CurrentEpisode = GetEpisode();
constexpr float TO_METERS = 1e-2;
NormalImpulse *= TO_METERS;
GetDataStream(*this).SerializeAndSend(
*this,
- Episode.SerializeActor(Actor),
- Episode.SerializeActor(OtherActor),
- carla::geom::Vector3D{NormalImpulse.X, NormalImpulse.Y, NormalImpulse.Z});
+ CurrentEpisode.SerializeActor(Actor),
+ CurrentEpisode.SerializeActor(OtherActor),
+ carla::geom::Vector3D(
+ (float)NormalImpulse.X,
+ (float)NormalImpulse.Y,
+ (float)NormalImpulse.Z));
+
// record the collision event
- if (Episode.GetRecorder()->IsEnabled()){
- Episode.GetRecorder()->AddCollision(Actor, OtherActor);
+ if (CurrentEpisode.GetRecorder()->IsEnabled()){
+ CurrentEpisode.GetRecorder()->AddCollision(Actor, OtherActor);
}
CollisionRegistry.emplace_back(CurrentFrame, Actor, OtherActor);
// ROS2
- #if defined(WITH_ROS2)
+#if defined(WITH_ROS2)
auto ROS2 = carla::ros2::ROS2::GetInstance();
if (ROS2->IsEnabled())
{
@@ -107,5 +147,25 @@ void ACollisionSensor::OnCollisionEvent(
ROS2->ProcessDataFromCollisionSensor(0, StreamId, GetActorTransform(), OtherActor->GetUniqueID(), carla::geom::Vector3D{NormalImpulse.X, NormalImpulse.Y, NormalImpulse.Z}, this);
}
}
- #endif
+#endif
+}
+
+void ACollisionSensor::OnActorCollisionEvent(
+ AActor *Actor,
+ AActor *OtherActor,
+ FVector NormalImpulse,
+ const FHitResult &Hit)
+{
+ OnCollisionEvent(Actor, OtherActor, NormalImpulse, Hit);
+}
+
+void ACollisionSensor::OnComponentCollisionEvent(
+ UPrimitiveComponent* HitComp,
+ AActor* OtherActor,
+ UPrimitiveComponent* OtherComp,
+ FVector NormalImpulse,
+ const FHitResult& Hit)
+{
+ AActor* Actor = HitComp->GetOwner();
+ OnCollisionEvent(Actor, OtherActor, NormalImpulse, Hit);
}
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.h
index 215f5bf5d4a..7b0528c3ec2 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/CollisionSensor.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
+// Copyright (c) 2024 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
@@ -26,10 +26,9 @@ class CARLA_API ACollisionSensor : public ASensor
ACollisionSensor(const FObjectInitializer& ObjectInitializer);
+ virtual void PrePhysTick(float DeltaSeconds) override;
void SetOwner(AActor *NewOwner) override;
-private:
-
UFUNCTION()
void OnCollisionEvent(
AActor *Actor,
@@ -37,6 +36,22 @@ class CARLA_API ACollisionSensor : public ASensor
FVector NormalImpulse,
const FHitResult &Hit);
+ UFUNCTION(BlueprintCallable, Category="Collision")
+ void OnActorCollisionEvent(
+ AActor *Actor,
+ AActor *OtherActor,
+ FVector NormalImpulse,
+ const FHitResult &Hit);
+
+ UFUNCTION()
+ void OnComponentCollisionEvent(
+ UPrimitiveComponent* HitComp,
+ AActor* OtherActor,
+ UPrimitiveComponent* OtherComp,
+ FVector NormalImpulse,
+ const FHitResult& Hit);
+
+private:
/// Registry that saves all collisions. Used to avoid sending the same collision more than once per frame,
/// as the collision sensor uses the PhysX substepping tick. Helps with sensor usage and stream overload.
std::vector> CollisionRegistry;
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp
index a2f4838d9eb..bffecb8d4a0 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Sensor/InertialMeasurementUnit.cpp
@@ -104,8 +104,8 @@ carla::geom::Vector3D AInertialMeasurementUnit::ComputeAccelerometer(
{
// Used to convert from UE4's cm to meters
constexpr float TO_METERS = 1e-2;
- // Earth's gravitational acceleration is approximately 9.81 m/s^2
- constexpr float GRAVITY = 9.81f;
+ // Gravity set by gamemode
+ const float GRAVITY = UCarlaStatics::GetGameMode(GetWorld())->IMUISensorGravity;
// 2nd derivative of the polynomic (quadratic) interpolation
// using the point in current time and two previous steps:
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp
index af6cbc6586b..7824ddfde62 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Server/CarlaServer.cpp
@@ -9,6 +9,11 @@
#include "Carla/Server/CarlaServerResponse.h"
#include "Carla/Traffic/TrafficLightGroup.h"
#include "EngineUtils.h"
+#include "Components/SkeletalMeshComponent.h"
+#include "Components/SkinnedMeshComponent.h"
+#include "Components/SceneComponent.h"
+#include "Engine/SkeletalMesh.h"
+#include "Engine/SkeletalMeshSocket.h"
#include "Carla/OpenDrive/OpenDrive.h"
#include "Carla/Util/DebugShapeDrawer.h"
@@ -659,6 +664,31 @@ void FCarlaServer::FPimpl::BindActions()
Weather->ApplyWeather(weather);
return R::Success();
};
+
+ // -- IMUI Gravity ---------------------------------------------------------
+
+ BIND_SYNC(get_imui_gravity) << [this]() -> R
+ {
+ REQUIRE_CARLA_EPISODE();
+ ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(Episode->GetWorld());
+ if (GameMode == nullptr)
+ {
+ RESPOND_ERROR("get_imui_gravity error: unable to get carla gamemode");
+ }
+ return GameMode->IMUISensorGravity;
+ };
+
+ BIND_SYNC(set_imui_gravity) << [this](float newimuigravity) -> R
+ {
+ REQUIRE_CARLA_EPISODE();
+ ACarlaGameModeBase* GameMode = UCarlaStatics::GetGameMode(Episode->GetWorld());
+ if (GameMode == nullptr)
+ {
+ RESPOND_ERROR("get_imui_gravity error: unable to get carla gamemode");
+ }
+ GameMode->IMUISensorGravity = newimuigravity;
+ return R::Success();
+ };
// ~~ Actor operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -706,7 +736,8 @@ void FCarlaServer::FPimpl::BindActions()
cr::ActorDescription Description,
const cr::Transform &Transform,
cr::ActorId ParentId,
- cr::AttachmentType InAttachmentType) -> R
+ cr::AttachmentType InAttachmentType,
+ const std::string& socket_name) -> R
{
REQUIRE_CARLA_EPISODE();
@@ -760,7 +791,8 @@ void FCarlaServer::FPimpl::BindActions()
Episode->AttachActors(
CarlaActor->GetActor(),
ParentCarlaActor->GetActor(),
- static_cast(InAttachmentType));
+ static_cast(InAttachmentType),
+ FString(socket_name.c_str()));
}
else
{
@@ -1292,7 +1324,7 @@ BIND_SYNC(is_sensor_enabled_for_ros) << [this](carla::streaming::detail::stream_
TArray Components;
CarlaActor->GetActor()->GetComponents(Components);
- USceneComponent* Component;
+ USceneComponent* Component = nullptr;
for(auto Cmp : Components)
{
if(USceneComponent* SCMP = Cast(Cmp))
@@ -1336,7 +1368,7 @@ BIND_SYNC(is_sensor_enabled_for_ros) << [this](carla::streaming::detail::stream_
TArray Components;
CarlaActor->GetActor()->GetComponents(Components);
- USceneComponent* Component;
+ USceneComponent* Component = nullptr;
for(auto Cmp : Components)
{
if(USceneComponent* SCMP = Cast(Cmp))
@@ -1362,6 +1394,252 @@ BIND_SYNC(is_sensor_enabled_for_ros) << [this](carla::streaming::detail::stream_
}
};
+ BIND_SYNC(get_actor_bone_world_transforms) << [this](
+ cr::ActorId ActorId) -> R>
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "get_actor_bone_world_transforms",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ else
+ {
+ TArray BoneWorldTransforms;
+ TArray SkinnedMeshComponents;
+ CarlaActor->GetActor()->GetComponents(SkinnedMeshComponents);
+ if(!SkinnedMeshComponents[0])
+ {
+ return RespondError(
+ "get_actor_bone_world_transforms",
+ ECarlaServerResponse::ComponentNotFound,
+ " Component Name: SkinnedMeshComponent ");
+ }
+ else
+ {
+ for(USkinnedMeshComponent* SkinnedMeshComponent : SkinnedMeshComponents)
+ {
+ const int32 NumBones = SkinnedMeshComponent->GetNumBones();
+ for (int32 BoneIndex = 0; BoneIndex < NumBones; ++BoneIndex)
+ {
+ FTransform WorldTransform = SkinnedMeshComponent->GetComponentTransform();
+ FTransform BoneTransform = SkinnedMeshComponent->GetBoneTransform(BoneIndex, WorldTransform);
+ BoneWorldTransforms.Add(BoneTransform);
+ }
+ }
+ return MakeVectorFromTArray(BoneWorldTransforms);
+ }
+ }
+ };
+
+ BIND_SYNC(get_actor_bone_relative_transforms) << [this](
+ cr::ActorId ActorId) -> R>
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "get_actor_bone_relative_transforms",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ else
+ {
+ TArray BoneRelativeTransforms;
+ TArray SkinnedMeshComponents;
+ CarlaActor->GetActor()->GetComponents(SkinnedMeshComponents);
+ if(!SkinnedMeshComponents[0])
+ {
+ return RespondError(
+ "get_actor_bone_relative_transforms",
+ ECarlaServerResponse::ComponentNotFound,
+ " Component Name: SkinnedMeshComponent ");
+ }
+ else
+ {
+ for(USkinnedMeshComponent* SkinnedMeshComponent : SkinnedMeshComponents)
+ {
+ const int32 NumBones = SkinnedMeshComponent->GetNumBones();
+ for (int32 BoneIndex = 0; BoneIndex < NumBones; ++BoneIndex)
+ {
+ FTransform BoneTransform = SkinnedMeshComponent->GetBoneTransform(BoneIndex, FTransform::Identity);
+ BoneRelativeTransforms.Add(BoneTransform);
+ }
+ }
+ return MakeVectorFromTArray(BoneRelativeTransforms);
+ }
+ }
+ };
+
+ BIND_SYNC(get_actor_component_names) << [this](
+ cr::ActorId ActorId) -> R>
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "get_actor_component_names",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ else
+ {
+ TArray Components;
+ CarlaActor->GetActor()->GetComponents(Components);
+ std::vector ComponentNames;
+ for(auto Cmp : Components)
+ {
+ FString ComponentName = Cmp->GetName();
+ ComponentNames.push_back(TCHAR_TO_UTF8(*ComponentName));
+ }
+ return ComponentNames;
+ }
+ };
+
+ BIND_SYNC(get_actor_bone_names) << [this](
+ cr::ActorId ActorId) -> R>
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "get_actor_bone_names",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ else
+ {
+ USkinnedMeshComponent* SkinnedMeshComponent = CarlaActor->GetActor()->FindComponentByClass();
+ if(!SkinnedMeshComponent)
+ {
+ return RespondError(
+ "get_actor_bone_names",
+ ECarlaServerResponse::ComponentNotFound,
+ " Component Name: SkinnedMeshComponent ");
+ }
+ else
+ {
+ TArray BoneNames;
+ SkinnedMeshComponent->GetBoneNames(BoneNames);
+ TArray StringBoneNames;
+ for (const FName& Name : BoneNames)
+ {
+ FString FBoneName = Name.ToString();
+ std::string StringBoneName = TCHAR_TO_UTF8(*FBoneName);
+ StringBoneNames.Add(StringBoneName);
+ }
+ return MakeVectorFromTArray(StringBoneNames);
+ }
+ }
+ };
+
+ BIND_SYNC(get_actor_socket_world_transforms) << [this](
+ cr::ActorId ActorId) -> R>
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "get_actor_socket_world_transforms",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ else
+ {
+ TArray SocketWorldTransforms;
+ TArray Components;
+ CarlaActor->GetActor()->GetComponents(Components);
+ for(UActorComponent* ActorComponent : Components)
+ {
+ if(USceneComponent* SceneComponent = Cast(ActorComponent))
+ {
+ const TArray& SocketNames = SceneComponent->GetAllSocketNames();
+ for (const FName& SocketName : SocketNames)
+ {
+ FTransform SocketTransform = SceneComponent->GetSocketTransform(SocketName);
+ SocketWorldTransforms.Add(SocketTransform);
+ }
+ }
+ }
+ return MakeVectorFromTArray(SocketWorldTransforms);
+ }
+ };
+
+ BIND_SYNC(get_actor_socket_relative_transforms) << [this](
+ cr::ActorId ActorId) -> R>
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "get_actor_socket_relative_transforms",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ else
+ {
+ TArray SocketRelativeTransforms;
+ TArray Components;
+ CarlaActor->GetActor()->GetComponents(Components);
+ for(UActorComponent* ActorComponent : Components)
+ {
+ if(USceneComponent* SceneComponent = Cast(ActorComponent))
+ {
+ const TArray& SocketNames = SceneComponent->GetAllSocketNames();
+ for (const FName& SocketName : SocketNames)
+ {
+ FTransform SocketTransform = SceneComponent->GetSocketTransform(SocketName, ERelativeTransformSpace::RTS_Actor);
+ SocketRelativeTransforms.Add(SocketTransform);
+ }
+ }
+ }
+ return MakeVectorFromTArray(SocketRelativeTransforms);
+ }
+ };
+
+ BIND_SYNC(get_actor_socket_names) << [this](
+ cr::ActorId ActorId) -> R>
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "get_actor_socket_names",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ else
+ {
+ TArray SocketNames;
+ std::vector StringSocketNames;
+ TArray Components;
+ CarlaActor->GetActor()->GetComponents(Components);
+ for(UActorComponent* ActorComponent : Components)
+ {
+ if(USceneComponent* SceneComponent = Cast(ActorComponent))
+ {
+ SocketNames = SceneComponent->GetAllSocketNames();
+ for (const FName& Name : SocketNames)
+ {
+ FString FSocketName = Name.ToString();
+ std::string StringSocketName = TCHAR_TO_UTF8(*FSocketName);
+ StringSocketNames.push_back(StringSocketName);
+ }
+ }
+ }
+ return StringSocketNames;
+ }
+ };
+
BIND_SYNC(get_physics_control) << [this](
cr::ActorId ActorId) -> R
{
@@ -2041,6 +2319,30 @@ BIND_SYNC(is_sensor_enabled_for_ros) << [this](carla::streaming::detail::stream_
return R::Success();
};
+ BIND_SYNC(restore_physx_physics) << [this](
+ cr::ActorId ActorId) -> R
+ {
+ REQUIRE_CARLA_EPISODE();
+ FCarlaActor* CarlaActor = Episode->FindCarlaActor(ActorId);
+ if (!CarlaActor)
+ {
+ return RespondError(
+ "restore_physx_physics",
+ ECarlaServerResponse::ActorNotFound,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ ECarlaServerResponse Response =
+ CarlaActor->RestorePhysXPhysics();
+ if (Response != ECarlaServerResponse::Success)
+ {
+ return RespondError(
+ "restore_physx_physics",
+ Response,
+ " Actor Id: " + FString::FromInt(ActorId));
+ }
+ return R::Success();
+ };
+
// ~~ Traffic lights ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BIND_SYNC(set_traffic_light_state) << [this](
@@ -2545,7 +2847,8 @@ BIND_SYNC(is_sensor_enabled_for_ros) << [this](carla::streaming::detail::stream_
c.description,
c.transform,
*c.parent,
- cr::AttachmentType::Rigid) :
+ cr::AttachmentType::Rigid,
+ c.socket_name) :
spawn_actor(c.description, c.transform);
if (!result.HasError())
{
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.cpp
index 56ca9185adf..e0563522c92 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.cpp
@@ -96,7 +96,8 @@ static void UActorAttacher_AttachActorsWithSpringArmGhost(
void UActorAttacher::AttachActors(
AActor *Child,
AActor *Parent,
- const EAttachmentType AttachmentType)
+ const EAttachmentType AttachmentType,
+ const FString& SocketName)
{
check(Child != nullptr);
check(Parent != nullptr);
@@ -104,7 +105,7 @@ void UActorAttacher::AttachActors(
switch (AttachmentType)
{
case EAttachmentType::Rigid:
- Child->AttachToActor(Parent, FAttachmentTransformRules::KeepRelativeTransform);
+ Child->AttachToActor(Parent, FAttachmentTransformRules::KeepRelativeTransform, FName(*SocketName));
break;
case EAttachmentType::SpringArm:
UActorAttacher_AttachActorsWithSpringArm(Child, Parent);
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.h
index 4f6d5d1dd19..e95c24ae7a8 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/ActorAttacher.h
@@ -42,5 +42,5 @@ class CARLA_API UActorAttacher : public UBlueprintFunctionLibrary
public:
UFUNCTION(BlueprintCallable, Category="CARLA|Actor Attacher")
- static void AttachActors(AActor *Child, AActor *Parent, EAttachmentType AttachmentType);
+ static void AttachActors(AActor *Child, AActor *Parent, EAttachmentType AttachmentType, const FString& SocketName = "");
};
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/DebugShapeDrawer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/DebugShapeDrawer.cpp
index 04909cad3dd..7d84fcce61a 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/DebugShapeDrawer.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Util/DebugShapeDrawer.cpp
@@ -33,6 +33,17 @@ struct FShapeVisitor
World->PersistentLineBatcher->SetCollisionEnabled(ECollisionEnabled::NoCollision);
}
+ ACarlaHUD * GetHUD() const {
+ auto PlayerController = UGameplayStatics::GetPlayerController(World, 0);
+ if (PlayerController == nullptr)
+ {
+ UE_LOG(LogCarla, Error, TEXT("Can't find player controller!"));
+ return nullptr;
+ }
+ ACarlaHUD *Hud = Cast(PlayerController->GetHUD());
+ return Hud;
+ }
+
void operator()(const Shape::Point &Point) const
{
FVector Location = FVector(Point.location);
@@ -49,6 +60,20 @@ struct FShapeVisitor
LifeTime);
}
+ void operator()(const Shape::HUDPoint &Point) const
+ {
+ auto Hud = GetHUD();
+ if (!Hud) return; // Don't draw if HUD is not available.
+
+ FVector Location = FVector(Point.location);
+ ALargeMapManager* LargeMap = UCarlaStatics::GetLargeMapManager(World);
+ if (LargeMap)
+ {
+ Location = LargeMap->GlobalToLocalLocation(Location);
+ }
+ Hud->AddHUDLine(Location, Location, Point.size, Color.Quantize(), LifeTime);
+ }
+
void operator()(const Shape::Line &Line) const
{
FVector Begin = FVector(Line.begin);
@@ -68,6 +93,20 @@ struct FShapeVisitor
LifeTime);
}
+ void operator()(const Shape::HUDLine &Line) const {
+ auto Hud = GetHUD();
+ if (!Hud) return; // Don't draw if HUD is not available.
+ FVector Begin = FVector(Line.begin);
+ FVector End = FVector(Line.end);
+ ALargeMapManager* LargeMap = UCarlaStatics::GetLargeMapManager(World);
+ if (LargeMap)
+ {
+ Begin = LargeMap->GlobalToLocalLocation(Begin);
+ End = LargeMap->GlobalToLocalLocation(End);
+ }
+ Hud->AddHUDLine(Begin, End, Line.thickness, Color.Quantize(), LifeTime);
+ }
+
void operator()(const Shape::Arrow &Arrow) const
{
FVector Begin = FVector(Arrow.line.begin);
@@ -90,40 +129,55 @@ struct FShapeVisitor
World->PersistentLineBatcher->DrawLines(TArray({
FBatchedLine(
- Begin,
- End,
- Color,
- LifeTime,
- Thickness,
- DepthPriority),
+ Begin, End, Color, LifeTime, Thickness, DepthPriority),
FBatchedLine(
Transform.TransformPosition(FVector(ArrowTipDist, +ArrowSize, +ArrowSize)),
- End,
- Color,
- LifeTime,
- Thickness,
- DepthPriority),
+ End, Color, LifeTime, Thickness, DepthPriority),
FBatchedLine(
Transform.TransformPosition(FVector(ArrowTipDist, +ArrowSize, -ArrowSize)),
- End,
- Color,
- LifeTime,
- Thickness,
- DepthPriority),
+ End, Color, LifeTime, Thickness, DepthPriority),
FBatchedLine(
Transform.TransformPosition(FVector(ArrowTipDist, -ArrowSize, +ArrowSize)),
- End,
- Color,
- LifeTime,
- Thickness,
- DepthPriority),
+ End, Color, LifeTime, Thickness, DepthPriority),
FBatchedLine(
Transform.TransformPosition(FVector(ArrowTipDist, -ArrowSize, -ArrowSize)),
- End,
- Color,
- LifeTime,
- Thickness,
- DepthPriority)}));
+ End, Color, LifeTime, Thickness, DepthPriority)}));
+ }
+
+ void operator()(const Shape::HUDArrow &Arrow) const {
+ auto Hud = GetHUD();
+ if (!Hud) return; // Don't draw if HUD is not available.
+ FVector Begin = FVector(Arrow.line.begin);
+ FVector End = FVector(Arrow.line.end);
+ ALargeMapManager* LargeMap = UCarlaStatics::GetLargeMapManager(World);
+ if (LargeMap)
+ {
+ Begin = LargeMap->GlobalToLocalLocation(Begin);
+ End = LargeMap->GlobalToLocalLocation(End);
+ }
+ const auto Diff = End - Begin;
+ const FRotator LookAt = FRotationMatrix::MakeFromX(Diff).Rotator();
+ const FTransform Transform = {LookAt, Begin};
+
+ // Everything in centimeters
+ const auto Dist = Diff.Size();
+ const auto ArrowSize = Arrow.arrow_size;
+ const auto ArrowTipDist = Dist - ArrowSize;
+ const auto Thickness = Arrow.line.thickness;
+
+ Hud->AddHUDLine(Begin, End, Thickness, Color.Quantize(), LifeTime);
+ Hud->AddHUDLine(
+ Transform.TransformPosition(FVector(ArrowTipDist, +ArrowSize, +ArrowSize)),
+ End, Thickness, Color.Quantize(), LifeTime);
+ Hud->AddHUDLine(
+ Transform.TransformPosition(FVector(ArrowTipDist, +ArrowSize, -ArrowSize)),
+ End, Thickness, Color.Quantize(), LifeTime);
+ Hud->AddHUDLine(
+ Transform.TransformPosition(FVector(ArrowTipDist, -ArrowSize, +ArrowSize)),
+ End, Thickness, Color.Quantize(), LifeTime);
+ Hud->AddHUDLine(
+ Transform.TransformPosition(FVector(ArrowTipDist, -ArrowSize, -ArrowSize)),
+ End, Thickness, Color.Quantize(), LifeTime);
}
void operator()(const Shape::Box &Box) const
@@ -146,66 +200,79 @@ struct FShapeVisitor
{
for(int32 j = 0; j < 2; ++j)
{
- P.X=B[i].X;
- Q.X=B[i].X;
- P.Y=B[j].Y;
- Q.Y=B[j].Y;
- P.Z=B[0].Z;
- Q.Z=B[1].Z;
+ P.X=B[i].X; Q.X=B[i].X; P.Y=B[j].Y;
+ Q.Y=B[j].Y; P.Z=B[0].Z; Q.Z=B[1].Z;
World->PersistentLineBatcher->DrawLine(
- Transform.TransformPosition(P),
- Transform.TransformPosition(Q),
- Color,
- DepthPriority,
- Thickness,
- LifeTime);
-
- P.Y=B[i].Y;
- Q.Y=B[i].Y;
- P.Z=B[j].Z;
- Q.Z=B[j].Z;
- P.X=B[0].X;
- Q.X=B[1].X;
+ Transform.TransformPosition(P), Transform.TransformPosition(Q),
+ Color, DepthPriority, Thickness, LifeTime);
+
+ P.Y=B[i].Y; Q.Y=B[i].Y; P.Z=B[j].Z;
+ Q.Z=B[j].Z; P.X=B[0].X; Q.X=B[1].X;
World->PersistentLineBatcher->DrawLine(
- Transform.TransformPosition(P),
- Transform.TransformPosition(Q),
- Color,
- DepthPriority,
- Thickness,
- LifeTime);
-
- P.Z=B[i].Z;
- Q.Z=B[i].Z;
- P.X=B[j].X;
- Q.X=B[j].X;
- P.Y=B[0].Y;
- Q.Y=B[1].Y;
+ Transform.TransformPosition(P), Transform.TransformPosition(Q),
+ Color, DepthPriority, Thickness, LifeTime);
+
+ P.Z=B[i].Z; Q.Z=B[i].Z; P.X=B[j].X;
+ Q.X=B[j].X; P.Y=B[0].Y; Q.Y=B[1].Y;
World->PersistentLineBatcher->DrawLine(
- Transform.TransformPosition(P),
- Transform.TransformPosition(Q),
- Color,
- DepthPriority,
- Thickness,
- LifeTime);
+ Transform.TransformPosition(P), Transform.TransformPosition(Q),
+ Color, DepthPriority, Thickness, LifeTime);
}
}
}
- void operator()(const Shape::String &Str) const
- {
- auto PlayerController = UGameplayStatics::GetPlayerController(World, 0);
- if (PlayerController == nullptr)
+ void operator()(const Shape::HUDBox &Box) const {
+ auto Hud = GetHUD();
+ if (!Hud) return; // Don't draw if HUD is not available.
+ const FVector Extent = 1e2f * FVector{Box.box.extent.x, Box.box.extent.y, Box.box.extent.z};
+ FTransform Transform = {FRotator(Box.rotation), Box.box.location};
+ const auto Thickness = Box.thickness;
+
+ ALargeMapManager* LargeMap = UCarlaStatics::GetLargeMapManager(World);
+ if (LargeMap)
{
- UE_LOG(LogCarla, Error, TEXT("Can't find player controller!"));
- return;
+ Transform = LargeMap->GlobalToLocalTransform(Transform);
}
+
+ FVector B[2], P, Q;
+ B[0] = -Extent;
+ B[1] = Extent;
+
+ for(int32 i = 0; i < 2; ++i)
+ {
+ for(int32 j = 0; j < 2; ++j)
+ {
+ P.X=B[i].X; Q.X=B[i].X; P.Y=B[j].Y;
+ Q.Y=B[j].Y; P.Z=B[0].Z; Q.Z=B[1].Z;
+ Hud->AddHUDLine(
+ Transform.TransformPosition(P), Transform.TransformPosition(Q),
+ Thickness, Color.Quantize(), LifeTime);
+
+ P.Y=B[i].Y; Q.Y=B[i].Y; P.Z=B[j].Z;
+ Q.Z=B[j].Z; P.X=B[0].X; Q.X=B[1].X;
+ Hud->AddHUDLine(
+ Transform.TransformPosition(P), Transform.TransformPosition(Q),
+ Thickness, Color.Quantize(), LifeTime);
+
+ P.Z=B[i].Z; Q.Z=B[i].Z; P.X=B[j].X;
+ Q.X=B[j].X; P.Y=B[0].Y; Q.Y=B[1].Y;
+ Hud->AddHUDLine(
+ Transform.TransformPosition(P), Transform.TransformPosition(Q),
+ Thickness, Color.Quantize(), LifeTime);
+ }
+ }
+ }
+
+ void operator()(const Shape::String &Str) const
+ {
+ auto Hud = GetHUD();
+ if (!Hud) return;
FVector Location = FVector(Str.location);
ALargeMapManager* LargeMap = UCarlaStatics::GetLargeMapManager(World);
if (LargeMap)
{
Location = LargeMap->GlobalToLocalLocation(Location);
}
- ACarlaHUD *Hud = Cast(PlayerController->GetHUD());
Hud->AddHUDString(carla::rpc::ToFString(Str.text), Location, Color.Quantize(), LifeTime);
}
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp
index c9f3aadd642..433335b6b7a 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp
@@ -459,17 +459,25 @@ FVehiclePhysicsControl ACarlaWheeledVehicle::GetVehiclePhysicsControl() const
{
FWheelPhysicsControl PhysicsWheel;
- PxVehicleWheelData PWheelData = Vehicle4W->PVehicle->mWheelsSimData.getWheelData(i);
- PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
- PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
- PhysicsWheel.Radius = PWheelData.mRadius;
- PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
- PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
-
- PxVehicleTireData PTireData = Vehicle4W->PVehicle->mWheelsSimData.getTireData(i);
- PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
- PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
- PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
+ if (bPhysicsEnabled) {
+ PxVehicleWheelData PWheelData = Vehicle4W->PVehicle->mWheelsSimData.getWheelData(i);
+
+ PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
+ PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
+ PhysicsWheel.Radius = PWheelData.mRadius;
+ PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
+ PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
+
+ PxVehicleTireData PTireData = Vehicle4W->PVehicle->mWheelsSimData.getTireData(i);
+
+ PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
+ PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
+ PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
+ } else {
+ if (i < LastPhysicsControl.Wheels.Num()) {
+ PhysicsWheel = LastPhysicsControl.Wheels[i];
+ }
+ }
PhysicsWheel.TireFriction = Vehicle4W->Wheels[i]->TireConfig->GetFrictionScale();
PhysicsWheel.Position = Vehicle4W->Wheels[i]->Location;
@@ -537,17 +545,23 @@ FVehiclePhysicsControl ACarlaWheeledVehicle::GetVehiclePhysicsControl() const
{
FWheelPhysicsControl PhysicsWheel;
- PxVehicleWheelData PWheelData = VehicleNW->PVehicle->mWheelsSimData.getWheelData(i);
- PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
- PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
- PhysicsWheel.Radius = PWheelData.mRadius;
- PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
- PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
-
- PxVehicleTireData PTireData = VehicleNW->PVehicle->mWheelsSimData.getTireData(i);
- PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
- PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
- PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
+ if (bPhysicsEnabled) {
+ PxVehicleWheelData PWheelData = VehicleNW->PVehicle->mWheelsSimData.getWheelData(i);
+ PhysicsWheel.DampingRate = Cm2ToM2(PWheelData.mDampingRate);
+ PhysicsWheel.MaxSteerAngle = FMath::RadiansToDegrees(PWheelData.mMaxSteer);
+ PhysicsWheel.Radius = PWheelData.mRadius;
+ PhysicsWheel.MaxBrakeTorque = Cm2ToM2(PWheelData.mMaxBrakeTorque);
+ PhysicsWheel.MaxHandBrakeTorque = Cm2ToM2(PWheelData.mMaxHandBrakeTorque);
+
+ PxVehicleTireData PTireData = VehicleNW->PVehicle->mWheelsSimData.getTireData(i);
+ PhysicsWheel.LatStiffMaxLoad = PTireData.mLatStiffX;
+ PhysicsWheel.LatStiffValue = PTireData.mLatStiffY;
+ PhysicsWheel.LongStiffValue = PTireData.mLongitudinalStiffnessPerUnitGravity;
+ } else {
+ if (i < LastPhysicsControl.Wheels.Num()) {
+ PhysicsWheel = LastPhysicsControl.Wheels[i];
+ }
+ }
PhysicsWheel.TireFriction = VehicleNW->Wheels[i]->TireConfig->GetFrictionScale();
PhysicsWheel.Position = VehicleNW->Wheels[i]->Location;
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/BaseCarlaMovementComponent.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/BaseCarlaMovementComponent.h
index 9a6c0b08459..509a64219ca 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/BaseCarlaMovementComponent.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/BaseCarlaMovementComponent.h
@@ -35,6 +35,8 @@ class CARLA_API UBaseCarlaMovementComponent : public UMovementComponent
virtual float GetVehicleForwardSpeed() const;
+ virtual void DisableSpecialPhysics() {};
+
protected:
void DisableUE4VehiclePhysics();
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.cpp
index 505c5289edc..a63b9857c4d 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.cpp
@@ -103,10 +103,7 @@ void UCarSimManagerComponent::ProcessControl(FVehicleControl &Control)
#endif
}
-void UCarSimManagerComponent::OnCarSimHit(AActor *Actor,
- AActor *OtherActor,
- FVector NormalImpulse,
- const FHitResult &Hit)
+void UCarSimManagerComponent::DisableCarSimPhysics()
{
#ifdef WITH_CARSIM
// finish Carsim simulation
@@ -130,6 +127,19 @@ void UCarSimManagerComponent::OnCarSimHit(AActor *Actor,
#endif
}
+void UCarSimManagerComponent::DisableSpecialPhysics()
+{
+ DisableCarSimPhysics();
+}
+
+void UCarSimManagerComponent::OnCarSimHit(AActor *Actor,
+ AActor *OtherActor,
+ FVector NormalImpulse,
+ const FHitResult &Hit)
+{
+ DisableCarSimPhysics();
+}
+
void UCarSimManagerComponent::OnCarSimOverlap(UPrimitiveComponent* OverlappedComponent,
AActor* OtherActor,
@@ -142,26 +152,7 @@ void UCarSimManagerComponent::OnCarSimOverlap(UPrimitiveComponent* OverlappedCom
ECollisionChannel::ECC_WorldDynamic) ==
ECollisionResponse::ECR_Block)
{
- #ifdef WITH_CARSIM
- // finish Carsim simulation
- UDefaultMovementComponent::CreateDefaultMovementComponent(CarlaVehicle);
- CarlaVehicle->GetMesh()->SetPhysicsLinearVelocity(FVector(0,0,0), false, "Vehicle_Base");
- CarlaVehicle->GetVehicleMovementComponent()->SetComponentTickEnabled(true);
- CarlaVehicle->GetVehicleMovementComponent()->Activate();
- CarlaVehicle->GetMesh()->PhysicsTransformUpdateMode = EPhysicsTransformUpdateMode::SimulationUpatesComponentTransform;
- auto * Bone = CarlaVehicle->GetMesh()->GetBodyInstance(NAME_None);
- if (Bone)
- {
- Bone->SetInstanceSimulatePhysics(true);
- }
- else
- {
- carla::log_warning("No bone with name");
- }
- CarlaVehicle->GetMesh()->SetCollisionResponseToChannel(ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Block);
- CarlaVehicle->GetMesh()->SetCollisionProfileName("Vehicle");
- CarlaVehicle->RestoreVehiclePhysicsControl();
- #endif
+ DisableCarSimPhysics();
}
}
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.h
index c4f7ee42feb..0d7ab42158b 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/CarSimManagerComponent.h
@@ -52,6 +52,10 @@ class CARLA_API UCarSimManagerComponent : public UBaseCarlaMovementComponent
float GetVehicleForwardSpeed() const override;
+ void DisableCarSimPhysics();
+
+ virtual void DisableSpecialPhysics() override;
+
private:
// On car mesh hit, only works when carsim is enabled
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.cpp
index 5250d88e1ab..5cac86c0e20 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.cpp
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.cpp
@@ -348,6 +348,11 @@ void UChronoMovementComponent::EndPlay(const EEndPlayReason::Type EndPlayReason)
}
#endif
+void UChronoMovementComponent::DisableSpecialPhysics()
+{
+ DisableChronoPhysics();
+}
+
void UChronoMovementComponent::DisableChronoPhysics()
{
this->SetComponentTickEnabled(false);
@@ -358,7 +363,6 @@ void UChronoMovementComponent::DisableChronoPhysics()
CarlaVehicle->GetMesh()->SetCollisionResponseToChannel(
ECollisionChannel::ECC_WorldStatic, ECollisionResponse::ECR_Block);
UDefaultMovementComponent::CreateDefaultMovementComponent(CarlaVehicle);
- carla::log_warning("Chrono physics does not support collisions yet, reverting to default PhysX physics.");
}
void UChronoMovementComponent::OnVehicleHit(AActor *Actor,
@@ -366,6 +370,7 @@ void UChronoMovementComponent::OnVehicleHit(AActor *Actor,
FVector NormalImpulse,
const FHitResult &Hit)
{
+ carla::log_warning("Chrono physics does not support collisions yet, reverting to default PhysX physics.");
DisableChronoPhysics();
}
@@ -383,6 +388,7 @@ void UChronoMovementComponent::OnVehicleOverlap(
ECollisionChannel::ECC_WorldDynamic) ==
ECollisionResponse::ECR_Block)
{
+ carla::log_warning("Chrono physics does not support collisions yet, reverting to default PhysX physics.");
DisableChronoPhysics();
}
}
diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.h
index 68e86f4d1cd..600cf0f3ea9 100644
--- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.h
+++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/MovementComponents/ChronoMovementComponent.h
@@ -101,6 +101,8 @@ class CARLA_API UChronoMovementComponent : public UBaseCarlaMovementComponent
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
#endif
+ virtual void DisableSpecialPhysics() override;
+
private:
void DisableChronoPhysics();
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/BP_OpenDriveToMap.uasset b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/BP_OpenDriveToMap.uasset
index b73e2caa59e..94bee4e500d 100644
Binary files a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/BP_OpenDriveToMap.uasset and b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/BP_OpenDriveToMap.uasset differ
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/Blueprints/BP_BuildingGenerator.uasset b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/Blueprints/BP_BuildingGenerator.uasset
index 165501747d2..0e6e56b6505 100644
Binary files a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/Blueprints/BP_BuildingGenerator.uasset and b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/Blueprints/BP_BuildingGenerator.uasset differ
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/MapPreview/W_MapPreview.uasset b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/MapPreview/W_MapPreview.uasset
index 3014c4eed41..d978ae881e2 100644
Binary files a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/MapPreview/W_MapPreview.uasset and b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/MapPreview/W_MapPreview.uasset differ
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_HoudiniBuildingImporter.uasset b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_HoudiniBuildingImporter.uasset
index fbf48f5db83..3348f8d44de 100644
Binary files a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_HoudiniBuildingImporter.uasset and b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_HoudiniBuildingImporter.uasset differ
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_OnRoadMainWidget.uasset b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_OnRoadMainWidget.uasset
index d1c30094bb7..3ca4126ad1f 100644
Binary files a/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_OnRoadMainWidget.uasset and b/Unreal/CarlaUE4/Plugins/CarlaTools/Content/OnroadMapGenerator/UW_OnRoadMainWidget.uasset differ
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs
index 5f1dc68d246..a5181554adb 100644
--- a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs
+++ b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/CarlaTools.Build.cs
@@ -6,7 +6,6 @@
public class CarlaTools : ModuleRules
{
- bool UsingHoudini = true;
bool bUsingOmniverseConnector = false;
private bool IsWindows(ReadOnlyTargetRules Target)
{
@@ -97,16 +96,6 @@ public CarlaTools(ReadOnlyTargetRules Target) : base(Target)
// ... add private dependencies that you statically link with here ...
}
);
- if(UsingHoudini)
- {
- PrivateDependencyModuleNames.AddRange(
- new string[]
- {
- "HoudiniEngine",
- "HoudiniEngineEditor",
- "HoudiniEngineRuntime"
- });
- }
if(bUsingOmniverseConnector)
{
PrivateDependencyModuleNames.AddRange(
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/HoudiniImportNodeWrapper.cpp b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/HoudiniImportNodeWrapper.cpp
index 015ffe56d4c..d2d57a4ee86 100644
--- a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/HoudiniImportNodeWrapper.cpp
+++ b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/HoudiniImportNodeWrapper.cpp
@@ -5,7 +5,6 @@
// For a copy, see .
#include "HoudiniImportNodeWrapper.h"
-#include "HoudiniAsset.h"
UHoudiniImportNodeWrapper::UHoudiniImportNodeWrapper(const FObjectInitializer& ObjectInitializer)
{
@@ -24,44 +23,15 @@ UHoudiniImportNodeWrapper* UHoudiniImportNodeWrapper::ImportBuildings(
int ClusterSize, int CurrentCluster,
bool bUseCOM)
{
- UE_LOG(LogCarlaTools, Log, TEXT("Start building import"));
- UHoudiniAsset* InHoudiniAsset = Cast(InHoudiniObject);
- if (!InHoudiniAsset)
- {
- UE_LOG(LogCarlaTools, Error, TEXT("Houdini asset not valid"));
- return nullptr;
- }
- UHoudiniImportNodeWrapper* WrapperNode = NewObject();
-
- TMap InParameters =
- { {"userMapName", FHoudiniParameterTuple(MapName)},
- {"osmPath", FHoudiniParameterTuple(OSMFilePath)},
- {"clusterSize", FHoudiniParameterTuple(ClusterSize)},
- {"displayedCluster", FHoudiniParameterTuple(CurrentCluster)},
- {"startCooking", FHoudiniParameterTuple(true)},
- {"lat", FHoudiniParameterTuple(Latitude)},
- {"lon", FHoudiniParameterTuple(Longitude)},
- {"centOfMass", FHoudiniParameterTuple(bUseCOM)}};
-
- WrapperNode->HDANode =
- UHoudiniPublicAPIProcessHDANode::ProcessHDA(
- InHoudiniAsset, InInstantiateAt, InParameters, {}, {},
- InWorldContextObject, nullptr,
- true, true, "", EHoudiniEngineBakeOption::ToActor,
- true);
- WrapperNode->HDANode->Completed.AddDynamic(WrapperNode, &UHoudiniImportNodeWrapper::HandleCompleted);
- WrapperNode->HDANode->Failed.AddDynamic(WrapperNode, &UHoudiniImportNodeWrapper::HandleFailed);
- UE_LOG(LogCarlaTools, Log, TEXT("HDA node created"));
- return WrapperNode;
+ UE_LOG(LogCarlaTools, Error, TEXT("Houdini asset not valid"));
+ return nullptr;
}
void UHoudiniImportNodeWrapper::Activate()
{
- HDANode->Activate();
}
void UHoudiniImportNodeWrapper::HandleCompleted(
- UHoudiniPublicAPIAssetWrapper* ,
bool bCookSuccess, bool bBakeSuccess)
{
UE_LOG(LogCarlaTools, Log, TEXT("Generation Finished"));
@@ -73,7 +43,6 @@ void UHoudiniImportNodeWrapper::HandleCompleted(
}
void UHoudiniImportNodeWrapper::HandleFailed(
- UHoudiniPublicAPIAssetWrapper* ,
bool bCookSuccess, bool bBakeSuccess)
{
UE_LOG(LogCarlaTools, Log, TEXT("Generation failed"));
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/OpenDriveToMap.cpp b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/OpenDriveToMap.cpp
index 8ee02779308..a3049125bbd 100644
--- a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/OpenDriveToMap.cpp
+++ b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Private/OpenDriveToMap.cpp
@@ -154,16 +154,32 @@ void UOpenDriveToMap::CreateMap()
UE_LOG(LogCarlaToolsMapGenerator, Error, TEXT("Map Name Is Empty") );
return;
}
- if ( !IsValid(FileDownloader) )
+
+ if( !Url.IsEmpty() ) {
+ if ( !IsValid(FileDownloader) )
+ {
+ FileDownloader = NewObject();
+ }
+
+ FileDownloader->ResultFileName = MapName;
+ FileDownloader->Url = Url;
+
+ FileDownloader->DownloadDelegate.BindUObject( this, &UOpenDriveToMap::ConvertOSMInOpenDrive );
+ FileDownloader->StartDownload();
+ }
+ else if(LocalFilePath.EndsWith(".xodr"))
{
- FileDownloader = NewObject();
+ ImportXODR();
+ }
+ else if(LocalFilePath.EndsWith(".osm"))
+ {
+ ImportOSM();
+ }
+ else
+ {
+ UE_LOG(LogCarlaToolsMapGenerator, Error, TEXT("URL and Local FilePath are Empty. URL: %s Local FilePath: %s"), *Url, *LocalFilePath );
}
- FileDownloader->ResultFileName = MapName;
- FileDownloader->Url = Url;
-
- FileDownloader->DownloadDelegate.BindUObject( this, &UOpenDriveToMap::ConvertOSMInOpenDrive );
- FileDownloader->StartDownload();
}
void UOpenDriveToMap::CreateTerrain( const int MeshGridSize, const float MeshGridSectionSize)
@@ -490,7 +506,7 @@ void UOpenDriveToMap::GenerateAll(const boost::optional& Param
{
GenerateRoadMesh(ParamCarlaMap, MinLocation, MaxLocation);
GenerateLaneMarks(ParamCarlaMap, MinLocation, MaxLocation);
- //GenerateSpawnPoints(ParamCarlaMap);
+ GenerateSpawnPoints(ParamCarlaMap, MinLocation, MaxLocation);
CreateTerrain(12800, 256);
GenerateTreePositions(ParamCarlaMap, MinLocation, MaxLocation);
GenerationFinished(MinLocation, MaxLocation);
@@ -714,10 +730,14 @@ void UOpenDriveToMap::GenerateSpawnPoints( const boost::optionalComputeTransform(Wp);
- AVehicleSpawnPoint *Spawner = UEditorLevelLibrary::GetEditorWorld()->SpawnActor();
- Spawner->SetActorRotation(Trans.GetRotation());
- Spawner->SetActorLocation(Trans.GetTranslation() + FVector(0.f, 0.f, SpawnersHeight));
- ActorsToMove.Add(Spawner);
+ if( Trans.GetLocation().X >= MinLocation.X && Trans.GetLocation().Y >= MinLocation.Y &&
+ Trans.GetLocation().X <= MaxLocation.X && Trans.GetLocation().Y <= MaxLocation.Y)
+ {
+ AVehicleSpawnPoint *Spawner = UEditorLevelLibrary::GetEditorWorld()->SpawnActor();
+ Spawner->SetActorRotation(Trans.GetRotation());
+ Spawner->SetActorLocation(Trans.GetTranslation() + FVector(0.f, 0.f, SpawnersHeight));
+ ActorsToMove.Add(Spawner);
+ }
}
}
@@ -878,6 +898,41 @@ bool UOpenDriveToMap::IsInRoad(
return false;
}
+void UOpenDriveToMap::ImportXODR(){
+ IPlatformFile& FileManager = FPlatformFileManager::Get().GetPlatformFile();
+ FString MyFileDestination = FPaths::ProjectContentDir() + "CustomMaps/" + MapName + "/OpenDrive/" + MapName + ".xodr";
+
+ if(FileManager.CopyFile( *MyFileDestination, *LocalFilePath,
+ EPlatformFileRead::None,
+ EPlatformFileWrite::None))
+ {
+ UE_LOG(LogCarlaToolsMapGenerator, Verbose, TEXT("FilePaths: File Copied!"));
+ FilePath = MyFileDestination;
+ LoadMap();
+ }
+ else
+ {
+ UE_LOG(LogCarlaToolsMapGenerator, Error, TEXT("FilePaths local xodr file not copied: File not Copied!"));
+ }
+}
+
+void UOpenDriveToMap::ImportOSM(){
+ IPlatformFile& FileManager = FPlatformFileManager::Get().GetPlatformFile();
+ FString MyFileDestination = FPaths::ProjectContentDir() + "CustomMaps/" + MapName + "/OpenDrive/" + MapName + ".osm";
+
+ if(FileManager.CopyFile( *MyFileDestination, *LocalFilePath,
+ EPlatformFileRead::None,
+ EPlatformFileWrite::None))
+ {
+ UE_LOG(LogCarlaToolsMapGenerator, Verbose, TEXT("FilePaths: File Copied!"));
+ ConvertOSMInOpenDrive();
+ }
+ else
+ {
+ UE_LOG(LogCarlaToolsMapGenerator, Error, TEXT("FilePaths local osm file not copied: File not Copied!"));
+ }
+}
+
void UOpenDriveToMap::MoveActorsToSubLevels(TArray ActorsToMove)
{
AActor* QueryActor = UGameplayStatics::GetActorOfClass(
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/HoudiniImportNodeWrapper.h b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/HoudiniImportNodeWrapper.h
index 02b6e74e306..b8ccc524862 100644
--- a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/HoudiniImportNodeWrapper.h
+++ b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/HoudiniImportNodeWrapper.h
@@ -8,9 +8,6 @@
#include "CoreMinimal.h"
#include "Kismet/BlueprintAsyncActionBase.h"
-
-#include "HoudiniPublicAPIProcessHDANode.h"
-
#include "HoudiniImportNodeWrapper.generated.h"
// Delegate type for output pins on the node.
@@ -49,17 +46,13 @@ class CARLATOOLS_API UHoudiniImportNodeWrapper : public UBlueprintAsyncActionBas
UFUNCTION()
void HandleCompleted(
- UHoudiniPublicAPIAssetWrapper* AssetWrapper,
bool bCookSuccess,
bool bBakeSuccess);
UFUNCTION()
void HandleFailed(
- UHoudiniPublicAPIAssetWrapper* AssetWrapper,
bool bCookSuccess,
bool bBakeSuccess);
-private:
- UHoudiniPublicAPIProcessHDANode* HDANode;
};
diff --git a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/OpenDriveToMap.h b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/OpenDriveToMap.h
index 2002c827564..115b456bb75 100644
--- a/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/OpenDriveToMap.h
+++ b/Unreal/CarlaUE4/Plugins/CarlaTools/Source/CarlaTools/Public/OpenDriveToMap.h
@@ -91,6 +91,9 @@ class CARLATOOLS_API UOpenDriveToMap : public UEditorUtilityObject
UPROPERTY( EditAnywhere, BlueprintReadWrite, Category="Settings" )
FString Url;
+ UPROPERTY( EditAnywhere, BlueprintReadWrite, Category="Settings" )
+ FString LocalFilePath;
+
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Settings")
FVector2D OriginGeoCoordinates;
@@ -213,6 +216,9 @@ class CARLATOOLS_API UOpenDriveToMap : public UEditorUtilityObject
void InitTextureData();
+ void ImportXODR();
+ void ImportOSM();
+
UPROPERTY()
UCustomFileDownloader* FileDownloader;
UPROPERTY()
diff --git a/Util/BuildTools/BuildCarlaUE4.bat b/Util/BuildTools/BuildCarlaUE4.bat
index bae39a3a183..cce89009025 100644
--- a/Util/BuildTools/BuildCarlaUE4.bat
+++ b/Util/BuildTools/BuildCarlaUE4.bat
@@ -129,18 +129,6 @@ if %REMOVE_INTERMEDIATE% == true (
)
)
-rem Download Houdini Plugin
-
-set HOUDINI_PLUGIN_REPO=https://github.com/sideeffects/HoudiniEngineForUnreal.git
-set HOUDINI_PLUGIN_PATH=Plugins/HoudiniEngine
-set HOUDINI_PLUGIN_COMMIT=55b6a16cdf274389687fce3019b33e3b6e92a914
-set HOUDINI_PATCH=${CARLA_UTIL_FOLDER}/Patches/houdini_patch.txt
-if not exist "%HOUDINI_PLUGIN_PATH%" (
- call git clone %HOUDINI_PLUGIN_REPO% %HOUDINI_PLUGIN_PATH%
- cd %HOUDINI_PLUGIN_PATH%
- call git checkout %HOUDINI_PLUGIN_COMMIT%
- cd ../..
-)
rem Build Carla Editor
rem
@@ -155,10 +143,10 @@ if exist %OMNIVERSE_PLUGIN_FOLDER% (
)
if %USE_CARSIM% == true (
- py -3 %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject" -e
+ python %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject" -e
set CARSIM_STATE="CarSim ON"
) else (
- py -3 %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject"
+ python %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject"
set CARSIM_STATE="CarSim OFF"
)
if %USE_CHRONO% == true (
diff --git a/Util/BuildTools/BuildCarlaUE4.sh b/Util/BuildTools/BuildCarlaUE4.sh
index 3100fc7ed9e..19f204447a7 100755
--- a/Util/BuildTools/BuildCarlaUE4.sh
+++ b/Util/BuildTools/BuildCarlaUE4.sh
@@ -19,7 +19,6 @@ USE_UNITY=true
USE_ROS2=false
EDITOR_FLAGS=""
-USE_HOUDINI=false
GDB=
RHI="-vulkan"
@@ -71,9 +70,6 @@ while [[ $# -gt 0 ]]; do
--no-unity )
USE_UNITY=false
shift ;;
- --with-houdini )
- USE_HOUDINI=true;
- shift ;;
-h | --help )
echo "$DOC_STRING"
echo "$USAGE_STRING"
@@ -136,22 +132,6 @@ if ${REMOVE_INTERMEDIATE} ; then
fi
-# ==============================================================================
-# -- Download Houdini Plugin for Unreal Engine ---------------------------------
-# ==============================================================================
-
-HOUDINI_PLUGIN_REPO=https://github.com/sideeffects/HoudiniEngineForUnreal.git
-HOUDINI_PLUGIN_PATH=Plugins/HoudiniEngine
-HOUDINI_PLUGIN_COMMIT=55b6a16cdf274389687fce3019b33e3b6e92a914
-HOUDINI_PATCH=${CARLA_UTIL_FOLDER}/Patches/houdini_patch.txt
-if [[ ! -d ${HOUDINI_PLUGIN_PATH} ]] ; then
- git clone ${HOUDINI_PLUGIN_REPO} ${HOUDINI_PLUGIN_PATH}
- pushd ${HOUDINI_PLUGIN_PATH} >/dev/null
- git checkout ${HOUDINI_PLUGIN_COMMIT}
- git apply ${HOUDINI_PATCH}
- popd >/dev/null
-fi
-
# ==============================================================================
# -- Build CarlaUE4 ------------------------------------------------------------
# ==============================================================================
diff --git a/Util/BuildTools/BuildPythonAPI.bat b/Util/BuildTools/BuildPythonAPI.bat
index cc8d92504bb..9812c8220ab 100644
--- a/Util/BuildTools/BuildPythonAPI.bat
+++ b/Util/BuildTools/BuildPythonAPI.bat
@@ -109,7 +109,7 @@ rem Build for Python 3
rem
if %BUILD_FOR_PYTHON3%==true (
echo Building Python API for Python 3.
- py -3 setup.py bdist_egg bdist_wheel
+ python setup.py bdist_egg bdist_wheel
if %errorlevel% neq 0 goto error_build_wheel
)
diff --git a/Util/BuildTools/Package.bat b/Util/BuildTools/Package.bat
index 6be833077a6..82f03da84a5 100644
--- a/Util/BuildTools/Package.bat
+++ b/Util/BuildTools/Package.bat
@@ -119,10 +119,10 @@ rem ============================================================================
if %DO_PACKAGE%==true (
if %USE_CARSIM% == true (
- py -3 %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject" -e
+ python %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject" -e
echo CarSim ON > "%ROOT_PATH%Unreal/CarlaUE4/Config/CarSimConfig.ini"
) else (
- py -3 %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject"
+ python %ROOT_PATH%Util/BuildTools/enable_carsim_to_uproject.py -f="%ROOT_PATH%Unreal/CarlaUE4/CarlaUE4.uproject"
echo CarSim OFF > "%ROOT_PATH%Unreal/CarlaUE4/Config/CarSimConfig.ini"
)
diff --git a/Util/BuildTools/Plugins.sh b/Util/BuildTools/Plugins.sh
index 94154d04cba..8514acb9945 100755
--- a/Util/BuildTools/Plugins.sh
+++ b/Util/BuildTools/Plugins.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
# ==============================================================================
# -- Parse arguments -----------------------------------------------------------
# ==============================================================================
diff --git a/Util/BuildTools/Setup.bat b/Util/BuildTools/Setup.bat
index 99dd8bb82ff..5a496a96640 100644
--- a/Util/BuildTools/Setup.bat
+++ b/Util/BuildTools/Setup.bat
@@ -320,6 +320,7 @@ IF "%USE_ROS2%"=="true" (
-DCMAKE_INSTALL_PREFIX="%FASTDDS_INSTALL_DIR%" ^
-DBUILD_SHARED_LIBS=ON ^
-DCMAKE_CXX_FLAGS_RELEASE="-D_GLIBCXX_USE_CXX11_ABI=0" ^
+ -DFOONATHAN_MEMORY_FORCE_VENDORED_BUILD=ON ^
..
ninja
ninja install
diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh
index 0a46ae55596..e91d149d7d5 100755
--- a/Util/BuildTools/Setup.sh
+++ b/Util/BuildTools/Setup.sh
@@ -92,15 +92,30 @@ for PY_VERSION in ${PY_VERSION_LIST[@]} ; do
BOOST_PACKAGE_BASENAME=boost_${BOOST_VERSION//./_}
log "Retrieving boost."
+
+ start=$(date +%s)
wget "https://archives.boost.io/release/${BOOST_VERSION}/source/${BOOST_PACKAGE_BASENAME}.tar.gz" || true
+ end=$(date +%s)
+ echo "Elapsed Time downloading from boost webpage: $(($end-$start)) seconds"
+
# try to use the backup boost we have in Jenkins
if [ ! -f "${BOOST_PACKAGE_BASENAME}.tar.gz" ] || [[ $(sha256sum "${BOOST_PACKAGE_BASENAME}.tar.gz") != "${BOOST_SHA256SUM}" ]] ; then
log "Using boost backup"
+
+ start=$(date +%s)
wget "https://carla-releases.s3.us-east-005.backblazeb2.com/Backup/${BOOST_PACKAGE_BASENAME}.tar.gz" || true
+ end=$(date +%s)
+ echo "Elapsed Time downloading from boost carla backup in backblaze: $(($end-$start)) seconds"
+
fi
log "Extracting boost for Python ${PY_VERSION}."
+
+ start=$(date +%s)
tar -xzf ${BOOST_PACKAGE_BASENAME}.tar.gz
+ end=$(date +%s)
+ echo "Elapsed Time Extracting boost for Python: $(($end-$start)) seconds"
+
mkdir -p ${BOOST_BASENAME}-install/include
mv ${BOOST_PACKAGE_BASENAME} ${BOOST_BASENAME}-source
@@ -166,8 +181,13 @@ else
log "Retrieving rpclib."
+ start_download_time=$(date +%s)
+
git clone -b ${RPCLIB_PATCH} https://github.com/carla-simulator/rpclib.git ${RPCLIB_BASENAME}-source
+ end_download_time=$(date +%s)
+
+ echo "Elapsed Time downloading rpclib: $(($end_download_time-$start_download_time)) seconds"
log "Building rpclib with libc++."
# rpclib does not use any cmake 3.9 feature.
@@ -234,8 +254,13 @@ else
log "Retrieving Google Test."
+ start_download_time=$(date +%s)
+
git clone --depth=1 -b release-${GTEST_VERSION} https://github.com/google/googletest.git ${GTEST_BASENAME}-source
+ end_download_time=$(date +%s)
+ echo "Elapsed Time downloading rpclib: $(($end_download_time-$start_download_time)) seconds"
+
log "Building Google Test with libc++."
mkdir -p ${GTEST_BASENAME}-libcxx-build
@@ -296,11 +321,14 @@ else
log "Retrieving Recast & Detour"
- git clone https://github.com/carla-simulator/recastnavigation.git ${RECAST_BASENAME}-source
+ start=$(date +%s)
- pushd ${RECAST_BASENAME}-source >/dev/null
+ git clone --depth 1 -b carla https://github.com/carla-simulator/recastnavigation.git ${RECAST_BASENAME}-source
+
+ end=$(date +%s)
+ echo "Elapsed Time downloading: $(($end-$start)) seconds"
- git checkout carla
+ pushd ${RECAST_BASENAME}-source >/dev/null
popd >/dev/null
@@ -351,10 +379,18 @@ if [[ -d ${LIBPNG_INSTALL} ]] ; then
log "Libpng already installed."
else
log "Retrieving libpng."
+
+ start=$(date +%s)
wget ${LIBPNG_REPO}
+ end=$(date +%s)
+ echo "Elapsed Time downloading libpng: $(($end-$start)) seconds"
+ start=$(date +%s)
log "Extracting libpng."
tar -xf libpng-${LIBPNG_VERSION}.tar.xz
+ end=$(date +%s)
+ echo "Elapsed Time Extracting libpng: $(($end-$start)) seconds"
+
mv ${LIBPNG_BASENAME} ${LIBPNG_BASENAME}-source
pushd ${LIBPNG_BASENAME}-source >/dev/null
@@ -388,16 +424,26 @@ if [[ -d ${XERCESC_INSTALL_DIR} && -d ${XERCESC_INSTALL_SERVER_DIR} ]] ; then
log "Xerces-c already installed."
else
log "Retrieving xerces-c."
+ start=$(date +%s)
wget ${XERCESC_REPO}
-
+ end=$(date +%s)
+ echo "Elapsed Time downloading from xerces repo: $(($end-$start)) seconds"
# try to use the backup boost we have in Jenkins
if [[ ! -f "${XERCESC_BASENAME}.tar.gz" ]] ; then
log "Using xerces backup"
+ start=$(date +%s)
wget "https://carla-releases.s3.us-east-005.backblazeb2.com/Backup/${XERCESC_BASENAME}.tar.gz" || true
+ end=$(date +%s)
+ echo "Elapsed Time downloading from xerces backup: $(($end-$start)) seconds"
fi
log "Extracting xerces-c."
+
+ start=$(date +%s)
tar -xzf ${XERCESC_BASENAME}.tar.gz
+ end=$(date +%s)
+ echo "Elapsed Time Extracting xerces-c: $(($end-$start)) seconds"
+
mv ${XERCESC_BASENAME} ${XERCESC_SRC_DIR}
mkdir -p ${XERCESC_INSTALL_DIR}
mkdir -p ${XERCESC_SRC_DIR}/build
@@ -461,10 +507,18 @@ if [[ -d ${EIGEN_INSTALL_DIR} ]] ; then
log "Eigen already installed."
else
log "Retrieving Eigen."
+
+ start=$(date +%s)
wget ${EIGEN_REPO}
+ end=$(date +%s)
+ echo "Elapsed Time downloading from eigen repo: $(($end-$start)) seconds"
log "Extracting Eigen."
+ start=$(date +%s)
tar -xzf ${EIGEN_BASENAME}.tar.gz
+ end=$(date +%s)
+ echo "Elapsed Time Extracting EIGEN: $(($end-$start)) seconds"
+
mv ${EIGEN_BASENAME} ${EIGEN_SRC_DIR}
mkdir -p ${EIGEN_INCLUDE}/unsupported
mv ${EIGEN_SRC_DIR}/Eigen ${EIGEN_INCLUDE}
@@ -496,10 +550,19 @@ if ${USE_CHRONO} ; then
log "Eigen already installed."
else
log "Retrieving Eigen."
+
+ start=$(date +%s)
wget ${EIGEN_REPO}
+ end=$(date +%s)
+ echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting Eigen."
+
+ start=$(date +%s)
tar -xzf ${EIGEN_BASENAME}.tar.gz
+ end=$(date +%s)
+ echo "Elapsed Time Extracting for Eigen: $(($end-$start)) seconds"
+
mv ${EIGEN_BASENAME} ${EIGEN_SRC_DIR}
mkdir -p ${EIGEN_INCLUDE}/unsupported
mv ${EIGEN_SRC_DIR}/Eigen ${EIGEN_INCLUDE}
@@ -527,7 +590,10 @@ if ${USE_CHRONO} ; then
log "chrono library already installed."
else
log "Retrieving chrono library."
+ start=$(date +%s)
git clone --depth 1 --branch ${CHRONO_TAG} ${CHRONO_REPO} ${CHRONO_SRC_DIR}
+ end=$(date +%s)
+ echo "Elapsed Time dowloading chrono: $(($end-$start)) seconds"
mkdir -p ${CHRONO_SRC_DIR}/build
@@ -574,10 +640,19 @@ if [[ -d ${SQLITE_INSTALL_DIR} ]] ; then
log "Sqlite already installed."
else
log "Retrieving Sqlite3"
+
+ start=$(date +%s)
wget ${SQLITE_REPO}
+ end=$(date +%s)
+ echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting Sqlite3"
+
+ start=$(date +%s)
tar -xzf ${SQLITE_TAR}
+ end=$(date +%s)
+ echo "Elapsed Time Extracting for SQlite: $(($end-$start)) seconds"
+
mv ${SQLITE_VERSION} ${SQLITE_SOURCE_DIR}
mkdir ${SQLITE_INSTALL_DIR}
@@ -621,10 +696,18 @@ if [[ -d ${PROJ_INSTALL_DIR} && -d ${PROJ_INSTALL_SERVER_DIR_FULL} ]] ; then
log "PROJ already installed."
else
log "Retrieving PROJ"
+
+ start=$(date +%s)
wget ${PROJ_REPO}
+ end=$(date +%s)
+ echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting PROJ"
+ start=$(date +%s)
tar -xzf ${PROJ_TAR}
+ end=$(date +%s)
+ echo "Elapsed Time Extracting for PROJ: $(($end-$start)) seconds"
+
mv ${PROJ_VERSION} ${PROJ_SRC_DIR}
mkdir -p ${PROJ_SRC_DIR}/build
@@ -692,10 +775,18 @@ if [[ -d ${PATCHELF_INSTALL_DIR} ]] ; then
log "Patchelf already installed."
else
log "Retrieving patchelf"
+
+ start=$(date +%s)
wget ${PATCHELF_REPO}
+ end=$(date +%s)
+ echo "Elapsed Time: $(($end-$start)) seconds"
log "Extracting patchelf"
+ start=$(date +%s)
tar -xzf ${PATCHELF_TAR}
+ end=$(date +%s)
+ echo "Elapsed Time Extracting patchelf: $(($end-$start)) seconds"
+
mv patchelf-${PATCHELF_VERSION} ${PATCHELF_SOURCE_DIR}
mkdir ${PATCHELF_INSTALL_DIR}
@@ -730,7 +821,12 @@ if ${USE_PYTORCH} ; then
LIBTORCH_ZIPFILE=libtorch-shared-with-deps-1.11.0+cu113.zip
LIBTORCH_REPO=https://download.pytorch.org/libtorch/cu113/libtorch-shared-with-deps-1.11.0%2Bcu113.zip
if [[ ! -d ${LIBTORCH_PATH} ]] ; then
+
+ start=$(date +%s)
wget ${LIBTORCH_REPO}
+ end=$(date +%s)
+ echo "Elapsed Time downloading LIBTORCH_REPO: $(($end-$start)) seconds"
+
unzip ${LIBTORCH_ZIPFILE}
fi
@@ -810,7 +906,10 @@ if ${USE_ROS2} ; then
if [[ ! -d ${LIB_SOURCE} ]] ; then
mkdir -p ${LIB_SOURCE}
log "${LIB_REPO}"
+ start=$(date +%s)
git clone --depth 1 --branch ${LIB_BRANCH} ${LIB_REPO} ${LIB_SOURCE}
+ end=$(date +%s)
+ echo "Elapsed Time dowloading fastdds extension: $(($end-$start)) seconds"
mkdir -p ${LIB_SOURCE}/build
fi
}
@@ -827,6 +926,7 @@ if ${USE_ROS2} ; then
-DCMAKE_INSTALL_PREFIX="${FASTDDS_INSTALL_DIR}" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_CXX_FLAGS_RELEASE="-D_GLIBCXX_USE_CXX11_ABI=0" \
+ -DFOONATHAN_MEMORY_FORCE_VENDORED_BUILD=ON \
..
ninja
ninja install
@@ -860,7 +960,8 @@ if ${USE_ROS2} ; then
-DCMAKE_INSTALL_PREFIX="${FASTDDS_INSTALL_DIR}" \
-DCMAKE_CXX_FLAGS=-latomic \
-DCMAKE_CXX_FLAGS_RELEASE="-D_GLIBCXX_USE_CXX11_ABI=0" \
- \
+ -DTHIRDPARTY_Asio=FORCE \
+ -DTHIRDPARTY_TinyXML2=FORCE \
..
ninja
ninja install
diff --git a/Util/InstallersWin/install_zlib.bat b/Util/InstallersWin/install_zlib.bat
index e6bdf2db684..d14a5367dc3 100644
--- a/Util/InstallersWin/install_zlib.bat
+++ b/Util/InstallersWin/install_zlib.bat
@@ -54,7 +54,7 @@ set ZLIB_TEMP_FOLDER=%ZLIB_BASENAME%-%ZLIB_VERSION%
set ZLIB_TEMP_FILE=%ZLIB_TEMP_FOLDER%.zip
set ZLIB_TEMP_FILE_DIR=%BUILD_DIR%%ZLIB_TEMP_FILE%
-set ZLIB_REPO=https://www.zlib.net/zlib%ZLIB_VERSION:.=%.zip
+set ZLIB_REPO=https://github.com/madler/zlib/archive/refs/tags/v%ZLIB_VERSION%.zip
set ZLIB_BACKUP_REPO=https://carla-releases.s3.us-east-005.backblazeb2.com/Backup/zlib%ZLIB_VERSION:.=%.zip
set ZLIB_SRC_DIR=%BUILD_DIR%%ZLIB_BASENAME%-source\
set ZLIB_INSTALL_DIR=%BUILD_DIR%%ZLIB_BASENAME%-install\
diff --git a/Util/Patches/houdini_patch.txt b/Util/Patches/houdini_patch.txt
deleted file mode 100644
index ddc164d65c5..00000000000
--- a/Util/Patches/houdini_patch.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/Source/HoudiniEngineEditor/Private/HoudiniEngineDetails.cpp b/Source/HoudiniEngineEditor/Private/HoudiniEngineDetails.cpp
-index 36c9bf5cd..d9d6dbfdb 100755
---- a/Source/HoudiniEngineEditor/Private/HoudiniEngineDetails.cpp
-+++ b/Source/HoudiniEngineEditor/Private/HoudiniEngineDetails.cpp
-@@ -1131,8 +1131,8 @@ FHoudiniEngineDetails::CreateAssetOptionsWidgets(
-
- auto IsCheckedParameterChangedLambda = [MainHAC]()
- {
-- if (!IsValidWeakPointer(MainHAC))
-- return ECheckBoxState::Unchecked;
-+ if (!IsValidWeakPointer(MainHAC))
-+ return ECheckBoxState::Unchecked;
-
- return MainHAC->bCookOnParameterChange ? ECheckBoxState::Checked : ECheckBoxState::Unchecked;
- };
diff --git a/mkdocs.yml b/mkdocs.yml
index 40a876c9e1a..c2a5aae009d 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -42,7 +42,7 @@ nav:
- 'Chrono': 'tuto_G_chrono.md'
- 'MathWorks': 'large_map_roadrunner.md'
- 'NVIDIA SimReady': 'ecosys_simready.md'
- - 'OpenDRIVE': 'adv_opendrive.md'
+ - 'ASAM OpenDRIVE': 'adv_opendrive.md'
- 'PTV Vissim': 'adv_ptv.md'
- 'RSS': 'adv_rss.md'
- 'ROS': https://carla.readthedocs.io/projects/ros-bridge/en/latest/