This tutorial demonstrates how to use the converter to translate single OpenSCENARIO format to the CommonRoad scenarios.
Please make sure that you have correctly installed the package by following the README.md
%matplotlib inline
%load_ext autoreload
%autoreload 2
import sys
sys.path.append("../")
import warnings
warnings.filterwarnings('ignore')
warnings.simplefilter('ignore')
from osc_cr_converter.utility.configuration import ConverterParams
from osc_cr_converter.converter.osc2cr import Osc2CrConverter
# ==== specify openscenario
scenario_path = '../scenarios/from_esmini/xosc/'
openscenario = 'pedestrian_collision.xosc'
# ==== build configuration
config = ConverterParams.load('../configurations/' + openscenario.replace('.xosc', '.yaml'))
# ==== initialize the converter
converter = Osc2CrConverter(config)
# ==== run conversion
scenario = converter.run_conversion(scenario_path + openscenario)
# ==== plot converted results
from osc_cr_converter.utility.visualization import visualize_scenario
visualize_scenario(scenario, config)