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.
Let’s take a look!
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.
# Install dependencies pip install --user pygame numpy # Add the repository sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 304F9BC29914A77D && sudo add-apt-repository "deb [arch=amd64 trusted=yes] http://dist.carla.org/carla-0.9.8/ all main" # Install CARLA sudo apt-get update sudo apt-get install carla # CARLA is in the /opt/ folder cd /opt/carla # Get the resources for the simulator. ./ImportAssets.sh # Run the CARLA server. cd bin ./CarlaUE4.sh
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:
# After installing ROS Melodic and CARLA 0.9.8 # For ROS Kinetic, change "melodic" instances for "kinetic" and the key server to 9BE2A0CDC0161D6C # Add the repository sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 81061A1A042F527D && sudo add-apt-repository "deb [arch=amd64 trusted=yes] http://dist.carla.org/carla-ros-bridge-melodic/ bionic main" # Install the ROS bridge sudo apt update && sudo apt install carla-ros-bridge-melodic # The ROS bridge will be in the /opt/ folder # Launch CARLA (this example runs the apt package) cd /opt/carla/bin/ && ./CarlaUE4.sh # Add the source for melodic bridge source /opt/carla-ros-bridge/melodic/setup.bash # Launch ROS bridge launchfile to test roslaunch carla_ros_bridge carla_ros_bridge.launch
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:
The carla_ad_demo meta-package is an all-in-one solution that brings everything together.
roslaunch ros_ad_demo ros_ad_demo.launch
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.
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.
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:
python3 run_synchronization.py -c examples/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.
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,
--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:
python3 config.py -x path/to/some/file.xodr
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.
Check all of these changes in the CARLA documentation!
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.
/carla/PythonAPI/util >weather.py --clouds 100 --rain 80 --wetness 100 --puddles 60 --wind 80 --fog 50
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.
/carla/PythonAPI/util >weather.py --clouds 100 --rain 80 --wetness 100
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:
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:
# Set a morning scenario. /carla/PythonAPI/util >weather.py --altitude 30 # Change the azimuth for an evening scenario. /carla/PythonAPI/util >weather.py --altitude 30 --azimuth 220
A whole new mode in CARLA! The moment the sun disappears in the horizon (altitude is below 0), it is considered night time and therefore streets and vehicles turn their lights automatically on.
# Go to night mode by locating the sun below the horizon. Midnight = -90 /carla/PythonAPI/util >weather.py --altitude -90
For this release, lights have been added to a specific set of vehicles.
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.NONE current_lights |= carla.VehicleLightState.Position vehicle.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.
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:
config.pyto load .xml files into CARLA.
/Utilseases weather control by the user.
Lkey manages lights in four states: off, position, low beam and fog lights.
shitf+Lturns on main beam lights.