Merge branch 'dev' into julee/fix_enum_to_string

This commit is contained in:
Blyron 2024-04-10 16:21:25 +02:00 committed by GitHub
commit 3a3b0b5c24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
173 changed files with 3685 additions and 1143 deletions

21
.readthedocs.yaml Normal file
View File

@ -0,0 +1,21 @@
# Read the Docs configuration file for MkDocs projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.7"
mkdocs:
configuration: mkdocs.yml
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: Docs/requirements.txt

View File

@ -1,14 +0,0 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
mkdocs:
configuration: mkdocs.yml
formats: all
python:
version: 3.7
install:
- requirements: Docs/requirements.txt

View File

@ -1,17 +1,29 @@
## Latest
## Latest Changes
* Prevent from segfault on failing SignalReference identification when loading OpenDrive files
* Added vehicle doors to the recorder
* 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.
* Added build support for VS2022 and Ninja for LibCarla and osm2odr on Windows
* Fixed bug causing the TM's unstuck logic to incorrectly remove the vehicles in some situations.
* Fixed the extra data in Directx textures, so we need to copy row by row on Windows to remove extra bytes on images
* Added API functions to enable sensor data publishing for ROS2 without listen to it
* `Sensor.enable_for_ros()`
* `Sensor.disable_for_ros()`
* `Sensor.is_enabled_for_ros()`
* Fixed vertices of big meshes (more than 65k vertices) in CarlaExporter
* Fixed sensors to check for the stream to be ready (race condition)
* Added empty actor
## CARLA 0.9.15
* Added Digital Twins feature version 0.1. Now you can create your own map based on OpenStreetMaps
* Added compatibility with SymReady Assets, using NVIDIA Omniverse
* Added new maps: Town13 (is a large map) and Town15
* The spectator will be used to load tiles and actor in Large Maps when no other actors with the rolename 'ego_vehicle' or 'hero' are present. Added the `spectator_as_ego` to the `carla.WorldSettings()` to allow users to disable this behavior.
* Fixed the import script, where could use any other TilesInfo.txt if the destination folder has many
* Add keyword arguments for `carla.TrafficManager` Python API functions
* Added build support for VS2022 and Ninja for LibCarla and osm2odr on Windows
* Added empty actor
* Restored gamma value to 2.2 instead of 2.4
* CarlaExporter tool now exports the box collider and convex collider of the object if it has one, otherwise the mesh
* Pedestrians with AI or in replayer are now faster around 10x. They have collisions disabled until they hit a vehicle.
@ -20,12 +32,18 @@
* `start_replaying.py` using flag `--move-spectator`
* Surface non-unity build mode by passing ARGS=--no-unity to make; allows IWYU-type errors to be unmasked and fixed.
* Added maps, vehicles, pedestrians and props catalogues to the documentation
* Add keyword arguments for `carla.TrafficManager` Python API functions
* Fixed bug causing the `FPixelReader::SavePixelsToDisk(PixelData, FilePath)` function to crash due to pixel array not set correctly.
* Collisions detected by the CollisionSensor no longer generate more than one event per frame.
* Fixed segfaults in Python API due to incorrect GIL locking under Python 3.10.
* Added API function to load a map only if it is different from the current one.
* Fixed a bug in the TrafficManager causing vehicles that reached an ending lane to have abnormal behavior while lane changing.
* Fixed bug causing the TM's unstuck logic to incorrectly remove the vehicles in some situations.
* Fixed the extra data in Directx textures, so we need to copy row by row on Windows to remove extra bytes on images
* Fixed vertices of big meshes (more than 65k vertices) in CarlaExporter
* Fixed sensors to check for the stream to be ready (race condition)
* 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

View File

@ -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):

View File

@ -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

87
Docs/adv_digital_twin.md Normal file
View File

@ -0,0 +1,87 @@
!!! note
The __Digital Twin Tool__ is currently an __experimental feature__ and is not considered *production ready* at this stage. Some parts of maps may be undecorated or untextured. Hence it should only be used for experimental research projects.
# Digital Twin Tool
![digital_twin_pipeline](img/pipeline.jpg)
- [__Downloading and preparing OSM map data__](#downloading-and-preparing-osm-map-data)
- [__OpenStreetMap browser__](#openstreetmap-browser)
- [__Procedural environment generation__](#procedural-environment-generation)
- [Road decoration](#overview)
- [Buildings](#alsm)
- [__Generate the map__](#generate-the-map)
- [__Save the map__](#save-the-map)
The __Digital Twin Tool__ enables procedural generation of unique 3D environments based on road networks derived from the [OpenStreetMap](https://www.openstreetmap.org) (OSM) service. Through the Digital Twin Tool interface in CARLA's Unreal Engine editor a user can select a region of map from OSM and download the road network as the basis for a new CARLA map. The tool then fills the spaces between the roads with procedurally generated 3D buildings that adjust to the layout of the road, creating a realistic 3D road environment with high variability.
## 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.
## Downloading and preparing OSM map data
![osm_website](img/osm_export.png)
In a web-browser, go to the [OpenStreetMap website](https:/www.openstreetmap.org) and choose an area of the map which you would like to use. Define your region and then export the data as an `.osm` file, or you can use a URL, as explained later. Alternatively, you could use other tools based on the OpenStreetMap service such as [GeoFabrik](https://download.geofabrik.de/), which allows specific map regions such as states or territories to be extracted from the OSM data.
There are two ways to use the OSM data. Using a URL or downloading an OSM file:
### Using a URL
In the [OpenStreetMap website](https:/www.openstreetmap.org) website, navigate to an area of interest, then press `Export`, you may also want to use the `Manually select a different area` option. Then, right click on `Overpass API` and select `Copy link` from the context menu. You must ensure that the file will be no bigger than 1 Gb. Take this link and paste it into the URL field of the interface.
### Downloading an OSM file and navigating in the interface
This option is only available to Linux users. You may download a larger region of map, for example an entire state or territory, then use the OSM interface in CARLA to navigate the map using the arrow and zoom buttons. Download your desired region of OSM data as a `.osm` file, then place this file in the `{CARLA_ROOT}/Build/libosmcout-source/maps/` folder. Open a terminal inside this folder and run the following command:
```sh
cd {CARLA_ROOT}/Build/libosmcout-source/maps/
./build.sh <path_to_osm_file>
```
## OpenStreetMap browser
To open the OSM browser, open the content browser and navigate to `CarlaToolsContent/OnroadMapGenerator`. Right click on *UW_OnRoadMainWidget* and select *Launch Editor Utility Widget* from the context menu. This will open the tool's interface.
![osm_interface_open](img/digital_twins_widget.png)
The interface enables browsing of a region of OSM map that has been downloaded from the OSM database and baked. First, you should enter the directory location where you stored the processed OSM data in the previous step in the *Select OSM Database* field in the interface. If you are using a URL directly, paste it into the `OSM URL` field, you will not be able to use the navigator in this case.
![osm_interface](img/digital_twins_interface.png)
Use the directional arrows and the zoom icons to navigate the map and find a part of the road network you want to turn into a CARLA map. The square region you see in the preview will be the extent of your map. Enter an appropriate name in the `File Name` field and then press *generate* to start the procedural generation process. The map generation process may take several minutes, or more if you are using a large region.
## Procedural environment generation
### Road decoration
The tool extracts the road network from the OSM data as the basis of the map. The road surface is decorated with realistic surface irregularities, road markings and textures.
![road_markings](img/road_surface.jpg)
### Buildings
The empty spaces between the roads are populated with buildings or open areas that will adjust their shape and dimensions to fill the space between the roads.
![procedural_buildings](img/procedural_building_generation.jpg)
The procedural generation tool extracts the building footprints and height information from the OSM data to generate virtual buildings with similar dimensions. Detailed cladding is applied to simulate windows, doors and balconies. Different decoration styles are applied depending upon the dimensions of the building, with the tallest buildings having an office style, smaller buildings have a commercial or residential style applied according to the area of the building footprint.
![procedural_cities](img/digital_twins_vegetation.jpg)
Vegetation is also added to the pavements in the next step step for additional detail.
![residential_building_style](img/digital_twins_buildings.jpg)
*Digital Twin Tool building styles*
The buildings are in a variety of styles that are randomly distributed throughout the city, the architectural style of an area is chosen based on the characteristic dimensions of the buildings extracted from the OSM data.
## Generate the map
The generation step will take around 10 minutes for a 2x2 km<sup>2</sup> region, larger regions will take longer. Once the generation process has finished, you can examine the map in 3D in the Unreal Engine editor.
## Save the map
If you are satisfied with the generated map then you can press *Save Map* button to save the map. __This step will take a significant amount of time__, it may take over an hour and could take several. You should prepare to leave your computer running for several hours while this step is completed. Once this step is completed, the map will be available through the Unreal Engine editor or through the CARLA API, the same as any other map.

View File

@ -1,52 +1,49 @@
# Carla Multi-GPU feature
Multi-GPU in carla means that the user can start several servers (called secondary servers) that will do render work for the main server (called primary server) for different sensors.
Multi-GPU in carla means that the user can start several servers (called secondary servers) that will do render work for the main server (called primary server) using a dedicated GPU from the system. The primary server will distribute the sensors, that are created by the user, to the different secondary servers available.
![Multi-GPU example with 2 secondary servers](img/multigpu-example.png)
We need to start the primary server (usually with a flag to avoid using any GPU). This server will process all physics and synchronize the scene data to the others secondary servers. Then we can start any secondary server as we want (usually one per dedicated GPU in the system), using the parameters we will describe further. After this, the client can connect (always to the primary server) and proceed as usual.
All the system is transparent to the user, who don't need to know from which server comes the sensor data, he just receives the data directly from a secondary server.
## Primary server
The steps are: first, start the primary server without any render capability. The parameters we can use are:
The steps are, first, start the primary server without any render capability.
The parameters we can use are:
* `-nullrhi`: disables any render capabilities (GPU free)
* `-carla-primary-port`: TCP port used to listen for secondary servers (default 2002)
* `-nullrhi`
* `-carla-primary-port`
For example
Run the following from the command line:
**./CarlaUE4.sh -nullrhi**
```sh
./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
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 port flag:
```sh
./CarlaUE4.sh -nullrhi -carla-primary-port=3002
```
**./CarlaUE4.sh -nullrhi -carla-primary-port=3002**
## Secondary servers
We may then start as many servers as we need, but the ideal is to have as many secondary servers as the number of GPUs installed in the computer. Through parameters we need to specify the GPU we want the server use and also the host/port where the primary server is listening, with the flags:
Then we need to start as many servers as we want, but the ideal is to have as many secondary servers as GPU. Through parameters we need to specify the GPU we want the server use and also the host/port where the primary server is listenning, with the flags:
* `-carla-rpc-port`: TCP port to accept client connections (for secondary servers it is not needed, but the port needs to be free)
* `-carla-primary-host`: IP of the primary server to connect
* `-carla-primary-port`: TCP port of the primary server to connect
* `-ini:[/Script/Engine.RendererSettings]:r.GraphicsAdapter`: tells which GPU device to use for this secondary server
* `-carla-rpc-port`
* `-carla-primary-host`
* `-carla-primary-port`
* `-ini:[/Script/Engine.RendererSettings]:r.GraphicsAdapter`
For example, if the primary server is executing in the same computer than the secondary servers and with the default port, we can use this:
For example, if the primary server is executing in the same computer than the secondary servers and with the default port, we can use this command:
```sh
./CarlaUE4.sh -carla-rpc-port=3000 -carla-primary-host=127.0.0.1 -ini:[/Script/Engine.RendererSettings]:r.GraphicsAdapter=0
```
**./CarlaUE4.sh -carla-rpc-port=3000 -carla-primary-host=127.0.0.1 -ini:[/Script/Engine.RendererSettings]:r.GraphicsAdapter=0**
Here, the secondary server will use port 3000 as the RPC server to avoid conflicts with other ports (but it will never be used), and will connect to the primary server located at IP 127.0.0.1 (localhost) in the default port (2002), and also this server will use the GPU device 0.
If we want to start another secondary server using another GPU, we could use the following command:
If we want to start another secondary server in the same machine using another GPU, we could use this command:
```sh
./CarlaUE4.sh -carla-rpc-port=4000 -carla-primary-host=127.0.0.1 -carla-primary-port=2002 -ini:[/Script/Engine.RendererSettings]:r.GraphicsAdapter=1
```
**./CarlaUE4.sh -carla-rpc-port=4000 -carla-primary-host=127.0.0.1 -carla-primary-port=2002 -ini:[/Script/Engine.RendererSettings]:r.GraphicsAdapter=1**
This secondary server will use port 4000 as the RPC server to avoid conflicts with other ports and will connect to the primary server located at IP 127.0.0.1 in port 2002, and also this server will use the GPU device 1.
This secondary server will use port 4000 as the RPC server to avoid conflicts with other ports and will connect to the primary server located at IP 127.0.0.1 in the port 2002, and also this server will use the GPU device 1.
## Pipeline
## Synchronous mode
After the first secondary server connects to the primary server, the system is setup to synchronous mode automatically, with the default values of 1/20 delta seconds.
After the first secondary server connects to the primary server, it will set up the synchronous mode automatically, with the default values of 1/20 delta seconds.

View File

@ -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.

View File

@ -0,0 +1,153 @@
!!! note
The __Procedural Building Tool__ is currently an __experimental feature__ and is not considered *production ready* at this stage. Hence it should only be used for experimental research projects.
# Procedural Building Tool
The __Procedural Building Tool__ facilitates the generation of virtual 3D buildings for which the dimensions and decoration styles can be modulated to create a near infinite array of variations through a simple interface. The footprint dimensions and height in stories can be chosen through the interface. Then users can select a variety of styles for the building lobby, the body and the top floor or penthouse. A variety of facia element styles can be chosen for features such as corners windows and balconies from the CARLA asset library.
- [__Opening the tool__](#opening-the-procedural-building-tool)
- [__Base parameters__](#base-parameters)
- [__Mesh parameters__](#mesh-parameters)
- [__Mesh elements__](#mesh-elements)
- [Sockets](#sockets)
- [__Facade materials__](#facade-materials)
- [__Cooking__](#cooking)
## Opening the Procedural Building Tool
Firstly, you need to add a procedural building actor to the scene. Navigate to `Content>Carla>Blueprints>LevelDesign` and drag the *BP_ProceduralBuilding* blueprint into your map. Move the asset to the position where you wish to visualize the building. Choose a place where you have space so you can see the result clearly. Then to open the tool, launch the Procedural Building tool by right clicking on the *WD_ProceduralBuilding* widget and selecting *Run editor utility widget* from the context menu. This will open the tool's interface.
![open_pb_tool](img/open_pb_tool.png)
!!! note
You must complete this step before opening the tool, an instance of the *BP_ProceduralBuilding* blueprint must exist in the map before the tool can function. You must also ensure that the *BP_ProceduralBuilding* entity is selected in the *World outliner* before proceeding.
## Base parameters
![base_parameters](img/pb_base_parameters.png)
In the base parameters section you select the fundamental properties of your building, such as the footprint and the height in floors.
!!! note
Until you have selected mesh pieces in the [mesh parameters](#mesh-parameters) section, you will not see any changes in the Unreal Engine viewport when you adjust the base parameters
The available parameters are as follows:
- __Seed__: sets the random seed for the procedural generation, this enables variations on the building with the same settings.
- __Num floors__: sets the number of stories or floors the building will have, and henceforth defines the height of the building.
- __Length X/Y__: defines the size of the footprint of the building in the X and Y dimensions. These are unitless, the number denotes the number repeating sections, each section is a column of windows.
- __Create automatically__: if this option is selected, the building will automatically update in the viewport so you can see the effect of your adjustments.
- __Corners__: allows corner pieces to be added to the building, you can choose these pieces in the Mesh Parameters section.
- __Walls__: replace the middle pieces of the left/right/front/back of the building with alternate pieces that can be selected using the [Mesh parameters](#mesh-parameters) menu.
- __Doors__: array allowing the placement of a door in the lobby level. The door is placed at the chosen index position.
## Mesh parameters
![mesh_parameters](img/pb_mesh_parameters.png)
In the Mesh Parameters tab in the interface, we choose the mesh pieces that will be used to clad the exterior of the building. There are 5 categories of mesh pieces for different parts of the building:
- __Lobby__: mesh pieces to decorate the lobby of the building.
- __Midsection__: mesh pieces to decorate the midsection of the building, every floor between the lobby and the top floor.
- __Penthouse__: mesh pieces to decorate the penthouse level.
- __Doors__: mesh pieces to add doors to the lobby
- __Walls__: mesh pieces to decorate the walls of the building
In each category you will find numerous options for mesh pieces. Click on one or more such that they turn red, these will be added to the respective section of your building. If you choose more than one, the tool will randomly alternate between the choices. As you select the mesh pieces for each section of your building, if you have *Create automatically* selected in the base parameters section, you will see the building taking shape in the editor viewport.
![building_parts](img/pb_building_parts.png)
## Mesh elements
![mesh_elements](img/pb_mesh_elements.png)
In this section you can select the more detailed elements of the building such as windows, columns, plant pots, air conditioning units and antennas. Each type of decoration has slightly different properties.
There are numerous types of decoration for details of the building:
- __Vertical/Horizontal window meshes__: these mesh pieces define the style of the window frames in the building. Vertical window meshes will occupy the window spaces that are taller than their width, while horizontal window meshes will occupy the window spaces that are wider than their height. If you select multiple options, they will alternate.
- __Column meshes__: these simulate brickwork column details that span the height of the building
- __Top/Bottom window details__: these meshes decorate the top of the windows with lintels and sunshades and the bottom of the windows with window sills and plant boxes.
- __Window columns__: brickwork columns that separate windows
- __Curtain meshes__: curtains and blinds to go inside the windows
- __Pot meshes__: plant pots that are added to window sills and plant boxes at specified socket points
- __Air conditioner meshes__: air conditioning units that are added to the windows at specified socket points
- __Pipe meshes__: pipes that descend the building vertically mimicking drainage pipes for the roof
- __Wire meshes__: wires that descend the building vertically mimicking TV aerial extensions and lightning grounding wires
- __Antenna meshes__: TV antennas that protrude from the windows
![mesh_variations](img/pb_detail_variations.webp)
The parameters work as follows:
__Common parameters__:
* __Percentage__: controls the amount pieces that will be placed on the building, 100% means all available spaces will be occupied
* __Offset__: spacial offset of the piece from the body of the building
__Blinds and curtains__:
* __Min/Max size__: selects the min/max length of the blinds or curtains with random variation between the values. 1.0 is fully shut, 0.0 is fully open.
__Pipes and wires__:
* __Index__: defines the face of the building where the pipe will be placed
* __Offset side/front__: adds a spatial offset to the piece from the center of the face of the building
!!! note
You may find in some cases that when you choose detail mesh pieces such as plant pots, antennas and air conditioning units, you don't see any change in the building. This is most likely because the pieces you are using don't have the appropriate sockets needed to add the pieces you chose. Refer to the [sockets section](#sockets) to learn how to use sockets
### Sockets
![socket_details](img/pb_detail_section.png)
Sockets are anchor points which define where to place detail meshes on another mesh piece. To add sockets to the mesh pieces in the procedural building, with the procedural building selected, go to the *details panel*, normally on the right hand side of the UE editor interface. In there, you will find the *Meshes* and *Detail meshes* panels. Open the relevant section to open the mesh piece where you wish to place the socket.
![mesh_details](img/pb_mesh_details.png)
Find the mesh on which you want to place a socket and double click the icon to open it in the editor. Click *create socket* to add a socket and name it using the following convention:
* Air conditioning unit: aa_*
* Antennas: ant_*
* Plant pots: pot_*
Replace the asterisk with an index, depending upon how many sockets you have, i.e. aa_0, aa_2, aa_3...
![socket_details](img/pb_add_socket.png)
When you click *Create socket* the socket will be instantiated in the editor with a 3D handle. Drag the socket to the desired position on the mesh, this is where your detail piece will appear attached to the unit.
## Facade materials
![facade_materials](img/pb_facade_materials.png)
In the facade materials tab, you can browse and preview the material that you want to decorate the walls of your building.
![facade_changes](img/pb_facade_changes.webp)
## Cooking
In the cooking tab, you initiate the combination of all the mesh pieces and materials you've selected into a single static mesh with associated materials and textures. An LOD texture of the building will also be created for the LOD. Specify a folder name in the interface where the assets for your new building will be saved.
Once you have cooked your building, you will then be able to place instances of the building in the map just like any other CARLA assets.

View File

@ -59,7 +59,7 @@ As a reminder, the feature is only available for the Linux build so far.
### Dependencies
There are additional prerequisites required for building RSS and its dependencies. Take a look at the [official documentation](https://intel.github.io/ad-rss-lib/BUILDING)) to know more about this.
There are additional prerequisites required for building RSS and its dependencies. Take a look at the [official documentation](https://intel.github.io/ad-rss-lib/BUILDING) to know more about this.
Dependencies provided by Ubunutu (>= 16.04).
```sh

View File

@ -365,7 +365,7 @@ CARLA forum</a>
>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:

View File

@ -48,6 +48,16 @@ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add
To avoid compatibility issues between Unreal Engine and the CARLA dependencies, use the same compiler version and C++ runtime library to compile everything. The CARLA team uses clang-8 (or clang-10 in Ubuntu 20.04) and LLVM's libc++. Change the default clang version to compile Unreal Engine and the CARLA dependencies.
__Ubuntu 22.04__.
```sh
sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu focal main universe"
sudo apt-get update
sudo apt-get install build-essential clang-10 lld-10 g++-7 cmake ninja-build libvulkan1 python python3 python3-dev python3-pip libpng-dev libtiff5-dev libjpeg-dev tzdata sed curl unzip autoconf libtool rsync libxml2-dev git git-lfs
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-10/bin/clang++ 180 &&
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-10/bin/clang 180 &&
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 180
```
__Ubuntu 20.04__.
```sh
sudo apt-add-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main"

View File

@ -1,13 +1,13 @@
# Update CARLA
* [__Update commands summary__](#update-commands-summary)
* [__Get the lastest binary release__](#get-latest-binary-release)
* [__Update Linux and Windows build__](#update-linux-and-windows-build)
* [Clean the build](#clean-the-build)
* [Pull from origin](#pull-from-origin)
* [Download the assets](#download-the-assets)
* [Launch the server](#launch-the-server)
* [__Get development assets__](#get-development-assets)
* [__Update commands summary__](#update-commands-summary)
* [__Get the lastest binary release__](#get-latest-binary-release)
* [__Update Linux and Windows build__](#update-linux-and-windows-build)
* [Clean the build](#clean-the-build)
* [Pull from origin](#pull-from-origin)
* [Download the assets](#download-the-assets)
* [Launch the server](#launch-the-server)
* [__Get development assets__](#get-development-assets)
To post unexpected issues, doubts or suggestions, feel free to login in the CARLA forum.
@ -25,30 +25,30 @@ CARLA forum</a>
<summary> Show command lines to update CARLA</summary>
```sh
# Update a CARLA packaged release.
# 1. Delete the current one.
# 2. Follow the Quick start installation to get the one desired.
# Update a CARLA packaged release.
# 1. Delete the current one.
# 2. Follow the Quick start installation to get the one desired.
# Update Linux build.
# Update Linux build.
git checkout master
make clean
git pull origin master
./Update.sh
# Update Windows build.
# Update Windows build.
git checkout master
make clean
git pull origin master
# Erase the content in `Unreal\CarlaUE4\Content\Carla`.
# Go to `\Util\ContentVersions.txt`.
# Download the latest content.
# Extract the new content in `Unreal\CarlaUE4\Content\Carla`.
# Extract the new content in `Unreal\CarlaUE4\Content\Carla`.
# Get development assets.
# Delete the `/Carla` folder containing previous assets.
# Get development assets.
# Delete the `/Carla` folder containing previous assets.
# Go to the main carla folder.
git clone https://bitbucket.org/carla-simulator/carla-content Unreal/CarlaUE4/Content/Carla
@ -56,11 +56,11 @@ git clone https://bitbucket.org/carla-simulator/carla-content Unreal/CarlaUE4/Co
</details>
---
## Get latest binary release
## Get latest binary release
Binary releases are prepackaged and thus, tied to a specific version of CARLA. To get the latest, erase the previous and follow the [quick start installation](start_quickstart.md) to get the one desired.
Binary releases are prepackaged and thus, tied to a specific version of CARLA. To get the latest, erase the previous and follow the [quick start installation](start_quickstart.md) to get the one desired.
Releases are listed in __Development__ in the CARLA repository. There is also a highly experimental __Nightly build__ containing the current state of CARLA up to date.
Releases are listed in __Development__ in the CARLA repository. There is also a highly experimental __Nightly build__ containing the current state of CARLA up to date.
<div class="build-buttons">
<p>
@ -69,22 +69,22 @@ Releases are listed in __Development__ in the CARLA repository. There is also a
</p>
<p>
<a href="http://carla-releases.s3.amazonaws.com/Linux/Dev/CARLA_Latest.tar.gz" target="_blank" class="btn btn-neutral" title="Go to the linux nightly CARLA build">
<a href="https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/Dev/CARLA_Latest.tar.gz" target="_blank" class="btn btn-neutral" title="Go to the linux nightly CARLA build">
<span class="icon fa-cloud-download"></span> Get the linux nightly build</a>
</p>
<p>
<a href="http://carla-releases.s3.amazonaws.com/Linux/Dev/AdditionalMaps_Latest.tar.gz" target="_blank" class="btn btn-neutral" title="Go to the linux nightly AdditionalMaps build">
<a href="https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/Dev/AdditionalMaps_Latest.tar.gz" target="_blank" class="btn btn-neutral" title="Go to the linux nightly AdditionalMaps build">
<span class="icon fa-cloud-download"></span> Get the linux nightly build additional maps</a>
</p>
<p>
<a href="http://carla-releases.s3.amazonaws.com/Windows/Dev/CARLA_Latest.zip" target="_blank" class="btn btn-neutral" title="Go to the windows nightly CARLA build">
<a href="https://carla-releases.s3.us-east-005.backblazeb2.com/Windows/Dev/CARLA_Latest.zip" target="_blank" class="btn btn-neutral" title="Go to the windows nightly CARLA build">
<span class="icon fa-cloud-download"></span> Get the windows nightly build</a>
</p>
<p>
<a href="http://carla-releases.s3.amazonaws.com/Windows/Dev/AdditionalMaps_Latest.zip" target="_blank" class="btn btn-neutral" title="Go to the windows nightly AdditionalMaps build">
<a href="https://carla-releases.s3.us-east-005.backblazeb2.com/Windows/Dev/AdditionalMaps_Latest.zip" target="_blank" class="btn btn-neutral" title="Go to the windows nightly AdditionalMaps build">
<span class="icon fa-cloud-download"></span> Get the windows nightly build additional maps</a>
</p>
@ -93,22 +93,22 @@ Releases are listed in __Development__ in the CARLA repository. There is also a
---
## Update Linux and Windows build
Make sure to be in the local `master` branch before the update. Then, merge or rebase the changes to other branches and solve possible conflicts.
Make sure to be in the local `master` branch before the update. Then, merge or rebase the changes to other branches and solve possible conflicts.
```sh
```sh
git checkout master
```
### Clean the build
Go to the main CARLA folder and delete binaries and temporals generated by the previous build.
```sh
```sh
make clean
```
### Pull from origin
Get the current version from `master` in the CARLA repository.
Get the current version from `master` in the CARLA repository.
```sh
git pull origin master
```
@ -120,19 +120,19 @@ __Linux.__
./Update.sh
```
__Windows.__
__Windows.__
__1.__ Erase the previous content in `Unreal\CarlaUE4\Content\Carla`.
__2.__ Go to `\Util\ContentVersions.txt`.
__3.__ Download the content for `latest`.
__4.__ Extract the new content in `Unreal\CarlaUE4\Content\Carla`.
__1.__ Erase the previous content in `Unreal\CarlaUE4\Content\Carla`.
__2.__ Go to `\Util\ContentVersions.txt`.
__3.__ Download the content for `latest`.
__4.__ Extract the new content in `Unreal\CarlaUE4\Content\Carla`.
!!! Note
In order to work with that the CARLA team is devleoping, go to __get development assets__ below.
In order to work with that the CARLA team is devleoping, go to __get development assets__ below.
### Launch the server
Run the server in spectator view to make sure that everything worked properly.
Run the server in spectator view to make sure that everything worked properly.
```sh
make launch
@ -141,18 +141,18 @@ make launch
---
## Get development assets
The CARLA team works with assets still in development. These models and maps have a [public git repository][contentrepolink] where the CARLA team regularly pushes latest updates. Assets are still unfinished, using them is only recommended for developers.
The CARLA team works with assets still in development. These models and maps have a [public git repository][contentrepolink] where the CARLA team regularly pushes latest updates. Assets are still unfinished, using them is only recommended for developers.
In order to handle this repository it is advisted to install [git-lfs][gitlfslink]. The repository is modified regularly, and git-lfs works faster with large binary files.
In order to handle this repository it is advisted to install [git-lfs][gitlfslink]. The repository is modified regularly, and git-lfs works faster with large binary files.
To clone the repository, __go to the main CARLA directory__ and run the following command.
To clone the repository, __go to the main CARLA directory__ and run the following command.
```sh
git clone https://bitbucket.org/carla-simulator/carla-content Unreal/CarlaUE4/Content/Carla
```
!!! Warning
Delete the `/Carla` folder containing the assets before cloning the repository. Otherwise, an error will show.
Delete the `/Carla` folder containing the assets before cloning the repository. Otherwise, an error will show.
[contentrepolink]: https://bitbucket.org/carla-simulator/carla-content
[gitlfslink]: https://github.com/git-lfs/git-lfs/wiki/Installation

View File

@ -40,7 +40,7 @@ In this section you will find details of system requirements, minor and major so
#### Minor installations
* [__CMake__](https://cmake.org/download/) generates standard build files from simple configuration files.
* [__CMake__](https://cmake.org/download/) generates standard build files from simple configuration files. __We recommend you use version 3.15+__.
* [__Git__](https://git-scm.com/downloads) is a version control system to manage CARLA repositories.
* [__Make__](http://gnuwin32.sourceforge.net/packages/make.htm) generates the executables. It is necessary to use __Make version 3.81__, otherwise the build may fail. If you have multiple versions of Make installed, check that you are using version 3.81 in your PATH when building CARLA. You can check your default version of Make by running `make --version`.
* [__7Zip__](https://www.7-zip.org/) is a file compression software. This is required for automatic decompression of asset files and prevents errors during build time due to large files being extracted incorrectly or partially.

View File

@ -26,6 +26,8 @@ The CARLA simulator provides 10 pre-built maps to choose from, providing a diver
| [__Town10__](map_town10.md) | A downtown urban environment with skyscrapers, residential buildings and an ocean promenade.|
| [__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.|
| [__Town13__](map_town13.md) | A Large Map similar in scale to Town 12, but with distinct features.|
| [__Town15__](map_town15.md) | A map based on the road layout of the Autonomous University of Barcelona. |
## Vehicles

View File

@ -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.

View File

@ -2,7 +2,7 @@
### Latest Release
- [CARLA 0.9.14](https://github.com/carla-simulator/carla/releases/tag/0.9.14/) - [Documentation](https://carla.readthedocs.io/en/0.9.14/)
- [CARLA 0.9.15](https://github.com/carla-simulator/carla/releases/tag/0.9.15/) - [Documentation](https://carla.readthedocs.io/en/0.9.15/)
### Nightly build
@ -10,15 +10,16 @@
> branch. It contains the very latest fixes and features that will be part of the
> next release, but also some experimental changes. Use at your own risk!
- [CARLA Nightly Build (Linux)](https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/Dev/CARLA_Latest.tar.gz)
- [AdditionalMaps Nightly Build (Linux)](https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/Dev/AdditionalMaps_Latest.tar.gz)
- [CARLA Nightly Build (Windows)](https://carla-releases.s3.eu-west-3.amazonaws.com/Windows/Dev/CARLA_Latest.zip)
- [AdditionalMaps Nightly Build (Windows)](https://carla-releases.s3.eu-west-3.amazonaws.com/Windows/Dev/AdditionalMaps_Latest.zip)
- [CARLA Nightly Build (Linux)](https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/Dev/CARLA_Latest.tar.gz)
- [AdditionalMaps Nightly Build (Linux)](https://carla-releases.s3.us-east-005.backblazeb2.com/Linux/Dev/AdditionalMaps_Latest.tar.gz)
- [CARLA Nightly Build (Windows)](https://carla-releases.s3.us-east-005.backblazeb2.com/Windows/Dev/CARLA_Latest.zip)
- [AdditionalMaps Nightly Build (Windows)](https://carla-releases.s3.us-east-005.backblazeb2.com/Windows/Dev/AdditionalMaps_Latest.zip)
### Versions 0.9.x
> Here are the previous versions of CARLA with links to the specific documentation for each version:
- [CARLA 0.9.14](https://github.com/carla-simulator/carla/releases/tag/0.9.14/) - [Documentation](https://carla.readthedocs.io/en/0.9.14/)
- [CARLA 0.9.13](https://github.com/carla-simulator/carla/releases/tag/0.9.13/) - [Documentation](https://carla.readthedocs.io/en/0.9.13/)
- [CARLA 0.9.12](https://github.com/carla-simulator/carla/releases/tag/0.9.12/) - [Documentation](https://carla.readthedocs.io/en/0.9.12/)
- [CARLA 0.9.11](https://github.com/carla-simulator/carla/releases/tag/0.9.11/) - [Documentation](https://carla.readthedocs.io/en/0.9.11/)

19
Docs/ecosys_ros.md Normal file
View File

@ -0,0 +1,19 @@
# ROS
![ros_carla](../img/ros_carla.png)
The [__Robotic Operating System (ROS)__](https://www.ros.org/) is a set of software libraries for robotic and autonomous driving applications. CARLA can be directly connected to ROS through its ROS interfaces, control signals can be sent to CARLA actors and sensor data can be accessed through ROS topics.
There are two options for connecting CARLA and ROS.
- __CARLA native interface__: a ROS interface build directly into the CARLA server
- __ROS Bridge__: a separate library for transfering signals between ROS and CARLA
## CARLA native ROS interface
This is the recommended interface, since it offers the best performance with the lowest latency. At the moment the native interface only supports ROS 2. If you are using ROS 1, you must use the ROS Bridge.
## CARLA ROS Bridge
The [__CARLA ROS Bridge__](https://carla.readthedocs.io/projects/ros-bridge/en/latest/) is a library for connecting ROS to CARLA, it is compatible with both ROS 1 and ROS 2. Since the CARLA ROS Bridge is a separate package, there is additional latency compared to the native interface. The ROS Bridge is still provide to support ROS 1 and legacy implementations with ROS 2.

66
Docs/ecosys_simready.md Normal file
View File

@ -0,0 +1,66 @@
# SimReady content with NVIDIA Omniverse
NVIDIA's [__SimReady__](https://developer.nvidia.com/omniverse/simready-assets) specification supports the preparation of __3D content that is purpose-built for simulation__ to help streamline content creation pipelines for simulating 3D virtual environments for machine learning purposes in robotics and autonomous driving. Through the Omniverse Unreal Engine plugin now integrated into CARLA users can import, in just a few clicks, SimReady content such as vehicles already configured with working lights, doors and wheels and props ready for use instantaneously to decorate CARLA maps. CARLA's Omniverse integration boasts to significantly accelerate your environment building pipeline and opens the door to a whole world of applications in the [__Omniverse ecosystem__](https://www.nvidia.com/en-us/omniverse/ecosystem/).
!!! note
The Omniverse Unreal Engine Connector is currently only available in Windows.
Follow these steps to start using Omniverse and using SimReady content in CARLA:
Before anything else, you should first [install NVIDIA Omniverse](https://docs.omniverse.nvidia.com/install-guide/latest/index.html)
### 1. Installing the Unreal Engine Omniverse Connector
1. Launch the NVIDIA Omniverse Launcher
2. Navigate to the **Exchange** tab
3. Locate the __Epic Games Unreal Engine 4.26 Omniverse Connector__
4. Ensure the install version is **Release 105.1.578**
5. Click *Install*
6. Omniverse will not be able to find Unreal Engine, click **OK**.
7. It will prompt you to find your Unreal Engine installation, select this path: {UE4_ROOT}\Engine\Plugins\Marketplace\NVIDIA
8. Press *Install*.
### 2. Set Up Local Omniverse Server
1. Open NVIDIA Omniverse with the launcher
2. Navigate to the *Nucleus* tab
3. Click on *Create Local Server*
4. Create administrator details
5. Select the folder icon next to *Local Nucleus Service*, this should open your localhost server in your web browser
### 3. Connecting to CARLA Simulator
1. Launch CARLA using `make launch` from the command line the CARLA root folder
2. If an existing server is active and you want to restart the setup, click on *Clean Local Assets* (optional)
3. Select the *Omniverse* icon and click on *Add Server*
4. Name the server and click *Add to Content Browser*
5. A login form should launch in your browser, click *Create Account*
6. Create administrator details
7. Omniverse folders should now be visible in your Content/Omniverse folder in the Unreal Engine content browser
8. Go to your web browser again
9. Click on *Connect to a Server*
10. Authenticate using the server name you set for the CARLA server
11. Use the administrator details that you set for the CARLA server
12. The server folders should now show up in your browser
### 4. Importing a SimReady asset
1. Navigate to the Projects folder within the browser navigator
2. Right click, and select *Upload Folder*
3. Select your SimReady folders
4. Upload the files
### 5. Using the Omniverse Connector to Load the Vehicle to CARLA
1. Open the CARLA project in Unreal Engine
2. Navigate to `CarlaTools/Content/USDImporter`
3. Right click on *UW_USDVehicleImporterEditorWidget*
4. Select *Run Editor Utility Widget*
5. Find the Vehicle within your Omniverse browser navigator
6. Copy the path (should look something like: omniverse://localhost/Projects/SimReadyUSD.../vehicle.usd)
7. Paste it inside the Omiverse URL tab within the Widget
8. Select *Import Asset*
9. You should see the vehicle show up in the engine within the folder that you specified in the *Import destination* field
10. Open another map scene (it may have opened a new scene with the imported data) a *Save Content* prompt should appear. Uncheck the *Untitled* scene, and click on *Save selected* to save new content
11. The vehicle is now usable within CARLA and will be available through the Python API

56
Docs/ecosys_synkrotron.md Normal file
View File

@ -0,0 +1,56 @@
<img src="../img/synkrotron.jpg" alt= “synkrotron_logo” style="display: block; margin-left: auto; margin-right: auto; width: 70%;">
# Synkrotron simulation solutions
Synkrotron provides advanced solutions for autonomous driving simulation built on top of CARLA. Synkrotron's product suite OASIS supports a broad range of applications including scenario generation, sensor modelling, traffic simulation and data management. Based on a flexible architecture OASIS can be deployed on the cloud at scale, or in a developer's local environment for prototyping.
---
<img src="../img/oasis_logo.png" alt= “synkrotron_logo” style="display: block; margin-left: auto; margin-right: auto; width: 70%;">
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; height: auto;">
<iframe src="https://www.youtube.com/embed/YRI67aar3S0" frameborder="0" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe>
</div>
<br>
## [__OASIS simulation platform__](https://www.synkrotron.ai/sim.html)
OASIS Sim is a fully-fledged, scalable simulation platform with CARLA at its core. It supports the complete life-cycle of AD simulation:
- scenario import & editing with a graphical user interface
- sensor configuration
- distributed task management
- diagnosis through rich simulation data and logs
Both cloud and local deployment are available through containerized packaging. Comprehensive APIs are exposed for integration with DevOps too. You can [request a trial](https://synkrotron.ai/contact.html) from Synkrotron.
## [__OASIS data platform__](https://www.synkrotron.ai/data.html)
OASIS Data is a platform for managing the high volume of data flowing through the autonomous driving R&D pipeline. Data-driven development of AD systems are made possible with OASIS Data via the following functionalities:
* data acquisition and anonymization
* multi-stage filtering based on structured data (CAN bus signals, active-safety triggering, etc.) and unstructured data (sensor readings)
* information mapping and environment reconstruction with LIDAR and/or vision-only strategy
* auto-labeling of data with pre-trained perception models
* scenario tagging and reconstruction with OpenX format output
The processed data from the platform supports downstream applications such as scenario re-simulation with Oasis Sim, retraining of perception models with new labeled data and operational fleet management.
## __Synkrotron Tools and Services__
In addition to the complete solutions introduced above, Synkrotron also offers the following developer tools and services to facilitate AD simulation development.
| Product/service | Description |
| -----------| ------ |
| __Sensor model__: fish-eye camera | Fisheye camera with configurable distortion parameters |
| __Sensor model__: LIDAR | Advanced lidar model with configurable shutter mode and material reflections |
| __SOTIF__ scenario generation tool | Given the ODD description from user, identify important scenario elements and generate critical scenarios to help uncover unknown unsafe domains of the autonomous driving systems, achieved by using an ontology-based method combined with iterative optimizations against evaluations in Carla |
| __Map creation__ | Given lidar scan data (can also provide road-test data collection equipments & service), create HD maps for the user and output OpenDrive files which can be loaded in Carla for PnC tests or logsim |
| __Sensor model__: physics models for camera | Supports CMOS simulations and outputs 12bit raw sensor data, for customers who develop ISP algorithms or who has ECUs that need raw data from camera instead of RGBs |
| __Static scene creation__ | Combined HD mapping, 3D asset development and procedural modeling to create 3D static scenes/digital twins for users |
| __Dynamic scenario reconstruction__ | On top of static scenes, also detect and track various traffic participants from user's road-test data; the recovered trajectories/behaviors are turned into OpenScenario 1.0 files and can be re-simulated in CARLA |

View File

@ -13,7 +13,7 @@ Below, you will find in depth documentation on the many extensive features of CA
## Traffic Simulation
[__ Traffic Simulation Overview__](ts_traffic_simulation_overview.md) — An overview of the different options available to populate your scenes with traffic.
[__Traffic Simulation Overview__](ts_traffic_simulation_overview.md) — An overview of the different options available to populate your scenes with traffic.
[__Traffic Manager__](adv_traffic_manager.md) — Simulate urban traffic by setting vehicles to autopilot mode.
## References
@ -23,17 +23,18 @@ Below, you will find in depth documentation on the many extensive features of CA
## Custom Maps
[__Digital Twin Tool__](adv_digital_twin.md) — A procedural map generation tool that uses OpenStreetMap data
[__Overview of custom maps in CARLA__](tuto_M_custom_map_overview.md) — An overview of the process and options involved in adding a custom, standard sized map.
[__Create a map in RoadRunner__](tuto_M_generate_map.md) — How to generate a customs, standard sized map in RoadRunner.
[__ Import map in CARLA package__](tuto_M_add_map_package.md) How to import a map in a CARLA package.
[__Import map in CARLA package__](tuto_M_add_map_package.md) How to import a map in a CARLA package.
[__Import map in CARLA source build__](tuto_M_add_map_source.md) — How to import a map in CARLA built from source.
[__Alternative ways to import maps__](tuto_M_add_map_alternative.md) — Alternative methods to import maps.
[__ Manually prepare map package__](tuto_M_manual_map_package.md) — How to prepare a map for manual import.
[__Manually prepare map package__](tuto_M_manual_map_package.md) — How to prepare a map for manual import.
[__Customizing maps: Layered maps__](tuto_M_custom_layers.md) — How to create sub-layers in your custom map.
[__ Customizing maps: Traffic lights and signs__](tuto_M_custom_add_tl.md) — How to add traffic lights and signs to your custom map.
[__ Customizing maps: Road painter__](tuto_M_custom_road_painter.md) — How to use the road painter tool to change the appearance of the road.
[__Customizing maps: Traffic lights and signs__](tuto_M_custom_add_tl.md) — How to add traffic lights and signs to your custom map.
[__Customizing maps: Road painter__](tuto_M_custom_road_painter.md) — How to use the road painter tool to change the appearance of the road.
[__Customizing Maps: Procedural Buildings__](tuto_M_custom_buildings.md) — Populate your custom map with buildings.
[__ Customizing maps: Weather and landscape__](tuto_M_custom_weather_landscape.md) — Create the weather profile for your custom map and populate the landscape.
[__Customizing maps: Weather and landscape__](tuto_M_custom_weather_landscape.md) — Create the weather profile for your custom map and populate the landscape.
[__Generate pedestrian navigation__](tuto_M_generate_pedestrian_navigation.md) — Obtain the information needed for walkers to move around.
## Large Maps

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
Docs/img/oasis_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

BIN
Docs/img/open_pb_tool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

BIN
Docs/img/osm_export.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
Docs/img/pb_add_socket.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 513 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

BIN
Docs/img/pipeline.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

BIN
Docs/img/road_surface.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
Docs/img/ros_carla.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

BIN
Docs/img/synkrotron.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -217,6 +217,8 @@ window.addEventListener('load', function () {
parentX.replaceChild(newX, text_coord_x);
parentY.replaceChild(newY, text_coord_y);
//console.log(state.pX + ", " + state.pY)
})
})

228
Docs/map_town13.md Normal file
View File

@ -0,0 +1,228 @@
# Town 13
![town_13](../img/catalogue/maps/town13/town13montage.webp)
Town 13 is a Large Map with dimensions of 10x10 km<sup>2</sup>. It is divided into 36 tiles, most with dimensions of 2x2 km<sup>2</sup> (some edge tiles are smaller). There are numerous contrasting regions to the city including urban, residential and rural areas, along with a large highway system surrounding the city with a ringroad. The architectural styles reflect those of many medium to large cities across North America.
!!! note
Town 13 has been designed as an adjunct to Town 12, such that they can serve as a __train-test pair__. The towns share many common features, but also many differences in the styles of buildings, road textures, pavement textures and also vegetation. Using one of the pair to produce training data and then using the other for testing is ideal for exposing overfitting issues that might be arising while developing an AD stack.
## Navigator
The navigator interactive map can be used to browse the town and derive coordinates to use in the CARLA simulator.
__Using the navigator__:
* `left mouse button` - click and hold, drag left, right, up or down to move the map
* `scroll mouse wheel` - scroll down to zoom out, scroll up to zoom in on the location under the mouse pointer
* `double click` - double click on a point on the map to record the coordinates, you will find the coordinates in the text and the code block just below the map
__Zone color reference__:
* <span style="color:#595d5e; background-color:#595d5e;">&nbsp</span> [Skyscraper](#high-rise-downtown)
* <span style="color:#d2dddc; background-color:#d2dddc;">&nbsp</span> [High density residential](#high-density-residential)
* <span style="color:#838c8b; background-color:#838c8b;">&nbsp</span> [Community buildings](#community-buildings)
* <span style="color:#17d894; background-color:#17d894;">&nbsp</span> [Low density residential](#low-density-residential)
* <span style="color:#df6a19; background-color:#df6a19;">&nbsp</span> [Parks](#parks)
* <span style="color:#839317; background-color:#839317;">&nbsp</span> [Rural farmland](#rural-and-farmland)
* <span style="color:#265568; background-color:#265568;">&nbsp</span> [Water](#water)
![town13_aerial](../img/catalogue/maps/town13/town13roadrunner.webp#map)
__CARLA coordinates__:
* __X__: <span id="carlacoord_x" style="animation: fadeMe 2s;">--</span>
* __Y__: <span id="carlacoord_y" style="animation: fadeMe 2s;">--</span>
After double clicking on a point of interest, the navigator will display the corresponding CARLA coordinates and update them in the following code block. Copy and paste the code into a notebook or Python terminal to translate the spectator to the desired location. You will need first to [connect the client and set up the world object](tuto_first_steps.md#launching-carla-and-connecting-the-client):
```py
# CARLA coordinates: X 0.0, Y 0.0
spectator = world.get_spectator()
loc = carla.Location(0.0, 0.0, 300.0)
rot = carla.Rotation(pitch=-90, yaw=0.0, roll=0.0)
spectator.set_transform(carla.Transform(loc, rot))
```
## Town 13 zones
#### High-rise downtown:
Town 13's downtown area is a large span of high-rise skyscrapers arranged into blocks on a consistent grid of roads, resembling downtown areas in many large American and European cities.
![high_rise](../img/catalogue/maps/town13/high_rise.webp)
#### Community buildings:
The community buildings are a set of 2-4 storey apartment buildings in a colorful bohemian style with businesses on the ground floors, located next to the downtown area of the city.
![community](../img/catalogue/maps/town13/community.webp)
#### High density residential:
The high density residential areas of Town 13 have many 2-10 storey apartment buildings with commercial properties like cafes and retail stores at street level. Many of the residential blocks have balconies with sun shades similar to those in sunny southern European countries.
![high_dens_res](../img/catalogue/maps/town13/high_dens_res.webp)
#### Low density residential:
The low density residential regions of Town 13 reflect the suburbs of many European cities, with one and two story homes surrounded by fenced gardens and garages.
![low_dens_res](../img/catalogue/maps/town13/low_dens_res.webp)
#### Parks:
The dense residential and downtown areas are broken up by small islands of green communal space, juxtaposing green foliage against urban architecture.
![parks](../img/catalogue/maps/town13/parks.webp)
#### Highways and intersections:
Town 13 has an extensive highway system, including 3-4 lane highways, large roundabouts and a causeway over a large body of water.
![highway](../img/catalogue/maps/town13/highway.webp)
#### Rural and farmland:
Town 13 also has rural regions with characteristic farmland buildings like wooden barns and farmhouses, windmills, grain silos, corn fields, hay bails and rural fencing. These areas have unmarked country dirt roads and single lane interurban roads for inter-city traffic.
![rural](../img/catalogue/maps/town13/rural.webp)
#### Water:
There are several bodies of water in town 13 including a large lake with a central island and several ponds in rural areas.
![water](../img/catalogue/maps/town13/water.webp)
<style>
@keyframes fadeMe {
from {
color: #77aaff;
}
to {
color: #000000;
}
}
</style>
<script>
window.addEventListener('load', function () {
var text_coord_x = document.getElementById("carlacoord_x")
var text_coord_y = document.getElementById("carlacoord_y")
const code_coords = document.getElementsByClassName("hljs-number")
const code_comment = document.getElementsByClassName("hljs-comment")
const image = document.querySelector('[src$="map"]');
const canv = document.createElement('canvas');
canv.setAttribute('height', image.height)
canv.setAttribute('width', image.width)
image.parentNode.replaceChild(canv, image)
var state = {mDown: false, button: 0, lastX: 0, lastY:0, canvX: 0, canvY: 0, zoom: 1.0, mdownX: 0, mdownY: 0, pX: 0.5, pY: 0.5, dblClick: false, listObj: false, touch: false}
ctx = canv.getContext('2d')
ctx.drawImage(image, 0, 0, canv.width, canv.height)
canv.addEventListener('mousemove', (event) => {
dX = event.clientX - state.lastX
dY = event.clientY - state.lastY
state.lastX = event.clientX
state.lastY = event.clientY
if(state.mDown && state.button == 0) {
state.canvX += dX
state.canvY += dY
ctx.clearRect(0, 0, canv.width, canv.height)
ctx.drawImage(image, state.canvX, state.canvY, canv.width * state.zoom, canv.height * state.zoom)
state.touch = true;
}
})
canv.addEventListener('mousedown', (event) => {
state.button = event.button;
state.mDown = true;
state.touch = true;
var rect = canv.getBoundingClientRect();
state.mdownX = event.clientX - rect.left;
state.mdownY = event.clientY - rect.top;
state.pX = (state.mdownX - state.canvX) / (canv.width * state.zoom);
state.pY = (state.mdownY - state.canvY) / (canv.height * state.zoom);
})
canv.addEventListener('mouseup', (event) => {
state.mDown = false;
})
canv.addEventListener('wheel', (event) => {
state.mDown = false;
var rect = canv.getBoundingClientRect();
dX = event.clientX - rect.left;
dY = event.clientY - rect.top;
state.pX = (dX - state.canvX) / (canv.width * state.zoom);
state.pY = (dY - state.canvY) / (canv.height * state.zoom);
if(state.touch){
event.preventDefault();
if(event.wheelDelta > 0){
state.zoom *= 1.15
} else {
state.zoom *= 0.85
}
if(state.zoom < 1.0){state.zoom = 1.0;}
if(state.zoom > 30.0){state.zoom = 30.0}
ctx.clearRect(0, 0, canv.width, canv.height)
state.canvX = - canv.width * state.zoom * state.pX + dX;
state.canvY = - canv.height * state.zoom * state.pY + dY;
ctx.drawImage(image, state.canvX, state.canvY, canv.width * state.zoom, canv.height * state.zoom);
}
})
canv.addEventListener('dblclick', (event) => {
text_coord_x = document.getElementById("carlacoord_x")
text_coord_y = document.getElementById("carlacoord_y")
const carlaX = 14556.0868 * state.pX + -7.34734913 * state.pY - 6655.00941;
const carlaY = 2.19186383 * state.pX + 12431.3323 * state.pY - 4524.46039;
code_coords[0].textContent = carlaX.toFixed(1)
code_coords[1].textContent = carlaY.toFixed(1)
code_comment[0].textContent = "# CARLA coordinates - X: " + carlaX.toFixed(1) + " Y: " + carlaY.toFixed(1)
var newX = text_coord_x.cloneNode(true)
var newY = text_coord_y.cloneNode(true)
newX.textContent = carlaX.toFixed(1)
newY.textContent = carlaY.toFixed(1)
var parentX = text_coord_x.parentNode
var parentY = text_coord_y.parentNode
parentX.replaceChild(newX, text_coord_x);
parentY.replaceChild(newY, text_coord_y);
//console.log(state.pX + ", " + state.pY)
})
})
</script>

17
Docs/map_town15.md Normal file
View File

@ -0,0 +1,17 @@
# Town 15
![town_15](../img/catalogue/maps/town15/town15montage.webp)
Town 15 is a map based on the road layout of the Autonomous University of Barcelona (Universitat Autònoma de Barcelona). Some emblematic buildings from the modern campus are modelled in the map, including the humanities library, the medicine building and also the Computer Vision Center, the birthplace of CARLA.
## Computer Vision Center
The map includes the Computer Vision Center (CVC - Centre de Visió per Computador in Catalan) is a world reknowned research center for research in computer vision and is where the CARLA development team is based.
![CVC](../img/catalogue/maps/town15/cvc.png)
## Humanities Library
Known as the Biblioteca d'Humanitats in Catalan, this building houses literature covering many disciplines for the students and researchers studying and working at the Autonomous University of Barcelona.
![library](../img/catalogue/maps/town15/library.png)

View File

@ -475,7 +475,7 @@ Executes a list of commands on a single simulation step, blocks until the comman
- <a name="carla.Client.generate_opendrive_world"></a>**<font color="#7fb800">generate_opendrive_world</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**opendrive**</font>, <font color="#00a6ed">**parameters**=(2.0, 50.0, 1.0, 0.6, true, true)</font>, <font color="#00a6ed">**reset_settings**=True</font>)
Loads a new world with a basic 3D topology generated from the content of an OpenDRIVE file. This content is passed as a `string` parameter. It is similar to `client.load_world(map_name)` but allows for custom OpenDRIVE maps in server side. Cars can drive around the map, but there are no graphics besides the road and sidewalks.
- **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.
- <a name="carla.Client.load_world"></a>**<font color="#7fb800">load_world</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**map_name**</font>, <font color="#00a6ed">**reset_settings**=True</font>, <font color="#00a6ed">**map_layers**=[carla.MapLayer.All](#carla.MapLayer.All)</font>)
@ -722,13 +722,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<small> - seconds</small>_) - Shape's lifespan. By default it only lasts one frame. Set this to <code>0</code> for permanent shapes.
- <a name="carla.DebugHelper.draw_box"></a>**<font color="#7fb800">draw_box</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**box**</font>, <font color="#00a6ed">**rotation**</font>, <font color="#00a6ed">**thickness**=0.1</font>, <font color="#00a6ed">**color**=(255,0,0)</font>, <font color="#00a6ed">**life_time**=-1.0</font>)<button class="SnipetButton" id="carla.DebugHelper.draw_box-snipet_button">snippet &rarr;</button>
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)<small> - degrees (pitch,yaw,roll)</small>_) - Orientation of the box according to Unreal Engine's axis system.
- `thickness` (_float<small> - meters</small>_) - 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<small> - seconds</small>_) - Shape's lifespan. By default it only lasts one frame. Set this to <code>0</code> for permanent shapes.
- <a name="carla.DebugHelper.draw_hud_arrow"></a>**<font color="#7fb800">draw_hud_arrow</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**begin**</font>, <font color="#00a6ed">**end**</font>, <font color="#00a6ed">**thickness**=0.1</font>, <font color="#00a6ed">**arrow_size**=0.1</font>, <font color="#00a6ed">**color**=(255,0,0)</font>, <font color="#00a6ed">**life_time**=-1.0</font>)
Draws an arrow on the HUD from `begin` to `end` which can only be seen server-side.
- **Parameters:**
- `begin` (_[carla.Location](#carla.Location)<small> - meters</small>_) - Point in the coordinate system where the arrow starts.
- `end` (_[carla.Location](#carla.Location)<small> - meters</small>_) - Point in the coordinate system where the arrow ends and points towards to.
- `thickness` (_float<small> - meters</small>_) - Density of the line.
- `arrow_size` (_float<small> - meters</small>_) - Size of the tip of the arrow.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default.
- `life_time` (_float<small> - seconds</small>_) - Shape's lifespan. By default it only lasts one frame. Set this to <code>0</code> for permanent shapes.
- <a name="carla.DebugHelper.draw_hud_box"></a>**<font color="#7fb800">draw_hud_box</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**box**</font>, <font color="#00a6ed">**rotation**</font>, <font color="#00a6ed">**thickness**=0.1</font>, <font color="#00a6ed">**color**=(255,0,0)</font>, <font color="#00a6ed">**life_time**=-1.0</font>)
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)<small> - degrees (pitch,yaw,roll)</small>_) - Orientation of the box according to Unreal Engine's axis system.
- `thickness` (_float<small> - meters</small>_) - 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<small> - seconds</small>_) - Shape's lifespan. By default it only lasts one frame. Set this to <code>0</code> for permanent shapes.
- <a name="carla.DebugHelper.draw_hud_line"></a>**<font color="#7fb800">draw_hud_line</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**begin**</font>, <font color="#00a6ed">**end**</font>, <font color="#00a6ed">**thickness**=0.1</font>, <font color="#00a6ed">**color**=(255,0,0)</font>, <font color="#00a6ed">**life_time**=-1.0</font>)
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)<small> - meters</small>_) - Point in the coordinate system where the line starts.
- `end` (_[carla.Location](#carla.Location)<small> - meters</small>_) - Spot in the coordinate system where the line ends.
- `thickness` (_float<small> - meters</small>_) - Density of the line.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default.
- `life_time` (_float<small> - seconds</small>_) - Shape's lifespan. By default it only lasts one frame. Set this to <code>0</code> for permanent shapes.
- <a name="carla.DebugHelper.draw_hud_point"></a>**<font color="#7fb800">draw_hud_point</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**location**</font>, <font color="#00a6ed">**size**=0.1</font>, <font color="#00a6ed">**color**=(255,0,0)</font>, <font color="#00a6ed">**life_time**=-1.0</font>)
Draws a point on the HUD at `location`. The point can only be seen server-side.
- **Parameters:**
- `location` (_[carla.Location](#carla.Location)<small> - meters</small>_) - Spot in the coordinate system to center the object.
- `size` (_float<small> - meters</small>_) - Density of the point.
- `color` (_[carla.Color](#carla.Color)_) - RGB code to color the object. Red by default.
- `life_time` (_float<small> - seconds</small>_) - Shape's lifespan. By default it only lasts one frame. Set this to <code>0</code> for permanent shapes.
- <a name="carla.DebugHelper.draw_line"></a>**<font color="#7fb800">draw_line</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**begin**</font>, <font color="#00a6ed">**end**</font>, <font color="#00a6ed">**thickness**=0.1</font>, <font color="#00a6ed">**color**=(255,0,0)</font>, <font color="#00a6ed">**life_time**=-1.0</font>)
Draws a line in between `begin` and `end`.
- **Parameters:**
@ -1706,7 +1738,7 @@ Distance between `actor` and `other`.
---
## carla.OpendriveGenerationParameters<a name="carla.OpendriveGenerationParameters"></a>
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
- <a name="carla.OpendriveGenerationParameters.vertex_distance"></a>**<font color="#f8805a">vertex_distance</font>** (_float_)
@ -2202,6 +2234,12 @@ Sensors compound a specific family of actors quite diverse and unique. They are
When <b>True</b> the sensor will be waiting for data.
### Methods
- <a name="carla.Sensor.disable_for_ros"></a>**<font color="#7fb800">disable_for_ros</font>**(<font color="#00a6ed">**self**</font>)
Commands the sensor to not be processed for publishing in ROS2 if there is no any listen to it.
- <a name="carla.Sensor.enable_for_ros"></a>**<font color="#7fb800">enable_for_ros</font>**(<font color="#00a6ed">**self**</font>)
Commands the sensor to be processed to be able to publish in ROS2 without any listen to it.
- <a name="carla.Sensor.is_enabled_for_ros"></a>**<font color="#7fb800">is_enabled_for_ros</font>**(<font color="#00a6ed">**self**</font>)
Returns if the sensor is enabled or not to publish in ROS2 if there is no any listen to it.
- <a name="carla.Sensor.is_listening"></a>**<font color="#7fb800">is_listening</font>**(<font color="#00a6ed">**self**</font>)
Returns whether the sensor is in a listening state.
- <a name="carla.Sensor.is_listening_gbuffer"></a>**<font color="#7fb800">is_listening_gbuffer</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**gbuffer_id**</font>)
@ -4188,384 +4226,6 @@ document.getElementById("snipets-container").innerHTML = null;
}
</script>
<div id ="carla.World.enable_environment_objects-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.enable_environment_objects
</p>
<div id="carla.World.enable_environment_objects-code" class="SnipetContent">
```py
# This recipe turn visibility off and on for two specifc buildings on the map
# Get the buildings in the world
world = client.get_world()
env_objs = world.get_environment_objects(carla.CityObjectLabel.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 buildings off
world.enable_environment_objects(objects_to_toggle, False)
# Toggle buildings on
world.enable_environment_objects(objects_to_toggle, True)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.enable_environment_objects-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.DebugHelper.draw_string-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.DebugHelper.draw_string
</p>
<div id="carla.DebugHelper.draw_string-code" class="SnipetContent">
```py
# This recipe is a modification of lane_explorer.py example.
# It draws the path of an actor through the world, printing information at each waypoint.
# ...
current_w = map.get_waypoint(vehicle.get_location())
while True:
next_w = map.get_waypoint(vehicle.get_location(), lane_type=carla.LaneType.Driving | carla.LaneType.Shoulder | carla.LaneType.Sidewalk )
# Check if the vehicle is moving
if next_w.id != current_w.id:
vector = vehicle.get_velocity()
# Check if the vehicle is on a sidewalk
if current_w.lane_type == carla.LaneType.Sidewalk:
draw_waypoint_union(debug, current_w, next_w, cyan if current_w.is_junction else red, 60)
else:
draw_waypoint_union(debug, current_w, next_w, cyan if current_w.is_junction else green, 60)
debug.draw_string(current_w.transform.location, str('%15.0f km/h' % (3.6 * math.sqrt(vector.x**2 + vector.y**2 + vector.z**2))), False, orange, 60)
draw_transform(debug, current_w.transform, white, 60)
# Update the current waypoint and sleep for some time
current_w = next_w
time.sleep(args.tick_time)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.DebugHelper.draw_string-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.World.unload_map_layer-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.unload_map_layer
</p>
<div id="carla.World.unload_map_layer-code" class="SnipetContent">
```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)
# Toggle all parked vehicles off
world.unload_map_layer(carla.MapLayer.ParkedVehicles)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.unload_map_layer-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.Vehicle.set_wheel_steer_direction-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Vehicle.set_wheel_steer_direction
</p>
<div id="carla.Vehicle.set_wheel_steer_direction-code" class="SnipetContent">
```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)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Vehicle.set_wheel_steer_direction-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.Client.__init__-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Client.__init__
</p>
<div id="carla.Client.__init__-code" class="SnipetContent">
```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)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Client.__init__-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.Map.get_waypoint-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Map.get_waypoint
</p>
<div id="carla.Map.get_waypoint-code" class="SnipetContent">
```py
# 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.
# ...
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))
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Map.get_waypoint-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
<img src="/img/snipets_images/carla.Map.get_waypoint.jpg">
</div>
<div id ="carla.World.spawn_actor-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.spawn_actor
</p>
<div id="carla.World.spawn_actor-code" class="SnipetContent">
```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)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.spawn_actor-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.WalkerAIController.stop-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.WalkerAIController.stop
</p>
<div id="carla.WalkerAIController.stop-code" class="SnipetContent">
```py
#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()
# destroy pedestrian (actor and controller)
client.apply_batch([carla.command.DestroyActor(x) for x in all_id])
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.WalkerAIController.stop-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.DebugHelper.draw_box-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.DebugHelper.draw_box
</p>
<div id="carla.DebugHelper.draw_box-code" class="SnipetContent">
```py
# This recipe shows how to draw traffic light actor bounding boxes from a world snapshot.
# ....
debug = world.debug
world_snapshot = world.get_snapshot()
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)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.DebugHelper.draw_box-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
<img src="/img/snipets_images/carla.DebugHelper.draw_box.jpg">
</div>
<div id ="carla.World.get_spectator-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.get_spectator
</p>
<div id="carla.World.get_spectator-code" class="SnipetContent">
```py
# This recipe spawns an actor and the spectator camera at the actor's location.
# ...
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()
world_snapshot = world.wait_for_tick()
actor_snapshot = world_snapshot.find(vehicle.id)
# Set spectator at given transform (vehicle transform)
spectator.set_transform(actor_snapshot.get_transform())
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.get_spectator-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.Sensor.listen-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Sensor.listen
</p>
<div id="carla.Sensor.listen-code" class="SnipetContent">
```py
# 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))
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Sensor.listen-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.TrafficLight.set_state-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.TrafficLight.set_state
</p>
<div id="carla.TrafficLight.set_state-code" class="SnipetContent">
```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()
world_snapshot = world.wait_for_tick()
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)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.TrafficLight.set_state-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
<img src="/img/snipets_images/carla.TrafficLight.set_state.gif">
</div>
<div id ="carla.ActorBlueprint.set_attribute-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.ActorBlueprint.set_attribute
@ -4673,6 +4333,333 @@ for i in range(0, len(all_actors), 2):
</div>
<div id ="carla.Client.__init__-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Client.__init__
</p>
<div id="carla.Client.__init__-code" class="SnipetContent">
```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)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Client.__init__-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.DebugHelper.draw_box-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.DebugHelper.draw_box
</p>
<div id="carla.DebugHelper.draw_box-code" class="SnipetContent">
```py
# This recipe shows how to draw traffic light actor bounding boxes from a world snapshot.
# ....
debug = world.debug
world_snapshot = world.get_snapshot()
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)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.DebugHelper.draw_box-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
<img src="/img/snipets_images/carla.DebugHelper.draw_box.jpg">
</div>
<div id ="carla.DebugHelper.draw_string-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.DebugHelper.draw_string
</p>
<div id="carla.DebugHelper.draw_string-code" class="SnipetContent">
```py
# This recipe is a modification of lane_explorer.py example.
# It draws the path of an actor through the world, printing information at each waypoint.
# ...
current_w = map.get_waypoint(vehicle.get_location())
while True:
next_w = map.get_waypoint(vehicle.get_location(), lane_type=carla.LaneType.Driving | carla.LaneType.Shoulder | carla.LaneType.Sidewalk )
# Check if the vehicle is moving
if next_w.id != current_w.id:
vector = vehicle.get_velocity()
# Check if the vehicle is on a sidewalk
if current_w.lane_type == carla.LaneType.Sidewalk:
draw_waypoint_union(debug, current_w, next_w, cyan if current_w.is_junction else red, 60)
else:
draw_waypoint_union(debug, current_w, next_w, cyan if current_w.is_junction else green, 60)
debug.draw_string(current_w.transform.location, str('%15.0f km/h' % (3.6 * math.sqrt(vector.x**2 + vector.y**2 + vector.z**2))), False, orange, 60)
draw_transform(debug, current_w.transform, white, 60)
# Update the current waypoint and sleep for some time
current_w = next_w
time.sleep(args.tick_time)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.DebugHelper.draw_string-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.Map.get_waypoint-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Map.get_waypoint
</p>
<div id="carla.Map.get_waypoint-code" class="SnipetContent">
```py
# 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.
# ...
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))
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Map.get_waypoint-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
<img src="/img/snipets_images/carla.Map.get_waypoint.jpg">
</div>
<div id ="carla.Sensor.listen-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Sensor.listen
</p>
<div id="carla.Sensor.listen-code" class="SnipetContent">
```py
# 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))
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Sensor.listen-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.TrafficLight.set_state-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.TrafficLight.set_state
</p>
<div id="carla.TrafficLight.set_state-code" class="SnipetContent">
```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()
world_snapshot = world.wait_for_tick()
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)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.TrafficLight.set_state-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
<img src="/img/snipets_images/carla.TrafficLight.set_state.gif">
</div>
<div id ="carla.Vehicle.set_wheel_steer_direction-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.Vehicle.set_wheel_steer_direction
</p>
<div id="carla.Vehicle.set_wheel_steer_direction-code" class="SnipetContent">
```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)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.Vehicle.set_wheel_steer_direction-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.WalkerAIController.stop-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.WalkerAIController.stop
</p>
<div id="carla.WalkerAIController.stop-code" class="SnipetContent">
```py
#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()
# destroy pedestrian (actor and controller)
client.apply_batch([carla.command.DestroyActor(x) for x in all_id])
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.WalkerAIController.stop-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.World.enable_environment_objects-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.enable_environment_objects
</p>
<div id="carla.World.enable_environment_objects-code" class="SnipetContent">
```py
# This recipe turn visibility off and on for two specifc buildings on the map
# Get the buildings in the world
world = client.get_world()
env_objs = world.get_environment_objects(carla.CityObjectLabel.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 buildings off
world.enable_environment_objects(objects_to_toggle, False)
# Toggle buildings on
world.enable_environment_objects(objects_to_toggle, True)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.enable_environment_objects-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.World.get_spectator-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.get_spectator
</p>
<div id="carla.World.get_spectator-code" class="SnipetContent">
```py
# This recipe spawns an actor and the spectator camera at the actor's location.
# ...
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()
world_snapshot = world.wait_for_tick()
actor_snapshot = world_snapshot.find(vehicle.id)
# Set spectator at given transform (vehicle transform)
spectator.set_transform(actor_snapshot.get_transform())
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.get_spectator-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.World.load_map_layer-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.load_map_layer
@ -4701,6 +4688,57 @@ world.load_map_layer(carla.MapLayer.ParkedVehicles)
</div>
<div id ="carla.World.spawn_actor-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.spawn_actor
</p>
<div id="carla.World.spawn_actor-code" class="SnipetContent">
```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)
# ...
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.spawn_actor-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
<div id ="carla.World.unload_map_layer-snipet" style="display: none;">
<p class="SnipetFont">
Snippet for carla.World.unload_map_layer
</p>
<div id="carla.World.unload_map_layer-code" class="SnipetContent">
```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)
# Toggle all parked vehicles off
world.unload_map_layer(carla.MapLayer.ParkedVehicles)
```
<button id="button1" class="CopyScript" onclick="CopyToClipboard('carla.World.unload_map_layer-code')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>
</div>
</div>
@ -4737,4 +4775,4 @@ for (let i = 0; i < buttons.length; i++) {
buttons[i].addEventListener("click",function(){ButtonAction(buttons[i].id);},true);
}
window.onresize = WindowResize;
</script>
</script>

View File

@ -711,34 +711,39 @@ This raw [carla.Image](python_api.md#carla.Image) can be stored and converted it
raw_image.save_to_disk("path/to/save/converted/image",carla.ColorConverter.cityScapesPalette)
```
The following tags are currently available:
The following tags are currently available (Note, tags changed from version 0.9.13 to 0.9.14):
| Value | Tag | Converted color | Description |
| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- |
| `0` | Unlabeled | `(0, 0, 0)` | Elements that have not been categorized are considered `Unlabeled`. This category is meant to be empty or at least contain elements with no collisions. |
| `1` | Building | `(70, 70, 70)` | Buildings like houses, skyscrapers,... and the elements attached to them. <br> E.g. air conditioners, scaffolding, awning or ladders and much more. |
| `2` | Fence | `(100, 40, 40)` | Barriers, railing, or other upright structures. Basically wood or wire assemblies that enclose an area of ground. |
| `3` | Other | `(55, 90, 80)` | Everything that does not belong to any other category. |
| `4` | Pedestrian | `(220, 20, 60)` | Humans that walk or ride/drive any kind of vehicle or mobility system. <br> E.g. bicycles or scooters, skateboards, horses, roller-blades, wheel-chairs, etc. |
| `5` | Pole | `(153, 153, 153)` | Small mainly vertically oriented pole. If the pole has a horizontal part (often for traffic light poles) this is also considered pole. <br> E.g. sign pole, traffic light poles. |
| `6` | RoadLine | `(157, 234, 50)` | The markings on the road. |
| `7` | Road | `(128, 64, 128)` | Part of ground on which cars usually drive. <br> E.g. lanes in any directions, and streets. |
| `8` | SideWalk | `(244, 35, 232)` | Part of ground designated for pedestrians or cyclists. Delimited from the road by some obstacle (such as curbs or poles), not only by markings. This label includes a possibly delimiting curb, traffic islands (the walkable part), and pedestrian zones. |
| `9` | Vegetation | `(107, 142, 35)` | Trees, hedges, all kinds of vertical vegetation. Ground-level vegetation is considered `Terrain`. |
| `10` | Vehicles | `(0, 0, 142)` | Cars, vans, trucks, motorcycles, bikes, buses, trains. |
| `11` | Wall | `(102, 102, 156)` | Individual standing walls. Not part of a building. |
| `12` | TrafficSign | `(220, 220, 0)` | Signs installed by the state/city authority, usually for traffic regulation. This category does not include the poles where signs are attached to. <br> E.g. traffic- signs, parking signs, direction signs... |
| `13` | Sky | `(70, 130, 180)` | Open sky. Includes clouds and the sun. |
| `14` | Ground | `(81, 0, 81)` | Any horizontal ground-level structures that does not match any other category. For example areas shared by vehicles and pedestrians, or flat roundabouts delimited from the road by a curb. |
| `15` | Bridge | `(150, 100, 100)` | Only the structure of the bridge. Fences, people, vehicles, an other elements on top of it are labeled separately. |
| `16` | RailTrack | `(230, 150, 140)` | All kind of rail tracks that are non-drivable by cars. <br> E.g. subway and train rail tracks. |
| `17` | GuardRail | `(180, 165, 180)` | All types of guard rails/crash barriers. |
| `18` | TrafficLight | `(250, 170, 30)` | Traffic light boxes without their poles. |
| `19` | Static | `(110, 190, 160)` | Elements in the scene and props that are immovable. <br> E.g. fire hydrants, fixed benches, fountains, bus stops, etc. |
| `20` | Dynamic | `(170, 120, 50)` | Elements whose position is susceptible to change over time. <br> E.g. Movable trash bins, buggies, bags, wheelchairs, animals, etc. |
| `21` | Water | `(45, 60, 150)` | Horizontal water surfaces. <br> E.g. Lakes, sea, rivers. |
| `22` | Terrain | `(145, 170, 100)` | Grass, ground-level vegetation, soil or sand. These areas are not meant to be driven on. This label includes a possibly delimiting curb. |
| `1` | Roads | `(128, 64, 128)` | Part of ground on which cars usually drive. <br> E.g. lanes in any directions, and streets. |
| `2` | SideWalks | `(244, 35, 232)` | Part of ground designated for pedestrians or cyclists. Delimited from the road by some obstacle (such as curbs or poles), not only by markings. This label includes a possibly delimiting curb, traffic islands (the walkable part), and pedestrian zones. |
| `3` | Building | `(70, 70, 70)` | Buildings like houses, skyscrapers,... and the elements attached to them. <br> E.g. air conditioners, scaffolding, awning or ladders and much more. |
| `4` | Wall | `(102, 102, 156)` | Individual standing walls. Not part of a building. |
| `5` | Fence | `(190, 153, 153)` | Barriers, railing, or other upright structures. Basically wood or wire assemblies that enclose an area of ground. |
| `6` | Pole | `(153, 153, 153)` | Small mainly vertically oriented pole. If the pole has a horizontal part (often for traffic light poles) this is also considered pole. <br> E.g. sign pole, traffic light poles. |
| `7` | TrafficLight | `(250, 170, 30)` | Traffic light boxes without their poles. |
| `8` | TrafficSign | `(220, 220, 0)` | Signs installed by the state/city authority, usually for traffic regulation. This category does not include the poles where signs are attached to. <br> E.g. traffic- signs, parking signs, direction signs... |
| `9` | Vegetation | `(107, 142, 35)` | Trees, hedges, all kinds of vertical vegetation. Ground-level vegetation is considered `Terrain`. |
| `10` | Terrain | `(152, 251, 152)` | Grass, ground-level vegetation, soil or sand. These areas are not meant to be driven on. This label includes a possibly delimiting curb. |
| `11` | Sky | `(70, 130, 180)` | Open sky. Includes clouds and the sun. |
| `12` | Pedestrian | `(220, 20, 60)` | Humans that walk |
| `13` | Rider | `(255, 0, 0)` | Humans that ride/drive any kind of vehicle or mobility system <br> E.g. bicycles or scooters, skateboards, horses, roller-blades, wheel-chairs, etc. . |
| `14` | Car | `(0, 0, 142)` | Cars, vans |
| `15` | Truck | `(0, 0, 70)` | Trucks |
| `16` | Bus | `(0, 60, 100)` | Busses |
| `17` | Train | `(0, 60, 100)` | Trains |
| `18` | Motorcycle | `(0, 0, 230)` | Motorcycle, Motorbike |
| `19` | Bicycle | `(119, 11, 32)` | Bicylces |
| `20` | Static | `(110, 190, 160)` | Elements in the scene and props that are immovable. <br> E.g. fire hydrants, fixed benches, fountains, bus stops, etc. |
| `21` | Dynamic | `(170, 120, 50)` | Elements whose position is susceptible to change over time. <br> E.g. Movable trash bins, buggies, bags, wheelchairs, animals, etc. |
| `22` | Other | `(55, 90, 80)` | Everything that does not belong to any other category. |
| `23` | Water | `(45, 60, 150)` | Horizontal water surfaces. <br> E.g. Lakes, sea, rivers. |
| `24` | RoadLine | `(157, 234, 50)` | The markings on the road. |
| `25` | Ground | `(81, 0, 81)` | Any horizontal ground-level structures that does not match any other category. For example areas shared by vehicles and pedestrians, or flat roundabouts delimited from the road by a curb. |
| `26` | Bridge | `(150, 100, 100)` | Only the structure of the bridge. Fences, people, vehicles, an other elements on top of it are labeled separately. |
| `27` | RailTrack | `(230, 150, 140)` | All kind of rail tracks that are non-drivable by cars. <br> E.g. subway and train rail tracks. |
| `28` | GuardRail | `(180, 165, 180)` | All types of guard rails/crash barriers. |
<br>
!!! Note

View File

@ -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.

View File

@ -13,7 +13,7 @@ This tutorial details how to add a new vehicle to CARLA. There are two sections,
---
## Add a 4 wheeled vehicle
Vehicles added to CARLA need to use a __common base skeleton__ which is found [__here__](https://carla-assets.s3.eu-west-3.amazonaws.com/fbx/VehicleSkeleton.rar). This link will download a folder called `VehicleSkeleton.rar` which contains the base skeleton in two different `.fbx` formats, one in ASCII and the other in binary. The format you use will depend on your 3D modeling software requirements.
Vehicles added to CARLA need to use a __common base skeleton__ which is found [__here__](https://carla-assets.s3.us-east-005.backblazeb2.com/fbx/VehicleSkeleton.rar). This link will download a folder called `VehicleSkeleton.rar` which contains the base skeleton in two different `.fbx` formats, one in ASCII and the other in binary. The format you use will depend on your 3D modeling software requirements.
__The positions of the skeleton bones can be changed but any other manipulation such as rotation, addition of new bones, or changing the current hierarchy will lead to errors. __
@ -52,7 +52,7 @@ We recommend that you divide the vehicle into the following materials:
- __Lights__: Headlights, indicator lights, etc.
- __LightGlass_Ext__: A layer of glass that allows visibility from the outside to the inside of the light.
- __LightGlass_Int__: A layer of glass that allows visibility from the inside to the outside of the light.
- __LicensePlate__: A rectangular plane of 29x12 cm. You can use the CARLA provided `.fbx` for best results, download it [here](https://carla-assets.s3.eu-west-3.amazonaws.com/fbx/LicensePlate.rar). The texture will be assigned automatically in Unreal Engine.
- __LicensePlate__: A rectangular plane of 29x12 cm. You can use the CARLA provided `.fbx` for best results, download it [here](https://carla-assets.s3.us-east-005.backblazeb2.com/fbx/LicensePlate.rar). The texture will be assigned automatically in Unreal Engine.
- __Interior__: Any other details that don't fit in the above sections can go into _Interior_.
Materials should be named using the format `M_CarPart_CarName`, e.g., `M_Bodywork_Mustang`.
@ -278,7 +278,7 @@ All other parameters such as engine, transmission, steering curve, are the same
---
## Add a 2 wheeled vehicle
Adding 2 wheeled vehicles is similar to adding a 4 wheeled one but due to the complexity of the animation you'll need to set up aditional bones to guide the driver's animation. [Here](https://carla-assets.s3.eu-west-3.amazonaws.com/fbx/BikeSkeleton.rar) is the link to the reference skeleton for 2 wheeled vehicles.
Adding 2 wheeled vehicles is similar to adding a 4 wheeled one but due to the complexity of the animation you'll need to set up aditional bones to guide the driver's animation. [Here](https://carla-assets.s3.us-east-005.backblazeb2.com/fbx/BikeSkeleton.rar) is the link to the reference skeleton for 2 wheeled vehicles.
As with the 4 wheeled vehicles, orient the model towards positive "x" and every bone axis towards
positive x and with the z axis facing upwards.

View File

@ -23,9 +23,9 @@ In CARLA, there is a set of master materials that are used as templates for the
* __M_CarInterior_Master__ — Material applied to the inside of the car.
* __M_CarLightsGlass_Master__ — Material applied to the glass covering car lights.
* __M_CarWindows_Master__ — Material applied to the windows.
* __M_CarLicensePlate_Master__ — Material applied to the license plate.
* __M_CarVehicleLights_Master__ — Material applied to the car lights as an emissive texure.
* __M_CarVehicleLigthsSirens_Master__ — Material applied to the sirens, if applicable.
* __M_LicensePlate_Master__ — Material applied to the license plate.
* __M_VehicleLights_Master__ — Material applied to the car lights as an emissive texure.
* __M_VehicleLights_Sirens_Master__ — Material applied to the sirens, if applicable.
---
## Customize car materials
@ -142,7 +142,7 @@ Similarly to car materials, a building material can be greatly changed if desire
* `Color` — Tint to be applied based on the white area on the __Diffuse__ `Alpha` texture.
* `Emissive Texture` — Enable the usage of an __Emissive__ texture.
* `EmissiveColor` — Tint to be applied based on the white area on the __ORME__ `Emissive mask` texture.
* `Emissive atenuance` — Factor that divides the intensity stated in __BP_Lights__ to obtain proper emissive values.
* `Emissive attenuance` — Factor that divides the intensity stated in __BP_Lights__ to obtain proper emissive values.
* `RoughnessCorrection` — Changes the intensity of the roughness map.
* `MetallicCorrection` — Changes the intensity of the metallic map.
* `NormalFlatness` — Changes the intensity of the normal map.

View File

@ -67,7 +67,7 @@ __4.3__ Press `Compile` in the toolbar above and save the changes.
## Physics colliders
!!! Important
This tutorial is based on a [contribution](https://bitbucket.org/yankagan/carla-content/wiki/Home) made by __[yankagan](https://github.com/yankagan)__! The contributor also wants to aknowledge __Francisco E__ for the tutorial on [how to import custom collisions in UE](https://www.youtube.com/watch?v=SEH4f0HrCDM).
This tutorial is based on a [contribution](https://bitbucket.org/yankagan/carla-content/wiki/Home) made by __[yankagan](https://github.com/yankagan)__! The contributor also wants to acknowledge __Francisco E__ for the tutorial on [how to import custom collisions in UE](https://www.youtube.com/watch?v=SEH4f0HrCDM).
[This video](https://www.youtube.com/watch?v=CXK2M2cNQ4Y) shows the results achieved after following this tutorial.

View File

@ -25,7 +25,7 @@ This page shows you how to generate a `.sim` file, explains how vehicle dimensio
__For Ubuntu__:
1. Download the plugin [here](https://www.carsim.com/users/unreal_plugin/unreal_plugin_2020_0.php).
2. Replace the file `CarSim.Build.cs` with the file found [here](https://carla-releases.s3.eu-west-3.amazonaws.com/Backup/CarSim.Build.cs) in order to use the correct solver for Ubuntu.
2. Replace the file `CarSim.Build.cs` with the file found [here](https://carla-assets.s3.us-east-005.backblazeb2.com/Backup/CarSim.Build.cs) in order to use the correct solver for Ubuntu.
3. This step can be skipped if you are using the packaged version of CARLA. The packaged version has already been compiled using this flag but if you are building CARLA from source then you will need to compile the server with the `--carsim` flag.

View File

@ -147,7 +147,7 @@ def build_projection_matrix(w, h, fov):
## Build the skeleton
Now we can put the moving parts together. First, gather the bone coordinates from the simulation using `pedestrian.get_bones()` and then put together the skeleton and project it onto the 2D imaging plane of the camera sensor. The bones are joined into the complete skeleton using the pairs defined in __skeleton.txt__ that can be downloaded [__here__](https://carla-assets.s3.eu-west-3.amazonaws.com/fbx/skeleton.txt).
Now we can put the moving parts together. First, gather the bone coordinates from the simulation using `pedestrian.get_bones()` and then put together the skeleton and project it onto the 2D imaging plane of the camera sensor. The bones are joined into the complete skeleton using the pairs defined in __skeleton.txt__ that can be downloaded [__here__](https://carla-assets.s3.us-east-005.backblazeb2.com/fbx/skeleton.txt).
We need a function to iterate through the bone pairs defined in __skeleton.txt__ and join the bone coordinates into lines that can be overlayed onto a camera sensor image.

View File

@ -568,7 +568,7 @@ The script places the sensor on the hood of the car, and rotated a bit upwards.
The callback is a bit more complex this time, showing more of its capabilities. It will draw the points captured by the radar on the fly. The points will be colored depending on their velocity regarding the ego vehicle.
* __Blue__ for points approaching the vehicle.
* __Read__ for points moving away from it.
* __Red__ for points moving away from it.
* __White__ for points static regarding the ego vehicle.
```py

View File

@ -8,7 +8,7 @@ Firstly, we need to load the Unreal Editor and load a CARLA map, follow the inst
![select_building](../img/tuto_G_texture_streaming/building_selected.png)
We have selected __BP_Apartment04_v5_Opt__ for texture manipulation, the name can be seen in the World Outliner panel. __Make sure to hover over the name in the World Outliner and use the name defined in the tooltip__. The the internal name may differ from the title displayed in the list. In this case, the internal name is actually __BP_Apartment04_v5_Opt_2__.
We have selected __BP_Apartment04_v05_Opt__ for texture manipulation, the name can be seen in the World Outliner panel. __Make sure to hover over the name in the World Outliner and use the name defined in the tooltip__. The the internal name may differ from the title displayed in the list. In this case, the internal name is actually __BP_Apartment04_v05_Opt_2__.
![tooltip](../img/tuto_G_texture_streaming/tooltip.png)

View File

@ -78,6 +78,10 @@ __6.__ A `<mapName>.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).

View File

@ -5,7 +5,8 @@ CARLA comes with a generous compliment of assets for creating driving simulation
In this tutorial we will cover the process of creating a simple map for use with CARLA. We will use two software packages to create parts of the map. We will create the road network using [__RoadRunner__](https://es.mathworks.com/products/roadrunner.html) and then add assets to the map through the [__Unreal Editor__](https://www.unrealengine.com/en-US/features/the-unreal-editor).
* __[Prerequisites](#prerequisites)__
* __[Large maps](#large-maps)__
* __[Large maps](#large-maps)__
* __[Digital Twin Tool](#digital-twin-tool)__
* __[RoadRunner](#create-a-road-network-using-roadrunner)__
* __[Importing into CARLA](#importing-your-road-network-into-carla)__
* __[Importing assets](#importing-assets-and-adding-them-to-the-map)__
@ -21,6 +22,9 @@ In this tutorial we will cover the process of creating a simple map for use with
* [Next steps](#next-steps)
* __[Trees and vegetation](#trees-and-vegetation)__
* [Foliage tool](#foliage-tool)
* __[Exporting a map](#exporting-a-map)__
* [Exporting a map as a separate package](#exporting-a-map-as-a-separate-package)
* [Exporting a map as part of a complete CARLA package](#exporting-a-map-as-part-of-a-complete-carla-package)
@ -31,6 +35,11 @@ To follow this guide, you will need to build CARLA from source, so that you may
## Large Maps
The following text details the procedures for creating and decorating a standard map. From version 0.9.12, CARLA has the Large Maps functionality. Large maps are bigger in scale than standard maps, and can be up to 100 km<sup>2</sup> in size. Large maps work in a slightly different way to standard maps, because of hardware limitations, even in high end graphics cards. Large maps are split up into tiles, and only the tiles needed immediately (i.e. those closest to the Ego vehicle) are loaded during the simulation. Other tiles sit dormant until the data is needed. This facilitates the highest performance for CARLA simulations. Most of the details that follow are similar when building a Large Map, but there are some additional steps. Please follow [this guide](content_authoring_large_maps.md) to build a Large Map for CARLA.
## Digital Twin Tool
CARLA offers a procedural map generation tool, which ingests road network data from OpenStreetMap and decorates the map procedurally with buildings and vegetation. Read about how to use the tool [here](adv_digital_twin.md).
## Create a road network using RoadRunner
Open RoadRunner and create a new scene. Choose the Road Plan Tool and right click in the workspace to drop the first control point for the road. Click and drag elsewhere in the workspace to extend the road.
@ -397,12 +406,56 @@ Navigate to the vegetation folder in the CARLA content library: `Carla > Static
A useful tool for trees and vegetation is the [__Unreal Engine foliage tool__](https://docs.unrealengine.com/4.27/en-US/BuildingWorlds/Foliage/). Activate the tool by selecting the `mode` from the mode dropdown in the toolbar.
![foliage_tool](img/tuto_content_authoring_maps/select_foliage_tool.png)
![foliage_tool](img/tuto_content_authoring_maps/select_foliage_tool.gif)
Drag your desired foliage item into the box labeled `+ Drop Foliage Here`. Set an appropriate density in the density field, then paint into the map with your foliage item.
![foliage_paint](img/tuto_content_authoring_maps/foliage_paint.gif)
---
## Exporting a map
### Exporting a map as a separate package
To export a map as a map package that can be ingested into a standalone CARLA package installation, use the `make package` command as follows:
```sh
make package ARGS="--packages=<mapName>"
```
The `<mapName>` must point to a json file located in `CARLA_ROOT/Unreal/CarlaUE4/Content/Carla/Config` named *mapName.Package.json* which has the following structure:
```json
{
"maps": [
{
"path": "/Game/Carla/Maps/",
"name": "MyMap",
"use_carla_materials": true
}
],
"props": []
}
```
Your map should have been saved as `MyMap.umap` file in the `CARLA_ROOT/Unreal/CarlaUE4/Content/Carla/Maps` directory.
The exported map archive will be saved in the `Dist` folder on Linux and the `/Build/UE4Carla/` folder on Windows.
### Exporting a map as part of a complete CARLA package
To export the map as part of a complete CARLA package, such that the map is available on launch of the package, include the following line in the `DefaultGame.ini` file in `CARLA_ROOT/Unreal/CarlaUE4/Config/`:
```
+MapsToCook=(FilePath="/Game/Carla/Maps/MyMap")
```
This line should be added in the `[/Script/UnrealEd.ProjectPackagingSettings]` section, preferably next to the other `MapsToCook(...)` entries. Then run `make package` command to build a package containing your map. The exported CARLA package with your map will be saved in the `Dist` folder on Linux and the `/Build/UE4Carla/` folder on Windows.
---
## Next steps
Continue customizing your map using the tools and guides below:

View File

@ -1,36 +1,36 @@
# Content authoring - vehicles
CARLA provides a comprehensive set of vehicles out of the box in the blueprint library. CARLA allows the user to expand upon this with custom vehicles for maximum extensibility.
CARLA provides a comprehensive set of vehicles out of the box in the blueprint library. CARLA allows the user to expand upon this with custom vehicles for maximum extensibility.
3D modelling of detailed vehicles is highly complex and requires a significant degree of skill. We therefore refer the reader to alternative sources of documentation on 3D modelling, since this is beyond the scope of this guide. There are, however, numerous sources of vehicle models in both free and proprietary online repositories. Hence the user has many options to turn to for creating custom vehicles for use in CARLA.
The key factors in preparing a custom vehicle for CARLA lie in rigging the vehicle armature and then importing into the Unreal Engine. After rigging and importing, blueprints need to be set for the car and the wheels. Then apply materials and add the glass parts of the vehicle. We will cover these steps in the following guide.
* __[Modeling](#modeling)__
* [Naming conventions](#naming-conventions)
* __[Rigging](#rigging-the-vehicle-using-an-armature)__
* [Import](#import)
* __[Modeling](#modeling)__
* [Naming conventions](#naming-conventions)
* __[Rigging](#rigging-the-vehicle-using-an-armature)__
* [Import](#import)
* [Armature](#add-an-armature)
* [Parenting](#parenting)
* [Assignment](#assigning-car-parts-to-bones)
* [Assignment](#assigning-car-parts-to-bones)
* [Blender add-on](#blender-ue4-vehicle-rigging-add-on)
* [Export](#export)
* __[Import into Unreal Engine](#importing-into-unreal-engine)__
* [Physics asset](#setting-the-physics-asset)
* [Export](#export)
* __[Import into Unreal Engine](#importing-into-unreal-engine)__
* [Physics asset](#setting-the-physics-asset)
* [Animation](#creating-the-animation)
* [Blueprint](#creating-the-blueprint)
* __[Materials](#materials)__
* __[Materials](#materials)__
* [Applying materials](#applying-a-material-to-your-vehicle)
* [Color](#color)
* [Clear coat](#clear-coat)
* [Orange peel](#orange-peel)
* [Flakes](#flakes)
* [Dust](#dust)
* __[Glass](#glass)__
* __[Glass](#glass)__
* [Glass meshes](#glass-meshes)
* [Glass material](#glass-material)
* [Single layer glass](#single-layer-glass)
* __[Wheels](#wheels)__
* __[Wheels](#wheels)__
* [Wheel blueprint](#wheel-blueprint)
* [Collision mesh](#collision-mesh)
* [Tire configuration](#tire-configuration)
@ -41,7 +41,7 @@ The key factors in preparing a custom vehicle for CARLA lie in rigging the vehic
## Modeling
Vehicles should have between 50,000 and 100,000 faces. We recommend triangulating the model prior to export as best practice. CARLA vehicles are modeled using the size and scale of actual cars as reference. Please ensure you pay careful attention to the units of your 3D application. Some work in centimeters while others work in meters.
Vehicles should have between 50,000 and 100,000 faces. We recommend triangulating the model prior to export as best practice. CARLA vehicles are modeled using the size and scale of actual cars as reference. Please ensure you pay careful attention to the units of your 3D application. Some work in centimeters while others work in meters.
### Naming conventions
@ -53,7 +53,7 @@ For ease and consistency we recommend that you divide the vehicle into the follo
- __Lights__: Headlights, indicator lights, etc.
- __LightGlass_Ext__: A layer of glass that allows visibility from the outside to the inside of the light.
- __LightGlass_Int__: A layer of glass that allows visibility from the inside to the outside of the light.
- __LicensePlate__: A rectangular plane of 29x12 cm. You can use the CARLA provided `.fbx` for best results, download it [here](https://carla-assets.s3.eu-west-3.amazonaws.com/fbx/LicensePlate.rar). The texture will be assigned automatically in Unreal Engine.
- __LicensePlate__: A rectangular plane of 29x12 cm. You can use the CARLA provided `.fbx` for best results, download it [here](https://carla-assets.s3.us-east-005.backblazeb2.com/fbx/LicensePlate.rar). The texture will be assigned automatically in Unreal Engine.
- __Interior__: Any other details that don't fit in the above sections can go into _Interior_.
Materials should be named using the format `M_CarPart_CarName`, e.g, `M_Bodywork_Mustang`.
@ -62,11 +62,11 @@ Textures should be named using the format `T_CarPart_CarName`, e.g, `T_Bodywork_
## Rigging the vehicle using an armature
To look realistic within the simulation, the car needs to have rotating and wheels, the front pair of which can turn with steering inputs. Therefore to prepare a vehicle for CARLA, an armature needs to be rigged to the car to identify the wheels and allow their movement.
To look realistic within the simulation, the car needs to have rotating and wheels, the front pair of which can turn with steering inputs. Therefore to prepare a vehicle for CARLA, an armature needs to be rigged to the car to identify the wheels and allow their movement.
### Import
### Import
Import or model the vehicle model mesh in your 3D modelling application. In this guide we will use Blender 3D. Ensure that the wheels are separable from the main body. Each wheel must be accessible as a distinct object.
Import or model the vehicle model mesh in your 3D modelling application. In this guide we will use Blender 3D. Ensure that the wheels are separable from the main body. Each wheel must be accessible as a distinct object.
![model_in_blender](img/tuto_content_authoring_vehicles/import_model_blender.png)
@ -74,23 +74,23 @@ It is important to ensure that the vehicle faces in the positive X direction, so
### Add an armature
Now add an armature to the center of the vehicle, ensure the object is properly centered, the root of the armature bone should be set at the origin. Switch to edit mode and rotate the armature 90 around the x axis.
Now add an armature to the center of the vehicle, ensure the object is properly centered, the root of the armature bone should be set at the origin. Switch to edit mode and rotate the armature 90 around the x axis.
![armature_init](img/tuto_content_authoring_vehicles/vehicle_base_bone.png)
Now select the armature and add 4 more bones. Each of these bones needs to be located such that the root of the bone coincides with the centre of the each wheel. This can be achieved by locating the 3D cursor at the center of each wheel in edit mode. Select one of the wheels in object mode, select a vertex, press A to select all vertices then `Shift+S` and select `Cursor to selected`. This will locate the cursor in the center of the wheel. Then, in object mode, select the armature, switch to edit mode, select a bone and choose `Selection to cursor`. Your bone will now coincide with the wheel. Rotate each bone such that it lines up with the base of the armature.
Now select the armature and add 4 more bones. Each of these bones needs to be located such that the root of the bone coincides with the centre of the each wheel. This can be achieved by locating the 3D cursor at the center of each wheel in edit mode. Select one of the wheels in object mode, select a vertex, press A to select all vertices then `Shift+S` and select `Cursor to selected`. This will locate the cursor in the center of the wheel. Then, in object mode, select the armature, switch to edit mode, select a bone and choose `Selection to cursor`. Your bone will now coincide with the wheel. Rotate each bone such that it lines up with the base of the armature.
For each wheel, it is recommended to name the bone according to the wheel it needs to be coupled to, this will help in identification later when you need to assign vertex groups to each bone.
For each wheel, it is recommended to name the bone according to the wheel it needs to be coupled to, this will help in identification later when you need to assign vertex groups to each bone.
![armature_full](img/tuto_content_authoring_vehicles/all_vehicle_bones.png)
### Parenting
### Parenting
Now select all the parts of the body and all 4 wheels using shift or control in the project outliner, then control select the armature you have created (this order is important, it won't work if you select these in reverse order). Press `Ctrl+p` and select `With empty groups` to bind the mesh to the armature.
Now select all the parts of the body and all 4 wheels using shift or control in the project outliner, then control select the armature you have created (this order is important, it won't work if you select these in reverse order). Press `Ctrl+p` and select `With empty groups` to bind the mesh to the armature.
![bind_armature](img/tuto_content_authoring_vehicles/bind_armature.gif)
Now you have parented the mesh to the armature, you now need to assign each wheel to its respective bone. Select a wheel either in the outliner or the editor. Switch to edit mode, and select all the vertices of the wheel (shortcut - `a`).
Now you have parented the mesh to the armature, you now need to assign each wheel to its respective bone. Select a wheel either in the outliner or the editor. Switch to edit mode, and select all the vertices of the wheel (shortcut - `a`).
### Assigning car parts to bones
@ -108,9 +108,9 @@ There is a very useful add on for blender for rigging a vehicle for import into
### Export
Now we will export our rigged model into FBX format for import into Unreal Engine. Select `Export > FBX (.fbx)` from the File menu. In the `Object Types` section of the `Include` panel, shift select the `Armature` and `Mesh` options.
Now we will export our rigged model into FBX format for import into Unreal Engine. Select `Export > FBX (.fbx)` from the File menu. In the `Object Types` section of the `Include` panel, shift select the `Armature` and `Mesh` options.
In the `Transform` panel. Change `Forward` to `X Forward` and change `Up` to `Z Up`. This is important to ensure the vehicle is oriented correctly in the Unreal Engine.
In the `Transform` panel. Change `Forward` to `X Forward` and change `Up` to `Z Up`. This is important to ensure the vehicle is oriented correctly in the Unreal Engine.
In the `Armature` section uncheck `Add Leaf Bones` and uncheck `Bake Animation`.
@ -118,7 +118,7 @@ In the `Armature` section uncheck `Add Leaf Bones` and uncheck `Bake Animation`.
## Importing into unreal engine
Launch the Unreal Editor with the `make launch` command from the CARLA root directory (the one where you have built CARLA from source). Open a content browser, set up an appropriate directory and right click and select `Import to ....`. Choose the FBX file that you previously exported from Blender (or another 3D modelling application). Import with default settings.
Launch the Unreal Editor with the `make launch` command from the CARLA root directory (the one where you have built CARLA from source). Open a content browser, set up an appropriate directory and right click and select `Import to ....`. Choose the FBX file that you previously exported from Blender (or another 3D modelling application). Import with default settings.
### Setting the physics asset
@ -130,7 +130,7 @@ First, select the main body, in the `Details` menu on the right, change the `Lin
![physics_details](img/tuto_content_authoring_vehicles/physics_details.png)
Now select all the wheels (in the `Skeleton Tree` section on the left).
Now select all the wheels (in the `Skeleton Tree` section on the left).
![regenerate_wheels](img/tuto_content_authoring_vehicles/wheels_asset.png)
@ -170,7 +170,7 @@ Select the `Vehicles` node and expand the `Vehicles` item in the `Default value`
![vehicle_factory](img/tuto_content_authoring_vehicles/vehicle_factory_page.png)
Press the plus icon to add your new vehicle. Scroll down to the last entry and expand it, it should be empty. Name the make and model of your vehicle and under the class section find your blueprint class that you created in the previous section. Leave the number of wheels as 4 and put the generation as 2. Compile and save. Do a global save for safety and you are now..ready to run your vehicle in a simulation.
Press the plus icon to add your new vehicle. Scroll down to the last entry and expand it, it should be empty. Name the make and model of your vehicle and under the class section find your blueprint class that you created in the previous section. Leave the number of wheels as 4 and put the generation as 2. Compile and save. Do a global save for safety and you are now..ready to run your vehicle in a simulation.
Press play in the unreal toolbar to run the simulation. Once it is running, open a terminal and run the `manual_control.py` script with the filter option to specify your new vehicle model:
@ -185,13 +185,13 @@ As it is, the vehicle currently has no textures or colors applied. The next step
Once you have your vehicle imported as a basic asset with the mesh and blueprints laid out, you now want to add materials to your vehicle to facilitate photorealistic rendering in the Unreal Engine, for maximum fidelity in your machine learning training data.
The Unreal Editor boasts a comprehensive materials workflow that facilitates the creation of highly realistic materials. This does, however, add a significant degree of complexity to the process. For this reason, CARLA is provided with a large library of material prototypes for you to use without having to start from scratch.
The Unreal Editor boasts a comprehensive materials workflow that facilitates the creation of highly realistic materials. This does, however, add a significant degree of complexity to the process. For this reason, CARLA is provided with a large library of material prototypes for you to use without having to start from scratch.
### Applying a material to your vehicle
CARLA provides a prototype material for replicating the glossy finish of vehicles that can mimic numerous different types of vehicle paint jobs and features. Open Unreal editor and in the content browser, locate the material in `Content > Carla > Static > GenericMaterials > 00_MastersOpt`. The basic material is called `M_CarPaint_Master`. Right click on this material and choose `Create Material Instance` from the context material. Name it and move it into the folder where your new vehicle content is stored.
In the Unreal Editor, move the spectator to a point near the floor and drag the skeletal mesh of the vehicle from the content browser into the scene, the body of your vehicle will now appear there.
In the Unreal Editor, move the spectator to a point near the floor and drag the skeletal mesh of the vehicle from the content browser into the scene, the body of your vehicle will now appear there.
![add_model](img/tuto_content_authoring_vehicles/add_model.gif)
@ -207,7 +207,7 @@ The color settings govern the overall color of the car. The base color is simply
![change_base_color](img/tuto_content_authoring_vehicles/change_base_color.gif)
#### __Clear coat__
#### __Clear coat__
The clear coat settings govern the appearance of the finish and how it reacts to light. The roughness uses a texture to apply imperfections to the vehicle surface, scattering light more with higher values to create a matte look. Subtle adjustments and low values are recommended for a realistic look. Generally, car paint jobs are smooth and reflective, however, this effect might be used more generously to model specialist matte finishes of custom paint jobs.
@ -215,7 +215,7 @@ The clear coat settings govern the appearance of the finish and how it reacts to
An important parameter to govern the "shininess" or "glossiness" of your car is the `Clear Coat Intensity`. High values close to 1 will make the coat shiny and glossy.
#### __Orange peel__
#### __Orange peel__
Finishes on real cars (particularly on mass produced cars for the general market) tend to have imperfections that appear as slight ripples in the paint. The orange peel effect mimics this and makes cars look more realistic.
@ -223,13 +223,13 @@ Finishes on real cars (particularly on mass produced cars for the general market
#### __Flakes__
Some cars have paint jobs that include flakes of other material, such as metals or ceramics, to give the car a `metallic` or `pearlescant` appearance, adding extra glints and reflections that react in an attractive way to light. The flakes parameters allows CARLA to mimic this. To mimic metallic finishes, it would be
Some cars have paint jobs that include flakes of other material, such as metals or ceramics, to give the car a `metallic` or `pearlescant` appearance, adding extra glints and reflections that react in an attractive way to light. The flakes parameters allows CARLA to mimic this. To mimic metallic finishes, it would be
![flakes](img/tuto_content_authoring_vehicles/flakes.gif)
#### __Dust__
Cars often accumulate grease and dust on the body that adds additional texture to the paint, affecting the way it reflects the light. The dust parameters allow you to add patches of disruption to the coat to mimic foreign materials sticking to the paint.
Cars often accumulate grease and dust on the body that adds additional texture to the paint, affecting the way it reflects the light. The dust parameters allow you to add patches of disruption to the coat to mimic foreign materials sticking to the paint.
![dust](img/tuto_content_authoring_vehicles/change_dust.gif)
@ -245,15 +245,15 @@ Here we see the glass parts attached to the main bodywork (not the doors or othe
![main_glass](img/tuto_content_authoring_vehicles/glass.png)
If we separate the constituent mesh parts, we can see that the glass profile is separated into 4 different layers.
If we separate the constituent mesh parts, we can see that the glass profile is separated into 4 different layers.
![main_glass_expanded](img/tuto_content_authoring_vehicles/glass_expanded.png)
The 4 layers are separated into 2 groups, the exterior layers, with normals facing out of the vehicle and the interior layers, with mesh normals facing into the vehicle interior. The following diagram demonstrates
The 4 layers are separated into 2 groups, the exterior layers, with normals facing out of the vehicle and the interior layers, with mesh normals facing into the vehicle interior. The following diagram demonstrates
![glass_layers](img/tuto_content_authoring_vehicles/glass_layers.png)
Once you have created your mesh layers, import them in the content browser into the Unreal Editor in the folder where you have stored your vehicle.
Once you have created your mesh layers, import them in the content browser into the Unreal Editor in the folder where you have stored your vehicle.
Shift select the 4 glass layers and drag them into the map so you can see them.
@ -288,7 +288,7 @@ For the wheels of CARLA vehicles, we need to set up a blueprint class for each w
### Wheel blueprint
Inside the folder where you have your new vehicle, right click and choose to create a new blueprint class. Search for
Inside the folder where you have your new vehicle, right click and choose to create a new blueprint class. Search for
![wheel_blueprint](img/tuto_content_authoring_vehicles/wheel_blueprint.png)
@ -298,12 +298,12 @@ Double click on the blueprint to adjust it:
### Collision mesh
Firstly, the default cylinder used for the collision mesh has a high polygon count, so we should replace this with a low polygon version. In the content browser locate the `CollisionWheel` mesh inside `Content > Carla > Blueprints > Vehicles`. Drag it onto the
Firstly, the default cylinder used for the collision mesh has a high polygon count, so we should replace this with a low polygon version. In the content browser locate the `CollisionWheel` mesh inside `Content > Carla > Blueprints > Vehicles`. Drag it onto the
`Collision Mesh` slot in the details panel of the blueprint. This will improve performance without any noticeable deficit to physics simulation.
### Tire configuration
Next, we set the tire configuration. Inside `Content > Carla > Blueprints > Vehicles` locate the `CommonTireConfig` configuration and drag it onto the `Tire Config` section of the blueprint. If you double click on the Tire Config in the blueprint, you can adjust the Friction Scale, you can modify the behavior of the vehicle's road handling. By default it is set at 3.5, a value suitable for most vehicle use cases. However, if you wish to model for example a racing vehicle with slick tires, this would be the appropriate parameter to adjust.
Next, we set the tire configuration. Inside `Content > Carla > Blueprints > Vehicles` locate the `CommonTireConfig` configuration and drag it onto the `Tire Config` section of the blueprint. If you double click on the Tire Config in the blueprint, you can adjust the Friction Scale, you can modify the behavior of the vehicle's road handling. By default it is set at 3.5, a value suitable for most vehicle use cases. However, if you wish to model for example a racing vehicle with slick tires, this would be the appropriate parameter to adjust.
### Wheel dimensions
@ -316,24 +316,24 @@ Now plug these numbers into the `Wheel` section of the blueprint.Take care to re
![bp_wheel_dimensions](img/tuto_content_authoring_vehicles/bp_wheel_dimensions.png)
`Affected by handbrake` should be checked for both rear wheels.
`Affected by handbrake` should be checked for both rear wheels.
`Steer angle` should be set to the maximum intended steer angle for both front wheels and set to zero for both rear wheels.
### __Suspension characteristics__
The default values here provide a reasonable starting point. View [__this guide__](tuto_D_customize_vehicle_suspension.md) to set suspension characteristics appropriate to your vehicle type.
The default values here provide a reasonable starting point. View [__this guide__](tuto_D_customize_vehicle_suspension.md) to set suspension characteristics appropriate to your vehicle type.
## Lights
The last element to complete a realistic vehicle for CARLA is the lights, headlights, brake lights, blinkers etc. In your 3D modelling application, you should model some shapes that resemble the lights of the vehicle you are replicating. This would be flat discs or flat cuboid structures for most headlights. Some vehicles may also have strips of LEDs.
The last element to complete a realistic vehicle for CARLA is the lights, headlights, brake lights, blinkers etc. In your 3D modelling application, you should model some shapes that resemble the lights of the vehicle you are replicating. This would be flat discs or flat cuboid structures for most headlights. Some vehicles may also have strips of LEDs.
![lights_blender](img/tuto_content_authoring_vehicles/lights_blender.png)
### UV map
The different types of lights (headlights, blinkers, brake lights, etc.) are distinguished using a texture. You need to create a UV map in your 3D modelling application and position the lights to match up with the relevant region of the texture.
The different types of lights (headlights, blinkers, brake lights, etc.) are distinguished using a texture. You need to create a UV map in your 3D modelling application and position the lights to match up with the relevant region of the texture.
![lights_uv](img/tuto_content_authoring_vehicles/lights_uv_map.png)

View File

@ -1,45 +1,45 @@
# Tutorials
Here you will find the multitude of tutorials available to help you understand how to use CARLA's many features.
Here you will find the multitude of tutorials available to help you understand how to use CARLA's many features.
## General
### CARLA features
[__Retrieve simulation data__](tuto_G_retrieve_data.md) — A step by step guide to properly gather data using the recorder.
[__Traffic manager__](tuto_G_traffic_manager.md) — How to use traffic manager to guide traffic around your town.
[__Texture streaming__](tuto_G_texture_streaming.md) — Modify textures of map objects in real time to add variation.
[__Instance segmentation camera__](tuto_G_instance_segmentation_sensor.md) — Use an instance segmentation camera to distinguish objects of the same class.
[__Bounding boxes__](tuto_G_bounding_boxes.md) — Project bounding boxes from CARLA objects into the camera.
[__Pedestrian bones__](tuto_G_pedestrian_bones.md) — Project pedestrian skeleton into camera plane.
[__Control walker skeletons__](tuto_G_control_walker_skeletons.md) — Animate walkers using skeletons.
* [__Retrieve simulation data__](tuto_G_retrieve_data.md) — A step by step guide to properly gather data using the recorder.
* [__Traffic manager__](tuto_G_traffic_manager.md) — How to use traffic manager to guide traffic around your town.
* [__Texture streaming__](tuto_G_texture_streaming.md) — Modify textures of map objects in real time to add variation.
* [__Instance segmentation camera__](tuto_G_instance_segmentation_sensor.md) — Use an instance segmentation camera to distinguish objects of the same class.
* [__Bounding boxes__](tuto_G_bounding_boxes.md) — Project bounding boxes from CARLA objects into the camera.
* [__Pedestrian bones__](tuto_G_pedestrian_bones.md) — Project pedestrian skeleton into camera plane.
* [__Control walker skeletons__](tuto_G_control_walker_skeletons.md) — Animate walkers using skeletons.
### Building and integration
[__Build Unreal Engine and CARLA in Docker__](build_docker_unreal.md) — Build Unreal Engine and CARLA in Docker.
[__CarSim Integration__](tuto_G_carsim_integration.md) — Tutorial on how to run a simulation using the CarSim vehicle dynamics engine.
[__RLlib Integration__](tuto_G_rllib_integration.md) — Find out how to run your own experiment using the RLlib library.
[__Chrono Integration__](tuto_G_chrono.md) — Use the Chrono integration to simulation physics.
[__PyGame control__](tuto_G_pygame.md) — Use PyGame to display the output of camera sensors.
* [__Build Unreal Engine and CARLA in Docker__](build_docker_unreal.md) — Build Unreal Engine and CARLA in Docker.
* [__CarSim Integration__](tuto_G_carsim_integration.md) — Tutorial on how to run a simulation using the CarSim vehicle dynamics engine.
* [__RLlib Integration__](tuto_G_rllib_integration.md) — Find out how to run your own experiment using the RLlib library.
* [__Chrono Integration__](tuto_G_chrono.md) — Use the Chrono integration to simulation physics.
* [__PyGame control__](tuto_G_pygame.md) — Use PyGame to display the output of camera sensors.
## Assets and maps
[__Generate maps with OpenStreetMap__](tuto_G_openstreetmap.md) — Use OpenStreetMap to generate maps for use in simulations.
[__Add a new vehicle__](tuto_A_add_vehicle.md) — Prepare a vehicle to be used in CARLA.
[__Add new props__](tuto_A_add_props.md) — Import additional props into CARLA.
[__Create standalone packages__](tuto_A_create_standalone.md) — Generate and handle standalone packages for assets.
[__Material customization__](tuto_A_material_customization.md) — Edit vehicle and building materials.
* [__Generate maps with OpenStreetMap__](tuto_G_openstreetmap.md) — Use OpenStreetMap to generate maps for use in simulations.
* [__Add a new vehicle__](tuto_A_add_vehicle.md) — Prepare a vehicle to be used in CARLA.
* [__Add new props__](tuto_A_add_props.md) — Import additional props into CARLA.
* [__Create standalone packages__](tuto_A_create_standalone.md) — Generate and handle standalone packages for assets.
* [__Material customization__](tuto_A_material_customization.md) — Edit vehicle and building materials.
## Developers
[__How to upgrade content__](tuto_D_contribute_assets.md) — Add new content to CARLA.
[__Create a sensor__](tuto_D_create_sensor.md) — Develop a new sensor to be used in CARLA.
[__Create semantic tags__](tuto_D_create_semantic_tags.md) — Define customized tags for semantic segmentation.
[__Customize vehicle suspension__](tuto_D_customize_vehicle_suspension.md) — Modify the suspension system of a vehicle.
[__Generate detailed colliders__](tuto_D_generate_colliders.md) — Create detailed colliders for vehicles.
[__Make a release__](tuto_D_make_release.md) — How to make a release of CARLA
* [__How to upgrade content__](tuto_D_contribute_assets.md) — Add new content to CARLA.
* [__Create a sensor__](tuto_D_create_sensor.md) — Develop a new sensor to be used in CARLA.
* [__Create semantic tags__](tuto_D_create_semantic_tags.md) — Define customized tags for semantic segmentation.
* [__Customize vehicle suspension__](tuto_D_customize_vehicle_suspension.md) — Modify the suspension system of a vehicle.
* [__Generate detailed colliders__](tuto_D_generate_colliders.md) — Create detailed colliders for vehicles.
* [__Make a release__](tuto_D_make_release.md) — How to make a release of CARLA
## Video tutorials
[__Fundamentals__](https://www.youtube.com/watch?v=pONr1R1dy88) — Learn the fundamental concepts of CARLA and start your first script. [__CODE__](https://carla-releases.s3.eu-west-3.amazonaws.com/Docs/Fundamentals.ipynb)
[__An in depth look at CARLA's sensors__](https://www.youtube.com/watch?v=om8klsBj4rc) — An in depth look at CARLA's sensors and how to use them. [__CODE__](https://carla-releases.s3.eu-west-3.amazonaws.com/Docs/Sensors_code.zip)
* [__Fundamentals__](https://www.youtube.com/watch?v=pONr1R1dy88) — Learn the fundamental concepts of CARLA and start your first script. [__CODE__](https://carla-releases.s3.us-east-005.backblazeb2.com/Docs/Fundamentals.ipynb)
* [__An in depth look at CARLA's sensors__](https://www.youtube.com/watch?v=om8klsBj4rc) — An in depth look at CARLA's sensors and how to use them. [__CODE__](https://carla-releases.s3.us-east-005.backblazeb2.com/Docs/Sensors_code.zip)

500
Jenkinsfile vendored
View File

@ -11,91 +11,177 @@ pipeline
stages
{
stage('Creating nodes')
{
agent { label "master" }
steps
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
jenkinsLib.CreateUbuntuBuildNode(JOB_ID)
jenkinsLib.CreateWindowsBuildNode(JOB_ID)
}
}
}
stage('Building CARLA')
{
parallel
{
//stage('Building CARLA')
//{
//parallel
//{
stage('ubuntu')
{
agent { label "ubuntu && build && ${JOB_ID}" }
agent { label "gpu" }
environment
{
UE4_ROOT = '/home/jenkins/UnrealEngine_4.26'
}
stages
{
stage('ubuntu setup')
stage('stash dependencies')
{
agent{ label 'cache' }
options{skipDefaultCheckout()}
steps
{
sh 'git update-index --skip-worktree Unreal/CarlaUE4/CarlaUE4.uproject'
sh 'make setup ARGS="--python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64 --chrono --ros2"'
sh "echo ${BRANCH_NAME}"
sh "set"
sh "cp ../../Build_Linux.tar.gz ."
stash includes: 'Build_Linux.tar.gz', name: 'build_cache'
}
}
stage('ubuntu build')
stage('prepare environment')
{
steps
parallel
{
sh 'make LibCarla'
sh 'make PythonAPI ARGS="--python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64"'
sh 'make CarlaUE4Editor ARGS="--chrono --ros2"'
sh 'make plugins'
sh 'make examples'
}
post
{
always
stage('generate libs')
{
archiveArtifacts 'PythonAPI/carla/dist/*.egg'
archiveArtifacts 'PythonAPI/carla/dist/*.whl'
stash includes: 'PythonAPI/carla/dist/*.egg', name: 'ubuntu_eggs'
stash includes: 'PythonAPI/carla/dist/*.whl', name: 'ubuntu_wheels'
stages
{
stage('ubuntu setup')
{
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"'
}
}
stage('ubuntu build')
{
steps
{
sh 'make LibCarla'
sh 'make PythonAPI ARGS="--python-version=3.8,2 --target-wheel-platform=manylinux_2_27_x86_64"'
sh 'make CarlaUE4Editor ARGS="--chrono"'
sh 'make plugins'
sh 'make examples'
}
post
{
always
{
archiveArtifacts 'PythonAPI/carla/dist/*.egg'
archiveArtifacts 'PythonAPI/carla/dist/*.whl'
stash includes: 'PythonAPI/carla/dist/*.egg', name: 'ubuntu_eggs'
stash includes: 'PythonAPI/carla/dist/*.whl', name: 'ubuntu_wheels'
}
}
}
stage('ubuntu unit tests')
{
steps
{
sh 'make check ARGS="--all --xml --python-version=3.8,2 --target-wheel-platform=manylinux_2_27_x86_64"'
}
post
{
always
{
junit 'Build/test-results/*.xml'
archiveArtifacts 'profiler.csv'
}
}
}
}
}
}
}
stage('ubuntu unit tests')
{
steps
{
sh 'make check ARGS="--all --xml --python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64"'
}
post
{
always
stage('Download additional resources')
{
junit 'Build/test-results/*.xml'
archiveArtifacts 'profiler.csv'
stages
{
stage('TEST: Checkout Doxygen repo')
{
when { branch "ruben/jenkins_migration"; }
steps
{
dir('doc_repo')
{
checkout scmGit(
branches: [[name: '*/ruben/jenkins_migration']],
extensions: [
cleanBeforeCheckout(),
checkoutOption(120),
localBranch("**"),
cloneOption(noTags:false, reference:'', shallow: false, timeout:120)
],
userRemoteConfigs: [
[
credentialsId: 'github_token_as_pwd_2',
url: 'https://github.com/carla-simulator/carla-simulator.github.io.git'
]
]
)
}
}
}
stage('Checkout Doxygen repo')
{
when { anyOf { branch "master"; branch "dev"; buildingTag() } }
steps
{
dir('doc_repo')
{
checkout scmGit(
branches: [[name: '*/master']],
extensions: [
cleanBeforeCheckout(),
checkoutOption(120),
localBranch("**"),
cloneOption(noTags:false, reference:'', shallow: false, timeout:120)
],
userRemoteConfigs: [
[
credentialsId: 'github_token_as_pwd_2',
url: 'https://github.com/carla-simulator/carla-simulator.github.io.git'
]
]
)
}
}
}
stage('ubuntu retrieve content')
{
steps
{
sh './Update.sh'
}
}
}
}
}
}
stage('ubuntu retrieve content')
{
steps
{
sh './Update.sh'
}
}
stage('ubuntu package')
{
steps
{
sh 'make package ARGS="--python-version=3.7,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.7,2 --target-wheel-platform=manylinux_2_27_x86_64"'
sh 'make package ARGS="--python-version=3.8,2 --target-wheel-platform=manylinux_2_27_x86_64 --chrono"'
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
@ -103,120 +189,161 @@ 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: 'Dist/AdditionalMaps*.tar.gz', name: 'ubuntu_package2'
stash includes: 'Examples/', name: 'ubuntu_examples'
}
}
}
stage('ubuntu package with ROS2')
{
steps
{
sh 'rm Dist/CARLA*.tar.gz'
sh 'make package ARGS="--python-version=3.7,2 --target-wheel-platform=manylinux_2_27_x86_64 --archive-sufix=ROS2 --chrono --ros2"'
}
post
{
always
{
archiveArtifacts 'Dist/CARLA*.tar.gz'
}
success
{
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
jenkinsLib.CreateUbuntuTestNode(JOB_ID)
stage('Testing and documentation')
{
parallel
{
stage('Testing')
{
stages
{
stage('ubuntu smoke tests')
{
steps
{
unstash name: 'ubuntu_eggs'
unstash name: 'ubuntu_wheels'
unstash name: 'ubuntu_package'
unstash name: 'ubuntu_examples'
sh 'tar -xvzf Dist/CARLA*.tar.gz -C Dist/'
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"'
}
post
{
always
{
archiveArtifacts 'CarlaUE4.log'
junit 'Build/test-results/smoke-tests-*.xml'
}
}
}
}
}
stage('Generate documentation')
{
stages
{
stage('ubuntu Doxygen generation')
{
when { anyOf { branch "master"; branch "dev"; buildingTag() } }
steps
{
sh 'make docs'
sh 'tar -czf carla_doc.tar.gz ./Doxygen'
stash includes: 'carla_doc.tar.gz', name: 'carla_docs'
}
}
stage('TEST: ubuntu Doxygen generation')
{
when { branch "ruben/jenkins_migration"; }
steps
{
sh 'make docs'
sh 'tar -czf carla_doc.tar.gz ./Doxygen'
stash includes: 'carla_doc.tar.gz', name: 'carla_docs'
}
}
}
}
}
}
stage('ubuntu smoke tests')
{
agent { label "ubuntu && gpu && ${JOB_ID}" }
steps
{
unstash name: 'ubuntu_eggs'
unstash name: 'ubuntu_wheels'
unstash name: 'ubuntu_package'
// unstash name: 'ubuntu_package2'
unstash name: 'ubuntu_examples'
sh 'tar -xvzf Dist/CARLA*.tar.gz -C Dist/'
// sh 'tar -xvzf Dist/AdditionalMaps*.tar.gz -C Dist/'
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.7 --target-wheel-platform=manylinux_2_27_x86_64"'
sh 'make run-examples ARGS="localhost 3654"'
}
post
{
always
{
archiveArtifacts 'CarlaUE4.log'
junit 'Build/test-results/smoke-tests-*.xml'
deleteDir()
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
jenkinsLib.DeleteUbuntuTestNode(JOB_ID)
stage('Deployment and documentation publishing')
{
parallel
{
stage('Release Deployment')
{
stages
{
stage('TEST: ubuntu deploy sim')
{
when { branch "ruben/jenkins_migration"; }
steps
{
sh 'git checkout .'
sh 'make deploy ARGS="--test"'
}
}
stage('ubuntu deploy dev')
{
when { branch "dev"; }
steps
{
sh 'git checkout .'
sh 'make deploy ARGS="--replace-latest"'
}
}
stage('ubuntu deploy master')
{
when { anyOf { branch "master"; buildingTag() } }
steps
{
sh 'git checkout .'
sh 'make deploy ARGS="--replace-latest --docker-push"'
}
}
}
}
}
}
stage('ubuntu deploy dev')
{
when { branch "dev"; }
steps
{
sh 'git checkout .'
sh 'make deploy ARGS="--replace-latest"'
}
}
stage('ubuntu deploy master')
{
when { anyOf { branch "master"; buildingTag() } }
steps
{
sh 'git checkout .'
sh 'make deploy ARGS="--replace-latest --docker-push"'
}
}
stage('ubuntu Doxygen')
{
when { anyOf { branch "master"; branch "dev"; buildingTag() } }
steps
{
sh 'rm -rf ~/carla-simulator.github.io/Doxygen'
sh '''
cd ~/carla-simulator.github.io
git remote set-url origin git@docs:carla-simulator/carla-simulator.github.io.git
git fetch
git checkout -B master origin/master
'''
sh 'make docs'
sh 'cp -rf ./Doxygen ~/carla-simulator.github.io/'
sh '''
cd ~/carla-simulator.github.io
git add Doxygen
git commit -m "Updated c++ docs" || true
git push
'''
}
post
{
always
stage('Publish documentation')
{
deleteDir()
stages
{
stage('ubuntu Doxygen upload')
{
when { anyOf { branch "master"; branch "dev"; buildingTag() } }
steps
{
dir('doc_repo')
{
unstash name: 'carla_docs'
withCredentials([gitUsernamePassword(credentialsId: 'github_token_as_pwd_2', gitToolName: 'git-tool')]) {
sh '''
tar -xvzf carla_doc.tar.gz
git add Doxygen
git commit -m "Updated c++ docs" || true
git push --set-upstream origin ruben/jenkins_migration
'''
}
}
}
}
stage('TEST: ubuntu Doxygen upload')
{
when { branch "ruben/jenkins_migration"; }
steps
{
dir('doc_repo')
{
unstash name: 'carla_docs'
withCredentials([gitUsernamePassword(credentialsId: 'github_token_as_pwd_2', gitToolName: 'git-tool')]) {
sh '''
tar -xvzf carla_doc.tar.gz
git add Doxygen
git commit -m "Updated c++ docs" || true
git push --set-upstream origin ruben/jenkins_migration
'''
}
}
}
}
}
}
}
}
@ -226,23 +353,14 @@ pipeline
always
{
deleteDir()
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
jenkinsLib.DeleteUbuntuBuildNode(JOB_ID)
}
}
}
}
}
/*
stage('windows')
{
agent { label "windows && build && ${JOB_ID}" }
agent { label "windows" }
environment
{
UE4_ROOT = 'C:\\UE_4.26'
@ -254,11 +372,11 @@ pipeline
steps
{
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
git update-index --skip-worktree Unreal/CarlaUE4/CarlaUE4.uproject
"""
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
make setup ARGS="--chrono"
"""
}
@ -268,19 +386,19 @@ pipeline
steps
{
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
make LibCarla
"""
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
make PythonAPI
"""
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
make CarlaUE4Editor ARGS="--chrono"
"""
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
make plugins
"""
}
@ -298,7 +416,7 @@ pipeline
steps
{
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
call Update.bat
"""
}
@ -308,11 +426,11 @@ pipeline
steps
{
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
make package ARGS="--chrono"
"""
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
make package ARGS="--packages=AdditionalMaps,Town06_Opt,Town07_Opt,Town11,Town12,Town13,Town15 --target-archive=AdditionalMaps --clean-intermediate"
"""
}
@ -322,38 +440,30 @@ pipeline
}
}
}
stage('windows deploy')
{
when { anyOf { branch "master"; branch "dev"; buildingTag() } }
steps {
bat """
call ../setEnv64.bat
call C:\\Users\\jenkins\\setEnv64.bat
git checkout .
make deploy ARGS="--replace-latest"
REM make deploy ARGS="--replace-latest"
"""
}
}
}
post
{
always
{
deleteDir()
node('master')
{
script
{
JOB_ID = "${env.BUILD_TAG}"
jenkinsLib = load("/home/jenkins/jenkins_426.groovy")
jenkinsLib.DeleteWindowsBuildNode(JOB_ID)
}
}
}
}
}
}
}
}*/
//}
//}
}
}

View File

@ -21,6 +21,18 @@ if (BUILD_RSS_VARIANT)
install(FILES ${spdlog_file} DESTINATION lib)
list(APPEND ADRSS_LIBS ${spdlog_file})
set(proj_include_dir ${ADRSS_INSTALL_DIR}/../../proj-install/include)
set(proj_lib ${ADRSS_INSTALL_DIR}/../../proj-install/lib/libproj.a)
install(DIRECTORY ${proj_include_dir} DESTINATION include/system)
list(APPEND ADRSS_INCLUDE_DIRS ${proj_include_dir})
install(FILES ${proj_lib} DESTINATION lib)
list(APPEND ADRSS_LIBS ${proj_lib})
# as long as the libosm2odr uses the same odrSprial interface it is enough to copy the built static library
set(odr_lib ${ADRSS_INSTALL_DIR}/../src/ad-rss-lib/dependencies/map/dependencies/odrSpiral/lib/libodrSpiral.a)
install(FILES ${odr_lib} DESTINATION lib)
list(APPEND ADRSS_LIBS ${odr_lib})
foreach(ad_lib ad_physics ad_rss ad_map_access ad_map_opendrive_reader ad_rss_map_integration)
set(${ad_lib}_file ${ADRSS_INSTALL_DIR}/${ad_lib}/lib/lib${ad_lib}.a)
install(FILES ${${ad_lib}_file} DESTINATION lib)

View File

@ -32,6 +32,42 @@ namespace client {
return GetEpisode().Lock()->GetActorAcceleration(*this);
}
geom::Transform Actor::GetComponentWorldTransform(const std::string componentName) const {
return GetEpisode().Lock()->GetActorComponentWorldTransform(*this, componentName);
}
geom::Transform Actor::GetComponentRelativeTransform(const std::string componentName) const {
return GetEpisode().Lock()->GetActorComponentRelativeTransform(*this, componentName);
}
std::vector<geom::Transform> Actor::GetBoneWorldTransforms() const {
return GetEpisode().Lock()->GetActorBoneWorldTransforms(*this);
}
std::vector<geom::Transform> Actor::GetBoneRelativeTransforms() const {
return GetEpisode().Lock()->GetActorBoneRelativeTransforms(*this);
}
std::vector<std::string> Actor::GetComponentNames() const {
return GetEpisode().Lock()->GetActorComponentNames(*this);
}
std::vector<std::string> Actor::GetBoneNames() const {
return GetEpisode().Lock()->GetActorBoneNames(*this);
}
std::vector<geom::Transform> Actor::GetSocketWorldTransforms() const {
return GetEpisode().Lock()->GetActorSocketWorldTransforms(*this);
}
std::vector<geom::Transform> Actor::GetSocketRelativeTransforms() const {
return GetEpisode().Lock()->GetActorSocketRelativeTransforms(*this);
}
std::vector<std::string> Actor::GetSocketNames() const {
return GetEpisode().Lock()->GetActorSocketNames(*this);
}
void Actor::SetLocation(const geom::Location &location) {
GetEpisode().Lock()->SetActorLocation(*this, location);
}

View File

@ -60,6 +60,24 @@ namespace client {
/// acceleration calculated after the actor's velocity.
geom::Vector3D GetAcceleration() const;
geom::Transform GetComponentWorldTransform(const std::string componentName) const;
geom::Transform GetComponentRelativeTransform(const std::string componentName) const;
std::vector<geom::Transform> GetBoneWorldTransforms() const;
std::vector<geom::Transform> GetBoneRelativeTransforms() const;
std::vector<std::string> GetComponentNames() const;
std::vector<std::string> GetBoneNames() const;
std::vector<geom::Transform> GetSocketWorldTransforms() const;
std::vector<geom::Transform> GetSocketRelativeTransforms() const;
std::vector<std::string> GetSocketNames() const;
/// Teleport the actor to @a location.
void SetLocation(const geom::Location &location);

View File

@ -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,

View File

@ -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,

View File

@ -12,6 +12,7 @@
#include <iostream>
#include <string>
#include <sys/stat.h>
#include <cstdint>
namespace carla {
namespace client {

View File

@ -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;
}

View File

@ -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;

View File

@ -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<Actor> 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;
}

View File

@ -29,6 +29,7 @@
#include "carla/rpc/Texture.h"
#include "carla/rpc/MaterialParameter.h"
#include <string>
#include <boost/optional.hpp>
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;

View File

@ -267,6 +267,14 @@ namespace detail {
_pimpl->AsyncCall("set_weather_parameters", weather);
}
float Client::GetIMUISensorGravity() const {
return _pimpl->CallAndWait<float>("get_imui_gravity");
}
void Client::SetIMUISensorGravity(float NewIMUISensorGravity) {
_pimpl->AsyncCall("set_imui_gravity", NewIMUISensorGravity);
}
std::vector<rpc::Actor> Client::GetActorsById(
const std::vector<ActorId> &ids) {
using return_t = std::vector<rpc::Actor>;
@ -326,11 +334,12 @@ namespace detail {
return _pimpl->CallAndWait<rpc::Actor>("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) {
@ -408,6 +418,49 @@ namespace detail {
_pimpl->AsyncCall("add_actor_torque", actor, vector);
}
geom::Transform Client::GetActorComponentWorldTransform(rpc::ActorId actor, const std::string componentName) {
return _pimpl->CallAndWait<geom::Transform>("get_actor_component_world_transform", actor, componentName);
}
geom::Transform Client::GetActorComponentRelativeTransform(rpc::ActorId actor, const std::string componentName) {
return _pimpl->CallAndWait<geom::Transform>("get_actor_component_relative_transform", actor, componentName);
}
std::vector<geom::Transform> Client::GetActorBoneWorldTransforms(rpc::ActorId actor) {
using return_t = std::vector<geom::Transform>;
return _pimpl->CallAndWait<return_t>("get_actor_bone_world_transforms", actor);
}
std::vector<geom::Transform> Client::GetActorBoneRelativeTransforms(rpc::ActorId actor) {
using return_t = std::vector<geom::Transform>;
return _pimpl->CallAndWait<return_t>("get_actor_bone_relative_transforms", actor);
}
std::vector<std::string> Client::GetActorComponentNames(rpc::ActorId actor) {
using return_t = std::vector<std::string>;
return _pimpl->CallAndWait<return_t>("get_actor_component_names", actor);
}
std::vector<std::string> Client::GetActorBoneNames(rpc::ActorId actor) {
using return_t = std::vector<std::string>;
return _pimpl->CallAndWait<return_t>("get_actor_bone_names", actor);
}
std::vector<geom::Transform> Client::GetActorSocketWorldTransforms(rpc::ActorId actor) {
using return_t = std::vector<geom::Transform>;
return _pimpl->CallAndWait<return_t>("get_actor_socket_world_transforms", actor);
}
std::vector<geom::Transform> Client::GetActorSocketRelativeTransforms(rpc::ActorId actor) {
using return_t = std::vector<geom::Transform>;
return _pimpl->CallAndWait<return_t>("get_actor_socket_relative_transforms", actor);
}
std::vector<std::string> Client::GetActorSocketNames(rpc::ActorId actor) {
using return_t = std::vector<std::string>;
return _pimpl->CallAndWait<return_t>("get_actor_socket_names", actor);
}
void Client::SetActorSimulatePhysics(rpc::ActorId actor, const bool enabled) {
_pimpl->CallAndWait<void>("set_actor_simulate_physics", actor, enabled);
}
@ -475,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);
}

View File

@ -149,6 +149,10 @@ namespace detail {
void SetWeatherParameters(const rpc::WeatherParameters &weather);
float GetIMUISensorGravity() const;
void SetIMUISensorGravity( float NewIMUISensorGravity );
std::vector<rpc::Actor> GetActorsById(const std::vector<ActorId> &ids);
rpc::VehiclePhysicsControl GetVehiclePhysicsControl(rpc::ActorId vehicle) const;
@ -179,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);
@ -232,6 +237,35 @@ namespace detail {
rpc::ActorId actor,
const geom::Vector3D &vector);
geom::Transform GetActorComponentWorldTransform(
rpc::ActorId actor,
const std::string componentName);
geom::Transform GetActorComponentRelativeTransform(
rpc::ActorId actor,
const std::string componentName);
std::vector<geom::Transform> GetActorBoneWorldTransforms(
rpc::ActorId actor);
std::vector<geom::Transform> GetActorBoneRelativeTransforms(
rpc::ActorId actor);
std::vector<std::string> GetActorComponentNames(
rpc::ActorId actor);
std::vector<std::string> GetActorBoneNames(
rpc::ActorId actor);
std::vector<geom::Transform> GetActorSocketWorldTransforms(
rpc::ActorId actor);
std::vector<geom::Transform> GetActorSocketRelativeTransforms(
rpc::ActorId actor);
std::vector<std::string> GetActorSocketNames(
rpc::ActorId actor);
void SetActorSimulatePhysics(
rpc::ActorId actor,
bool enabled);
@ -297,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);

View File

@ -342,19 +342,21 @@ EpisodeProxy Simulator::GetCurrentEpisode() {
// -- General operations with actors -----------------------------------------
// ===========================================================================
SharedPtr<Actor> Simulator::SpawnActor(
SharedPtr<Actor> 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(),

View File

@ -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);
@ -438,6 +447,42 @@ namespace detail {
return GetActorSnapshot(actor).acceleration;
}
geom::Transform GetActorComponentWorldTransform(const Actor &actor, const std::string componentName) {
return _client.GetActorComponentWorldTransform(actor.GetId(), componentName);
}
geom::Transform GetActorComponentRelativeTransform(const Actor &actor, std::string componentName) {
return _client.GetActorComponentRelativeTransform(actor.GetId(), componentName);
}
std::vector<geom::Transform> GetActorBoneWorldTransforms(const Actor &actor) {
return _client.GetActorBoneWorldTransforms(actor.GetId());
}
std::vector<geom::Transform> GetActorBoneRelativeTransforms(const Actor &actor) {
return _client.GetActorBoneRelativeTransforms(actor.GetId());
}
std::vector<std::string> GetActorComponentNames(const Actor &actor) {
return _client.GetActorComponentNames(actor.GetId());
}
std::vector<std::string> GetActorBoneNames(const Actor &actor) {
return _client.GetActorBoneNames(actor.GetId());
}
std::vector<geom::Transform> GetActorSocketWorldTransforms(const Actor &actor) {
return _client.GetActorSocketWorldTransforms(actor.GetId());
}
std::vector<geom::Transform> GetActorSocketRelativeTransforms(const Actor &actor) {
return _client.GetActorSocketRelativeTransforms(actor.GetId());
}
std::vector<std::string> GetActorSocketNames(const Actor &actor) {
return _client.GetActorSocketNames(actor.GetId());
}
void SetActorLocation(Actor &actor, const geom::Location &location) {
_client.SetActorLocation(actor.GetId(), location);
}
@ -572,6 +617,10 @@ namespace detail {
BaseJSONPath);
}
void RestorePhysXPhysics(Vehicle &vehicle) {
_client.RestorePhysXPhysics(vehicle.GetId());
}
/// @}
// =========================================================================
/// @name Operations with the recorder

View File

@ -1232,12 +1232,17 @@ namespace road {
while(s_current < s_end){
if(lane->GetWidth(s_current) != 0.0f){
const auto edges = lane->GetCornerPositions(s_current, 0);
if (edges.first == edges.second) continue;
geom::Vector3D director = edges.second - edges.first;
geom::Vector3D treeposition = edges.first - director.MakeUnitVector() * distancefromdrivinglineborder;
geom::Transform lanetransform = lane->ComputeTransform(s_current);
geom::Transform treeTransform(treeposition, lanetransform.rotation);
const carla::road::element::RoadInfoSpeed* roadinfo = lane->GetInfo<carla::road::element::RoadInfoSpeed>(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;
}

View File

@ -761,14 +761,11 @@ std::map<road::Lane::LaneType , std::vector<std::unique_ptr<Mesh>>> MeshFactory:
case carla::road::element::LaneMarking::Type::Solid: {
size_t currentIndex = out_mesh.GetVertices().size() + 1;
std::pair<geom::Vector3D, geom::Vector3D> edges = lane.GetCornerPositions(s_current, 0);
geom::Vector3D director = edges.second - edges.first;
director /= director.Length();
geom::Vector3D endmarking = edges.first + director * lane_mark_info.width;
std::pair<geom::Vector3D, geom::Vector3D> edges =
ComputeEdgesForLanemark(lane_section, lane, s_current, lane_mark_info.width);
out_mesh.AddVertex(edges.first);
out_mesh.AddVertex(endmarking);
out_mesh.AddVertex(edges.second);
out_mesh.AddIndex(currentIndex);
out_mesh.AddIndex(currentIndex + 1);
@ -784,30 +781,23 @@ std::map<road::Lane::LaneType , std::vector<std::unique_ptr<Mesh>>> MeshFactory:
case carla::road::element::LaneMarking::Type::Broken: {
size_t currentIndex = out_mesh.GetVertices().size() + 1;
std::pair<geom::Vector3D, geom::Vector3D> edges =
lane.GetCornerPositions(s_current, road_param.extra_lane_width);
geom::Vector3D director = edges.second - edges.first;
director /= director.Length();
geom::Vector3D endmarking = edges.first + director * lane_mark_info.width;
std::pair<geom::Vector3D, geom::Vector3D> edges =
ComputeEdgesForLanemark(lane_section, lane, s_current, lane_mark_info.width);
out_mesh.AddVertex(edges.first);
out_mesh.AddVertex(endmarking);
out_mesh.AddVertex(edges.second);
s_current += road_param.resolution * 3;
if (s_current > s_end)
{
s_current = s_end;
}
edges = lane.GetCornerPositions(s_current, road_param.extra_lane_width);
director = edges.second - edges.first;
director /= director.Length();
endmarking = edges.first + director * lane_mark_info.width;
edges = ComputeEdgesForLanemark(lane_section, lane, s_current, lane_mark_info.width);
out_mesh.AddVertex(edges.first);
out_mesh.AddVertex(endmarking);
out_mesh.AddVertex(edges.second);
out_mesh.AddIndex(currentIndex);
out_mesh.AddIndex(currentIndex + 1);
out_mesh.AddIndex(currentIndex + 2);
@ -864,13 +854,12 @@ std::map<road::Lane::LaneType , std::vector<std::unique_ptr<Mesh>>> MeshFactory:
const carla::road::element::RoadInfoMarkRecord* road_info_mark = lane.GetInfo<carla::road::element::RoadInfoMarkRecord>(s_current);
if (road_info_mark != nullptr) {
carla::road::element::LaneMarking lane_mark_info(*road_info_mark);
std::pair<geom::Vector3D, geom::Vector3D> edges = lane.GetCornerPositions(s_end, 0);
geom::Vector3D director = edges.second - edges.first;
director /= director.Length();
geom::Vector3D endmarking = edges.first + director * lane_mark_info.width;
std::pair<geom::Vector3D, geom::Vector3D> edges =
ComputeEdgesForLanemark(lane_section, lane, s_end, lane_mark_info.width);
out_mesh.AddVertex(edges.first);
out_mesh.AddVertex(endmarking);
out_mesh.AddVertex(edges.second);
}
inout.push_back(std::make_unique<Mesh>(out_mesh));
}
@ -927,29 +916,21 @@ std::map<road::Lane::LaneType , std::vector<std::unique_ptr<Mesh>>> MeshFactory:
case carla::road::element::LaneMarking::Type::Broken: {
size_t currentIndex = out_mesh.GetVertices().size() + 1;
std::pair<geom::Vector3D, geom::Vector3D> edges =
lane.GetCornerPositions(s_current, road_param.extra_lane_width);
geom::Vector3D director = edges.second - edges.first;
director /= director.Length();
geom::Vector3D endmarking = edges.first + director * lane_mark_info.width;
std::pair<geom::Vector3D, geom::Vector3D> edges =
ComputeEdgesForLanemark(lane_section, lane, s_current, lane_mark_info.width);
out_mesh.AddVertex(edges.first);
out_mesh.AddVertex(endmarking);
out_mesh.AddVertex(edges.second);
s_current += road_param.resolution * 3;
if (s_current > s_end) {
s_current = s_end;
}
edges = lane.GetCornerPositions(s_current, road_param.extra_lane_width);
director = edges.second - edges.first;
director /= director.Length();
endmarking = edges.first + director * lane_mark_info.width;
edges = ComputeEdgesForLanemark(lane_section, lane, s_current, lane_mark_info.width);
out_mesh.AddVertex(edges.first);
out_mesh.AddVertex(endmarking);
out_mesh.AddVertex(edges.second);
out_mesh.AddIndex(currentIndex);
out_mesh.AddIndex(currentIndex + 1);
@ -1150,6 +1131,33 @@ std::map<road::Lane::LaneType , std::vector<std::unique_ptr<Mesh>>> MeshFactory:
return std::make_unique<Mesh>(out_mesh);
}
std::pair<geom::Vector3D, geom::Vector3D> MeshFactory::ComputeEdgesForLanemark(
const road::LaneSection& lane_section,
const road::Lane& lane,
const double s_current,
const double lanemark_width) const {
std::pair<geom::Vector3D, geom::Vector3D> edges =
lane.GetCornerPositions(s_current, road_param.extra_lane_width);
geom::Vector3D director;
if (edges.first != edges.second) {
director = edges.second - edges.first;
director /= director.Length();
} else {
const std::map<road::LaneId, road::Lane> & lanes = lane_section.GetLanes();
for (const auto& lane_pair : lanes) {
std::pair<geom::Vector3D, geom::Vector3D> another_edge =
lane_pair.second.GetCornerPositions(s_current, road_param.extra_lane_width);
if (another_edge.first != another_edge.second) {
director = another_edge.second - another_edge.first;
director /= director.Length();
break;
}
}
}
geom::Vector3D endmarking = edges.first + director * lanemark_width;
return std::make_pair(edges.first, endmarking);
}
} // namespace geom
} // namespace carla

View File

@ -148,6 +148,15 @@ namespace geom {
RoadParameters road_param;
private:
// Calculate the points on both sides of the lane mark for the specified s_current
std::pair<geom::Vector3D, geom::Vector3D> ComputeEdgesForLanemark(
const road::LaneSection& lane_section,
const road::Lane& lane,
const double s_current,
const double lanemark_width) const;
};
} // namespace geom

View File

@ -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 <string>
#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<ActorId> parent;
AttachmentType attachment_type;
std::string socket_name;
std::vector<Command> 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<DestroyActor> {

View File

@ -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<Point, Line, Arrow, Box, String> primitive;
boost::variant2::variant<Point, Line, Arrow, Box, String, HUDPoint, HUDLine, HUDArrow, HUDBox> primitive;
Color color = {255u, 0u, 0u};

View File

@ -309,17 +309,17 @@ void RssSensor::TickRssSensor(const client::Timestamp &timestamp, CallbackFuncti
auto const settings = GetWorld().GetSettings();
if ( settings.synchronous_mode ) {
_rss_check->GetLogger()->trace("RssSensor[{}] sync-tick", timestamp.frame);
_rss_check->GetLogger()->info("RssSensor[{}] sync-tick", timestamp.frame);
TickRssSensorThreadLocked(timestamp, actors, callback);
}
else {
// store the future to prevent the destructor of the future from blocked waiting
_rss_check->GetLogger()->trace("RssSensor[{}] async-tick", timestamp.frame);
_rss_check->GetLogger()->info("RssSensor[{}] async-tick", timestamp.frame);
_tick_future = std::async(&RssSensor::TickRssSensorThreadLocked, this, timestamp, actors, callback);
}
} else {
if (bool(_rss_check)){
_rss_check->GetLogger()->debug("RssSensor[{}] tick dropped", timestamp.frame);
_rss_check->GetLogger()->info("RssSensor[{}] tick dropped", timestamp.frame);
}
}
}

Some files were not shown because too many files have changed in this diff Show More