roadNetwork
Add road network to driving scenario
Syntax
Description
OpenDRIVE
roadNetwork(
uses the name-value pair scenario
,'OpenDRIVE',filename
,'ShowLaneTypes',showLaneTypes
)'ShowLaneTypes'
to also import lane
type information from the file and display it in the driving scenario.
Note
As of R2021b, the ASAM OpenDRIVE import feature offers functional and visual improvements, as well as a few additional limitations.
You can now import roads with multiple lane specifications.
Imported roads show boundary lines that were not shown previously.
Road centers always appear in the middle of imported roads. Previously, some roads were showing road centers on the road edges.
Junctions are represented using a
RoadGroup
object that combines road segments within a junction. Previously, each road segment within a junction was represented separately. As a result, imported road networks now use a smaller number of roads.The road IDs, number of roads, junction IDs, and number of junctions in a driving scenario may not match those specified in the imported ASAM OpenDRIVE file.
HERE HD Live Map
OpenStreetMap
Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0)
roadNetwork(
imports roads from a Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0)
2
road network into a driving scenario. The function imports the
roads that are nearest to the latitude and longitude coordinates specified in
scenario
,'ZenrinJapanMap',lat
,lon
)lat
and lon
, respectively.
Importing roads from the Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) service requires Automated Driving Toolbox Importer for Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) Service.
Examples
Input Arguments
Limitations
OpenDRIVE Import Limitations
You can import only lanes, lane type information, and roads. The import of road objects and traffic signals is not supported.
ASAM 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.
When you import one-way roads with multiple lane specifications, the function supports only those segment taper positions that match the travel direction of lane. For example, the function supports importing only right taper position for the right lanes. Left or both types of taper position are not supported for right lanes.
Roads with lane type information specified as
driving
,border
,restricted
,shoulder
, andparking
are supported. Lanes with any other lane type information are imported as border lanes.Lane marking styles
Bott Dots
,Curbs
, andGrass
are not supported. Lanes with these marking styles are imported as unmarked.
HERE HD Live Map Import Limitations
Importing HERE HDLM roads with lanes of varying widths is not supported. In the generated road network, each lane is set to have the maximum width found along its entire length. Consider a HERE HDLM lane with a width that varies from 2 to 4 meters along its length. In the generated road network, the lane width is 4 meters along its entire length. This modification to road networks can sometimes cause roads to overlap in the driving scenario.
Some issues with the imported roads might be due to missing or inaccurate map data in the HERE HDLM service. For example, you might see black lines where roads and junctions meet. To check where the issue stems from in the map data, use the HERE HD Live Map Viewer to view the geometry of the HERE HDLM road network. This viewer requires a valid HERE license. For more details, see the HERE Technologies website.
OpenStreetMap Import Limitations
When importing OpenStreetMap data, road and lane features have these limitations:
To import complete lane-level information, the OpenStreetMap must contain the
lanes
andlanes:backward
tags. Based on the data in thelanes
andlanes:backward
tags, these lane specifications are imported:One-way roads are imported with the data in the
lanes
tag. These lanes are programmatically equivalent tolanespec
(lanes)
.Two-way roads are imported based on the data in both
lanes
andlanes:backward
tags. These lanes are programmatically equivalent tolanespec
([lanes:backward numLanesForward])
, wherenumLanesForward = lanes - lanes:backward
.For roads that are not one-way without
lanes:backward
tag specified, number of lanes in the backward direction are imported asuint64(lanes/2)
. These lanes are programmatically equivalent tolanespec
([uint64(lanes/2) numLanesForward])
, wherenumLanesForward = lanes - uint64(lanes/2)
.
If
lanes
andlanes:backward
are not present in the OpenStreetMap, then lane specifications are based only on the direction of travel specified in the OpenStreetMap road network, where:One-way roads are imported as single-lane roads with default lane specifications. These lanes are programmatically equivalent to
lanespec
(1)
.Two-way roads are imported as two-lane roads with bidirectional travel and default lane specifications. These lanes are programmatically equivalent to
lanespec
([1 1])
.
The table shows these differences in the OpenStreetMap road network and the road network in the imported driving scenario.
OpenStreetMap Road Network Imported Driving Scenario When importing OpenStreetMap road networks that specify elevation data, if elevation data is not specified for all roads being imported, then the generated road network might contain inaccuracies and some roads might overlap. To prevent overlapping, ways in the OpenStreetMap file must specify the vertical stacking relationship of overlapping roads using the
layer
tags.OpenStreetMap files containing large road networks can take a long time to load. In addition, these road networks can make some of the app options unusable. To avoid this limitation, import files that contain only an area of interest, typically smaller than 20 square kilometers.
The basemap used in the app can have slight differences from the map used in the OpenStreetMap service. Some imported road issues might also be due to missing or inaccurate map data in the OpenStreetMap service. To check whether the data is missing or inaccurate due to the map service, consider viewing the map data on an external map viewer.
Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) Import Limitations
When you import Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) data, the generated road network has these limitations. As a result of these limitations, the generated network might contain inaccuracies and the roads might overlap.
The generated road network uses road elevation data when the Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) provides it. Otherwise, the generated network uses terrain elevation data provided by the service.
When the Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) service provides information using a range, such as by specifying a road with two to three lanes or a road between 3–5.5 meters wide, the generated road network uses scalar values instead. Consider a Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) road that has two to three lanes. The generated road network has two lanes.
Lanes within roads in the generated network have a uniform width. Consider a road that is 4.25 meters wide with two lanes. In the generated road network, each lane is 2.125 meters wide.
Where possible, the generated road network uses road names provided by the Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) service. Otherwise, the generated road network uses default names, such as
Road1
andRoad2
.
Tips
If the roads that you import do not look as expected, consider importing them by using the Driving Scenario Designer app. The app can make the process of troubleshooting and correcting roads easier than trying to troubleshoot and correct them by using the
roadNetwork
function.
Version History
Introduced in R2018b
See Also
Apps
Objects
Functions
Topics
- Import ASAM OpenDRIVE Roads into Driving Scenario
- Import HERE HD Live Map Roads into Driving Scenario
- Import OpenStreetMap Data into Driving Scenario
- Import Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) into Driving Scenario
- Scenario Generation from Recorded Vehicle Data
- Export Driving Scenario to ASAM OpenSCENARIO File
- Export Driving Scenario to ASAM OpenDRIVE File
1 You need to enter into a separate agreement with HERE in order to gain access to the HDLM services and to get the required credentials (access_key_id and access_key_secret) for using the HERE Service.
2 To gain access to the Zenrin Japan Map API 3.0 (Itsumo NAVI API 3.0) service and get the required credentials (a client ID and secret key), you must enter into a separate agreement with ZENRIN DataCom CO., LTD.