3.1. Preprocessing
The first stage is to process the downloaded vector data. Among the many entities involved in vector data, lane lines are typically used for the pointcloud map. For a road network map, lane centerlines are used as a reference path. Because the NGII vector map is originally in the SHP format, it must be converted to a format readable by the software and then used in preprocessing.
As in the previous workflow, launch Global Mapper to convert the SHP file representing the lane centerline to a TXT file. Under the File menu, click Batch Convert/Reproject. In the sequentially generated pop-up windows, select Shapefile as the filetype to perform conversion from and Simple ASCII Text as the filetype to perform conversion to. Consecutively, add a SHP file in the Source Files panel. The default options in the Destination Files panel do not need to be changed, except for checking off the Include Elevations for Each Vertex and Add Blank Line Between Features boxes. According to the latest revision of the NGII vector map format, the only associated SHP file is A2_Link. Click the OK button to start the file format conversion. The converted lane centerline is not directly applicable and needs to be preprocessed to satisfy the requirements specified in OpenPlanner (see
Table 12).
Notably, such preprocessing is difficult and error-prone, and in this study, a MATLAB script was written to automate the process. Run the script by typing its name, preprocess_centerlines, in the command line. The converted TXT file is input, and the script outputs as many CSV files as the number of segments. A segment denotes a set of points constituting a lane centerline. From the database of NGII, the SHP file representing the lane centerline can be downloaded by area, and thus a number of segments are mixed in random order. The points within a segment are ordered, whereas the points within a file are completely disordered. To resolve this problem, each segment is saved as a file. Based on the one file per segment, the points within a file can be arranged in sequential order. In addition, all the points on the lane centerline are regularly spaced (1 m) to serve as a waypoint. The regularly spaced points are placed wherever a global path can be generated, for instance, at the intersection. Furthermore, the points on the path are represented with the 3D position, orientation, and target speed. The points are relative to the map frame set in the previous stage to generate the pointcloud map.
3.2. Mapping
The second stage is editing of the vector data based on the processed lane centerline (see
Figure 10). Because a global path and local trajectories are generated based on a lane centerline, it is considered to be the most important in path planning. However, the lane centerline must be supplemented by other vector data to render the road network map more comprehensive. Diverse entities are provided by ASSURE, including lane lines, stop lines, curbs, boundaries, crosswalks, traffic signs, and lights. As mentioned, ASSURE is an editor for a road network map, which is optimal for OpenPlanner. The lane centerline, simply called a lane in ASSURE, is the basic road network entity. The lane consists of waypoints. A waypoint contains the intrinsic information of the pose and target speed and extrinsic information such as the next, previous, left, and right waypoints. Consequently, a waypoint can be used to link different entities. The lanes can be branched or merged only through the waypoints at both ends of the lane. Details regarding the provided entities can be found in [
14].
Depending on the input file formats, ASSURE can support various mapping processes (see
Table 13). The mapping process selected in this study takes CSV files as inputs and outputs a KML file to be used in OpenPlanner. Additionally, PCD files are often inputted to help accurately position the entities.
Launch the ASSURE map editor. We have screen recorded the actual usage of ASSURE for the mapping [
15]. The wide left panel displays all the entities in the vector map (map view), whereas the narrow right panel shows detailed information regarding the hovered-over or selected entities (info view).
3.2.1. Load Lanes
Load the converted CSV files. Right-click the map view. In the generated pop-up window, hover the pointer over the Load Map and click the CSV Folder in the hover box that appears. Select the folder containing the converted CSV files and click the Open button. Confirm that the lanes are displayed on the map view.
3.2.2. Link Lanes (One-to-One)
As mentioned, the loaded entities are split by file, with each file corresponding to one lane. The mapping process is initiated by linking the existing lanes on the road, described as a one-to-one link.
Click the lane; the properties of the selected lane appear under the Lane Info on the info view. Click From Lanes and press the plus sign key. In the generated blank > ID, enter the previous lane ID. In the same manner, enter the next lane ID into the blank > ID under To Lanes. After editing, press the Ctrl and S keys simultaneously. Lane Info involves many other properties other than these two properties; however, these properties do not need to be edited because they are either unused or subject to be overridden by the subsequent editing of the waypoint properties.
3.2.3. Insert Lanes
Next, insert new lanes. This insertion is not necessary on the road but required at the intersection in which the lanes are not provided as an entity in the converted CSV files.
Right-click the map view. In the generated pop-up window, hover the pointer over Insert and click the Lane in the hover box that appears. Click a location at which a waypoint is desired. Add waypoints sequentially and press the enter key to insert the formed lane or the Esc key to dismiss it. Click the added waypoint and enter its z coordinate into Z, the height of which can be estimated with reference to the height of the endpoint of the lane to be linked to. To reform the lane, the existing waypoints within the lane can be moved or removed. Alternatively, new waypoints can be added. To move waypoints, click and drag the waypoint while pressing the Shift key, or click and enter the new coordinates into X and Y. To add or remove waypoints, press the plus or minus sign keys, respectively. Similar to the previous process, link the new lane to the existing lanes.
3.2.4. Smooth Lanes
The inserted lanes tend to be rough because they are manually generated. Smooth the inserted lane by clicking on it and then pressing the asterisk key. Smoothing can be gradually performed by repeatedly pressing the key. The smoothing adjusts not only the position of waypoints but also the spacing between them.
3.2.5. Link Lanes (One-to-Many)
Unlike the road, intersections usually require a one-to-many link. Similar to the generation of the one-to-one link, click the approaching lane; the properties of the selected lane appear under the Lane Info on the info view. Click To Lanes and press the plus sign key as many times as the number of lanes to be branched off. In the generated blanks > ID, enter the next lane IDs. After editing, press the Ctrl and S keys simultaneously.
3.2.6. Link Waypoints (Longitudinal)
A linkage similar to that between lanes is also required between waypoints. Link the last waypoint on the previous lane to the first waypoint on the next lane, corresponding to a first-to-last link. Other neighboring waypoints in the middle of the lane are linked as-is.
Click the last waypoint of the previous lane; the properties of the selected waypoint appear under the Waypoint Info in the info view. From Points is already filled in. Click To Points, and press the plus sign key. In the generated blank > ID, enter the first waypoint ID of the next lane.
The opposite way around, click the first waypoint of the next lane. To Points is already filled in. In the same manner, click From Points, and press the plus sign key. In the generated blank > ID, enter the last waypoint ID of the previous lane. After editing, press the Ctrl and S keys simultaneously.
The above-mentioned processes correspond to basic mapping to solely enable lane- following. The subsequent processes describe the mapping process to allow more advanced operations including but not limited to lane-changing and traversing intersections. Notably, these operations are specific to the operational design domain corresponding to the operational area in which the AD system is designed to operate.
3.2.7. Inspect Linkage
Before proceeding further, it is advisable to examine the linkages between all the drivable lanes and their waypoints. Any missing or incorrect links on the road network can degrade the global path generation ability of the global planner. In general, a larger road network is more vulnerable to error. To examine the linkages, another editor named Java OpenStreetMap (JOSM) can be used. Save and export the linked entities to an OSM file that can be read by JOSM.
Right-click the map view. In the generated pop-up window, hover the pointer over Save Map and click Lanelet2.osm in the hover box that appears. Type an OSM filename and click the Save button.
Launch JOSM. Load the linked entities by clicking Open under the File menu. In the generated pop-up window, select the converted OSM file and click the Open button. In the JOSM, the linked entities are represented as a network graph; specifically, the waypoints are displayed as nodes, and the linkage between them is displayed as an edge, allowing any missing or incorrect link to be easily found. Confirm that the waypoints are arranged sequentially.
3.2.8. Link Waypoints (Lateral)
At this point, the entities are connected in the longitudinal direction. However, waypoints must also be connected in the lateral direction, enabling the global planner to facilitate lane changing.
Enter the closest waypoint ID on the left lane into the Left Point, while entering the closest waypoint ID on the right lane into the Right Point. The closest waypoint functions as a reference point when changing lanes. Therefore, it is preferable to specify a waypoint slightly ahead in the forward direction. Leave the Left and Right Points as zero for the lanes in which lane changing is not permitted by the Road Traffic Act.
3.2.9. Split/Merge Lanes
After checking all the connections, split the lane into two or, oppositely, merge the two lanes, if necessary. Editing the linked lanes is useful for the behavior planner to control discrete behaviors based on the lane. The simplest example of this control is turning on a left-turn signal on a left-turn lane. To turn on the signal in advance, the lane can be slightly extended by merging the previous lane. To this end, the previous lane must not be extremely long; therefore, it must be split before being merged.
Select the waypoint that can serve as the endpoint of the separate lane. Right-click this waypoint. In the generated pop-up window, hover the pointer over Lane Functions and click the Split Line button in the hover box that appears.
The other way around, click the lane to merge the next lane. Right-click the lane. In the generated pop-up window, hover the pointer over Lane Functions and click the Merge Next Lane button in the hover box that appears. Linkage between the lanes must be ensured to merge them, and the linkage between waypoints is also crucial.
3.2.10. Increase Action Cost
If necessary, increase the action cost, the default value of which is set to zero. Editing the traversal cost can help the global planner generate the optimal path. With a cost of zero, only the global path with the shortest distance is generated. However, in reality, the shortest path is not always the optimal path, for example, if it includes back streets full of illegal parking.
To optimize the path, change the action cost by clicking the lanes to be avoided. Enter the increased cost into Action Cost. The increased cost is then reflected to all the waypoints on the lane. The increased cost can be also reflected to a specific waypoint by clicking the waypoint, instead of the lane.
3.2.11. Decrease Maximum Speed
If necessary, decrease the maximum speed. Editing the maximum speed can help the global planner generate a safe speed profile. Although not mentioned in the previous stage, the target speed assigned to each waypoint is determined by the maximum speed specified by the Road Traffic Act. The default value of the maximum speed is based on this value. Although the global planner uses the target speed as is, the local planner changes the speed to evade obstacles within the lane. The local planner also decreases the target speed during a turn; however, the target speed decreases as a function of the lane curvature in a tight corner. In this scenario, a vehicle may not decelerate in a timely manner during a turn. To avoid such problems, it is beneficial for the global planner to decrease the target speed in the mapping process.
Change the maximum speed by clicking the lane in which the vehicle must slow down. Enter the reduced speed as the Max Speed. The reduced speed is then reflected to all the waypoints on the lane and can be reflected to a specific waypoint by clicking the waypoint instead of the lane.
3.2.12. Set Road Boundary
The road boundary must ideally be set such that the local planner only needs to react to obstacles within the lane. This setting can help address the perceptual inaccuracy. A representative example is swerving to avoid colliding with bollards. Because bollards are placed in the middle or at the end of the road, they are likely to be misidentified as obstacles within the lane. The boundary, also referred to as a wayarea, is in the form of a polygon with a set of points. To position the points accurately, the generated pointcloud map can be imported.
Right-click the map view. In the generated pop-up window, hover the pointer over the Load PointCloud button and click the Folder of .pcd(s) in the hover box that appears. Select the folder containing the relevant PCD files and click the Open button. Confirm that the registered pointcloud map is overlaid with the road network map under construction.
Again, right-click the map view. In the generated pop-up window, hover the pointer over Insert and click the Boundary button in the hover box that appears. Click the location at which a point is desired. Add points sequentially and press the enter key to insert the enclosed boundary or the Esc key to delete it. Click the added point and enter its z coordinate into Z. Although not mandatory, the height of the added point must preferably be similar to those of nearby entities. To reshape the boundary, the existing points on the boundary can be moved or removed. Alternatively, new points can be added. To move points, click and drag the point while pressing the Shift key, or click and enter its new coordinates as X and Y. To add or remove points, press the plus or minus sign keys, respectively.
3.2.13. Insert Stop Lines
If necessary, insert a stop line, similar to inserting a new lane. Right-click the map view. In the generated pop-up window, hover the pointer over the Insert and click the Stop Line in the hover box that appears. The stop line can only consist of two endpoints. Click the location at which one endpoint is desired. By adding the other endpoint, the stop line can be approximately located.
To accurately locate the stop line, revert to the first stage. Launch Global Mapper to convert the SHP file representing the stop line to a CSV file. The applicable SHP file is B2_Surfacelinemark or A2_STOP, depending on the version of the NGII vector map format.
Load the converted CSV file and save it as a KML file. Right-click the map view. In the generated pop-up window, hover the pointer over the Save Map button and click ASSURE.kml in the hover box that appears. Type a KML filename and click the Save button. Continue to run the ASSURE map editor to load the converted KML file and identify the position of the stop line. Right-click the map view. In the generated pop-up window, hover the pointer over Load Map, and click the Merge Items .kml button in the hover box that appears. Note that the loaded stop line is not a part of the road network map being constructed and used only to evaluate its position.
Click the endpoint; the properties of the selected endpoint appear under the Point Info in the info view. Using the X, Y, and Z of the endpoint, the approximately located stop line can be relocated. Ensure that the finely located stop line sufficiently reaches the lane to be connected to. If not, extend the lane. Click the stop line; the properties of the selected stop line appear under the Stop Line Info in the info view. The stop line and lane are linked by entering the lane ID and stop line ID into the Lane ID and SL ID, respectively. To activate the linked stop line, it must be joined again to either the traffic sign or lights, depending on the presence of traffic lights at the intersection.
3.2.14. Insert Traffic Signs
If the stop line is located at a non-signalized intersection, insert the traffic sign. Right-click the map view. In the generated pop-up window, hover the pointer over Insert, and click the Sign button in the hover box that appears. The Sign button is used to specify the position and type of the traffic sign. Only the stop sign is available at the present. Click to set the position of the traffic sign and click again to set its orientation. Click the traffic sign; the properties of the selected traffic sign appear under Sign Info in the info view. The traffic sign ID is assigned to Sign ID. Click Type and press the right arrow key to select the stop sign. Click the associated stop line and enter the Sign ID into Stop Sign ID. To relocate the stop sign, click on it. The sign is represented by a rectangle with a midline and two points. The large point is within the rectangle, and the small point is in the orbit around the large point. To move the stop sign, click and drag the large point while pressing the Shift key, or click and enter its new coordinates into X, Y, and Z. To rotate the stop sign, click and drag the small point while pressing the Shift key.
3.2.15. Insert Traffic Lights
If the stop line is located at a signalized intersection, insert the traffic light. Right-click the map view. In the generated pop-up window, hover the pointer over Insert and click the Light button in the hover box that appears. The Light button is used to specify the position and type of the traffic light bulb. The signal types for vehicles are green, yellow, red, left, and right and those for pedestrians are green and red. Similar to the traffic sign, click to set the position of the traffic light bulb and click it again to set its orientation. The positions of traffic lights must be as close to the real situation as possible because the TLR in the developed AD system requires the accurate location of the traffic lights on the road network map. Click the traffic light bulb; the properties of the selected traffic light bulb appear under Traffic Light Info in the info view. The traffic light ID is assigned to TL ID. Click Type and press the right arrow key to select the relevant signal type. Enter the associated stop line ID into Stop Line. In addition, click Controlled Lanes, and press the plus sign key. In the generated blanks > LID, enter the associated lane IDs. The opposite way around, click the associated stop line. Click Related Lights, and press the plus sign key as many times as the number of the traffic light bulbs to be linked. In the generated blanks > LID, enter the associated traffic light IDs. The traffic light can be relocated in the same fashion as the traffic sign.
3.3. Validation
The final stage is to test the edited vector data using the path-planning module of Autoware. As mentioned, OpenPlanner is a representative path-planning module within Autoware [
16]. The module incorporates global, local, and behavior planners that are implemented as a series of ROS nodes (see
Table 14). The global planner uses the traversal cost to determine the optimal path. Based on the global path, the local planner uses the collision cost to determine the best trajectory among candidate trajectories, also referred to as roll-outs. To this end, the lidar_kf_contour_tracker node from the detection module and op_motion_predictor node are engaged between the op_trajectory_generator node and op_trajectory_evaluator node in the path-planning module.
The global planner uses the traversal cost to determine the optimal path. Based on the global path, the local planner uses the collision cost to determine the best trajectory among the candidate trajectories, also referred to as the roll-outs. To this end, the lidar_kf_contour_tracker node from the detection module and op_motion_predictor node are engaged between the op_trajectory_generator node and op_trajectory_evaluator node in the path-planning module.
Launch Autoware. The actual usage of Autoware for path planning has been screen recorded in [
17]. As in the previous validation process, specify Localizer and Baselink to Localizer in the Setup Table The Vehicle Model and Vehicle Info can be optionally provided. Instead of loading the edited vector data by pressing the Vector Map button in the Map tab, edit the launch file of the op_global_planner node. Set the mapSource argument to two (KML file) and provide its path and filename to the mapFileName argument. Revert to the Map tab, and specify TF. In the Computing tab, launch the connector node by checking off the box of vel_pose_connect. In the pop-up window generated by clicking [app], check off the Simulation Mode box and press the OK button. As discussed, the current pose is measured by the matching node. The current velocity is measured from the vehicle side and transmitted to the connector node via the CAN bus. In simulation mode, these measurements are replaced with the estimates provided by the simulator built in Autoware, which is known as the wf_simulator. Launch the tracker node by checking off the kf_contour_tracker box. Launch the global planner node by checking off the op_global_planner box. In the pop-up window that is generated by clicking [app], check off the RViz Goals box and press the OK button. In doing so, the user can specify the start and goal poses in RViz. In addition, check off the Enable Smoothing, Enable Replanning, and Enable Lane Changing boxes. Click the RViz button. Confirm that the generated road network map is displayed. In the Displays panel, check off the Vector Map Centerlines box to display the lane edited in the previous stage. The name may differ according to a configuration file (/vector_map_center_lines_rviz is published). Press the 2D Pose Estimate and Nav Goal buttons to set the start and goal poses, respectively. The goal pose can be set multiple times to allow the vehicle to navigate consecutively with replanning. By doing this, the vehicle starts for the next goal as soon as it reaches the current goal. If the Global Path box in the Displays panel is checked, the generated global path is displayed.
Repeatedly send the op_global_planner node all possible start and goal locations, and see if the optimal path can be generated as a result of global planning based on the created vector map. As previously mentioned, the operational area consists of main streets without back streets. Hence, the global planning requires only a simple validation, and the shortest path is the optimal path. In the operational area, the long loop is preferable to the short loop because in the long loop, considerable validation is required for local and behavioral planning, such as lane changing before traversing the signalized intersection. Starting from a one-way road between the long and short loops, the global path around the long loop can be generated by setting an intermediate goal; otherwise, the global path is generated pertaining to the short loop (see
Figure 11a).
Launch the local planner nodes by checking off op_common_params, op_trajectory_generator, op_motion_predictor, and op_trajectory_evaluator. In the pop-up window that is generated by clicking [app], check off the Enable Prediction box, and press the OK button. In doing so, the op_trajectory_evaluator node can use the estimated trajectories of dynamic obstacles and their measured contour to calculate the collision cost. The calculated cost is reflected to the generated trajectories of the vehicle, which can be represented by color. Generally, a darker red corresponds to a higher cost. Therefore, the red trajectory represents the fully blocked trajectory with the highest cost, whereas the pink trajectory indicates the optimal trajectory with the lowest cost. As the final node in the local planning pipeline, launch the behavior planner node by checking off the box of op_behavior_selector. Launch the filter node by checking off the twist_filter box, and launch the waypoint follower node by checking off the pure_pursuit box. The pure_pursuit node publishes the twist command to the twist filter node in/twist_raw. The twist filter node consecutively publishes the modified command in/twist_cmd by smoothening and limiting the linear and angular velocities. Provide the velocity command, and check if the vehicle can follow the best trajectory generated as a result of local planning based on the created vector map. Additionally, see if the vehicle can handle discrete behaviors, such as avoiding dynamic obstacles and stopping before a stop line or traffic lights in consequence of behavior planning.
The main test scenarios to validate the generated vector map were possible only with the wf_simulator. This is because lane following, lane changing, and intersection traversal can be performed without dynamic obstacles. Although not the main test scenario, swerving to avoid dynamic obstacles was impossible due to the limited functionality of the wf_simulator. For more rigorous and comprehensive validation, state-of-the-art simulators, such as CARLA [
18], LGSVL [
19], and CarMaker [
20,
21,
22,
23] are required. We instead performed physical tests in the operational area.
While autonomously driving around the long loop, the positioning error between the reference and actual trajectories was observed to be less than 0.1 m, except near intersections (see
Figure 11b). As mentioned, the reference trajectory was generated based on lane centerlines in the created vector map, and the actual trajectory followed by the vehicle was measured by the LiDAR localizer. The error can be attributed to the difference in the current positions of the vehicle and its nearest waypoint. The long loop had four signalized intersections (J1 to J4), and the vehicle turned right at J1, J3, and J4. To avoid illegal parking, the vehicle drove in the middle lane and moved to the far-right lane when approaching the intersection. The error increased during lane changing because the vehicle moved between waypoints on the lanes. Moreover, the error increased when turning right because the vehicle was steered by more than the amount referenced by the local planner. This behavior depended on the look-ahead distance in the pure_pursuit node. The behavior states transitioned from/to FORWARD (2), STOPPING (3), TRAFFIC_LIGHT_STOP (5), TRAFFIC_LIGHT_WAIT (6), STOP_SIGN_STOP (7), STOP_SIGN_WAIT (8), FOLLOW (9), and OBSTACLE_AVOIDANCE (11) (see
Figure 11c). Among the four signalized intersections in the long loop, the vehicle stopped at a red light at J1 and J3. Moreover, the vehicle stopped at both the vehicle and pedestrian traffic lights at J1, whereas it stopped only at the pedestrian traffic lights at J3. In the case of the signalized intersections, the state proceeded with 2, 3, 5, 6, and 2. In the case of the non-signalized intersections, states 5 and 6 were replaced by states 7 and 8, respectively. The vehicle almost stopped and swerved to avoid colliding with a long truck parked near J4, and the state proceeded accordingly with 2, 9, 11, and 2.