Merge branch 'dev' into lidar-branch

This commit is contained in:
Blyron 2023-12-11 18:13:45 +01:00 committed by GitHub
commit bd719cde3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 528 additions and 108 deletions

View File

@ -1,3 +1,7 @@
## Latest Changes
* Prevent from segfault on failing SignalReference identification when loading OpenDrive files
* Added vehicle doors to the recorder
## CARLA 0.9.15 ## CARLA 0.9.15
* Added Digital Twins feature version 0.1. Now you can create your own map based on OpenStreetMaps * Added Digital Twins feature version 0.1. Now you can create your own map based on OpenStreetMaps

View File

@ -1,52 +1,49 @@
# Carla Multi-GPU feature # 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 ## 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` For example
* `-carla-primary-port`
Run the following from the command line: **./CarlaUE4.sh --nullrhi**
```sh The primary server will use by default the port 2002 to listen for secondary servers. If you need to listen on another port, then you can change it with the flag
./CarlaUE4.sh -nullrhi
```
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: **./CarlaUE4.sh --nullrhi -carla-primary-port=3002**
```sh
./CarlaUE4.sh -nullrhi -carla-primary-port=3002
```
## Secondary servers ## 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` 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:
* `-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 command: **./CarlaUE4.sh -carla-rpc-port=3000 -carla-primary-host=127.0.0.1 -ini:[/Script/Engine.RendererSettings]:r.GraphicsAdapter=0**
```sh
./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. 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.

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 |

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 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

BIN
Docs/img/synkrotron.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -5,7 +5,7 @@
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. 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 !!! note
Town 13 has been designed as an adjunct to Town 13, 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. 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 ## Navigator

View File

@ -21,6 +21,18 @@ if (BUILD_RSS_VARIANT)
install(FILES ${spdlog_file} DESTINATION lib) install(FILES ${spdlog_file} DESTINATION lib)
list(APPEND ADRSS_LIBS ${spdlog_file}) 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) 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) set(${ad_lib}_file ${ADRSS_INSTALL_DIR}/${ad_lib}/lib/lib${ad_lib}.a)
install(FILES ${${ad_lib}_file} DESTINATION lib) install(FILES ${${ad_lib}_file} DESTINATION lib)

View File

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

View File

@ -55,7 +55,7 @@ def get_libcarla_extensions():
os.path.join(pwd, 'dependencies/lib/libxerces-c.a')] os.path.join(pwd, 'dependencies/lib/libxerces-c.a')]
extra_link_args += ['-lz'] extra_link_args += ['-lz']
extra_compile_args = [ extra_compile_args = [
'-isystem', 'dependencies/include/system', '-fPIC', '-std=c++14', '-isystem', os.path.join(pwd, 'dependencies/include/system'), '-fPIC', '-std=c++14',
'-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wno-self-assign-overloaded', '-Werror', '-Wall', '-Wextra', '-Wpedantic', '-Wno-self-assign-overloaded',
'-Wdeprecated', '-Wno-shadow', '-Wuninitialized', '-Wunreachable-code', '-Wdeprecated', '-Wno-shadow', '-Wuninitialized', '-Wunreachable-code',
'-Wpessimizing-move', '-Wold-style-cast', '-Wnull-dereference', '-Wpessimizing-move', '-Wold-style-cast', '-Wnull-dereference',
@ -77,6 +77,7 @@ def get_libcarla_extensions():
extra_link_args += [os.path.join(pwd, 'dependencies/lib/libad_physics.a')] extra_link_args += [os.path.join(pwd, 'dependencies/lib/libad_physics.a')]
extra_link_args += [os.path.join(pwd, 'dependencies/lib/libad_map_opendrive_reader.a')] extra_link_args += [os.path.join(pwd, 'dependencies/lib/libad_map_opendrive_reader.a')]
extra_link_args += [os.path.join(pwd, 'dependencies/lib/libboost_program_options.a')] extra_link_args += [os.path.join(pwd, 'dependencies/lib/libboost_program_options.a')]
extra_link_args += [os.path.join(pwd, 'dependencies/lib/libodrSpiral.a')]
extra_link_args += [os.path.join(pwd, 'dependencies/lib/libspdlog.a')] extra_link_args += [os.path.join(pwd, 'dependencies/lib/libspdlog.a')]
extra_link_args += ['-lrt'] extra_link_args += ['-lrt']
extra_link_args += ['-ltbb'] extra_link_args += ['-ltbb']

View File

@ -135,6 +135,7 @@ class World(object):
def __init__(self, carla_world, args): def __init__(self, carla_world, args):
self.world = carla_world self.world = carla_world
self.sync = args.sync
self.actor_role_name = args.rolename self.actor_role_name = args.rolename
self.dim = (args.width, args.height) self.dim = (args.width, args.height)
try: try:
@ -161,10 +162,7 @@ class World(object):
sys.exit(1) sys.exit(1)
self.restart() self.restart()
self.world_tick_id = self.world.on_tick(self.on_world_tick) self.world_tick_id = self.world.on_tick(self.hud.on_world_tick)
def on_world_tick(self, world_snapshot):
self.hud.on_world_tick(world_snapshot)
def toggle_pause(self): def toggle_pause(self):
settings = self.world.get_settings() settings = self.world.get_settings()
@ -235,6 +233,11 @@ class World(object):
self.rss_sensor = RssSensor(self.player, self.world, self.rss_sensor = RssSensor(self.player, self.world,
self.rss_unstructured_scene_visualizer, self.rss_bounding_box_visualizer, self.hud.rss_state_visualizer) self.rss_unstructured_scene_visualizer, self.rss_bounding_box_visualizer, self.hud.rss_state_visualizer)
if self.sync:
self.world.tick()
else:
self.world.wait_for_tick()
def tick(self, clock): def tick(self, clock):
self.hud.tick(self.player, clock) self.hud.tick(self.player, clock)
@ -384,7 +387,7 @@ class VehicleControl(object):
print('\nReceived signal {}. Trigger stopping...'.format(signum)) print('\nReceived signal {}. Trigger stopping...'.format(signum))
VehicleControl.signal_received = True VehicleControl.signal_received = True
def parse_events(self, world, clock): def parse_events(self, world, clock, sync_mode):
if VehicleControl.signal_received: if VehicleControl.signal_received:
print('\nAccepted signal. Stopping loop...') print('\nAccepted signal. Stopping loop...')
return True return True
@ -806,13 +809,27 @@ def game_loop(args):
(args.width, args.height), (args.width, args.height),
pygame.HWSURFACE | pygame.DOUBLEBUF) pygame.HWSURFACE | pygame.DOUBLEBUF)
world = World(client.get_world(), args) sim_world = client.get_world()
original_settings = sim_world.get_settings()
settings = sim_world.get_settings()
if args.sync != settings.synchronous_mode:
args.sync = True
settings.synchronous_mode = True
settings.fixed_delta_seconds = 0.05
sim_world.apply_settings(settings)
traffic_manager = client.get_trafficmanager()
traffic_manager.set_synchronous_mode(True)
world = World(sim_world, args)
controller = VehicleControl(world, args.autopilot) controller = VehicleControl(world, args.autopilot)
clock = pygame.time.Clock() clock = pygame.time.Clock()
while True: while True:
if args.sync:
sim_world.tick()
clock.tick_busy_loop(60) clock.tick_busy_loop(60)
if controller.parse_events(world, clock): if controller.parse_events(world, clock, args.sync):
return return
world.tick(clock) world.tick(clock)
world.render(display) world.render(display)
@ -875,6 +892,10 @@ def main():
'--externalActor', '--externalActor',
action='store_true', action='store_true',
help='attaches to externally created actor by role name') help='attaches to externally created actor by role name')
argparser.add_argument(
'--sync',
action='store_true',
help='Activate synchronous mode execution')
args = argparser.parse_args() args = argparser.parse_args()
args.width, args.height = [int(x) for x in args.res.split('x')] args.width, args.height = [int(x) for x in args.res.split('x')]

View File

@ -334,6 +334,9 @@ class RssSensor(object):
self.map_log_level = self.map_log_level-1 self.map_log_level = self.map_log_level-1
self.sensor.set_map_log_level(self.map_log_level) self.sensor.set_map_log_level(self.map_log_level)
def drop_route(self):
self.sensor.drop_route()
@staticmethod @staticmethod
def get_default_parameters(): def get_default_parameters():
ego_dynamics = ad.rss.world.RssDynamics() ego_dynamics = ad.rss.world.RssDynamics()

View File

@ -1,7 +1,6 @@
CARLA Simulator CARLA Simulator
=============== ===============
[![Build Status](https://travis-ci.org/carla-simulator/carla.svg?branch=master)](https://travis-ci.org/carla-simulator/carla)
[![Documentation](https://readthedocs.org/projects/carla/badge/?version=latest)](http://carla.readthedocs.io) [![Documentation](https://readthedocs.org/projects/carla/badge/?version=latest)](http://carla.readthedocs.io)
[![carla.org](Docs/img/btn/web.png)](http://carla.org) [![carla.org](Docs/img/btn/web.png)](http://carla.org)
@ -15,11 +14,9 @@ validation of autonomous driving systems. In addition to open-source code and pr
vehicles) that were created for this purpose and can be used freely. The simulation platform supports flexible specification of sensor suites and vehicles) that were created for this purpose and can be used freely. The simulation platform supports flexible specification of sensor suites and
environmental conditions. environmental conditions.
[![CARLA Video](Docs/img/video_thumbnail_0910.jpg)](https://www.youtube.com/watch?v=7jej46ALVRE) [![CARLA Video](Docs/img/0_9_15_thumbnail.webp)](https://www.youtube.com/watch?v=q4V9GYjA1pE )
If you want to benchmark your model in the same conditions as in our CoRL17 ### Download CARLA
paper, check out
[Benchmarking](https://github.com/carla-simulator/driving-benchmarks).
Linux: Linux:
* [**Get CARLA overnight build**](http://carla-releases.s3.amazonaws.com/Linux/Dev/CARLA_Latest.tar.gz) * [**Get CARLA overnight build**](http://carla-releases.s3.amazonaws.com/Linux/Dev/CARLA_Latest.tar.gz)
@ -32,12 +29,23 @@ Windows:
### Recommended system ### Recommended system
* Intel i7 gen 9th - 11th / Intel i9 gen 9th - 11th / AMD ryzen 7 / AMD ryzen 9 * Intel i7 gen 9th - 11th / Intel i9 gen 9th - 11th / AMD ryzen 7 / AMD ryzen 9
* +16 GB RAM memory * +32 GB RAM memory
* NVIDIA RTX 2070 / NVIDIA RTX 2080 / NVIDIA RTX 3070, NVIDIA RTX 3080 * NVIDIA RTX 3070 / NVIDIA RTX 3080 / NVIDIA RTX 4090
* Ubuntu 18.04 * Ubuntu 20.04
## Documentation
The [CARLA documentation](https://carla.readthedocs.io/en/latest/) is hosted on ReadTheDocs. Please see the following key links:
- [Building on Linux](https://carla.readthedocs.io/en/latest/build_linux/)
- [Building on Windows](https://carla.readthedocs.io/en/latest/build_windows/)
- [First steps](https://carla.readthedocs.io/en/latest/tuto_first_steps/)
- [CARLA asset catalogue](https://carla.readthedocs.io/en/latest/catalogue/)
- [Python API reference](https://carla.readthedocs.io/en/latest/python_api/)
- [Blueprint library](https://carla.readthedocs.io/en/latest/bp_library/)
## CARLA Ecosystem ## CARLA Ecosystem
Repositories associated to the CARLA simulation platform: Repositories associated with the CARLA simulation platform:
* [**CARLA Autonomous Driving leaderboard**](https://leaderboard.carla.org/): Automatic platform to validate Autonomous Driving stacks * [**CARLA Autonomous Driving leaderboard**](https://leaderboard.carla.org/): Automatic platform to validate Autonomous Driving stacks
* [**Scenario_Runner**](https://github.com/carla-simulator/scenario_runner): Engine to execute traffic scenarios in CARLA 0.9.X * [**Scenario_Runner**](https://github.com/carla-simulator/scenario_runner): Engine to execute traffic scenarios in CARLA 0.9.X
@ -46,8 +54,10 @@ Repositories associated to the CARLA simulation platform:
* [**Conditional Imitation-Learning**](https://github.com/felipecode/coiltraine): Training and testing Conditional Imitation Learning models in CARLA * [**Conditional Imitation-Learning**](https://github.com/felipecode/coiltraine): Training and testing Conditional Imitation Learning models in CARLA
* [**AutoWare AV stack**](https://github.com/carla-simulator/carla-autoware): Bridge to connect AutoWare AV stack to CARLA * [**AutoWare AV stack**](https://github.com/carla-simulator/carla-autoware): Bridge to connect AutoWare AV stack to CARLA
* [**Reinforcement-Learning**](https://github.com/carla-simulator/reinforcement-learning): Code for running Conditional Reinforcement Learning models in CARLA * [**Reinforcement-Learning**](https://github.com/carla-simulator/reinforcement-learning): Code for running Conditional Reinforcement Learning models in CARLA
* [**RoadRunner**](https://www.mathworks.com/products/roadrunner.html): MATLAB GUI based application to create road networks in OpenDrive format
* [**Map Editor**](https://github.com/carla-simulator/carla-map-editor): Standalone GUI application to enhance RoadRunner maps with traffic lights and traffic signs information * [**Map Editor**](https://github.com/carla-simulator/carla-map-editor): Standalone GUI application to enhance RoadRunner maps with traffic lights and traffic signs information
**Like what you see? Star us on GitHub to support the project!** **Like what you see? Star us on GitHub to support the project!**
Paper Paper
@ -74,24 +84,22 @@ Felipe Codevilla, Antonio Lopez, Vladlen Koltun; PMLR 78:1-16
Building CARLA Building CARLA
-------------- --------------
Use `git clone` or download the project from this page. Note that the master branch contains the most recent release of CARLA with the latest fixes and features. Clone this repository locally from GitHub:
Then follow the instruction at [How to build on Linux][buildlinuxlink] or [How to build on Windows][buildwindowslink].
The Linux build needs for an UE patch to solve some visualization issues regarding Vulkan. Those already working with a Linux build should install the patch and make the UE build again using the following commands.
```sh ```sh
# Download and install the UE patch git clone https://github.com/carla-simulator/carla.git .
cd ~/UnrealEngine_4.24
wget https://carla-releases.s3.eu-west-3.amazonaws.com/Linux/UE_Patch/430667-13636743-patch.txt ~/430667-13636743-patch.txt
patch --strip=4 < ~/430667-13636743-patch.txt
# Build UE
./Setup.sh && ./GenerateProjectFiles.sh && make
``` ```
Unfortunately we don't have official instructions to build on Mac yet, please check the progress at [issue #150][issue150]. Also, clone the [CARLA fork of the Unreal Engine](https://github.com/CarlaUnreal/UnrealEngine) into an appropriate location:
```sh
git clone --depth 1 -b carla https://github.com/CarlaUnreal/UnrealEngine.git .
```
Once you have cloned the repositories, follow the instructions for [building in Linux][buildlinuxlink] or [building in Windows][buildwindowslink].
[buildlinuxlink]: https://carla.readthedocs.io/en/latest/build_linux/ [buildlinuxlink]: https://carla.readthedocs.io/en/latest/build_linux/
[buildwindowslink]: https://carla.readthedocs.io/en/latest/build_windows/ [buildwindowslink]: https://carla.readthedocs.io/en/latest/build_windows/
[issue150]: https://github.com/carla-simulator/carla/issues/150
Contributing Contributing
------------ ------------
@ -106,29 +114,6 @@ F.A.Q.
If you run into problems, check our If you run into problems, check our
[FAQ](https://carla.readthedocs.io/en/latest/build_faq/). [FAQ](https://carla.readthedocs.io/en/latest/build_faq/).
CARLA Talks
------
The team creates some additional content for users, besides the docs. This is a great way to cover different subjects such as detailed explanations for a specific module, latest improvements in a feature, future work and much more.
__CARLA Talks 2020 (May):__
* __General__
* Art improvements: environment and rendering — [video](https://youtu.be/ZZaHevsz8W8) | [slides](https://drive.google.com/file/d/1l9Ztaq0Q8fNN5YPU4-5vL13eZUwsQl5P/view?usp=sharing)
* Core implementations: synchrony, snapshots and landmarks — [video](https://youtu.be/nyyTLmphqY4) | [slides](https://drive.google.com/file/d/1yaOwf1419qWZqE1gTSrrknsWOhawEWh_/view?usp=sharing)
* Data ingestion — [video](https://youtu.be/mHiUUZ4xC9o) | [slides](https://drive.google.com/file/d/10uNBAMreKajYimIhwCqSYXjhfVs2bX31/view?usp=sharing)
* Pedestrians and their implementation — [video](https://youtu.be/Uoz2ihDwaWA) | [slides](https://drive.google.com/file/d/1Tsosin7BLP1k558shtbzUdo2ZXVKy5CB/view?usp=sharing)
* Sensors in CARLA — [video](https://youtu.be/T8qCSet8WK0) | [slides](https://drive.google.com/file/d/1UO8ZAIOp-1xaBzcFMfn_IoipycVkUo4q/view?usp=sharing)
* __Modules__
* Improvements in the Traffic Manager — [video](https://youtu.be/n9cufaJ17eA) | [slides](https://drive.google.com/file/d/1R9uNZ6pYHSZoEBxs2vYK7swiriKbbuxo/view?usp=sharing)
* Integration of autoware and ROS — [video](https://youtu.be/ChIgcC2scwU) | [slides](https://drive.google.com/file/d/1uO6nBaFirrllb08OeqGAMVLApQ6EbgAt/view?usp=sharing)
* Introducing ScenarioRunner — [video](https://youtu.be/dcnnNJowqzM) | [slides](https://drive.google.com/file/d/1zgoH_kLOfIw117FJGm2IVZZAIRw9U2Q0/view?usp=sharing)
* OpenSCENARIO support — [slides](https://drive.google.com/file/d/1g6ATxZRTWEdstiZwfBN1_T_x_WwZs0zE/view?usp=sharing)
* __Features__
* Co-Simulations with SUMO and PTV-Vissim — [video](https://youtu.be/PuFSbj1PU94) | [slides](https://drive.google.com/file/d/10DgMNUBqKqWBrdiwBiAIT4DdR9ObCquI/view?usp=sharing)
* Integration of RSS-lib — [slides](https://drive.google.com/file/d/1whREmrCv67fOMipgCk6kkiW4VPODig0A/view?usp=sharing)
* The External Sensor Interface (ESI) — [video](https://youtu.be/5hXHPV9FIeY) | [slides](https://drive.google.com/file/d/1VWFaEoS12siW6NtQDUkm44BVO7tveRbJ/view?usp=sharing)
* The OpenDRIVE Standalone Mode — [video](https://youtu.be/U25GhofVV1Q) | [slides](https://drive.google.com/file/d/1D5VsgfX7dmgPWn7UtDDid3-OdS1HI4pY/view?usp=sharing)
Licenses Licenses
------- -------

View File

@ -304,6 +304,15 @@ void ACarlaRecorder::AddVehicleLight(FCarlaActor *CarlaActor)
AddLightVehicle(LightVehicle); AddLightVehicle(LightVehicle);
} }
void ACarlaRecorder::AddVehicleDoor(const ACarlaWheeledVehicle &Vehicle, const EVehicleDoor SDoors, bool bIsOpen)
{
CarlaRecorderDoorVehicle DoorVehicle;
DoorVehicle.DatabaseId = Episode->GetActorRegistry().FindCarlaActor(&Vehicle)->GetActorId();
DoorVehicle.Doors = static_cast<CarlaRecorderDoorVehicle::VehicleDoorType>(SDoors);
DoorVehicle.bIsOpen = bIsOpen;
AddDoorVehicle(DoorVehicle);
}
void ACarlaRecorder::AddActorKinematics(FCarlaActor *CarlaActor) void ACarlaRecorder::AddActorKinematics(FCarlaActor *CarlaActor)
{ {
check(CarlaActor != nullptr); check(CarlaActor != nullptr);
@ -478,6 +487,7 @@ void ACarlaRecorder::Clear(void)
PhysicsControls.Clear(); PhysicsControls.Clear();
TrafficLightTimes.Clear(); TrafficLightTimes.Clear();
WalkersBones.Clear(); WalkersBones.Clear();
DoorVehicles.Clear();
Wheels.Clear(); Wheels.Clear();
Bikers.Clear(); Bikers.Clear();
} }
@ -496,6 +506,7 @@ void ACarlaRecorder::Write(double DeltaSeconds)
EventsDel.Write(File); EventsDel.Write(File);
EventsParent.Write(File); EventsParent.Write(File);
Collisions.Write(File); Collisions.Write(File);
DoorVehicles.Write(File);
// positions and states // positions and states
Positions.Write(File); Positions.Write(File);
@ -652,6 +663,14 @@ void ACarlaRecorder::AddLightVehicle(const CarlaRecorderLightVehicle &LightVehic
} }
} }
void ACarlaRecorder::AddDoorVehicle(const CarlaRecorderDoorVehicle &DoorVehicle)
{
if (Enabled)
{
DoorVehicles.Add(DoorVehicle);
}
}
void ACarlaRecorder::AddEventLightSceneChanged(const UCarlaLight* Light) void ACarlaRecorder::AddEventLightSceneChanged(const UCarlaLight* Light)
{ {
if (Enabled) if (Enabled)

View File

@ -33,7 +33,9 @@
#include "CarlaRecorderState.h" #include "CarlaRecorderState.h"
#include "CarlaRecorderVisualTime.h" #include "CarlaRecorderVisualTime.h"
#include "CarlaRecorderWalkerBones.h" #include "CarlaRecorderWalkerBones.h"
#include "CarlaRecorderDoorVehicle.h"
#include "CarlaReplayer.h" #include "CarlaReplayer.h"
#include "Carla/Vehicle/CarlaWheeledVehicle.h"
#include "CarlaRecorder.generated.h" #include "CarlaRecorder.generated.h"
@ -67,6 +69,7 @@ enum class CarlaRecorderPacketId : uint8_t
FrameCounter, FrameCounter,
WalkerBones, WalkerBones,
VisualTime, VisualTime,
VehicleDoor,
AnimVehicleWheels, AnimVehicleWheels,
AnimBiker AnimBiker
}; };
@ -137,6 +140,10 @@ public:
void AddActorBones(FCarlaActor *CarlaActor); void AddActorBones(FCarlaActor *CarlaActor);
void AddVehicleDoor(const ACarlaWheeledVehicle& Vehicle, const EVehicleDoor SDoors, bool bIsOpen);
void AddDoorVehicle(const CarlaRecorderDoorVehicle &DoorVehicle);
// set episode // set episode
void SetEpisode(UCarlaEpisode *ThisEpisode) void SetEpisode(UCarlaEpisode *ThisEpisode)
{ {
@ -208,6 +215,7 @@ private:
CarlaRecorderTrafficLightTimes TrafficLightTimes; CarlaRecorderTrafficLightTimes TrafficLightTimes;
CarlaRecorderWalkersBones WalkersBones; CarlaRecorderWalkersBones WalkersBones;
CarlaRecorderVisualTime VisualTime; CarlaRecorderVisualTime VisualTime;
CarlaRecorderDoorVehicles DoorVehicles;
// replayer // replayer
CarlaReplayer Replayer; CarlaReplayer Replayer;

View File

@ -0,0 +1,75 @@
// Copyright (c) 2023 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
#include "CarlaRecorderDoorVehicle.h"
#include "CarlaRecorder.h"
#include "CarlaRecorderHelpers.h"
void CarlaRecorderDoorVehicle::Write(std::ostream &OutFile)
{
// database id
WriteValue<uint32_t>(OutFile, this->DatabaseId);
WriteValue<VehicleDoorType>(OutFile, this->Doors);
WriteValue<bool>(OutFile, this->bIsOpen);
}
void CarlaRecorderDoorVehicle::Read(std::istream &InFile)
{
// database id
ReadValue<uint32_t>(InFile, this->DatabaseId);
ReadValue<VehicleDoorType>(InFile, this->Doors);
ReadValue<bool>(InFile, this->bIsOpen);
}
// ---------------------------------------------
void CarlaRecorderDoorVehicles::Clear(void)
{
Vehicles.clear();
}
void CarlaRecorderDoorVehicles::Add(const CarlaRecorderDoorVehicle &Vehicle)
{
Vehicles.push_back(Vehicle);
}
void CarlaRecorderDoorVehicles::Write(std::ostream &OutFile)
{
// write the packet id
WriteValue<char>(OutFile, static_cast<char>(CarlaRecorderPacketId::VehicleDoor));
// write a dummy packet size
uint32_t Total = 2 + Vehicles.size() * sizeof(CarlaRecorderDoorVehicle);
WriteValue<uint32_t>(OutFile, Total);
// write total records
Total = Vehicles.size();
WriteValue<uint16_t>(OutFile, Total);
for (auto& Vehicle : Vehicles)
{
Vehicle.Write(OutFile);
}
}
void CarlaRecorderDoorVehicles::Read(std::istream &InFile)
{
uint16_t Total;
CarlaRecorderDoorVehicle DoorVehicle;
// read Total walkers
ReadValue<uint16_t>(InFile, Total);
for (uint16_t i = 0; i < Total; ++i)
{
DoorVehicle.Read(InFile);
Add(DoorVehicle);
}
}
const std::vector<CarlaRecorderDoorVehicle>& CarlaRecorderDoorVehicles::GetDoorVehicles()
{
return Vehicles;
}

View File

@ -0,0 +1,45 @@
// Copyright (c) 2023 Computer Vision Center (CVC) at the Universitat Autonoma
// de Barcelona (UAB).
//
// This work is licensed under the terms of the MIT license.
// For a copy, see <https://opensource.org/licenses/MIT>.
#pragma once
#include <sstream>
#include <vector>
#include <type_traits>
#pragma pack(push, 1)
struct CarlaRecorderDoorVehicle
{
// Use same type as carla::vehicle::CarlaWheeledVehicle::EVehicleDoor
using VehicleDoorType = uint8_t;
uint32_t DatabaseId;
VehicleDoorType Doors;
bool bIsOpen;
void Read(std::istream &InFile);
void Write(std::ostream &OutFile);
};
#pragma pack(pop)
struct CarlaRecorderDoorVehicles
{
public:
void Add(const CarlaRecorderDoorVehicle &InObj);
void Clear(void);
void Write(std::ostream &OutFile);
void Read(std::istream &InFile);
const std::vector<CarlaRecorderDoorVehicle>& GetDoorVehicles();
private:
std::vector<CarlaRecorderDoorVehicle> Vehicles;
};

View File

@ -19,6 +19,8 @@
#include <carla/rpc/VehiclePhysicsControl.h> #include <carla/rpc/VehiclePhysicsControl.h>
#include <compiler/enable-ue4-macros.h> #include <compiler/enable-ue4-macros.h>
#include <Carla/Vehicle/CarlaWheeledVehicle.h>
inline bool CarlaRecorderQuery::ReadHeader(void) inline bool CarlaRecorderQuery::ReadHeader(void)
{ {
if (File.eof()) if (File.eof())
@ -271,6 +273,49 @@ std::string CarlaRecorderQuery::QueryInfo(std::string Filename, bool bShowAll)
SkipPacket(); SkipPacket();
break; break;
// vehicle door animations
case static_cast<char>(CarlaRecorderPacketId::VehicleDoor):
if (bShowAll)
{
ReadValue<uint16_t>(File, Total);
if (Total > 0 && !bFramePrinted)
{
PrintFrame(Info);
bFramePrinted = true;
}
Info << " Vehicle door animations: " << Total << std::endl;
for (i = 0; i < Total; ++i)
{
DoorVehicle.Read(File);
CarlaRecorderDoorVehicle::VehicleDoorType doorVehicle;
doorVehicle = DoorVehicle.Doors;
EVehicleDoor eDoorVehicle = static_cast<EVehicleDoor>(doorVehicle);
std::string opened_doors_list;
Info << " Id: " << DoorVehicle.DatabaseId << std::endl;
Info << " Doors opened: ";
if (eDoorVehicle == EVehicleDoor::FL)
Info << " Front Left " << std::endl;
if (eDoorVehicle == EVehicleDoor::FR)
Info << " Front Right " << std::endl;
if (eDoorVehicle == EVehicleDoor::RL)
Info << " Rear Left " << std::endl;
if (eDoorVehicle == EVehicleDoor::RR)
Info << " Rear Right " << std::endl;
if (eDoorVehicle == EVehicleDoor::Hood)
Info << " Hood " << std::endl;
if (eDoorVehicle == EVehicleDoor::Trunk)
Info << " Trunk " << std::endl;
if (eDoorVehicle == EVehicleDoor::All)
Info << " All " << std::endl;
}
}
else
SkipPacket();
break;
// vehicle light animations // vehicle light animations
case static_cast<char>(CarlaRecorderPacketId::VehicleLight): case static_cast<char>(CarlaRecorderPacketId::VehicleLight):
if (bShowAll) if (bShowAll)

View File

@ -26,6 +26,7 @@
#include "CarlaRecorderPosition.h" #include "CarlaRecorderPosition.h"
#include "CarlaRecorderState.h" #include "CarlaRecorderState.h"
#include "CarlaRecorderWalkerBones.h" #include "CarlaRecorderWalkerBones.h"
#include "CarlaRecorderDoorVehicle.h"
class CarlaRecorderQuery class CarlaRecorderQuery
{ {
@ -69,6 +70,7 @@ private:
CarlaRecorderPhysicsControl PhysicsControl; CarlaRecorderPhysicsControl PhysicsControl;
CarlaRecorderTrafficLightTime TrafficLightTime; CarlaRecorderTrafficLightTime TrafficLightTime;
CarlaRecorderWalkerBones WalkerBones; CarlaRecorderWalkerBones WalkerBones;
CarlaRecorderDoorVehicle DoorVehicle;
// read next header packet // read next header packet
bool ReadHeader(void); bool ReadHeader(void);

View File

@ -378,6 +378,14 @@ void CarlaReplayer::ProcessToTime(double Time, bool IsFirstTime)
SkipPacket(); SkipPacket();
break; break;
// vehicle door animation
case static_cast<char>(CarlaRecorderPacketId::VehicleDoor):
if (bFrameFound)
ProcessDoorVehicle();
else
SkipPacket();
break;
// scene lights animation // scene lights animation
case static_cast<char>(CarlaRecorderPacketId::SceneLight): case static_cast<char>(CarlaRecorderPacketId::SceneLight):
if (bFrameFound) if (bFrameFound)
@ -649,6 +657,25 @@ void CarlaReplayer::ProcessLightVehicle(void)
} }
} }
void CarlaReplayer::ProcessDoorVehicle(void)
{
uint16_t Total;
CarlaRecorderDoorVehicle DoorVehicle;
// read Total walkers
ReadValue<uint16_t>(File, Total);
for (uint16_t i = 0; i < Total; ++i)
{
DoorVehicle.Read(File);
DoorVehicle.DatabaseId = MappedId[DoorVehicle.DatabaseId];
// check if ignore this actor
if (!(IgnoreHero && IsHeroMap[DoorVehicle.DatabaseId]))
{
Helper.ProcessReplayerDoorVehicle(DoorVehicle);
}
}
}
void CarlaReplayer::ProcessLightScene(void) void CarlaReplayer::ProcessLightScene(void)
{ {
uint16_t Total; uint16_t Total;

View File

@ -158,6 +158,8 @@ private:
void ProcessLightVehicle(void); void ProcessLightVehicle(void);
void ProcessLightScene(void); void ProcessLightScene(void);
void ProcessDoorVehicle(void);
void ProcessWalkerBones(void); void ProcessWalkerBones(void);
// positions // positions

View File

@ -416,6 +416,24 @@ void CarlaReplayerHelper::ProcessReplayerAnimVehicle(CarlaRecorderAnimVehicle Ve
} }
} }
// set the openings and closings of vehicle doors
void CarlaReplayerHelper::ProcessReplayerDoorVehicle(CarlaRecorderDoorVehicle DoorVehicle)
{
check(Episode != nullptr);
FCarlaActor * CarlaActor = Episode->FindCarlaActor(DoorVehicle.DatabaseId);
if (CarlaActor)
{
ACarlaWheeledVehicle * Vehicle = Cast<ACarlaWheeledVehicle>(CarlaActor->GetActor());
if (Vehicle) {
if(DoorVehicle.bIsOpen){
Vehicle->OpenDoor(static_cast<EVehicleDoor>(DoorVehicle.Doors));
}else{
Vehicle->CloseDoor(static_cast<EVehicleDoor>(DoorVehicle.Doors));
}
}
}
}
// set the lights for vehicles // set the lights for vehicles
void CarlaReplayerHelper::ProcessReplayerLightVehicle(CarlaRecorderLightVehicle LightVehicle) void CarlaReplayerHelper::ProcessReplayerLightVehicle(CarlaRecorderLightVehicle LightVehicle)
{ {

View File

@ -15,6 +15,7 @@
#include "CarlaRecorderAnimVehicleWheels.h" #include "CarlaRecorderAnimVehicleWheels.h"
#include "CarlaRecorderLightVehicle.h" #include "CarlaRecorderLightVehicle.h"
#include "CarlaRecorderLightScene.h" #include "CarlaRecorderLightScene.h"
#include "CarlaRecorderDoorVehicle.h"
#include "CarlaRecorderWalkerBones.h" #include "CarlaRecorderWalkerBones.h"
#include <unordered_map> #include <unordered_map>
@ -65,6 +66,9 @@ public:
// set the animation for walkers // set the animation for walkers
void ProcessReplayerAnimWalker(CarlaRecorderAnimWalker Walker); void ProcessReplayerAnimWalker(CarlaRecorderAnimWalker Walker);
// set the openings and closing of vehicle doors
void ProcessReplayerDoorVehicle(CarlaRecorderDoorVehicle DoorVehicle);
// set the animation for bikers // set the animation for bikers
void ProcessReplayerAnimBiker(CarlaRecorderAnimBiker Biker); void ProcessReplayerAnimBiker(CarlaRecorderAnimBiker Biker);

View File

@ -4,7 +4,7 @@
#include "Carla/Game/CarlaGameInstance.h" #include "Carla/Game/CarlaGameInstance.h"
#include "Carla/Settings/CarlaSettings.h" #include "Carla/Settings/CarlaSettings.h"
#include "Carla/Game/CarlaGameInstance.h"
#include "Async.h" #include "Async.h"
#include "Components/StaticMeshComponent.h" #include "Components/StaticMeshComponent.h"
#include "Engine/DirectionalLight.h" #include "Engine/DirectionalLight.h"

View File

@ -36,11 +36,15 @@ void UYieldSignComponent::InitializeSign(const carla::road::Map &Map)
if(lane == 0) if(lane == 0)
continue; continue;
auto signal_waypoint = Map.GetWaypoint( auto signal_waypoint_optional = Map.GetWaypoint(RoadId, lane, SignalReference->GetS());
RoadId, lane, SignalReference->GetS()).get(); if (!signal_waypoint_optional) {
carla::log_warning("YieldSignComponent::InitializeSignsignal() waypoint seems to be invalid, ignoring. RoadId:", RoadId, " LaneId:", lane, " s:", SignalReference->GetS());
if(Map.GetLane(signal_waypoint).GetType() != cr::Lane::LaneType::Driving) continue;
}
auto signal_waypoint = signal_waypoint_optional.value();
if(Map.GetLane(signal_waypoint).GetType() != cr::Lane::LaneType::Driving) {
continue; continue;
}
auto box_waypoint = signal_waypoint; auto box_waypoint = signal_waypoint;
// Prevent adding the bounding box inside the intersection // Prevent adding the bounding box inside the intersection

View File

@ -1019,6 +1019,8 @@ void ACarlaWheeledVehicle::OpenDoorPhys(const EVehicleDoor DoorIdx)
{ {
(*CollisionDisable)->InitComponentConstraint(); (*CollisionDisable)->InitComponentConstraint();
} }
RecordDoorChange(DoorIdx, true);
} }
void ACarlaWheeledVehicle::CloseDoorPhys(const EVehicleDoor DoorIdx) void ACarlaWheeledVehicle::CloseDoorPhys(const EVehicleDoor DoorIdx)
@ -1032,6 +1034,16 @@ void ACarlaWheeledVehicle::CloseDoorPhys(const EVehicleDoor DoorIdx)
DoorComponent->SetWorldTransform(DoorInitialTransform); DoorComponent->SetWorldTransform(DoorInitialTransform);
DoorComponent->AttachToComponent( DoorComponent->AttachToComponent(
GetMesh(), FAttachmentTransformRules(EAttachmentRule::KeepWorld, true)); GetMesh(), FAttachmentTransformRules(EAttachmentRule::KeepWorld, true));
RecordDoorChange(DoorIdx, false);
}
void ACarlaWheeledVehicle::RecordDoorChange(const EVehicleDoor DoorIdx, bool bIsOpen)
{
auto * Recorder = UCarlaStatics::GetRecorder(GetWorld());
if (Recorder && Recorder->IsEnabled())
{
Recorder->AddVehicleDoor(*this, DoorIdx, bIsOpen);
}
} }
void ACarlaWheeledVehicle::ApplyRolloverBehavior() void ACarlaWheeledVehicle::ApplyRolloverBehavior()

View File

@ -406,6 +406,9 @@ public:
UFUNCTION(Category = "CARLA Wheeled Vehicle", BlueprintCallable) UFUNCTION(Category = "CARLA Wheeled Vehicle", BlueprintCallable)
void CloseDoorPhys(const EVehicleDoor DoorIdx); void CloseDoorPhys(const EVehicleDoor DoorIdx);
UFUNCTION(Category = "CARLA Wheeled Vehicle", BlueprintCallable)
void RecordDoorChange(const EVehicleDoor DoorIdx, const bool bIsOpen);
virtual FVector GetVelocity() const override; virtual FVector GetVelocity() const override;
//-----CARSIM-------------------------------- //-----CARSIM--------------------------------

View File

@ -29,7 +29,7 @@ IFS="," read -r -a PY_VERSION_LIST <<< "${PY_VERSION_LIST}"
# -- Get ad-rss ------------------------------------------- # -- Get ad-rss -------------------------------------------
# ============================================================================== # ==============================================================================
ADRSS_VERSION=4.4.3 ADRSS_VERSION=4.4.4
ADRSS_BASENAME=ad-rss-${ADRSS_VERSION} ADRSS_BASENAME=ad-rss-${ADRSS_VERSION}
ADRSS_COLCON_WORKSPACE="${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}" ADRSS_COLCON_WORKSPACE="${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}"
ADRSS_SRC_DIR="${ADRSS_COLCON_WORKSPACE}/src" ADRSS_SRC_DIR="${ADRSS_COLCON_WORKSPACE}/src"
@ -40,10 +40,13 @@ if [[ ! -d "${ADRSS_SRC_DIR}" ]]; then
mkdir -p "${ADRSS_SRC_DIR}" mkdir -p "${ADRSS_SRC_DIR}"
# clone ad-rss with all submodules, but remove proj, as CARLA already uses it
pushd "${ADRSS_SRC_DIR}" >/dev/null pushd "${ADRSS_SRC_DIR}" >/dev/null
git clone --depth=1 -b v1.7.0 https://github.com/gabime/spdlog.git git clone -b v${ADRSS_VERSION} https://github.com/intel/ad-rss-lib.git && cd ad-rss-lib && git submodule update --init --recursive && rm -rf dependencies/map/dependencies/PROJ4 && cd ..
git clone --depth=1 -b v2.4.5_hotfix https://github.com/carla-simulator/map.git
git clone --depth=1 -b v${ADRSS_VERSION} https://github.com/intel/ad-rss-lib.git # ADRSS_VERSION is designed for older boost, update datatype from boost::array to std::array
grep -rl "boost::array" | xargs sed -i 's/boost::array/std::array/g'
grep -rl "find_package(Boost" | xargs sed -i 's/find_package(Boost/find_package(Boost 1.80/g'
popd popd
cat >"${ADRSS_COLCON_WORKSPACE}/colcon.meta" <<EOL cat >"${ADRSS_COLCON_WORKSPACE}/colcon.meta" <<EOL
@ -56,7 +59,8 @@ if [[ ! -d "${ADRSS_SRC_DIR}" ]]; then
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"] "cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"]
}, },
"ad_map_opendrive_reader": { "ad_map_opendrive_reader": {
"cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"] "cmake-args": ["-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"],
"dependencies": ["odrSpiral"]
}, },
"ad_rss": { "ad_rss": {
"cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"] "cmake-args": ["-DBUILD_PYTHON_BINDING=ON", "-DCMAKE_POSITION_INDEPENDENT_CODE=ON", "-DBUILD_SHARED_LIBS=OFF", "-DDISABLE_WARNINGS_AS_ERRORS=ON"]
@ -78,13 +82,16 @@ fi
# ============================================================================== # ==============================================================================
ADRSS_INSTALL_DIR="${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/install" ADRSS_INSTALL_DIR="${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/install"
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang --version | head -n 1 | sed -r 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/')") # Automation doesn't work if the clang installed within the system is not matching the one that is provided by Unreal
# Setup.sh would have to be adapted to reflect it
if [ -z "$CARLA_LLVM_VERSION_MAJOR" ] ; then # so we need to change
fatal_error "Failed to retrieve the installed version of the clang compiler." #CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang --version | head -n 1 | sed -r 's/^([^.]+).*$/\1/; s/^[^0-9]*([0-9]+).*$/\1/')")
else #if [ -z "$CARLA_LLVM_VERSION_MAJOR" ] ; then
echo "Using clang-$CARLA_LLVM_VERSION_MAJOR as the CARLA compiler." # fatal_error "Failed to retrieve the installed version of the clang compiler."
fi #else
# echo "Using clang-$CARLA_LLVM_VERSION_MAJOR as the CARLA compiler."
#fi
CXX_TAG=c10
# #
# Since it it not possible with boost-python to build more than one python version at once (find_package has some bugs) # Since it it not possible with boost-python to build more than one python version at once (find_package has some bugs)
@ -99,15 +106,17 @@ for PY_VERSION in ${PY_VERSION_LIST[@]} ; do
log "Building ${ADRSS_BASENAME} for python${PY_VERSION}" log "Building ${ADRSS_BASENAME} for python${PY_VERSION}"
pushd "${ADRSS_COLCON_WORKSPACE}" >/dev/null pushd "${ADRSS_COLCON_WORKSPACE}" >/dev/null
if [ "${CMAKE_PREFIX_PATH}" == "" ]; then if [[ "${CMAKE_PREFIX_PATH}" == "" ]]; then
CMAKE_PREFIX_PATH="${CARLA_BUILD_FOLDER}/boost-1.72.0-c$CARLA_LLVM_VERSION_MAJOR-install;${CARLA_BUILD_FOLDER}/proj-install" CMAKE_PREFIX_PATH="${CARLA_BUILD_FOLDER}/boost-1.80.0-$CXX_TAG-install;${CARLA_BUILD_FOLDER}/proj-install"
else else
CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH};${CARLA_BUILD_FOLDER}/boost-1.72.0-c$CARLA_LLVM_VERSION_MAJOR-install;${CARLA_BUILD_FOLDER}/proj-install" CMAKE_PREFIX_PATH="${CARLA_BUILD_FOLDER}/boost-1.80.0-$CXX_TAG-install;${CARLA_BUILD_FOLDER}/proj-install;${CMAKE_PREFIX_PATH}"
fi fi
# get the python version of the binding to be built # get the python version of the binding to be built, need to query the binary,
# because might be just provided a '3' as PY_VERSION and then the symbolic linked python3 is called
PYTHON_VERSION=$(/usr/bin/env python${PY_VERSION} -V 2>&1) PYTHON_VERSION=$(/usr/bin/env python${PY_VERSION} -V 2>&1)
PYTHON_BINDING_VERSIONS=${PYTHON_VERSION:7:3} PYTHON_BINDING_VERSIONS=${PYTHON_VERSION:7}
PYTHON_BINDING_VERSIONS=${PYTHON_BINDING_VERSIONS%.*}
echo "PYTHON_BINDING_VERSIONS=${PYTHON_BINDING_VERSIONS}" echo "PYTHON_BINDING_VERSIONS=${PYTHON_BINDING_VERSIONS}"
# enforce sequential executor to reduce the required memory for compilation # enforce sequential executor to reduce the required memory for compilation

View File

@ -146,7 +146,7 @@ function build_libcarla {
M_TOOLCHAIN=${LIBSTDCPP_TOOLCHAIN_FILE} M_TOOLCHAIN=${LIBSTDCPP_TOOLCHAIN_FILE}
M_BUILD_FOLDER=${LIBCARLA_BUILD_CLIENT_FOLDER}.rss.$(echo "$2" | tr '[:upper:]' '[:lower:]') M_BUILD_FOLDER=${LIBCARLA_BUILD_CLIENT_FOLDER}.rss.$(echo "$2" | tr '[:upper:]' '[:lower:]')
M_INSTALL_FOLDER=${LIBCARLA_INSTALL_CLIENT_FOLDER} M_INSTALL_FOLDER=${LIBCARLA_INSTALL_CLIENT_FOLDER}
CMAKE_EXTRA_OPTIONS="${CMAKE_EXTRA_OPTIONS:+${CMAKE_EXTRA_OPTIONS} }-DBUILD_RSS_VARIANT=ON -DADRSS_INSTALL_DIR=${CARLA_BUILD_FOLDER}/ad-rss-4.4.3/install" CMAKE_EXTRA_OPTIONS="${CMAKE_EXTRA_OPTIONS:+${CMAKE_EXTRA_OPTIONS} }-DBUILD_RSS_VARIANT=ON -DADRSS_INSTALL_DIR=${CARLA_BUILD_FOLDER}/ad-rss-4.4.4/install"
else else
fatal_error "Invalid build configuration \"$1\"" fatal_error "Invalid build configuration \"$1\""
fi fi

View File

@ -41,12 +41,14 @@ nav:
- 'CarSIM': 'tuto_G_carsim_integration.md' - 'CarSIM': 'tuto_G_carsim_integration.md'
- 'Chrono': 'tuto_G_chrono.md' - 'Chrono': 'tuto_G_chrono.md'
- 'MathWorks': 'large_map_roadrunner.md' - 'MathWorks': 'large_map_roadrunner.md'
- 'NVIDIA SimReady': 'ecosys_simready.md'
- 'OpenDRIVE': 'adv_opendrive.md' - 'OpenDRIVE': 'adv_opendrive.md'
- 'PTV Vissim': 'adv_ptv.md' - 'PTV Vissim': 'adv_ptv.md'
- 'RSS': 'adv_rss.md' - 'RSS': 'adv_rss.md'
- 'ROS': https://carla.readthedocs.io/projects/ros-bridge/en/latest/ - 'ROS': https://carla.readthedocs.io/projects/ros-bridge/en/latest/
- 'Scenic': 'tuto_G_scenic.md' - 'Scenic': 'tuto_G_scenic.md'
- 'SUMO': 'adv_sumo.md' - 'SUMO': 'adv_sumo.md'
- 'SYNKROTRON': 'ecosys_synkrotron.md'
- Contributing: - Contributing:
- 'Guidelines': 'cont_contribution_guidelines.md' - 'Guidelines': 'cont_contribution_guidelines.md'