CARLA 0.9.8 release

The CARLA team is delighted to finally announce the release of CARLA 0.9.8!

This release makes for a new CARLA experience, bringing improvements to well established modules, along with a bunch of new features. Among these features we would like to highlight the new installation method using deb packages for Ubuntu. A new repository provides deb packages for the CARLA simulator and the ROS bridge, which can be easily installed using apt.

This post will dive deep into all the new features, but first let’s see a brief summary of what CARLA 0.9.8 brings to the table.

Deb installation for CARLA

The new deb package system consists of an online repository containing a collection of files to easily distribute CARLA. This is available in Ubuntu using APT command. This feature makes the installation of CARLA a straightforward process.

The following commands show how to use APT to install CARLA 0.9.8 in a Ubuntu system.

ROS bridge

CARLA is moving towards a soon-to-be full integration with Autoware, and in its way to do so, an out-of-the-box integration between CARLA and ROS is now easier than ever. The creation of a deb package for the CARLA-ROS bridge eases the installation process. Now, the ROS bridge can be installed in Linux systems using tools such as APT. Let’s take a look at how:

The CARLA messages have a specific repository and soon they will be available from the ROS-buildfarm. Sensors have also been upgraded, now including IMU and RADAR, along with some improvements to LIDAR, GNSS and RGB cameras. The ROS bridge includes now packages to integrate with RVIZ and run traffic scenarios directly from ROS. The demo provided will load an autonomous driving agent that avoids collisions, respects traffic lights and follows a specified route. To sum up:

rviz_carla_plugin. Displays the simulation. The camera orientation can be changed directly from the RVIZ view and manual control can be enabled and used in the same window using a grid.

The carla_ad_demo meta-package is an all-in-one solution that brings everything together.

roslaunch ros_ad_demo ros_ad_demo.launch

Python API extension

CARLA now provides full support for all the OpenDRIVE geometries, including for B-splines and spirals. The library now makes use of RTrees to accelerates queries (such as closest waypoint in a road).

Additionally, the functionalities of the PythonAPI now include the carla.Junction class to help finding different ways in these road segments, and the option in carla.Map to obtain waypoints from a .xodr definition.

Traffic Manager

This module has been greatly improved for this release. In addition to the many bug fixes, the greatest changes are related to the behavior of the Traffic Manager in synchronous mode, which is now stable. Traffic Manager can now also manage situations where multiple clients are running different Traffic Managers. Besides that, the Traffic Manager includes an improved lane changing behavior and vehicles can successfully avoid joining crowded junctions by using an anticipation algorithm.

SUMO integration

CARLA is now also compatible with SUMO so that both simulators can work together to run a synchronous co-simulation. The feature is experimental for CARLA 0.9.8. In this co-simulation mode, the actions or events happening in one simulator are automatically propagated to the other, e.g.: vehicle’s motion, agent spawning, vehicle’s lights, etc.

All the scripts related to this feature can be found in Co-Simulation/Sumo. It contains an example for Town 01 that runs the following command:

python3run_synchronization.py-cexamples/town01/Town01.sumocfg

There are some helper scripts that translate CARLA blueprints to SUMO vehicle types so that the vehicles’ specifications are the same in both simulators. If these are not used, CARLA will spawn a random vehicle based on the given SUMO vehicle type.

Warning! This feature has only been tested thoroughly in Town01.

OpenDRIVE standalone mode

This new and experimental mode allows to perform full simulation starting from a single OpenDRIVE file: no additional geometries or assets required. Finally your own OpenDRIVE files can be easily ingested by CARLA. To this end, the simulator takes an OpenDRIVE file and procedurally creates a 3D mesh to run simulations with. In order to test this feature, the config.py script in PythonAPI/util/ has a new argument, -x or --xodr-path, which is a string containing the path to the .xml file. This script calls a new method in carla.Client, client.generate_opendrive_world(), which blocks the simulation (as load_world() would do) until the new map is active.

There are some considerations to be taken into account:

OpenDRIVE maps created with RoadRunner present some issues related to tilted junctions.

The standalone mode uses the .xml directly so any issues in it will propagate to the simulation. This could be an issue especially at junctions, where many lanes are mixed.

The map will consists of only roads and sidewalks with no walls: just void outside. Vehicles will fall when driving outside of roads. Avoid this situation.

Traffic lights are not supported yet.

Walkers cannot cross pedestrian crossings yet.

Lateral slope for roads is not supported yet.

The sidewalks height is currently hardcoded. This ensures collisions with them are detected even if the map definition does not include this field.

python3 config.py -x path/to/some/file.xodr

Documentation

There have been major (dramatic) changes in the CARLA documentation. Almost every section has been revisited, from the installation and build guides to the Python API and sensor references. Everything is now up-to-date with the current version of CARLA.

There have been also remarkable changes on the structure of the documentation to simplify the learning curve. The First steps section now acts as a step-by-step guide for newcomers, and the Advanced steps include in-depth explanations for some specific CARLA features such as synchronous mode, Traffic Manager, ROS bridge and much more.

Weather extension

Continuing the path started in CARLA to make weather fully configurable by the user, this upgrade includes two new weather parameters and many improvements on previous ones.
First of all, now fog can be controlled in CARLA using two different variables. Distance sets the meters for the fog to start being applied. Density will state the opacity of the elements in scene depending on their distance from the point of view.

There is also wetness of the road, which applies a fader to the road to make it look wet. This new parameter works hand-in-hand with the previous precipitation deposits and improves realism on rainy environments.

The wind parameter has also been improved. Previously it was only obvious when looking at tree leaves. Now it also influences other types of vegetation, rain’s direction, and clouds’ movement.

/carla/PythonAPI/util >weather.py --weather overcast

As for other visual improvements made for this release:

Rain particles have been made more realistic.

Cludiness will darken the sky.

The sun intensity is regulated by both the sun position and cloudiness.

All these elements influence the intensity and color temperature of the light in the scene.

All of these improvements can be perceived using a RGB camera sensor. The dynamic_weather.py script in /PythonAPI/examples has been updated to include all of these changes in its main cycle. The Weather.py script in /Utils/ allows to modify the weather parameters at will:

Speaking of which, CARLA is glad to announce the arrival of a new car model, the Cybertruck!

The light set for vehicles is base on real examples, including front and back beams, blinkers and some special ones such as license plates, interior lights or sirens, among others. Some of them turn on automatically (brake and reverse lights), but most of them are implemented to be accessible using the API. In order to do this, the carla.VehicleLightState class lists the set of lights as flags that can be enabled or disabled using binary operations.

# Turn on position lights
current_lights=carla.VehicleLightState.NONEcurrent_lights|=carla.VehicleLightState.Positionvehicle.set_light_state(current_lights)

The manual_control.py script in /PythonAPI/examples has been updated to include commands for lights. Left/Right blinkers correspond to the Z/X keys. High beams are turned on when Shift+L is pressed. There is also a specific cycle of vehicle lights that is enabled when L is pressed: No lights --> position light + license plate --> low beam --> fog lights.

Mesh distance fields

Unreal Engine uses mesh distance fields to represent elements and actors in scene and gain some information about the scene’s illumination. In previous releases these features were disabled due to ghosting issues that now have been palliated.

Distance field shadows works along with the previous Cascade shadows to create shadows with non-sharp edges based on light sources. Distance field ambient occlusion helps placing the objects on scene by creating shadows that take into consideration the proximity between elements in scene.

These are complex Unreal Engine features that allow for higher visual realism. To learn more about this feature and its possibilities take a look at Unreal Engine’s documentation.

Mesh distance fields can be disabled via code, in DefaultEngine.ini set to false the parameter r.GenerateMeshDistanceFields=False or through the UE Editor. Go to Project Settings, look up mesh distance fields and just disable these:

Changelog

Debian repositories for CARLA release and ROS bridge.

CARLA forum open to everybody.

OpenDRIVE standalone mode:

New argument --xodr-path in config.py to load .xml files into CARLA.

SUMO co-simulation:

Run a SUMO simulation synchronously with CARLA.

Helper scripts to translate CARLA blueprints into SUMO vehicle types.

New documentation:

Getting started: Introduction and Quickstart.

CARLA build: Linux build, Windows build, Update CARLA, F.A.Q.

First steps: Core concepts, 1st. World and client, 2nd. Actors and blueprints, 3rd. Maps and navigation, 4th. Sensors and data.