Compiling OpenSCENARIO 2.1 for Scenario-Based Testing in CARLA
Thoshitha Gamage, Lasanthi Gamage

TL;DR
This paper presents a novel compiler architecture that translates OpenSCENARIO 2.1 DSL directly into executable behaviors in CARLA, enabling scalable scenario-based testing with complex, concurrent actions.
Contribution
It introduces a multi-pass compiler pipeline with an ANTLR4 frontend and a custom runtime backend that maps OpenSCENARIO 2.1 directly to CARLA's API, improving integration and scalability.
Findings
Successfully compiles multi-actor scenarios with concurrent actions
Demonstrates dynamic mathematical expressions and asynchronous signaling handling
Establishes a baseline for reproducible large-scale scenario testing
Abstract
While the ASAM OpenSCENARIO 2.1 Domain-Specific Language (DSL) enables declarative, intent-driven authoring for Scenario-Based Testing (SBT), its integration into open-source simulators like CARLA remains limited by legacy parsers. We propose a multi-pass modern compiler architecture that translates the OpenSCENARIO 2.1 DSL directly into executable CARLA behaviors. The pipeline features an ANTLR4 frontend for Abstract Syntax Tree (AST) generation, a semantic middle-end, and a runtime backend that synthesizes deterministic py_trees behavior trees. Mapping the standardized domain ontology directly to CARLA's procedural API via a custom method registry eliminates the need for external logic solvers. A demonstrative multi-actor cut-in and evasive maneuver, selected from a wider suite of validated scenarios, confirms the compiler's ability to process concurrent actions, dynamic mathematical…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
