CARLA 0.9.9 release

Automatized map ingestion, full-road RSS support, accessible OpenDRIVE signals, a new Town in HD and great improvements in other features.

Posted by @sergi-e on April 22, 2020

The CARLA team is thrilled to release CARLA 0.9.9! Buckle up, because it comes ready to drift!

The development has been brief but intense. There are plenty of announces to make, some of great importance. Especially remarkable is the new map ingestion proccess. This has been simplified for users to use their maps in CARLA out-of-the-box. Traffic lights and traffic signs will nevermore require users’ manual intervention. Instead, CARLA can now automatically ingest these traffic landmarks directly from OpenDRIVE.

Moreover, previous features and modules are growing strong. The RSS sensor, SUMO co-simulation, OpenDRIVE standalone mode, and Traffic Manager all have new features, and improved performance. There is even a new integration with PTV-Vissim. The documentation keeps up to date with all of these improvements, and features new tutorials. Last but not least, there is a new map in CARLA. It is opening day in Town10HD!

Here is a summary of every feature included in CARLA 0.9.9!

  • Upgrade UE version. (4.24) Those working with a build from source have to upgrade to the latest UE version. In return, users will get better rendering performance and fixes for several crashes happening when using Vulkan as a back-end.
  • Automatized map ingestion. The process to ingest maps and assets has been further simplified. The intervention of users to set up traffic lights and signs is not required anymore. Prepare FBXs, the OpenDRIVE file and bake the contents using our docker map import pipeline.
  • Accesible OpenDRIVE signals. One of the game changers. CARLA now manages the OpenDRIVE signals as landmark objects. Signals described in the .xodr will be accessible from the API. Additionally, the simulator will generate stop, yield, and traffic light objects automatically when running.
  • RSS full-road integration. The integration of RSS is now operative on the entire road network, including traffic intersections. Additionally, a new stay on road feature guarantees that RSS-controlled vehicles will never go off-road.
  • Hybrid physics in Traffic Manager. Traffic Manager can now disable complex physics simulation for vehicles that are far away from an ego vehicle. This change reduces computation and improves traffic simulation performance.
  • Refined OpenDRIVE standalone mode. The procedural generation of maps from OpenDRIVE files has been refined to smooth the merge of different roads at junctions. Furthermore, now this mode includes crosswalks for pedestrian navigation, and some safety measures to prevent vehicles from falling off the map.
  • PTV-Vissim co-simulation. The CARLA ecosystem expands to integrate PTV-Vissim. CARLA can run a synchronous simulation with PTV-Vissim in a similar way it does with SUMO.
  • Traffic lights in SUMO co-simulation. This new iteration introduces co-simulation of traffic lights, and different tools to ease the usage of the feature.
  • New tutorials. A brand new tutorial about how to retrieve data will help users exploit the versatility of CARLA.. Besides that, the assets tutorials have been revisited, to facilitate the ingestion of self-created assets.
  • Town10 HD premiere. A new map of superb visual quality, with detailed buildings and a highly realistic road.

Let’s take a look!

Get CARLA 0.9.9


Upgrade UE version


The CARLA team has decided to upgrade to the latest version of Unreal Engine, UE4.24. Until now, some crashes were happening when spawning a lot of vehicles while using Vulkan. These crashes do not occur anymore after the upgrade. Furthermore, users should also expect a little increase in the FPS, which never comes amiss.

In order to update the CARLA build, there are some steps to be made.

  1. Delete the UE4.22 version of the system and download a UE4.24.x.

  2. Upgrade to clang-8 with the following commands.

sudo apt install clang-8 lld-8
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-8/bin/clang++ 180
sudo update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-8/bin/clang 180
rm -fr Build
make clean
make launch

Automatized map ingestion


Previously in CARLA, traffic lights, and traffic signs had to be created manually by the user after the map was imported. The user had to place them in the scene, add the bounding boxes that determine their influence, and set everything ready. This process is now automatic. When the simulator starts running, it generates traffic lights, stops, and yields using the information provided by the OpenDRIVE file.

The rest of settings that users had to do manually, are also managed during the process.

  • No need to create a .json file describing the package.
  • No need to structure the files in a certain way.
  • No need to set collisions, nor generate pedestrian navigation files.

Create your map, and make the ingestion. Read the documentation to learn more.

Accessible OpenDRIVE signals


From now on, CARLA can read OpenDRIVE signals as described in the road map. All of them will be described in CARLA as landmark objects that can be queried from the API. In order to facilitate their manipulation, there have been several additions to it.

  • carla.Landmark objects represent the OpenDRIVE signals. The attributes and methods describe the landmark, and where it is effective.
  • A carla.Waypoint can get landmarks located a certain distance ahead of it. The type of landmark can be specified.
  • The carla.Map retrieves sets of landmarks. It can return all the landmarks in the map, or those having an ID, type or group in common.
  • The carla.World acts as intermediary between landmarks, and the carla.TrafficSign and carla.TrafficLight that embody them in the simulation.

Even if the the simulator generates stop, yields and traffic lights in the simulation, the way these objects are managed has not changed for the user. For instance, it is still possible to customize the traffic lights timing directly from the API.

RSS full-road integration


The implementation of the RSS sensor has been extended. Now, the ability to consume the OpenDRIVE map information enables all the RSS features in CARLA, and full support of RSS anywhere in the map. This upgrade makes for two remarkable features.

RSS checks priority and safety at junctions. Previously, the RSS worked based on road segments, and was limited to these. Now, the RSS sensor can take different road segments into consideration to make the calculations. That makes it possible to integrate junctions, where different road segments meet. When at a junction, a RSS vehicle will check for priority. If necessary, it will brake when coming closer, or even stop to give right of way. More about how the RSS library manages this can be read in the official documentation under Handling of intersections.

rss_junctions

Stay on road mode is available. This RSS feature uses the map data to get a description of the road boundaries. At those boundaries, the RSS will place virtual objects, walls, that will prevent the vehicle from driving off the road. The RSS formulas apply to these objects as any other. As a result, the vehicle will always maintain a minimum safe distance with them. By default, the feature is Off. It can be switched using RssSensor.road_boundaries_mode.

rss_stay

The current state of the RSS sensor is now detailed in the documentation. Find out more in the RSS page, the RSS sensor reference, and the Python API.

Hybrid physics in Traffic Manager


The Traffic Manager module now includes a new mode. In hybrid mode, either all vehicle physics can be disabled, or enabled only in a radius around an ego vehicle with the tag hero. This feature removes the vehicle physics bottleneck from the simulator, especially for cars far away from the ego vehicle. Since vehicle physics are not active, all cars move by teleportation while following their path. This feature relies on the method Actor.set_simulate_physics(). However, not all the physics are disregarded. Basic calculations for a linear acceleration are maintained. By doing so, the position update, and vehicle speed still look realistic. That guarantees that when a vehicle enables or disables its physics, the transition is fluid.

The are two parameters ruling the hybrid mode. One is the radius that states the proximity area around any ego vehicle where physics are enabled. The other is the vehicle with role_name='hero', that will act as center of this radius.

  • The default radius is 70 meters, but can be changed with traffic_manager.set_hybrid_mode_radius(r).
  • If no ego vehicle is present, all the vehicles will disable physics.
  • If there are many ego vehicles, the radius will be considered for all of them. That will create different areas of influence with physics enabled.

The hybrid mode is disabled by default. There are two ways to enable it.

  • TrafficManager.set_hybrid_phisics_mode(True). This method will enable the hybrid mode for the Traffic Manager object calling it.
  • Running spawn_npc.py with the flag --hybrid. The vehicles spawned will be registered to a Traffic Manager stated inside the script, and this will run with the hybrid physics on.

Here is an example of the hybrid mode running. The ego vehicle is tagged with a red square. Vehicles with physics disabled are tagged with a blue square. When inside the area of influence stated by the radius, physics are enabled and the tag becomes green.

tm_hybrid

Besides that, the module has been iterated to improve performance, and there is a minor modification in the Vehicle.set_autopilot() method. This now needs for an attribute stating which Traffic Manager is the vehicle subscribed to.

Refined OpenDRIVE standalone mode


The mesh generation in the OpenDRIVE standalone mode has been greatly improved. Junctions have been polished to avoid inaccuracies, especially where uneven lanes joined. Instead of creating the whole map as a unique mesh, different fragments are created. Working smaller prevents unexpected issues. Also, by dividing the mesh, not all of it has to be rendered at a time. This is a step towards a larger goal, where the feature will be able to generate huge maps.

Here is an example showing some portions of TownBig. This map is now now available in CARLA, in PythonAPI/util/opendrive/TownBig.xodr!

ptv_cosim

On top of that there are two new additions. Crosswalks have been implemented to the pedestrian navigation, and some safety measures have been created to prevent vehicles from falling. About those, the width of the lanes is incremented at junctions, and visible walls appear on the boundaries of the road.

Some settings of the mesh generation can be customized when the method client.generate_opendrive_world(xodr_file,parameters) is called. Those settings are specified in parameters, using a carla.OpendriveGenerationParameters.

  • vertex_distance is the distance between the vertices of the mesh. The bigger the distance, the more inaccurate the mesh will be. However, if the distance is too small, the resulting mesh will be too heavy to work with.
  • max_road_length is the maximum length of a portion of the mesh. The mesh is divided in portions to reduce rendering overhead. If a portion is not visible, UE will not render it. The smaller the portions, the more probably they are discarded. However, if the portions are too small, UE will have too many objects to manage, and performance will be affected too.
  • wall_height states the height of the additional walls created on the boundaries of the road. These prevent vehicles from falling to the void.
  • additional_width is a small width increment applied to the junction lanes. This is a safety measure to prevent vehicles from falling.
  • smooth_junctions if True, some information of the OpenDRIVE will be reinterpreted to smooth the final mesh at junctions. This is done to prevent some inaccuracies that may occur when various lanes meet. If set to False, the mesh will be generated exactly as described in the OpenDRIVE.
  • enable_mesh_visibility if False, the mesh will not be rendered. This could save a lot of work to the simulator.

ptv_cosim

PTV-Vissim co-simulation


This new mode allows CARLA and PTV-Vissim to run a synchronous simulation. Vehicles spawned in one simulator will do so in the other, and their positions will be updated in parallel. In order work, the system must count with PTV-Vissim, and the Driving simulator interface package.

So far, this feature is still experimental, and there are some aspects to take into account.

  • Due to PTV-Vissim limitations, the amount of vehicles that will be spawned from CARLA has to be stated beforehand using the argument --simulator-vehicles <INT>. Default value is 1.
  • The blueprints are not exactly the same. The characteristics and dimensions of the vehicles are similar, but not always equal.
  • Traffic lights and pedestrians have not been implemented yet.

Everything related with the PTV-Vissim integration can be found in Co-Simulation/PTV-Vissim. There is a script in there to run the co-simulation, and examples for Town01 and Town03. Here is an example of how to run the co-simulation using the Town03 example.

python3 run_synchronization.py examples/Town03/Town03.inpx

ptv_cosim

Traffic lights in SUMO co-simulation


Traffic lights are now integrated in the co-simulation! As long as they are defined in the OpenDRIVE road map, they will be generated in SUMO. Now the synchronization script has some additional arguments.

  • --tls-manager to choose which simulator will change the state of traffic lights. The other will update them accordingly. Supported values are carla, sumo and none. Using the later, the traffic lights will not be synchronized.
  • --sumo-gui will open a window to visualize SUMO.
# Traffic lights controlled by CARLA
python run_synchronization.py examples/TestTLS.sumocfg --tls-manager carla --sumo-gui
Warning! SUMO Traffic lights will not be generated in the released CARLA maps. They were added manually, and cannot be retrieved from the OpenDRIVE.

There is also a new script, util/netconvert_carla.py, that generates a SUMO network from an OpenDRIVE file. This script runs the netconvert tool to generate the main road network without traffic lights. These are then created one by one, using the OpenDRIVE definition. That way, inaccuracies are avoided.

The script will generate a net file that can be opened in SUMO. Use that to prepare the SUMO environment for the co-simulation.

python netconvert_carla.py <PATH_TO_XODR> --output Test.net.xml

Additionally, the script spawn_npc_sumo.py is almost equivalent to the already-known spawn_npc.py. The difference is that vehicles will be managed using SUMO instead of the Traffic Manager. This script automatically generates a SUMO network in a temporal folder, based on the active town in CARLA. The script will create random routes and let the vehicles roam around.

As the script runs a synchronous simulation, and spawns vehicles in it, the arguments are the same that appear in run_synchronization.py and spawn_npc.py.

# Spawn 10 vehicles, that will be managed by SUMO instead of Traffic Manager. 
# CARLA in charge of traffic lights.
# Open a window for SUMO visualization. 
python spawn_sumo_npc.py -n 10 --tls-manager carla --sumo-gui

sumo_trafficlights

Lastly, there are two more examples for Town04 and Town05 available in CARLA. These will ease the usage of the feature, so the user does not have to set the SUMO environment previously. The examples can be found in Co-Simulation/Sumo/examples.

New tutorials


The documentation has been updated to reflect the upgrades mentioned in previous sections. Nonetheless, there are some remarkable new entries.

There is a new tutorial regarding how to properly retrieve data from the simulation. This is a holistic tutorial that comprises the whole process of retrieving data from start to finish. It starts with the simplest steps, such as customizing the simulation or spawning an ego vehicle. However, it also provides detailed descriptions for sensors, and explains how the recorder can be used to facilitate this process. The goal is to make sure that users can exploit CARLA, by retrieving as much data as desired in the simplest way.

The tutorials regarding assets have been revisited. This new iteration is focused on making simpler for users to add their own assets, being these props, maps, vehicles, and how to create standalone packages for them.

Town10HD premiere


Town10HD is the new addition to CARLA. The whole mindset during its development was to push forward towards visual realism. In order to achieve that, meticulous care has been put into materials.

The environment is based on an American city, designed using real references. Different parts of the map show different settings, such as a skycraper district, a promenade, or a humble and populated neighbourhood. This town also counts with several new props carefully designed including vegetation, scultpures, a museum, and a metro entrance among many others.

town10_street

Improvements are especially visible on buildings. The facades are now more detailed to be appealing. The streets are no longer plane series of buildings, but a vivid scene of elements coming in and out. This is noticeable from the very ground floors, all the way up. Cubemaps have been placed at windows so that they provide with diverse home pictures.

town10_facades

For the sake of creating these buildings, a new tool has been developed. BP_Procedural_Buildings is a blueprint that is at the same time compound from different blueprints. By using the tool, the dimensions of the building are stated, and then filled in at random. The blueprints are used as if they were pieces to fit the mold. All of the meshes are efficiently instantiated to avoid performance issues. The final result is a varied and realistic building.

town10_hotel

Last but not least, the road has been also carefully crafted. Each segment has been treated as a white canvas. The road came to life by painting weathering, tire marks, and day-to-day traits that made it look realistic. After that, decal textures and meshes were added to provide even more detail, such as oil splashes or dirt scattered around.

town10_road

Changelog


  • Upgrade to UE4.24.
    • Download UE4.24.x.
    • Upgrade to clang-8.
  • Automatized map ingestion.
    • Automatic generation of traffic lights, stop and yield signals by the simulator.
    • Automatic map ingestion for CARLA packages using Docker.
  • PTV-Vissim co-simulation.
    • Synchronous vehicle update between CARLA and PTV-Vissim.
    • Vehicle spawning co-simulated.
  • SUMO co-simulation.
    • New examples for Town04 and Town05.
    • Traffic lights integration.
    • netconvert_carla.py to generate SUMO net files.
    • spawn_npc_sumo.py to spawn vehicles managed by SUMO instead of Traffic Manager.
  • OpenDRIVE standalone mode.
    • Added crosswalks for pedestrians.
    • Improved mesh generation by creating it in separated in fragments.
    • Automatic mesh smooth preprocess.
    • Security checks to prevent cars from falling into the abyss.
    • Parametrization of the mesh generation.
  • RSS sensor.
    • Integration for the whole road network.
    • Integration of intersection RSS checks.
    • Support for stay on road feature.
    • Classes carla.RssSensor, carla.RssResponse, carla.RssRestrictor, carla.RssVisualizationMode, carla.RssRoadBoundariesMode and carla.RssEgoDynamicsOnRoute.
  • Traffic manager.
    • Hybrid mode to disable physics for vehicle farther than a distance from the ego vehicle.
    • carla.Vehicle.set_autopilot() and command.SetAutopilot() now has a carla.TrafficManager as parameter.
    • Added new methods to carla.TrafficManager: set_hybrid_physics_mode() and set_hybrid_radius().
    • Performance improvement on collision calculations and waypoint binning.
  • Accessible OpenDRIVE signals.
    • Classes carla.Landmark, carla.LandmarkType, and carla.LandmarkOrientation.
    • Added new methods to carla.Map: get_all_landmarks(), get_all_landmarks_from_id(), get_all_landmarks_of_type(), and get_landmark_group().
    • Added new methods to carla.Waypoint: get_landmarks(), and get_landmarks_of_type().
    • Added new methods to carla.World: get_traffic_light(), and get_traffic_sign().
    • RSS classes and enums. carla.RssSensor, carla.RssRestrictor, carla.RssResponse, carla.RssEGoDynamycsOnRoute, carla.RssRoudBoundariesMode, carla.RssVisualizationMode.
  • Documentation.
    • New tutorial to retrieve data from the simulation.
    • Assets tutorials revisited: Add vehicles, maps and props.
    • RSS sensor page and update to sensors reference
    • Python API updated with landmarks, Traffic Manager and RSS additions.
    • Python API lists Dunder methods separatedly.
    • Methods ordered alphabetically with getters and setters at the end.
  • Town10HD.
    • New map developed and available.
    • New props and buildings.
    • New PBR materials and textures for streets, roads, and assets.
    • BP_Power_poles. A blueprint to spawn power poles.
    • BP_Lights. A blueprint for assets using lights that exposes these in the API.
    • BP_Procedural_Buildings. A tool to create procedural buildings.
  • Fixes.
    • Updated material for the glass of vehicle lights.
    • Fixed autonomous agents’ incorrect detection of red traffic lights affecting them.
    • Improved manual_control.py for a more realistic throttle and brake.
    • Dead links in the documentation.