openscenario-rs
A Rust library for parsing, validating, and manipulating OpenSCENARIO files.
Features
- Parse and serialize
.xoscfiles (scenarios, catalogs, parameter variations) - Type-safe data model covering actions, conditions, entities, and distributions
- Parameter resolution with mathematical expression support (
${param + 1}) - Catalog loading and reference resolution
- Optional builder API for programmatic scenario construction (
--features builder) - CLI tools:
xosc-validate,scenario_analyzer
Status
Core parsing and serialization is functional. Actions and conditions have broad but not complete coverage — see the implementation table in docs/user_guide.md for details.
Quick Start
[]
= "0.3.0"
Parsing
use ;
Analysis Tools
Modules
types/— OpenSCENARIO data typesparser/— XML parsing and serializationcatalog/— catalog loading and reference resolutionexpression/— expression evaluationbuilder/— programmatic scenario construction (feature-gated)
Testing
Documentation
Contributing
Check existing patterns before adding new types. Add tests. Verify XML round-trip behavior.
License & Attribution
The Rust source code is licensed under the GNU General Public License v3.0.
ASAM OpenSCENARIO Schema
Schema/OpenSCENARIO.xsd is published by ASAM e.V. and redistributed unchanged for validation purposes under the ASAM license terms. See Schema/NOTICE for details.
ALKS Test Scenarios
tests/data/alks_scenario.xosc originates from openMSL/sl-3-1-osc-alks-scenarios (© BMW Group), licensed under MPL 2.0. See tests/data/NOTICE for details.
Acknowledgement
This package is developed as part of the SYNERGIES project.
Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or European Climate, Infrastructure and Environment Executive Agency (CINEA). Neither the European Union nor the granting authority can be held responsible for them.