This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Automatic Map Generation for Autonomous Driving System Testing

Yun Tang, Yuan Zhou, Kairui Yang, Ziyuan Zhong, Baishakhi Ray, Yang Liu, Ping Zhang, Junbo Chen Yun Tang, Yuan Zhou and Yang Liu are with Nanyang Technological University, Singapore 639798. Email: yun005@e.ntu.edu.sg, {y.zhou, yangliu}@ntu.edu.sgKairui Yang, Ping Zhang and Junbo Chen are with DAMO Academy, Alibaba Group, China. Email: kairui.ykr@alibaba-inc.com, zp.zp@cainiao.com, junbo.chenjb@taobao.com Ziyuan Zhong and Baishakhi Ray are with Columbia University, New York, NY, 10025. Email: ziyuan.zhong@columbia.edu, rayb@cs.columbia.edu
Abstract

High-definition (HD) maps are essential in testing autonomous driving systems (ADSs). HD maps essentially determine the potential diversity of the testing scenarios. However, the current HD maps suffer from two main limitations: lack of junction diversity in the publicly available HD maps and cost-consuming to build a new HD map. Hence, in this paper, we propose the first method, Feat2Map, to automatically generate concise HD maps with scenario diversity guarantees. Feat2Map focuses on junctions as they significantly influence scenario diversity, especially in urban road networks. Feat2Map first defines a set of features to characterize junctions. Then, Feat2Map extracts and samples concrete junction features from a list of input HD maps or user-defined requirements. Each junction feature generates a junction. Finally, Feat2Map builds a map by connecting the junctions in a grid layout. To demonstrate the effectiveness of Feat2Map, we conduct experiments with the public HD maps from SVL and the open-source ADS Apollo. The results show that Feat2Map can (1) generate new maps of reduced size while maintaining scenario diversity in terms of the code coverage and motion states of the ADS under test, and (2) generate new maps of increased scenario diversity by merging intersection features from multiple maps or taking user inputs.

I Introduction

Autonomous driving systems (ADSs) have gained enormous attention and development recently. Safety is the public’s primary concern for the mass deployment of ADSs. According to ISO/PAS 21448 [1], SOTIF (Safety Of The Intended Functionality) is the key for ADS safety. However, due to the enormous number of parameter combinations to specify test scenarios, it is still a challenge to validate the SOTIF of ADSs, which aims to reduce the region of unknown and unsafe scenarios.

Among the existing methods for the validation of SOTIF, simulation-based ADS testing is a major approach to discovering unknown and unsafe scenarios for ADSs [2]. In the simulation environment, we can model different elements for an autonomous vehicle, such as HD (High-Definition) maps (e.g., road network, traffic signs, and traffic lights), vehicle dynamics, and sensors (e.g., camera, LiDAR, radar). Among all the elements, HD maps are prerequisites for ADS testing, and they essentially determine the potential diversity of the testing scenarios, directly impacting the testing efficiency. For example, Gambi et al. demonstrated that many lane departure failures have manifested on different shapes of roads [3]. Tang et al. showed that by exploiting the topology features of junctions in HD maps, diverse testing scenarios could be generated, and different issues related to SOTIF were exposed in the Apollo ADS [4, 5, 6].

Despite the importance of HD maps, there are some limitations of the publicly available HD maps during ADS testing. First, the commercial HD maps, such as those provided by [7, 8] are replicas of the real world and contain a significant amount of duplicate map elements (e.g., junctions with similar shapes). Thus, scenarios from such HD maps may lack diversity. Second, although the open-source simulators, such as Carla [9] and SVL [10], often come with some built-in HD maps, they are relatively small with a limited number of junctions and roads. Consequently, the diversity of scenarios generated from these maps is limited. Third, different cities or regions may contain different junction structures. Hence, to test ADSs sufficiently, we need different HD maps from different areas and perform ADS testing within each map. It is time-consuming. Fourth, manually building diverse HD maps using tools, such as SUMO netedit [11] or CommonRoad Scenario Editor [12], is laborious, given a large number of scenario requirements. Therefore, it is essential to develop a framework to generate concise but scenario-diverse HD maps automatically.

However, there is little work on automatic HD map generation. Gambi et al. [3] proposed a search-based approach to generate lanes of changing curvatures to test the lane-keeping functionality. However, other traffic elements, such as intersections and traffic controls, are not considered. Thus, the map generated is incomplete, and the scenarios are limited. Mi et al. [13] used a trained hierarchical graph generation model to generate the road network graphs. The model is trained with existing HD maps and tries to generate maps similar to its training data. As a result, it suffers from the same aforementioned limitations (e.g., limited scenario diversity and duplicated intersections) as the training data (i.e., existing HD maps).

In this paper, we propose the first feature-based method, Feat2Map, to generate scenario-diverse HD maps automatically based on junction features as junctions significantly affect scenario diversity, especially in urban road networks [4, 5, 6]. First, we define a feature vector to characterize junctions, including the number of roads connected by a junction, orientations of the connected roads, traffic controls, and crosswalk features. Second, Feat2Map extracts all possible values of each feature element from a set of maps or users’ inputs. Third, Feat2Map applies combinatorial sampling to generate a minimal set of concrete feature vectors without duplication while covering all possible feature combinations. Finally, Feat2Map builds a junction per concrete feature vector and constructs a complete HD map with connected junctions in a grid layout. To demonstrate the effectiveness of Feat2Map, we generated several HD maps from single and multiple input maps and performed qualitative and quantitative analysis by performing route coverage testing [4] on the latest open-source ADS Apollo 7.0 [14]. The results show that (1) Feat2Map can effectively extract features from an input map and generate concise HD maps while preserving scenario diversity; (2) Feat2Map can generate HD maps based on combined features from multiple input maps with higher perceived scenario diversity by the ADS-under-test than individual input map; and (3) Feat2Map can generate customized HD maps from user input.

II Preliminaries and Problem Statement

Refer to caption
Figure 1: A two-junction traffic network.

HD map is one of the essential components for modern ADSs, especially in city-driving scenarios. It encodes the semantic features (e.g., topology and geometry) of traffic network elements such as traffic lanes, roads, intersections, traffic lights, crosswalks, and stop signs [15]. Fig. 1 shows a diagram of an HD map containing a two-junction traffic network. There are six two-way roads (R0R5R_{0}-R_{5}) in the diagram. Each road (e.g., R0R_{0}) contains a forward lane (e.g., L2L_{2} in R0R_{0}) and a backward lane (e.g., L1L_{1} in R0R_{0}). R0R3R_{0}-R_{3} form a traffic light-controlled junction J0J_{0}, and R3R5R_{3}-R_{5} construct a stop sign-controlled junction J1J_{1}. Lanes are the atomic element in an HD map, and each lane is represented by its center reference line. Lanes in an HD map can be classified into road lanes (e.g., L1L12L_{1}-L_{12} in Fig. 1) and junction lanes (e.g., L13L30L_{13}-L_{30} in Fig. 1).

Given an HD map, ADS testing aims to guarantee that the autonomous vehicle can run safely at any part of the map under any scenario. However, an HD map from part of a city or a limited area usually contains limited intersection structures. Consequently, we cannot test an ADS sufficiently on such a map. Hence, in this paper, we aim at generating an HD map automatically by eliminating duplicated intersections while maximizing the diversity of intersection structures and potential scenarios.

Before illustrating the generation method in detail, we first discuss some assumptions in the paper. (1) We currently focus on the intersections of a map, as intersections can significantly affect the map complexity and scenarios diversity. In the future, we will take roads into consideration. (2) An ADS can be roughly divided into the perception and the planning components. We mainly focus on generating maps for testing the planning component. Testing of AI models in the perception component is orthogonal to our work.

III Methodology

III-A Modeling of Lanes

Based on [16], lanes can be represented by their center reference paths. We model these reference paths using cubic Bézier curves, which are extensively used in computer graphics [17]. Given four control points P0P_{0}, P1P_{1}, P2P_{2} and P3P_{3}, the cubic Bézier curves can be formulated as:

B(t)=i=03(3i)(1t)3itiPiB(t)=\sum_{i=0}^{3}\binom{3}{i}(1-t)^{3-i}t^{i}P_{i} (1)

where t[0,1]t\in[0,1], and (3i)\binom{3}{i} are the binomial coefficients. Cubic Bézier curves are powerful in representing simple curves such as straight lines, circle-shaped or S-shaped, and can be combined into Bézier splines of complex shapes. For any path (e.g. reference path or boundary curve of a lane), if the start point PstartP_{start}, start heading θ0\theta_{0}, end point PendP_{end}, and end heading θ1\theta_{1} are known, the controls points can be calculated as:

P0=PstartP1=Pstart+(d0cosθ0,d0sinθ0)P2=Pend(d1cosθ1,d1sinθ1)P3=Pend\begin{split}P_{0}&=P_{start}\\ P_{1}&=P_{start}+(d_{0}\cos\theta_{0},d_{0}\sin\theta_{0})\\ P_{2}&=P_{end}-(d_{1}\cos\theta_{1},d_{1}\sin\theta_{1})\\ P_{3}&=P_{end}\end{split} (2)

where both d0d_{0} and d1d_{1} are heuristically defined as half of the distance between P0P_{0} and P3P_{3} for a smoother curve.

III-B Feature Modeling of Junctions

In the section, we define the junction features to characterize a junction, containing the road feature, the rotation feature, the control feature, and the crosswalk feature.

First, the road feature aims to describe the number of roads connected by a junction, such as T-junctions and n-legged intersections. The more connected roads, the more complex the junction becomes, resulting in more testing efforts for ADSs. Hence, the road feature of a junction JjJ_{j}, denoted as FJjroadF_{J_{j}}^{road}, is defined as the number of roads connected by a junction. For example, the junction J0J_{0} shown in Fig. 1 connects four roads, so FJ0road=4F_{J_{0}}^{road}=4, while FJ1road=3F_{J_{1}}^{road}=3.

Second, the rotation feature aims to model the relative orientations of the roads connected by a junction. It indicates the relative directions an autonomous vehicle can drive after entering the junction. Given a junction JjJ_{j}, suppose its center is CC, which is calculated as the geometry center of its bounding polygon, and the corresponding start point of road RiR_{i} is PiP_{i}, which is the connecting endpoint of RiR_{i}’s reference line to the junction. The vector \vvCPi\vv{CP_{i}} is called road socket of RiR_{i}. Hence, the relative location of RiR_{i} and RkR_{k} can be measured by the angle between \vvCPi\vv{CP_{i}} and \vvCPk\vv{CP_{k}}. Hence, the rotation feature is a vector of angles, each describing the angle from one road socket to its adjacent one in counter-clockwise order. Given a junction FjF_{j}, its rotation feature is denoted as FJjrot=[γ1,γ2,,γN]F_{J_{j}}^{rot}=[\gamma_{1},\gamma_{2},\ldots,\gamma_{N}], where N=FJjroadN=F_{J_{j}}^{road} and i=0Nγi=2π\sum_{i=0}^{N}\gamma_{i}=2\pi.

Given such a rotation feature, we can generate various junctions by rotating the original junction around its center. Hence, we may first perform rotation normalization, i.e., rotating each junction such that it aligns to the four regular directions, i.e., East, North, West, and South, as much as possible. The rotation normalization process can be described as follows. Suppose the rotation feature of a junction JjJ_{j} is [γ1,γ2,,γN][\gamma_{1},\gamma_{2},\ldots,\gamma_{N}], where N=FJjroadN=F_{J_{j}}^{road}. We first rotate and re-index the road sockets and the angles such that γ1\gamma_{1} is the maximal one. After rotation normalization, the angle from the East direction to CP1CP_{1} is αopt\alpha_{opt}. Then, αopt\alpha_{opt} can be the optimal solution by solving the following optimization problem:

minαi=1Nm=14signi,mβi,m2\displaystyle\min_{\alpha}\sum_{i=1}^{N}\sum_{m=1}^{4}sign_{i,m}\beta_{i,m}^{2} (3)
s.t. m\displaystyle\text{s.t. }\forall m {1,2,3,4},i{2,,N},\displaystyle\in\{1,2,3,4\},i\in\{2,\ldots,N\}, (4)
signi,m{0,1},\displaystyle sign_{i,m}\in\{0,1\}, (5)
β1,m=α(m1)π/2,\displaystyle\beta_{1,m}=\alpha-(m-1)\pi/2, (6)
βi,m=α+k=1i1γk(m1)π/2,\displaystyle\beta_{i,m}=\alpha+\sum_{k=1}^{i-1}\gamma_{k}-(m-1)\pi/2, (7)
m=14signi,m=1.\displaystyle\sum_{m=1}^{4}sign_{i,m}=1. (8)

were βi,1\beta_{i,1} (resp., βi,2\beta_{i,2}, βi,3\beta_{i,3}, and βi,4\beta_{i,4}) is the angle from East (resp., North, West, South) to \vvCPi\vv{CP_{i}}. Thus, the rotation feature can be represented by the angles from the East direction to the road sockets, i.e., FJjrot=[α1,α2,,αN]F_{J_{j}}^{rot}=[\alpha_{1},\alpha_{2},\ldots,\alpha_{N}], where αi=βi,1\alpha_{i}=\beta_{i,1} is computed by Eqns. 6 and 7 with α=αopt\alpha=\alpha^{opt}. With the normalized rotation feature, the corresponding road sockets are uniquely determined. For example, as shown in Fig. 2, suppose after rotation normalization, αopt=α1\alpha^{opt}=\alpha_{1}, then we have the rotation feature FJjrot=[α1,α1+γ1,α1+γ1+γ2]F_{J_{j}}^{rot}=[\alpha_{1},\alpha_{1}+\gamma_{1},\alpha_{1}+\gamma_{1}+\gamma_{2}].

Refer to caption
Figure 2: Junction rotation normalization.

Third, the control feature designates how the traffic is regulated in a junction. Commonly, there exist three kinds of control manners, i.e., barebare: no controls, signalsignal: controlled by traffic lights, and stopstop: controlled by stop signs. Hence, the control feature can be defined as FJjctrl{bare,signal,stop}F_{J_{j}}^{ctrl}\in\{bare,signal,stop\}. For example, in Fig. 1, FJ0ctrl=signalF_{J_{0}}^{ctrl}=signal and FJ1ctrl=stopF_{J_{1}}^{ctrl}=stop.

Finally, the crosswalk feature, denoted as FJjxwlkF_{J_{j}}^{xwlk}, indicates whether there are crosswalks in a junction. Hence, FJjxwlk{True,False}F_{J_{j}}^{xwlk}\in\{True,False\}.

Therefore, we have the following definition.

Definition 1

The junction feature of a junction JjJ_{j}, denoted as Jj\mathcal{F}_{J_{j}}, is a vector defined as:

Jj=[FJjroad,FJjrot,FJjctrl,FJjxwlk],\mathcal{F}_{J_{j}}=[F^{road}_{J_{j}},F^{rot}_{J_{j}},F^{ctrl}_{J_{j}},F^{xwlk}_{J_{j}}], (9)

where FJjroad3={3,4,}F^{road}_{J_{j}}\in\mathbb{N}_{\geq 3}=\{3,4,\ldots\} and FJjroti=1FJjroad[0,2π)F^{rot}_{J_{j}}\in\prod_{i=1}^{F^{road}_{J_{j}}}[0,2\pi) is a vector of length FJjroadF^{road}_{J_{j}}.

III-C Extraction of Feature Vectors

According to Definition 1, we describe how to extract the features from a set of HD maps.

First, since the road, the control, and the crosswalk features are discrete variables, we can obtain all their values by checking the junctions in each map. Therefore, the sets of all possible values of the three features of a given map are denoted as road\mathcal{F}^{road}, ctrl\mathcal{F}^{ctrl}, and xwlk\mathcal{F}^{xwlk}, respectively.

Second, as the rotation feature contains continuous variables, we collect from the HD maps the minimal and the maximal values of each element in the rotation feature. Note that the rotation features from the junctions with the same road feature can be compared element-wisely after rotation normalization. Hence, the collected rotation feature for the junctions with nn connected roads can be described as:

nrot=[[α1min,α1max],,[αnmin,αnmax]],\mathcal{F}_{n}^{rot}=[[\alpha_{1}^{\min},\alpha_{1}^{\max}],\ldots,[\alpha_{n}^{\min},\alpha_{n}^{\max}]], (10)

where αimin=minJj𝒥nFJjrot[i]\alpha_{i}^{\min}=\min\limits_{J_{j}\in\mathcal{J}^{n}}F_{J_{j}}^{rot}[i], αimax=maxJj𝒥nFJjrot[i]\alpha_{i}^{\max}=\max\limits_{J_{j}\in\mathcal{J}^{n}}F_{J_{j}}^{rot}[i], 𝒥n={Jj:FJjroad=n}\mathcal{J}^{n}=\{J_{j}:F_{J_{j}}^{road}=n\}, and FJjrot[i]=αiF_{J_{j}}^{rot}[i]=\alpha_{i} with FJjrot=[α1,,αn]F_{J_{j}}^{rot}=[\alpha_{1},\ldots,\alpha_{n}].

Hence, the map feature of a set of maps is described as =nroadnrot×ctrl×xwlk\mathcal{F}=\bigcup_{n\in\mathcal{F}^{road}}\mathcal{F}_{n}^{rot}\times\mathcal{F}^{ctrl}\times\mathcal{F}^{xwlk}.

III-D Map Construction Based on Feature Vectors

During the map construction with the junctions generated by the feature vectors, we need to ensure 1) all junctions are connected, 2) the generated map emulates urban road networks, and 3) no road or junction overlaps, which makes the construction process challenging. In this paper, we propose a greedy method to construct a grid-layout map iteratively. The details are shown in Algorithm 1.

1
Input: The set of junction features: =nroadnrot×ctrl×xwlk\mathcal{F}=\bigcup_{n\in\mathcal{F}^{road}}\mathcal{F}_{n}^{rot}\times\mathcal{F}^{ctrl}\times\mathcal{F}^{xwlk}.
Output: A new map c\mathcal{M}_{c}.
2
3Initialize the map c=\mathcal{M}_{c}=\emptyset, the sets of empty grid points 𝒫e={P0,0}\mathcal{P}_{e}=\{P_{0,0}\} and filled grid points 𝒫f=\mathcal{P}_{f}=\emptyset, an empty junction feature set 𝒥=\mathcal{J}=\emptyset;
4j=0j=0;
5for nroadn\in\mathcal{F}^{road} do
6       for controlctrlcontrol\in\mathcal{F}^{ctrl} do
7             for crosswalkxwlkcrosswalk\in\mathcal{F}^{xwlk} do
8                   FJjroad=nF^{road}_{J_{j}}=n;
9                  FJjrot=[αi:αi𝒰[nrot[i][0],nrot[i][1]]],i{1,,n}F_{J_{j}}^{rot}=[\alpha_{i}:\alpha_{i}\in\mathcal{U}_{[\mathcal{F}_{n}^{rot}[i][0],\mathcal{F}_{n}^{rot}[i][1]]}],\forall i\in\{1,...,n\};
10                  FJjctrl=controlF_{J_{j}}^{ctrl}=control;
11                  FJjxwlk=crosswalkF_{J_{j}}^{xwlk}=crosswalk;
12                  Jj=[FJjroad,FJjrot,FJjctrl,FJjxwlk]\mathcal{F}_{J_{j}}=[F^{road}_{J_{j}},F_{J_{j}}^{rot},F_{J_{j}}^{ctrl},F_{J_{j}}^{xwlk}];
13                  𝒥=𝒥{Jj}\mathcal{J}=\mathcal{J}\cup\{\mathcal{F}_{J_{j}}\}, j=j+1j=j+1;
14            
15      
16
17while 𝒥\mathcal{J}\neq\emptyset do
18       Select a junction feature Jj\mathcal{F}_{J_{j}} and 𝒥=𝒥{Jj}\mathcal{J}=\mathcal{J}\setminus\{\mathcal{F}_{J_{j}}\};
19      Find Jj\mathcal{F}_{J_{j}}’s best match grid point in 𝒫e\mathcal{P}_{e}, say Px,yP_{x,y};
20      c=c{(Px,y,Jj)}\mathcal{M}_{c}=\mathcal{M}_{c}\cup\{(P_{x,y},\mathcal{F}_{J_{j}})\};
21      𝒫e=𝒫e{Px,y}\mathcal{P}_{e}=\mathcal{P}_{e}\setminus\{P_{x,y}\}, 𝒫f=𝒫f{Px,y}\mathcal{P}_{f}=\mathcal{P}_{f}\cup\{P_{x,y}\};
22      if Px+1,y𝒫e𝒫fP_{x+1,y}\not\in\mathcal{P}_{e}\cup\mathcal{P}_{f} then
23             𝒫e=𝒫e{Px+1,y}\mathcal{P}_{e}=\mathcal{P}_{e}\cup\{P_{x+1,y}\};
24      if Px,y+1𝒫e𝒫fP_{x,y+1}\not\in\mathcal{P}_{e}\cup\mathcal{P}_{f} then
25             𝒫e=𝒫e{Px,y+1}\mathcal{P}_{e}=\mathcal{P}_{e}\cup\{P_{x,y+1}\};
26      if Px1,y𝒫e𝒫fP_{x-1,y}\not\in\mathcal{P}_{e}\cup\mathcal{P}_{f} then
27             𝒫e=𝒫e{Px1,y}\mathcal{P}_{e}=\mathcal{P}_{e}\cup\{P_{x-1,y}\};
28      if Px,y1𝒫e𝒫fP_{x,y-1}\not\in\mathcal{P}_{e}\cup\mathcal{P}_{f} then
29             𝒫e=𝒫e{Px,y1}\mathcal{P}_{e}=\mathcal{P}_{e}\cup\{P_{x,y-1}\};
30      
return c\mathcal{M}_{c}.
Algorithm 1 Feature-based HD Map Generation

Given a set of HD maps \mathcal{M}, by checking all junctions of the maps, we can extract the features road\mathcal{F}^{road}, {nrot:nroad}\{\mathcal{F}_{n}^{rot}:n\in\mathcal{F}^{road}\}, ctrl\mathcal{F}^{ctrl}, and xwlk\mathcal{F}^{xwlk}. Before constructing the map, we initialize a grid point container 𝒫e={P0,0}\mathcal{P}_{e}=\{P_{0,0}\} for holding empty points, another grid point container 𝒫f=\mathcal{P}_{f}=\emptyset for filled points and a set 𝒥=\mathcal{J}=\emptyset for storing sampled junction features (Line 1). For each vector [FJjroad,FJjctrl,FJjxwlk][F^{road}_{J_{j}},F_{J_{j}}^{ctrl},F_{J_{j}}^{xwlk}] in road×ctrl×xwlk\mathcal{F}^{road}\times\mathcal{F}^{ctrl}\times\mathcal{F}^{xwlk}, we perform multivariate uniform sampling in the region i=1n[nrot[i][0],nrot[i][1]]\prod_{i=1}^{n}[\mathcal{F}_{n}^{rot}[i][0],\mathcal{F}_{n}^{rot}[i][1]] to generate a junction feature Jj=[FJjroad,FJjrot,FJjctrl,FJjxwlk]\mathcal{F}_{J_{j}}=[F^{road}_{J_{j}},F_{J_{j}}^{rot},F_{J_{j}}^{ctrl},F_{J_{j}}^{xwlk}] (Lines 1 - 1). The sampled junction features are stored in 𝒥\mathcal{J} (Line 1), each of which will be used to instantiate an individual junction in the grid layout.

Next, for each junction feature 𝒥j\mathcal{J}_{j}, we search for the empty grid points in 𝒫e\mathcal{P}_{e} to select the grid point Px,yP_{x,y} of the highest matching score with 𝒥j\mathcal{J}_{j}. The matching score is heuristically calculated in the following way:

Let kk be the maximal number of roads that JjJ_{j} at Px,yP_{x,y} can connect after proper rotation with the surrounding junctions (if available) at Px+1,yP_{x+1,y}, Px,y+1P_{x,y+1}, Px1,yP_{x-1,y}, and Px,y1P_{x,y-1}. If FJjroad>kF^{road}_{J_{j}}>k, then the feature and the point does not match and the score is set to -\infty. Otherwise, the score is set to kk. Random selection is performed when a draw occurs.

After the grid point, say Px,yP_{x,y}, is selected for Jj\mathcal{F}_{J_{j}}, and the corresponding junction is instantiated at Px,yP_{x,y} (Line 1-1). The junction feature is removed from the feature set (Line 1) and the grid is extended in the four regular directions (i.e., East, North, West, and South) from Px,yP_{x,y}, free for new junction assignments (Line 1-1). After all the junctions are instantiated, the roads connecting junctions at neighboring grid points can be constructed via road socket vectors (controlled by FrotF^{rot}). The start point (resp. end point) of road lanes can then be obtained by shifting the start point (resp. end point) of the road’s reference path along the perpendicular direction of the start heading (resp. end heading) of the road. After the road lanes are built, the junction lanes can be added by connecting the incoming and outgoing lanes of the junction. Next, traffic controls and crosswalks are created at appropriate locations. Lastly, we can output the HD map files based on c\mathcal{M}_{c}.

Note that to make the generated HD map as concise as possible while preserving potential scenario diversity, we set the following default configurations for Feat2Map:

  • Given two junctions with the same junction feature, but one contains a one-way road while the other contains only two-way roads, any testing scenario generated from the former can also be generated from the latter one. Hence, all roads are two-way to keep the generated map concise.

  • To minimize the number of junctions in the generated map, we assume that all roads are fully connected at junctions. It means there exists at least one navigation path (i.e., junction lane) connecting each road pair.

  • The crosswalks are instantiated within the range of junctions and only overlap with junction lanes instead of road lanes. The signals are placed in front of the road it controls (facing the road), and the stop signs are placed on the right side of the road (facing the road).

  • The default grid-gap is 100 meters (e.g., Px+1,yP_{x+1,y} is 100 meters to the east of Px,yP_{x,y}, lane width is 3.5 meters (default value of selected input maps), and crosswalk width is 4.5 meters (slightly longer than a regular sedan).

IV Experiments

TABLE I: Features extracted from San Francisco map
road\mathcal{F}^{road} ctrl\mathcal{F}^{ctrl} xwlk\mathcal{F}^{xwlk} 3rot\mathcal{F}^{rot}_{3} 4rot\mathcal{F}^{rot}_{4}
{3, 4}
{signal\{signal,
stop}stop\}
{True\{True,
False}False\}
[[-22.62,9.81],
[61.40, 126.22],
[-143.45, 200.92]]
[[-5.26, 13.61],
[-75.63, 93.10],
[-176.85, 191.76],
[-109.24, -87.91]]
Refer to caption
(a) Input map.
Refer to caption
(b) M1M_{1}
Refer to caption
(c) M2M_{2}
Refer to caption
(d) M3M_{3}
Figure 3: (a) The input SanFranciscoSanFrancisco map; (b)–(d) three generated HD maps M1M_{1}, M2M_{2}, and M3M_{3}.

We conduct comprehensive experiments in this section to answer the following research questions.

RQ1: Can Feat2Map generate complete HD maps connecting all the intersections from sampled features correctly?

RQ2: Can Feat2Map take a single input map and generate concise maps of the same level of scenario diversity as the input?

RQ3: Can Feat2Map take multiple input maps and generate concise maps of equal or greater scenario diversity than individual input?

RQ4: Can Feat2Map take user-specified features and generate customized maps?

Refer to caption
(a) J0J_{0}
Refer to caption
(b) J1J_{1}
Refer to caption
(c) J2J_{2}
Refer to caption
(d) J3J_{3}
Refer to caption
(e) J4J_{4}
Refer to caption
(f) J5J_{5}
Refer to caption
(g) J6J_{6}
Refer to caption
(h) J7J_{7}
Figure 4: The detailed junctions of the map in Fig. 3(b).

IV-A Experimental Settings

To demonstrate the effectiveness of Feat2Map, we implement a prototype of Feat2Map and conduct experiments on the latest Apollo 7.0 [14] stack with three of the largest HD maps available for Apollo, i.e., SanFranciscoSanFrancisco [18], GoMentumGoMentum [19] and ShalunShalun [20]. We define two metrics to measure scenario diversity. The first one is line coverage, which describes how many statements in the ADS have been executed by the scenarios. Two scenarios are considered different if they cover different statements. The other one is behavior coverage, which describes different behavior transitions during the execution of a scenario.

To answer RQ1, we run Feat2Map on SanFranciscoSanFrancisco and perform qualitative analysis on three generated maps M13M_{1-3}. To answer RQ2, we conduct quantitative analysis by comparing the coverage results on SanFranciscoSanFrancisco and M13M_{1-3}. To answer RQ3, we generate a new map M4M_{4} from SanFranciscoSanFrancisco [18], GoMentumGoMentum [19] and ShalunShalun [20] and conduct the same experiments as in RQ2. To answer RQ4, we illustrate the construction of customized maps from manual features.

All the experiments are conducted on a desktop computer (with i7-6850K CPU, 64GB RAM, and GTX 1080T Ti). When an HD map is generated, Dreamview (Apollo’s full-stack HMI service) [21] is restarted to load the new map. We run the route coverage testing [4] in Apollo’s built-in sim-control mode [22], which does not require any third-party simulators such as SVL [10]. The input of the planning component is published using simulated dummy data. Specifically, sim-control publishes the results of localizationlocalization, chassischassis, and predictionprediction, while our testing script submits routingrequestsrouting\ requests and publishes trafficlighttraffic\ light information at runtime.

IV-B RQ1: Qualitative Analysis on Map Generation

San Francisco map contains 91 junctions (including 88 signal-controlled and three stop-sign controlled), 164 roads, and 1524 lanes (including 868 junction lanes and 656 road lanes); there are 13 junctions with crosswalks.

Due to randomness in the rotation sampling of road socket vectors, the extracted feature set \mathcal{F} can generate unlimited HD maps. Fig. 3 presents the bird-view of the input map SanFranciscoSanFrancisco and three generated HD maps M1M_{1}, M2M_{2} and M3M_{3} based on extracted features listed in Table I. We can find that the number of junctions is reduced to 8 in M13M_{1-3} from 91 in SanFranciscoSanFrancisco.

Take M1M_{1} in Fig. 3(b) for example. According to Algorithm 1 given in Section III-D, Feat2Map generates 8 junctions, as shown in Fig. 4. Junction J0J_{0}, J4J_{4}, J5J_{5}, and J7J_{7} are three-legged T-junctions and the rest are four-legged intersections. Junction J0J_{0}, J3J_{3}, J5J_{5}, and J6J_{6} are signal-controlled while the rest are stop-sign controlled. Junction J2J_{2}, J5J_{5}, J6J_{6}, and J7J_{7} have crosswalks instantiated at all the connected roads while the rest have no crosswalks. From Fig. 4, we can see that Feat2Map can generate junctions with different topological and geometrical features and instantiate traffic controls and crosswalks correctly.

Refer to caption
(a) Code coverage.
Refer to caption
(b) Stage transition.
Figure 5: Comparison of code coverage and stage transitions of Apollo running on SanFranciscoSanFrancisco map and the three generated maps.

IV-C RQ2: Quantitative Analysis of Scenario Diversity

To collect the line coverage, we instrument Apollo’s planning component during compilation using the coverage command [23] provided by its build tool Bazel [24] as the scenario handling mechanisms are implemented in the planning component. Fig. 5 shows the coverage results of our experiments on the four maps in Fig. 3. Fig. 5(a) shows the accumulated code coverage results on different maps. The accumulated lines covered eventually are 8275 (SanFranciscoSanFrancisco), 8232 (M1M_{1}), 8205 (M2M_{2}) and 8238 (M3M_{3}) respectively. As we can see, SanFranciscoSanFrancisco has many junctions covering the same lines of code (highlighted in light blue), resulting in a significant amount of duplicated test cases. On the other hand, unique lines of code get covered in every junction in M13M_{1-3}. It only takes eight junctions in M13M_{1-3} to reach a similar level of code coverage. Notice that SanFranciscoSanFrancisco has slightly higher code coverage than M13M_{1-3}. Based on the source code-level investigation, the uniquely covered codes in SanFranciscoSanFrancisco are related to human errors in the HD map file (e.g., the id of some crosswalk elements are missing). Such human errors do not exist in maps generated by Feat2Map automatically. Besides the map error, we also discovered some potential issues of the planning component (reported at [25, 26]). Such issues, encountered in different situations (e.g., on roads or inside junctions), trigger different error handling mechanisms implemented in the planning component. This is the main reason for the slight difference in the line coverage results of M13M_{1-3}.

Refer to caption
Figure 6: Scenarios and stage transitions covered in SanFranciscoSanFrancisco and M13M_{1-3}.

Apollo implements its planning component as a modularized state machine, where states align with common traffic scenarios such as intersection cruising, emergency stops, etc. and publishes its internal scenario selections (e.g., LaneFollow and TrafficLightProtected) and stage transitions (e.g. Approach and IntersectionCruise) within each scenario.

The coverage results of the stage transitions are shown in Fig. 5(b). From the results, we can find that many junctions belong to the same scenario in Apollo’s view of point. As a result, the same strategies are applied by Apollo to navigate through them (highlighted in light blue as well). On the other hand, the eight junctions in M13M_{1-3} reach the same level of coverage as that of 91 junctions in the SanFranciscoSanFrancisco map. Specifically, there are 16 scenario types defined in Apollo [27], out of which five scenarios and their stages are relevant to the experiments [28]:

  • Lane Follow

  • Stop Sign Unprotected

  • Traffic Light Protected

  • Traffic Light Unprotected Left Turn

  • Traffic Light Unprotected Right Turn

The relevant scenarios and their stage transitions are plotted in Fig. 6, where the nodes represent the stages and arrows are possible transitions. The stages and transitions covered by SanFranciscoSanFrancisco and M13M_{1-3} are the same and highlighted in orange, while the uncovered stages are rendered grey.

The four paths covered are:

  • LFS_PSS_SS_CS_ILFLF\rightarrow S\_PS\rightarrow S\_S\rightarrow S\_C\rightarrow S\_I\rightarrow LF

  • LFT_AT_CLFLF\rightarrow T\_A\rightarrow T\_C\rightarrow LF

  • LFL_AL_ILFLF\rightarrow L\_A\rightarrow L\_I\rightarrow LF

  • LFL_AL_CL_ILFLF\rightarrow L\_A\rightarrow L\_C\rightarrow L\_I\rightarrow LF

The stage transitions align with our testing setup, starting and ending at road lanes (i.e., LFLF). The covered scenarios also match with the features of the generated junctions. One may notice that the right turn-related scenarios are not covered. This is because Apollo only enters the right turn scenario when the ADS is turning right under the red traffic light. When the traffic light is green, which is always the case during our simcontrolsim-control simulation, Apollo treats right turning the same as driving straight across the junction (i.e., T_AT\_A and T_CT\_C).

IV-D RQ3: Map Generation From Multiple Maps

We generate map M4M_{4} with multiple input maps, i.e., SanFranciscoSanFrancisco, GoMentumGoMentum, and ShalunShalun. The experiment results are listed in Table II. The features extracted from ShalunShalun are not much different from SanFranciscoSanFrancisco. However, due to the existence of the bare junctions (i.e., no controls) in GoMentumGoMentum, the merged control feature is ctrl={signal,stop,bare}\mathcal{F}^{ctrl}=\{signal,stop,bare\}, which results in 12 junctions to be generated in M4M_{4}. The code coverage of M4M_{4} is similar to those of M13M_{1-3}. We find that Apollo 7.0 treats bare junctions as normal roads, hence no significant difference in the code coverage. However, a new path consisting of only one stage LFLF (i.e., no junction scenarios are triggered) is covered because of the existence of bare junctions.

In summary, experiments with single and multiple input maps have demonstrated the effectiveness of Feat2Map in feature-based map generation.

Refer to caption
(a) Mega junction
Refer to caption
(b) Road circle
Refer to caption
(c) One-way roads
Figure 7: Junctions generated with manually defined junction features.
TABLE II: Multiple input map generation
Discrete Features Rotation Features Code Stage
road={3,4}\mathcal{F}^{road}=\{3,4\}
ctrl=\mathcal{F}^{ctrl}=
{signal,stop,bare}\{signal,stop,bare\}
xwlk={True,False}\mathcal{F}^{xwlk}=\{True,False\}
3rot=\mathcal{F}^{rot}_{3}=
[[-23.58, 28.03],
[61.4, 127.39],
[140.41, 213.36]]
4rot=\mathcal{F}^{rot}_{4}=
[[-7.49, 13.61],
[60.46, 134.06],
[142.18, 214.47],
[-109.24, -69.95]]
8236
4 paths
covered
in previous
section
+
LFLF

IV-E RQ4: Map Generation from User-Defined Features

The generation capability of Feat2Map is not limited to generating junctions from the existing maps, such as those shown in Fig. 4. Feat2Map also accepts manually defined feature values if users require customization. For example, the mega junction shown in Fig. 7(a) is generated by specifying the following junction feature: Fmegaroad=5F_{mega}^{road}=5, Fmegactrl=signalF_{mega}^{ctrl}=signal, Fmegaxwlk=TrueF_{mega}^{xwlk}=True and Fmegarot=[0,72,144,144,72]F_{mega}^{rot}=[0^{\circ},72^{\circ},144^{\circ},-144^{\circ},-72^{\circ}].

With the cubic Bézier curve model, Feat2Map can also generate a set of roads connected end-to-end by specifying a list of road configurations where each road’s end point (resp. end heading) is the next road’s start point (resp. start heading). Finally, in addition to the default two-way roads, one-way roads are also supported by Feat2Map as long as users specify the road type of each road socket. Fig. 7(c) shows a T-junction where the road types associated to the sequence of the road sockets, started from the East most road socket and listed in a counterclockwise direction, is [In,Out,InOut][In,Out,InOut], where InIn, OutOut, InOutInOut mean one-way incoming, one-way outgoing, and two-way roads, respectively.

V Discussion and Conclusion

Discussion. Scenario-based testing is inevitable across the entire phase of ADS development. How diverse and representative the testing scenarios are essentially determines the testing efficiency and effectiveness. Bagschik et al. [29] proposes a 5-layer model for testing scenarios, including road level (layer 1), traffic infrastructure (layer 2), manipulation of layer 1 and 2 (layer 3), object (layer 4) and environment (layer 5). A recent survey [2] shows that most works focus on sampling critical scenarios at layer 4 and layer 5, i.e., by controlling the trajectories of other traffic participants such as vehicles or pedestrians or manipulating the simulated weather. However, the topological and geometric features of the traffic networks (i.e., layer 1-3), which we believe are the foundation of testing scenarios, are often overlooked. As a result, HD map generation based on required features substantially lifts the restrictions induced by the fixed elements of the first three layers and creates huge potential in generating diverse scenarios.

Conclusion. In this paper, we propose an automatic feature-based HD map generation framework Feat2Map for simulation-based testing. The framework takes in existing maps as input, extracts essential features, and applies combinatorial sampling to generate grid-layout HD maps. Feat2Map also accepts manual feature configurations to allow flexible customization. Experiment results show that the generated HD map is concise and preserves comparable scenario diversity.

The topological and geometrical features of the roads and junctions can be far more complex in real life than those considered here. Our framework can be extended to more complex features such as filter lanes in mega junctions, crosswalks on road lanes, and highway traffic networks. We leave the exploration of them for future work.

References