Add road network to driving scenario
Create an empty driving scenario.
scenario = drivingScenario;
Import an OpenDRIVE road network into the scenario.
filePath = fullfile(matlabroot,'examples','driving','intersection.xodr'); roadNetwork(scenario,'OpenDRIVE',filePath);
Plot the scenario and zoom in on the road network.
scenario— Driving scenario
Driving scenario, specified as a
scenario must contain no roads and no other
OpenDRIVE road network.
filePath— Path to valid OpenDRIVE file
Path to a valid OpenDRIVE file of type
.xodr, specified as a character vector or string
You can import only lanes and roads. The import of road objects and traffic signals is not supported.
OpenDRIVE files containing large road networks can take up to several minutes to load. Examples of large road networks include ones that model the roads of a city or ones with roads that are thousands of meters long.
Lanes with variable widths are not supported. The width is set to the highest width found within that lane. For example, if a lane has a width that varies from 2 meters to 4 meters, the function sets the lane width to 4 meters throughout.
Roads with multiple lane marking styles are not supported. The function
applies the first found marking style to all lanes in the road. For example, if
a road has
Solid lane markings,
the function applies
Dashed lane markings throughout.
Lane marking styles
Grass are not supported. Lanes with these marking styles
are imported as unmarked.
 Dupuis, Marius, et al. OpenDRIVE Format Specification. Revision 1.4, Issue H, Document No. VI2014.106. Bad Aibling, Germany: VIRES Simulationstechnologie GmbH, November 4, 2015.