Compiling OpenSCENARIO 2.1 for Scenario-Based Testing in CARLA
A novel multi-pass compiler translates high-level driving scenarios into executable CARLA behaviors, eliminating external solvers.
Researchers Thoshitha and Lasanthi Gamage have introduced a new compiler framework that directly bridges the high-level ASAM OpenSCENARIO 2.1 Domain-Specific Language (DSL) with the popular open-source CARLA autonomous vehicle simulator. The work addresses a key limitation in scenario-based testing (SBT), where the declarative, intent-driven authoring power of OpenSCENARIO 2.1 has been hampered by legacy parsers and poor integration with simulators like CARLA. The proposed solution is a multi-pass modern compiler that translates scenario descriptions into executable CARLA behaviors.
The compiler's architecture features an ANTLR4 frontend for generating an Abstract Syntax Tree (AST), a semantic middle-end for analysis, and a runtime backend that synthesizes deterministic py_trees behavior trees for execution. A critical innovation is the direct mapping of the standardized OpenSCENARIO domain ontology to CARLA's procedural API via a custom method registry, which completely eliminates the dependency on external logic solvers. The framework has been validated with scenarios like a complex multi-actor cut-in and evasive maneuver, demonstrating its ability to handle concurrent actions, dynamic mathematical expressions, and asynchronous signaling.
This compiler establishes a functional, reproducible baseline for large-scale SBT, a crucial step for rigorous autonomous vehicle development. While the current implementation uses Python and carries some computational overhead, the architecture paves the way for future optimizations in C++. The work represents a significant step towards making advanced, standardized scenario authoring directly usable within a leading open-source simulation environment.
- Directly compiles OpenSCENARIO 2.1 DSL into CARLA's py_trees behavior trees via a custom method registry, removing need for external solvers.
- Validated with complex multi-actor scenarios (e.g., cut-in & evasive maneuvers) processing concurrent actions and dynamic expressions.
- Establishes a reproducible baseline for large-scale Scenario-Based Testing, with architecture designed for future C++ performance optimizations.
Why It Matters
Enables scalable, standardized testing of autonomous vehicles by seamlessly connecting high-level scenario descriptions with a major open-source simulator.