CARLA 0.9.11 Release

Deterministic Traffic Manager and rag dolls, new and updated maps, new vehicles, beta integrations of CarSim and Scenic and improvements to the ROS bridge

Posted by @corkyw10 on December 22, 2020

What better way to round off the year than with the release of CARLA 0.9.11?

Get CARLA 0.9.11

In this release there has been a big focus on improving determinism, with the goal of making CARLA more reliable and stable. Traffic Manager can now be used in full deterministic mode, and even the animations used in pedestrian collisions (rag dolls) are deterministic by default.

CARLA 0.9.11 brings many fixes and updates of critical features. The PhysX Vehicle Manager has been enhanced to provide more realistic wheel rolling physics and accurate collisions. We have extended the maps API to provide the ability to toggle on and off every environment object individually. We also have new versions of all our maps, in which users can load and unload the different elements of the map by layers. The ROS bridge has plenty of improvements too, most notably the ability to spawn new pseudo sensors, which allows the user to visualize and collect ground truth data.

There have been several new additions to the CARLA ecosystem too. We are proud to present the new integration of CarSim (in beta). This is a powerful and high-fidelity vehicle dynamics simulator that allows users to perform realistic vehicle dynamics simulation of a specific vehicle model.
We are also excited to announce the integration of the Scenic traffic scenario specification language (in beta). And finally, we have added four new vehicle models to the blueprint library!

Here’s a rundown of the features that come with CARLA 0.9.11:

Improved PhysX Vehicle Manager

The model controlling the interaction between vehicles’ wheels and surfaces has been upgraded, fixing an important problem that was causing wheels to intersect solid objects. Users will now have the option to use a new model, based on sweep collision control. Sweep collision control allows for all possible contact planes along the wheel to be considered and thus ensure a smoother drive over obstacles and bumps in the scene. No more sudden jumps nor sinking into the curb!

sweep_wheels

Sweep collision control can be enabled using the following code:

physics_control = vehicle.get_physics_control()
physics_control.use_sweep_wheel_collision = True
vehicle.apply_physics_control(physics_control)

You can get started straight away with the manual_control.py example script.

Read more about the PhysX implementation of sweep queries here.

Map Sublevels

New versions of all our maps have been released and boast some additional features. The new maps (identified with the suffix “Opt”) have the same layout as previous ones but they are now divided into sublevels. This allows users to load and unload maps layer by layer, providing additional control over the performance of the simulation. The available layers are as follows:

  • NONE - No layers selected.
  • Buildings - Sublevel containing all the buildings on the map.
  • Decals - Sublevel containing all the decals on the map.
  • Foliage - Sublevel containing all the foliage on the map.
  • ParkedVehicles - Sublevel containing all the parked vehicles on the map.
  • Particles - Sublevel containing all the particles on the map.
  • Props - Sublevel containing all the props on the map.
  • StreetLights - Sublevel containing all the streetlights on the map.
  • Walls - Sublevel containing all the walls on the map.
  • All - All layers selected.

sublevels

Warning! Sublevels are only available in the "Opt" suffixed maps

Toggle Environment Objects

Users can now toggle individual environment objects in both old and new maps. Each object in the environment has a unique ID that can be fetched and used to turn that object off and on.

toggle_objects

Deterministic Traffic Manager

Users will now have the option to use Traffic Manager in deterministic mode. This will allow Traffic Manager to have the exact same output over distinct executions of a script as long as the same conditions are maintained. Deterministic mode is easily turned on by providing an arbitrary seed value to the following method:

my_tm.set_random_device_seed(seed_value)

The most important thing to keep in mind when using deterministic mode with Traffic Manager is that both the world and Traffic Manager must be in synchronous mode to function properly. It is not possible to achieve determinism in asynchronous mode due to the reduced amount of control this mode allows the client over the simulation. Read more about synchrony in CARLA and how to activate it for the world and for Traffic Manager.

Deterministic Rag Doll Animations

Collisions with pedestrians trigger a set of animations to simulate damage. Traditionally, these animations have been directly controlled by Unreal Engine, which introduced a source of stochasticity. In this new version of CARLA we take direct control of the rag doll animations, making them deterministic by default. Deterministic rag dolls can be toggled via the deterministic_ragdolls variable in the carla.WorldSettings class. When set to true, pedestrians have less realistic death animation but determinism is ensured. When false, simulation and collision are more realistic but determinism is not ensured.

rag_dolls

New Vehicles

CARLA’s showroom now boasts 4 new vehicles! This brings the total number of available vehicles in the blueprint library up to 31. With these latest additions you can now take a spin in our brand new Lincoln MKZ 2020, Mercedes-Benz Class C Coupe (by Fran Ruiz), Dodge Charger 2020 (by Martín Danlos) and Dodge Police Vehicle! These vehicles have been designed using new materials, with the goal of increasing the visual quality of the models.

stills_cars

Synchronous Mode Pipeline Update

We have developed an updated synchronisation pipeline that improves server-client communication and removes the frame delay present in previous versions.

Old synchronisation pipeline:

old_sync

New synchronisation pipeline:

new_sync

As shown in the above diagrams, we have changed the key moments in which synchronisation between the client and the server happens, providing a much quicker response from the client to the server. In the old pipeline, the client’s computations were based on the server’s information from the previous frame. This introduced a delay in the ability of the client to interact with the server. In the new pipeline, the input from the client is processed just before the physics computation. This, alongside the much earlier sensor rendering/computation, allows the client to respond in real-time and affect the server directly in the next frame.

CarSim Integration (Beta)

We are happy to announce the beta integration between CARLA and CarSim. CarSim is a simulation tool from Mechanical Simulation that performs highly accurate simulation of the dynamic behavior of passenger vehicles and light-duty trucks. Using a 3D multi-body dynamics model, it reproduces the physics of a vehicle in response to different controls (steering, throttle, braking, gear shifting) from a driver and/or automatic agent. This integration enables co-simulation between CarSim and CARLA, allowing users to create CarSim vehicles, taking control over dozens of parameters, including suspension system, tires, and many more.

This first integration is great news for users of both CARLA and CarSim as it paves the way for the most powerful features of both platforms to be combined. Multiple vehicle simulations with collision capability on complex maps can be run in CARLA and then data can easily be analysed with CarSim’s highly specialised vehicle dynamics tools.

carsim

If you are interested in learning more about CarSim before using it with CARLA, they have a great 2 part introduction to the tool on their YouTube channel.

Warning! This feature is still in experimental phase.

Scenic Support (Beta)

We are also proud to announce the integration of the Scenic programming language in CARLA. Scenic is a domain-specific probabilistic programming language specifically created to easily define traffic scenarios. Our ongoing collaboration with the Scenic team will allow for straightforward definition and execution of traffic scenarios using CARLA. As part of the advantages of Scenic, we would like to highlight the capability of creating multiple and diverse instances of the same scenario from a single scenario definition. This will help users to focus on the generation of new traffic scenarios, reducing the amount of effort required to create variations of an existing one.

Below, there is a code snippet of Traffic Scenario 03 from the CARLA Autonomous Driving Leaderboard created with Scenic. Here we are using Scenic to create a situation where a pedestrian crosses the road unexpectedly and the ego vehicle is required to react safely.

# SET SCENARIO PARAMETERS AND MODEL
param map = localPath('../../../tests/formats/opendrive/maps/CARLA/Town01.xodr')
param carla_map = 'Town01'
model scenic.simulators.carla.model  # Here the definitions of all referenceables are defined (vehicle types, road library, etc)

# SCENARIO CONSTANTS
EGO_MODEL = "vehicle.lincoln.mkz2017"
EGO_SPEED = 10
SAFETY_DISTANCE = 10
BRAKE_INTENSITY = 1.0

PEDESTRIAN_MIN_SPEED = 1.0
THRESHOLD = 18

# BEHAVIORS:
behavior EgoBehavior(speed=10):
    try:
        do FollowLaneBehavior(target_speed=speed)
    interrupt when withinDistanceToObjsInLane(self, SAFETY_DISTANCE):
        take SetBrakeAction(BRAKE_INTENSITY)

behavior PedestrianBehavior(min_speed=1, threshold=10):
    do CrossingBehavior(ego, min_speed, threshold)

## DEFINING SPATIAL RELATIONS
lane = Uniform(*network.lanes)

spot = OrientedPoint on lane.centerline
vending_spot = OrientedPoint following roadDirection from spot for -3

# ACTOR CREATION
pedestrian = Pedestrian right of spot by 3,
    with heading 90 deg relative to spot.heading,
    with regionContainedIn None,  # Allow the actor to spawn outside the driving lanes
    with behavior PedestrianBehavior(PEDESTRIAN_MIN_SPEED, THRESHOLD)

vending_machine = VendingMachine right of vending_spot by 3,
    with heading -90 deg relative to vending_spot.heading,
    with regionContainedIn None  # Allow the actor to spawn outside the driving lanes

ego = Car following roadDirection from spot for Range(-30, -20),
    with blueprint EGO_MODEL,
    with behavior EgoBehavior(EGO_SPEED)

# REQUIREMENTS
require (distance to intersection) > 30
require (distance from vending_machine to intersection) > 30
require always (ego.laneSection._slowerLane is None)
require always (ego.laneSection._fasterLane is None)

# TERMINATION CONDITION
terminate when (distance to spot) > 30

Execution of the script is easy and you can see some command line options in the Scenic documentation here. The following is an example of how we can run the above script:

scenic carlaChallenge3_dynamic.scenic --simulate

scenic

Watch this space for updates and improvements on our integration with Scenic and in the meantime, take a dive into the Scenic syntax and explore all the possibilities!

Warning! This feature is still in experimental phase.

ROS Bridge Improvements

There have been quite a few improvements made to the ROS Bridge-CARLA experience. A new internal structure has been developed to ease the integration of the ROS bridge with external tools. Actors can now be spawned and destroyed using ROS services, so we have added the SpawnObject and DestroyObject services. Now that actors can be spawned and destroyed in this manner, users can define pseudo sensors. Pseudo sensors are much like normal sensors but instead of existing in the CARLA context they are developed directly in the ROS Bridge. This extension brings much more control over the data collection process, as each user can define exactly what pseudo sensors they want to use.

The pseudo sensors available are:

  • sensor.pseudo.actor_list
  • sensor.pseudo.markers
  • sensor.pseudo.objects
  • sensor.pseudo.odom
  • sensor.pseudo.opendrive_map
  • sensor.pseudo.speedometer
  • sensor.pseudo.tf
  • sensor.pseudo.traffic_lights

Here is an example of how pseudo sensors can be defined:

{
    "objects":
    [
        {
            "type": "sensor.pseudo.opendrive_map",
            "id": "map"
        },
        {
            "type": "vehicle.lincoln.mkz2017",
            "id": "ego_vehicle",
            "sensors":
            [
                {
                    "type": "sensor.camera.rgb",
                    "id": "rgb_front",
                    "spawn_point": {"x": 2.0, "y": 0.0, "z": 2.0, "roll": 0.0, "pitch": 0.0, "yaw": 0.0},
                    "image_size_x": 800, "image_size_y": 600
                },
                {
                    "type": "sensor.pseudo.tf",
                    "id": "tf"
                },
                {
                    "type": "sensor.pseudo.objects",
                    "id": "objects"
                }
             ]
         }
    ]
}

We have added a passive mode to the ROS Bridge to ease the integration of external tools when having multiple CARLA clients running at the same time. When enabling this mode, the ROS bridge stays passive and other clients have the responsibility of ticking and configuring the world.

Finally in the ROS improvements, the DVS Camera and the Semantic LIDAR are now fully integrated in the ROS-Bridge.

Contributors

This space is dedicated to all of those whose contributions were merged in any of the project’s GitHub repositories during the development of CARLA 0.9.11. Thanks a lot for your hard work!

Changelog


  • Improved the documentation for use with pandoc tool by converting html tags to their markdown equivalent
  • Added parameter to carla settings to control culling
  • Refactored FAQ section of docs to use minimal html and fix broken layout
  • Added load_map_layer and unload_map_layer to control map layers on new maps that support subleveling
  • Added get_environment_objects call to get all the placed objects in the level
  • Added enable_environment_objects call to enable/disable objects of the level
  • Added fully deterministic option for Traffic Manager, sorting vehicles by ID and avoiding race conditions
  • Added the option to sweep the wheel shape for collision. This requires to patch the engine
  • Added the possibility of changing physics substepping options from client
  • Added ‘noise_seed’ to sensors to initialize the random generators
  • API extensions:
    • Added actor.set_enable_gravity() function to enable/disable the gravity affecting the actor
  • Upgraded to DirectX 12 on Windows
  • Added horizontal_fov parameter to lidar sensor to allow for restriction of its field of view
  • Extended the local planner with a lateral offset.

Art

  • Added WorldSettings.deterministic_ragdolls to enable deterministic or physically based ragdolls

Fixes

  • Fixed RSSSensor python3 build and import of open drive maps by updating to ad-rss v4.2.0 and ad-map-access v2.3.0. Python import of dependent ‘ad’ python modules reflects now the namespaces of the C++ interface and follow doxygen documentation
  • Fixed sensor transformations and sensor data transformations mismatch in IMU and camera-based sensors
  • Fixed random dead-lock on synchronous mode at high frame rate
  • Fixed bug on Windows causing sun reflection artifacts
  • Fixed bug in waypoint.get_landmarks() causing some landmarks to be missed when s = 0
  • Fixed the actor.set_simulate_physics() for pedestrians and vehicles
  • Fixed bug causing camera-based sensors to stop sending data
  • Fixed the lack of determinism on the output of raycast sensors
  • Fixed bug in the actor’s id returned by the semantic lidar
  • Fixed error when using –config parameter in make package
  • Fixed dependency of library Xerces-c on package
  • Fixed minor typo in the simulation data section of the documentation
  • Fixed the config.py to read the .osm files in proper utf-8 encoding