diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e25a3c61..a361dd37a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 * Added Digital Twins feature version 0.1. Now you can create your own map based on OpenStreetMaps diff --git a/Docs/adv_multigpu.md b/Docs/adv_multigpu.md index 8b3873cda..52b312ee9 100644 --- a/Docs/adv_multigpu.md +++ b/Docs/adv_multigpu.md @@ -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. diff --git a/Docs/ecosys_simready.md b/Docs/ecosys_simready.md new file mode 100644 index 000000000..da15569bc --- /dev/null +++ b/Docs/ecosys_simready.md @@ -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 + diff --git a/Docs/ecosys_synkrotron.md b/Docs/ecosys_synkrotron.md new file mode 100644 index 000000000..a147cab54 --- /dev/null +++ b/Docs/ecosys_synkrotron.md @@ -0,0 +1,56 @@ +“synkrotron_logo” + +# 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. + +--- + +“synkrotron_logo” + +
+ +
+ +
+ +## [__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 | + + + + diff --git a/Docs/img/0_9_15_thumbnail.webp b/Docs/img/0_9_15_thumbnail.webp new file mode 100644 index 000000000..41c25d1c6 Binary files /dev/null and b/Docs/img/0_9_15_thumbnail.webp differ diff --git a/Docs/img/multigpu-example.png b/Docs/img/multigpu-example.png new file mode 100644 index 000000000..a0763daad Binary files /dev/null and b/Docs/img/multigpu-example.png differ diff --git a/Docs/img/oasis_logo.png b/Docs/img/oasis_logo.png new file mode 100644 index 000000000..3108bc78e Binary files /dev/null and b/Docs/img/oasis_logo.png differ diff --git a/Docs/img/synkrotron.jpg b/Docs/img/synkrotron.jpg new file mode 100644 index 000000000..e854362a5 Binary files /dev/null and b/Docs/img/synkrotron.jpg differ diff --git a/Docs/map_town13.md b/Docs/map_town13.md index 7a86e3e3c..9ea5ff694 100644 --- a/Docs/map_town13.md +++ b/Docs/map_town13.md @@ -5,7 +5,7 @@ Town 13 is a Large Map with dimensions of 10x10 km2. It is divided into 36 tiles, most with dimensions of 2x2 km2 (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 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 diff --git a/LibCarla/cmake/client/CMakeLists.txt b/LibCarla/cmake/client/CMakeLists.txt index b4ecce487..20438ad3e 100644 --- a/LibCarla/cmake/client/CMakeLists.txt +++ b/LibCarla/cmake/client/CMakeLists.txt @@ -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) diff --git a/LibCarla/source/carla/rss/RssSensor.cpp b/LibCarla/source/carla/rss/RssSensor.cpp index 29fb6e164..ae19c145e 100644 --- a/LibCarla/source/carla/rss/RssSensor.cpp +++ b/LibCarla/source/carla/rss/RssSensor.cpp @@ -309,17 +309,17 @@ void RssSensor::TickRssSensor(const client::Timestamp ×tamp, 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); } } } diff --git a/PythonAPI/carla/setup.py b/PythonAPI/carla/setup.py index 1f10d0d66..067e140a9 100755 --- a/PythonAPI/carla/setup.py +++ b/PythonAPI/carla/setup.py @@ -55,7 +55,7 @@ def get_libcarla_extensions(): os.path.join(pwd, 'dependencies/lib/libxerces-c.a')] extra_link_args += ['-lz'] 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', '-Wdeprecated', '-Wno-shadow', '-Wuninitialized', '-Wunreachable-code', '-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_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/libodrSpiral.a')] extra_link_args += [os.path.join(pwd, 'dependencies/lib/libspdlog.a')] extra_link_args += ['-lrt'] extra_link_args += ['-ltbb'] diff --git a/PythonAPI/examples/rss/manual_control_rss.py b/PythonAPI/examples/rss/manual_control_rss.py index a845e6457..ff0b7e1c5 100755 --- a/PythonAPI/examples/rss/manual_control_rss.py +++ b/PythonAPI/examples/rss/manual_control_rss.py @@ -135,6 +135,7 @@ class World(object): def __init__(self, carla_world, args): self.world = carla_world + self.sync = args.sync self.actor_role_name = args.rolename self.dim = (args.width, args.height) try: @@ -161,10 +162,7 @@ class World(object): sys.exit(1) self.restart() - self.world_tick_id = self.world.on_tick(self.on_world_tick) - - def on_world_tick(self, world_snapshot): - self.hud.on_world_tick(world_snapshot) + self.world_tick_id = self.world.on_tick(self.hud.on_world_tick) def toggle_pause(self): settings = self.world.get_settings() @@ -235,6 +233,11 @@ class World(object): self.rss_sensor = RssSensor(self.player, self.world, 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): self.hud.tick(self.player, clock) @@ -384,7 +387,7 @@ class VehicleControl(object): print('\nReceived signal {}. Trigger stopping...'.format(signum)) VehicleControl.signal_received = True - def parse_events(self, world, clock): + def parse_events(self, world, clock, sync_mode): if VehicleControl.signal_received: print('\nAccepted signal. Stopping loop...') return True @@ -806,13 +809,27 @@ def game_loop(args): (args.width, args.height), 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) clock = pygame.time.Clock() while True: + if args.sync: + sim_world.tick() clock.tick_busy_loop(60) - if controller.parse_events(world, clock): + if controller.parse_events(world, clock, args.sync): return world.tick(clock) world.render(display) @@ -875,6 +892,10 @@ def main(): '--externalActor', action='store_true', 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.width, args.height = [int(x) for x in args.res.split('x')] diff --git a/PythonAPI/examples/rss/rss_sensor.py b/PythonAPI/examples/rss/rss_sensor.py index 68f1938dd..022660718 100644 --- a/PythonAPI/examples/rss/rss_sensor.py +++ b/PythonAPI/examples/rss/rss_sensor.py @@ -334,6 +334,9 @@ class RssSensor(object): self.map_log_level = self.map_log_level-1 self.sensor.set_map_log_level(self.map_log_level) + def drop_route(self): + self.sensor.drop_route() + @staticmethod def get_default_parameters(): ego_dynamics = ad.rss.world.RssDynamics() diff --git a/README.md b/README.md index 98086e0c0..eaad3df72 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ 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) [![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 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 CoRL’17 -paper, check out -[Benchmarking](https://github.com/carla-simulator/driving-benchmarks). +### Download CARLA Linux: * [**Get CARLA overnight build**](http://carla-releases.s3.amazonaws.com/Linux/Dev/CARLA_Latest.tar.gz) @@ -32,12 +29,23 @@ Windows: ### Recommended system * Intel i7 gen 9th - 11th / Intel i9 gen 9th - 11th / AMD ryzen 7 / AMD ryzen 9 -* +16 GB RAM memory -* NVIDIA RTX 2070 / NVIDIA RTX 2080 / NVIDIA RTX 3070, NVIDIA RTX 3080 -* Ubuntu 18.04 +* +32 GB RAM memory +* NVIDIA RTX 3070 / NVIDIA RTX 3080 / NVIDIA RTX 4090 +* 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 -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 * [**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 * [**AutoWare AV stack**](https://github.com/carla-simulator/carla-autoware): Bridge to connect AutoWare AV stack to CARLA * [**Reinforcement-Learning**](https://github.com/carla-simulator/reinforcement-learning): Code for running Conditional Reinforcement Learning models in CARLA +* [**RoadRunner**](https://www.mathworks.com/products/roadrunner.html): MATLAB GUI based application to create road networks in OpenDrive format * [**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!** Paper @@ -74,24 +84,22 @@ Felipe Codevilla, Antonio Lopez, Vladlen Koltun; PMLR 78:1-16 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 -# Download and install the UE patch -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 +git clone https://github.com/carla-simulator/carla.git . ``` -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/ [buildwindowslink]: https://carla.readthedocs.io/en/latest/build_windows/ -[issue150]: https://github.com/carla-simulator/carla/issues/150 Contributing ------------ @@ -106,29 +114,6 @@ F.A.Q. If you run into problems, check our [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 ------- diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp index 50cadabd8..596e8473f 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.cpp @@ -304,6 +304,15 @@ void ACarlaRecorder::AddVehicleLight(FCarlaActor *CarlaActor) 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(SDoors); + DoorVehicle.bIsOpen = bIsOpen; + AddDoorVehicle(DoorVehicle); +} + void ACarlaRecorder::AddActorKinematics(FCarlaActor *CarlaActor) { check(CarlaActor != nullptr); @@ -478,6 +487,7 @@ void ACarlaRecorder::Clear(void) PhysicsControls.Clear(); TrafficLightTimes.Clear(); WalkersBones.Clear(); + DoorVehicles.Clear(); Wheels.Clear(); Bikers.Clear(); } @@ -496,6 +506,7 @@ void ACarlaRecorder::Write(double DeltaSeconds) EventsDel.Write(File); EventsParent.Write(File); Collisions.Write(File); + DoorVehicles.Write(File); // positions and states 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) { if (Enabled) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.h index f6662d254..12f527728 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorder.h @@ -33,7 +33,9 @@ #include "CarlaRecorderState.h" #include "CarlaRecorderVisualTime.h" #include "CarlaRecorderWalkerBones.h" +#include "CarlaRecorderDoorVehicle.h" #include "CarlaReplayer.h" +#include "Carla/Vehicle/CarlaWheeledVehicle.h" #include "CarlaRecorder.generated.h" @@ -67,6 +69,7 @@ enum class CarlaRecorderPacketId : uint8_t FrameCounter, WalkerBones, VisualTime, + VehicleDoor, AnimVehicleWheels, AnimBiker }; @@ -137,6 +140,10 @@ public: void AddActorBones(FCarlaActor *CarlaActor); + void AddVehicleDoor(const ACarlaWheeledVehicle& Vehicle, const EVehicleDoor SDoors, bool bIsOpen); + + void AddDoorVehicle(const CarlaRecorderDoorVehicle &DoorVehicle); + // set episode void SetEpisode(UCarlaEpisode *ThisEpisode) { @@ -208,6 +215,7 @@ private: CarlaRecorderTrafficLightTimes TrafficLightTimes; CarlaRecorderWalkersBones WalkersBones; CarlaRecorderVisualTime VisualTime; + CarlaRecorderDoorVehicles DoorVehicles; // replayer CarlaReplayer Replayer; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderDoorVehicle.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderDoorVehicle.cpp new file mode 100644 index 000000000..ab6da8860 --- /dev/null +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderDoorVehicle.cpp @@ -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 . + +#include "CarlaRecorderDoorVehicle.h" +#include "CarlaRecorder.h" +#include "CarlaRecorderHelpers.h" + + +void CarlaRecorderDoorVehicle::Write(std::ostream &OutFile) +{ + // database id + WriteValue(OutFile, this->DatabaseId); + WriteValue(OutFile, this->Doors); + WriteValue(OutFile, this->bIsOpen); +} +void CarlaRecorderDoorVehicle::Read(std::istream &InFile) +{ + // database id + ReadValue(InFile, this->DatabaseId); + ReadValue(InFile, this->Doors); + ReadValue(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(OutFile, static_cast(CarlaRecorderPacketId::VehicleDoor)); + + // write a dummy packet size + uint32_t Total = 2 + Vehicles.size() * sizeof(CarlaRecorderDoorVehicle); + WriteValue(OutFile, Total); + + // write total records + Total = Vehicles.size(); + WriteValue(OutFile, Total); + + for (auto& Vehicle : Vehicles) + { + Vehicle.Write(OutFile); + } +} + +void CarlaRecorderDoorVehicles::Read(std::istream &InFile) +{ + uint16_t Total; + CarlaRecorderDoorVehicle DoorVehicle; + + // read Total walkers + ReadValue(InFile, Total); + for (uint16_t i = 0; i < Total; ++i) + { + DoorVehicle.Read(InFile); + Add(DoorVehicle); + } +} + +const std::vector& CarlaRecorderDoorVehicles::GetDoorVehicles() +{ + return Vehicles; +} diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderDoorVehicle.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderDoorVehicle.h new file mode 100644 index 000000000..0ba395f47 --- /dev/null +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderDoorVehicle.h @@ -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 . + +#pragma once + +#include +#include +#include + +#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& GetDoorVehicles(); + +private: + std::vector Vehicles; +}; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.cpp index 47cda18c5..75f2202c8 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.cpp @@ -19,6 +19,8 @@ #include #include +#include + inline bool CarlaRecorderQuery::ReadHeader(void) { if (File.eof()) @@ -271,6 +273,49 @@ std::string CarlaRecorderQuery::QueryInfo(std::string Filename, bool bShowAll) SkipPacket(); break; + // vehicle door animations + case static_cast(CarlaRecorderPacketId::VehicleDoor): + if (bShowAll) + { + ReadValue(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(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 case static_cast(CarlaRecorderPacketId::VehicleLight): if (bShowAll) diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.h index 070fb117c..f3e4c53cb 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaRecorderQuery.h @@ -26,6 +26,7 @@ #include "CarlaRecorderPosition.h" #include "CarlaRecorderState.h" #include "CarlaRecorderWalkerBones.h" +#include "CarlaRecorderDoorVehicle.h" class CarlaRecorderQuery { @@ -69,6 +70,7 @@ private: CarlaRecorderPhysicsControl PhysicsControl; CarlaRecorderTrafficLightTime TrafficLightTime; CarlaRecorderWalkerBones WalkerBones; + CarlaRecorderDoorVehicle DoorVehicle; // read next header packet bool ReadHeader(void); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.cpp index 918d3aa51..64e208b55 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.cpp @@ -378,6 +378,14 @@ void CarlaReplayer::ProcessToTime(double Time, bool IsFirstTime) SkipPacket(); break; + // vehicle door animation + case static_cast(CarlaRecorderPacketId::VehicleDoor): + if (bFrameFound) + ProcessDoorVehicle(); + else + SkipPacket(); + break; + // scene lights animation case static_cast(CarlaRecorderPacketId::SceneLight): if (bFrameFound) @@ -649,6 +657,25 @@ void CarlaReplayer::ProcessLightVehicle(void) } } +void CarlaReplayer::ProcessDoorVehicle(void) +{ + uint16_t Total; + CarlaRecorderDoorVehicle DoorVehicle; + + // read Total walkers + ReadValue(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) { uint16_t Total; diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.h index f1e73f05e..3e2f2408b 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayer.h @@ -158,6 +158,8 @@ private: void ProcessLightVehicle(void); void ProcessLightScene(void); + void ProcessDoorVehicle(void); + void ProcessWalkerBones(void); // positions diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp index 3ca4c4b4f..9bfa120f6 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.cpp @@ -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(CarlaActor->GetActor()); + if (Vehicle) { + if(DoorVehicle.bIsOpen){ + Vehicle->OpenDoor(static_cast(DoorVehicle.Doors)); + }else{ + Vehicle->CloseDoor(static_cast(DoorVehicle.Doors)); + } + } + } +} + // set the lights for vehicles void CarlaReplayerHelper::ProcessReplayerLightVehicle(CarlaRecorderLightVehicle LightVehicle) { diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.h index f6751117d..d4379dddd 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Recorder/CarlaReplayerHelper.h @@ -15,6 +15,7 @@ #include "CarlaRecorderAnimVehicleWheels.h" #include "CarlaRecorderLightVehicle.h" #include "CarlaRecorderLightScene.h" +#include "CarlaRecorderDoorVehicle.h" #include "CarlaRecorderWalkerBones.h" #include @@ -65,6 +66,9 @@ public: // set the animation for walkers void ProcessReplayerAnimWalker(CarlaRecorderAnimWalker Walker); + // set the openings and closing of vehicle doors + void ProcessReplayerDoorVehicle(CarlaRecorderDoorVehicle DoorVehicle); + // set the animation for bikers void ProcessReplayerAnimBiker(CarlaRecorderAnimBiker Biker); diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettingsDelegate.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettingsDelegate.cpp index 33f018ae2..673ef6ebe 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettingsDelegate.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Settings/CarlaSettingsDelegate.cpp @@ -4,7 +4,7 @@ #include "Carla/Game/CarlaGameInstance.h" #include "Carla/Settings/CarlaSettings.h" -#include "Carla/Game/CarlaGameInstance.h" + #include "Async.h" #include "Components/StaticMeshComponent.h" #include "Engine/DirectionalLight.h" diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Traffic/YieldSignComponent.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Traffic/YieldSignComponent.cpp index 9fc0e3dcf..8e660919a 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Traffic/YieldSignComponent.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Traffic/YieldSignComponent.cpp @@ -36,11 +36,15 @@ void UYieldSignComponent::InitializeSign(const carla::road::Map &Map) if(lane == 0) continue; - auto signal_waypoint = Map.GetWaypoint( - RoadId, lane, SignalReference->GetS()).get(); - - if(Map.GetLane(signal_waypoint).GetType() != cr::Lane::LaneType::Driving) + auto signal_waypoint_optional = Map.GetWaypoint(RoadId, lane, SignalReference->GetS()); + if (!signal_waypoint_optional) { + carla::log_warning("YieldSignComponent::InitializeSignsignal() waypoint seems to be invalid, ignoring. RoadId:", RoadId, " LaneId:", lane, " s:", SignalReference->GetS()); + continue; + } + auto signal_waypoint = signal_waypoint_optional.value(); + if(Map.GetLane(signal_waypoint).GetType() != cr::Lane::LaneType::Driving) { continue; + } auto box_waypoint = signal_waypoint; // Prevent adding the bounding box inside the intersection diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp index 1580e7180..8ba705acd 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.cpp @@ -1019,6 +1019,8 @@ void ACarlaWheeledVehicle::OpenDoorPhys(const EVehicleDoor DoorIdx) { (*CollisionDisable)->InitComponentConstraint(); } + + RecordDoorChange(DoorIdx, true); } void ACarlaWheeledVehicle::CloseDoorPhys(const EVehicleDoor DoorIdx) @@ -1032,6 +1034,16 @@ void ACarlaWheeledVehicle::CloseDoorPhys(const EVehicleDoor DoorIdx) DoorComponent->SetWorldTransform(DoorInitialTransform); DoorComponent->AttachToComponent( 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() diff --git a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.h b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.h index 704d4c72f..0f5b4fea8 100644 --- a/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.h +++ b/Unreal/CarlaUE4/Plugins/Carla/Source/Carla/Vehicle/CarlaWheeledVehicle.h @@ -406,6 +406,9 @@ public: UFUNCTION(Category = "CARLA Wheeled Vehicle", BlueprintCallable) void CloseDoorPhys(const EVehicleDoor DoorIdx); + UFUNCTION(Category = "CARLA Wheeled Vehicle", BlueprintCallable) + void RecordDoorChange(const EVehicleDoor DoorIdx, const bool bIsOpen); + virtual FVector GetVelocity() const override; //-----CARSIM-------------------------------- diff --git a/Util/BuildTools/Ad-rss.sh b/Util/BuildTools/Ad-rss.sh index 9c6bfecd1..3f7c71695 100755 --- a/Util/BuildTools/Ad-rss.sh +++ b/Util/BuildTools/Ad-rss.sh @@ -29,7 +29,7 @@ IFS="," read -r -a PY_VERSION_LIST <<< "${PY_VERSION_LIST}" # -- Get ad-rss ------------------------------------------- # ============================================================================== -ADRSS_VERSION=4.4.3 +ADRSS_VERSION=4.4.4 ADRSS_BASENAME=ad-rss-${ADRSS_VERSION} ADRSS_COLCON_WORKSPACE="${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}" ADRSS_SRC_DIR="${ADRSS_COLCON_WORKSPACE}/src" @@ -40,10 +40,13 @@ if [[ ! -d "${ADRSS_SRC_DIR}" ]]; then 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 - git clone --depth=1 -b v1.7.0 https://github.com/gabime/spdlog.git - 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 + 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 .. + + # 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 cat >"${ADRSS_COLCON_WORKSPACE}/colcon.meta" </dev/null - 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" + if [[ "${CMAKE_PREFIX_PATH}" == "" ]]; then + CMAKE_PREFIX_PATH="${CARLA_BUILD_FOLDER}/boost-1.80.0-$CXX_TAG-install;${CARLA_BUILD_FOLDER}/proj-install" 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 - # 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_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}" # enforce sequential executor to reduce the required memory for compilation diff --git a/Util/BuildTools/BuildLibCarla.sh b/Util/BuildTools/BuildLibCarla.sh index 783ed594e..c9e2f13a0 100755 --- a/Util/BuildTools/BuildLibCarla.sh +++ b/Util/BuildTools/BuildLibCarla.sh @@ -146,7 +146,7 @@ function build_libcarla { M_TOOLCHAIN=${LIBSTDCPP_TOOLCHAIN_FILE} M_BUILD_FOLDER=${LIBCARLA_BUILD_CLIENT_FOLDER}.rss.$(echo "$2" | tr '[:upper:]' '[:lower:]') 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 fatal_error "Invalid build configuration \"$1\"" fi diff --git a/mkdocs.yml b/mkdocs.yml index 15dc563b2..40a876c9e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -41,12 +41,14 @@ nav: - 'CarSIM': 'tuto_G_carsim_integration.md' - 'Chrono': 'tuto_G_chrono.md' - 'MathWorks': 'large_map_roadrunner.md' + - 'NVIDIA SimReady': 'ecosys_simready.md' - 'OpenDRIVE': 'adv_opendrive.md' - 'PTV Vissim': 'adv_ptv.md' - 'RSS': 'adv_rss.md' - 'ROS': https://carla.readthedocs.io/projects/ros-bridge/en/latest/ - 'Scenic': 'tuto_G_scenic.md' - 'SUMO': 'adv_sumo.md' + - 'SYNKROTRON': 'ecosys_synkrotron.md' - Contributing: - 'Guidelines': 'cont_contribution_guidelines.md'