CARLA is an open-source simulator for autonomous driving research, built on Unreal Engine, that provides realistic urban environments, configurable vehicles and pedestrians, and a full suite of simulated sensors such as cameras, LiDAR and radar. In robotics simulation, it is one of the most widely used platforms for developing, training and validating self-driving perception, planning and control software without putting real vehicles on the road.
CARLA was first released in 2017 by the Computer Vision Center in Barcelona, with support from industry partners. It is distributed under the MIT license, while its digital assets use a Creative Commons license, which makes it popular both in academic research and in early-stage industrial prototyping.
How the CARLA client-server architecture works
CARLA runs as a server that simulates the world and one or more clients that control it through an API. The server renders the scene with Unreal Engine, steps the physics and produces sensor data. Clients written in Python or C++ connect over TCP to spawn actors, attach sensors, send vehicle commands and receive measurements.
The simulation can run in two timing modes, and choosing between them is one of the first decisions in any CARLA project.
| Mode | How time advances | Best for | Risk |
|---|---|---|---|
| Asynchronous mode | Server runs as fast as it can | Interactive driving and demos | Sensor data may be missed or misaligned |
| Synchronous mode | Server waits for a client tick | Data collection and reproducible tests | Slower if the client is slow |
| Fixed time step | Each tick covers a set interval, e.g. 0.05 s | Deterministic physics and replay | Large steps reduce physics accuracy |
| Variable time step | Interval follows wall-clock time | Casual exploration | Results vary between runs |
For research, the usual recommendation is synchronous mode with a fixed time step, because every sensor then reports data for the same simulated instant and experiments can be repeated exactly.
Sensors, maps and traffic in CARLA
CARLA offers a broad catalog of configurable sensors that can be attached to any vehicle at a chosen position and orientation. Each sensor has parameters such as resolution, field of view, range, noise and update rate, which lets developers approximate a real vehicle sensor setup.
| Sensor | Output | Typical use |
|---|---|---|
| RGB camera | Color images | Object detection, lane detection |
| Depth and semantic cameras | Per-pixel depth or class labels | Ground truth for training |
| LiDAR | 3D point cloud | Localization, obstacle detection |
| Radar | Points with relative velocity | Adaptive cruise and tracking |
| GNSS and IMU | Position, acceleration, rotation rate | State estimation |
| Collision and lane invasion | Event messages | Safety metrics and rewards |
Maps are defined with the ASAM OpenDRIVE road description standard, which encodes lanes, junctions and traffic rules. CARLA ships with a set of towns ranging from small grids to highways and large mixed areas. The built-in Traffic Manager controls background vehicles in autopilot, and walkers can be spawned with navigation controllers to create dense urban scenes.
CARLA compared with other robot simulators
CARLA is specialized for road vehicles, while most robot simulators target manipulators, mobile robots or legged systems. The comparison below shows where it fits among common tools.
| Simulator | Primary focus | Rendering | Typical users |
|---|---|---|---|
| CARLA | Autonomous driving in towns | Unreal Engine, photorealistic | Driving research and testing |
| Gazebo | General robotics with ROS | Moderate realism | Mobile robots and manipulators |
| Isaac Sim | Robotics and synthetic data | RTX ray tracing | Industrial and AI robotics |
| MuJoCo | Fast contact-rich physics | Basic | Reinforcement learning, control |
| AI Habitat | Indoor embodied navigation | Fast photorealistic scans | Embodied AI research |
The main strength of CARLA is the combination of traffic, road rules and sensor realism in a free package. Its vehicle dynamics are good enough for planning and perception work but are not a substitute for high-fidelity vehicle models used in chassis or tire engineering.
Scenario testing and the CARLA ecosystem
Beyond free driving, CARLA supports structured scenario testing. The ScenarioRunner tool executes scripted situations, such as a pedestrian stepping out from behind a parked car, and it can read scenarios written in the ASAM OpenSCENARIO format. This allows teams to test rare and dangerous events many times under controlled conditions.
- ROS bridge: publishes sensor data and receives commands through ROS and ROS 2 topics.
- Recorder and replay: stores a simulation and replays it for debugging.
- CARLA Leaderboard: a benchmark that scores driving agents on routes with scripted hazards.
- Co-simulation: links CARLA with traffic simulators such as SUMO for larger traffic flows.
These tools make CARLA useful across the development cycle, from training end-to-end driving models to regression testing of a modular autonomy stack.
Practical limits and the sim-to-real gap
CARLA is computationally demanding: rendering several high-resolution cameras and LiDAR sensors at once usually requires a dedicated GPU, and simulation may run slower than real time. Teams often reduce sensor resolution or render without a display to reach a usable real-time factor.
The larger concern is the sim-to-real gap. Synthetic images, simplified weather effects and scripted traffic behavior do not match real roads perfectly, so a model that performs well in CARLA can fail outdoors. Common mitigations include domain randomization of weather and textures, mixing synthetic and real data, and treating simulation results as evidence, not proof, of road safety.
Version management also requires care. CARLA releases have changed API behavior and map assets between versions, and the newer Unreal Engine 5 branch differs from the long-standing Unreal Engine 4 releases. Pinning a single CARLA version for a whole project, and recording it alongside every dataset and benchmark result, avoids confusing regressions that come from the simulator rather than from the driving software.
Finally, background traffic in CARLA follows rule-based autopilot logic, so other road users rarely behave as aggressively or unpredictably as real drivers. Scenario libraries and co-simulation help, but behavioral realism of other agents remains an open research problem.
The idea in brief
Testing a self-driving car on real streets is slow, expensive and sometimes dangerous. CARLA is a free virtual world that looks like a real town, with roads, traffic lights, other cars and people walking around.
Engineers put a virtual car into this world, give it virtual cameras and sensors, and let their software drive it. They can repeat the same tricky situation hundreds of times, such as a child running into the road, without risking anyone.
A practical scenario
A research team is developing an emergency braking function for an autonomous shuttle. Real-world tests of pedestrians stepping into the road are unsafe, so the team builds 40 scenario variants in CARLA, changing pedestrian speed, visibility behind parked cars, lighting and rain intensity.
The shuttle model carries a front camera and a 32-channel LiDAR, simulated in synchronous mode at 20 Hz. The first runs show missed detections in heavy rain at dusk. After retraining the detector with randomized weather data, the system brakes in time in nearly all variants, and the team then moves the validated configuration to a closed test track for confirmation with a soft dummy target.