-
API_main.m:
This function serves as the central entry point for creating and configuring OpenSCENARIO dynamics, integrating various components for automated vehicle simulations. It orchestrates the generation of required files, the setup of experiment parameters, and the customization of Simulink models for simulation purposes.this function Cleans up intermediate files and folders after execution. Inputs: nameEgo (Name of the ego vehicle in PreScan), nameExperiment (Name of the PreScan experiment) and nameExperimentTemplate (Template .xosc file name used to create or modify experiment scenarios.). Outputs: Simulink Model File(.slx Customizable Simulink model for vehicle simulation),Compiled Experiment File (.pex Experiment file for execution in PreScan),Protobuf File(.pb Intermediate experiment data)and Customized OpenSCENARIO files(.xosc Customized OpenSCENARIO files).
-
xml2struct.m:
Function which creates a structure from a XML type file. Inputs: XML file. Outputs: structure array.
-
struct2xml.m:
Function which creates a XML type file from a structure array. Inputs: structure array. Outputs: XML file.
-
slblocks.m:
Function to make a library visible in the Simulink Library Browser. Inputs: -. Outputs: -.
-
delete_files.m:
Function which deletes old files which do not have the OpenSCENARIO changes in them. Inputs: folder_name (the name of newly created folder), name_experiment (name of the Prescan experiment). Outputs: -.
-
initializeactors.m:
Function which calls parametersweepinitalPositions.m based on the object type. Inputs: Struct_OpenSCENARIO (structure made from .xosc file), Struct_pex (structure made from .pex file of the Prescan experiment) and name_ego(A string to assign a new name to the ego vehicle within the scenario). Outputs: Struct_OpenSCENARIO(Updated OpenSCENARIO structure with modified actor attributes and configurations), Struct_pex (Modified PreScan experiment structure reflecting the updated scenario settings) .
-
parametersweepinitalPositions.m:
Function which changed the initial positions of the actors in the .pex file. Inputs: Struct_OpenSCENARIO (structure made from .xosc file), Struct_pex (structure made from .pex file of the Prescan experiment), k (value dependent on the object type in Prescan), i (for loop index) . Outputs: Struct_pex (structure made from .pex file of the Prescan experiment).
-
parameter_sweep_vehicle.m:
Function which changes vehicle parameters (not used).
-
parameter_sweep_pedestrian.m:
Function which changes pedestrian parameters (not used).
-
parameter_sweep_bicycle.m:
Function which changes bicycle parameters (not used).
-
weatherconditions.m:
Function which changes the the weather conditions of the Prescan experiment. Inputs: Struct_OpenSCENARIO (structure made from .xosc file), Struct_pex (structure made from .pex file of the Prescan experiment). Outputs: Struct_pex .
-
trajectorydeclaring.m:
Function which creates a variable which contains all the trajectory information. Inputs: models (structure made from .pb file of the Prescan experiment), Struct_OpenSCENARIO (structure made from .xosc file). Outputs: trajectoryVariable (variable containing trajectory information).
-
initialvelocitydeclaring.m:
Function which creates a variable which contains all the initial velocity information. Inputs: models (structure made from .pb file of the Prescan experiment), Struct_OpenSCENARIO (structure made from .xosc file). Outputs: velocityVariable (variable containing initial velocity information).
-
trajectorycounter.m:
Function which creates two variable which contain the number of lateral and longitudinal trajectories. Inputs: models (structure made from .pb file of the Prescan experiment), Struct_OpenSCENARIO (structure made from .xosc file), trajectory_variable (variable containing trajectory information). Outputs: lateralEvents (number of lateral trajectories), longitudinalEvent (number of longitudinal trajectories).
-
simulinkego.m:
Function which adds the main ROS blocks to the ego vehicle in Simulink from the ROS_lib library, it also adjusts the constant R (rainfall rate, see Prescan manual p. 497). Inputs: nameSimulink (the name of the Simulink file in of the Prescan experiment), models (structure made from .pb file of the Prescan experiment), nameEgo (the name of the ego vehicle in Prescan), Structpex (structure made from .pex file of the Prescan experiment) and StructOpenScenario(structure made from.xosc file) . Outputs: -.
-
trajectorylabels.m:
Function which adds labels to SELF_Demux in Simulink per declared actor in the .xosc file. Inputs: velocityVariable (variable containing initial velocity information), models (structure made from .pb file of the Prescan experiment), name_simulink (the name of the Simulink file in of the Prescan experiment). Outputs: -.
-
initialvelocitydynamics.m:
Function which adds a constant velocity block in Dynamics_Empty in Simulink per declared actor in the .xosc file. Inputs: name(the name of the Simulink file in of the Prescan experiment), models (structure made from .pb file of the Prescan experiment), Struct_OpenSCENARIO (structure made from .xosc file), velocityVariable (variable containing initial velocity information). Outputs: -.
-
trajectoryDynamics.m:
Function which adds trajectories in Dynamics_Empty in Simulink per declared actor in the .xosc file. Inputs: name_simulink (the name of the Simulink file in of the Prescan experiment), models (structure made from .pb file of the Prescan experiment), Struct_OpenSCENARIO (structure made from .xosc file), trajectoryVariable (variable containing trajectory information), LateralEvents (number of lateral trajectories), LongitudinalEvents (number of longitudinal trajectories),nameEgo (the name of the ego vehicle in Prescan). Outputs: -.