%% Import OpenDRIVE Road with Multiple Lane Types into Driving Scenario
% Create an empty driving scenario.

scenario = drivingScenario;

% Import an OpenDRIVE road composed of driving and parking lanes into the scenario. By default, the function interprets the lane type information and imports the lanes into driving scenario without altering the lane type.

filePath = 'parking.xodr';  
roadNetwork(scenario,'OpenDRIVE',filePath);

% Plot the scenario.

plot(scenario)
zoom(2)
legend('Driving lane','Parking lane')

% Import the OpenDRIVE road into the scenario. Set the 'ShowLaneTypes' value to false to suppress multiple lane types. The function ignores the lane type information and imports all the lanes as driving lanes.

scenario = drivingScenario;
roadNetwork(scenario,'OpenDRIVE',filePath,'ShowLaneTypes',false);
plot(scenario)
zoom(2)

% Copyright 2019 The MathWorks, Inc.