Automated Driving in the Urban Environment with RoadRunner Scenario
Seo-Wook Park, MathWorks
Learn how to simulate automated driving in the urban environment with RoadRunner.
- Create a complex urban scene consisting of intersections with traffic lights.
- Generate a V2X Map from the RoadRunner HD map and a V2X SPaT (signal phase and timing) from the RoadRunner traffic signalization.
- Implement a mission planner to search the shortest path for a given start and destination position using an A-star planner.
- Design a behavioral planner to follow traffic lights in the urban intersections using V2X Map and SPaT.
Published: 15 May 2024
Hello, everyone, and welcome to our final session of the day. My name is Seo-Wook Park, an application engineer specializing in ADAS and automated driving at MathWorks. In this session, I will demonstrate how to simulate the automated driving in urban environment with the RoadRunner scenario.
SAE categorized driving automation into six levels, ranging from level 0 to level 5. Level 0 involved no actual driving automation, but issued warnings for lane departure, blind spots, and for the collision. Level 1 included ADAS features such as AEB, ACC, LKA, et cetera.
Technology up to level 2 automation has already been established and is widely available in today's vehicle. The automated driving industry continues to develop technology for level 3 and higher, with the ultimate goal of achieving fully autonomous driving at level 5 despite facing numerous obstacles.
In this discussion, my focus will be on the application of automated driving technology within urban environment. Automated driving faces many challenges in urban environment due to the complex road geometry and maneuvering in intersection controlled by a traffic signal. The effectiveness of onboard vehicle sensors is often compromised by urban obstacles, such as tall buildings and parked vehicle, which can obstruct their perception capabilities. Therefore, V2X communication could be a better solution, offering comprehensive 360 degree detection coverages. However, adopting V2X technology requires a careful consideration of infrastructure enhancements, regulatory compliance, and standardization requirements.
Before we take a deep dive into today's topic, I'd like to start with a short demonstration of the traffic light flow at urban intersections. In the urban scenario, the Ego vehicle is approaching the intersection. It applies the brake to stop upon detecting that left turn signal is red.
It waits for the light to change to green color. At the green light, the car initiated a left turn. This demonstration showcases how the vehicle detects traffic signal at the intersection and adjusts its maneuvers accordingly.
I will now outline a workflow for implementing this traffic light follower. First, we will create a complex urban scene featuring intersections equipped with traffic light. Next, design a Path Planner to identify the shortest path to a specified destination. Lastly, develop a Behavior Planner complying with traffic light signal at urban intersection.
To realize the Behavior Planner, several components are essential, including a V2X map, signal phase and timing, and traffic light follow module. Let's start by creating an urban scene.
RoadRunner enables us to create realistic roles and environment for the scenario simulation. We created a complex urban scene called US City Block, containing 15 intersections with traffic light. All roads in the scene are two-way road with four lanes. If we zoom in on one of the intersection, we can see a four-way intersection equipped with traffic lights.
Next, we will design a Path Planner to specify the destination within the urban scene we've just constructed. The Automated Driving Toolbox include an example that demonstrated a lane-level Path Planner using the RoadRunner scenario. This example illustrates the process of determining the shortest path from a starting point to a destination.
The workflow for this Path Planner begins with creating the nodes and edge table from RoadRunner HD map. Next, we created a graph data structure utilizing navGraph from Navigation Toolbox, where a graph represents a collection of nodes and edges.
From the navGraph object, we then created an A* planner. Eventually, this workflow enabled us to identify the shortest path between the start and goal positions using the A* planner. Through this workflow, we can get the vehicle reference paths within the urban scene.
Now let's develop a Behavioral Planner complying with the traffic light signal at urban intersections. What is the functionality of the Behavioral Planner? This includes several tasks. For example, how do we detect an approaching intersection?
How do we get the current state and the timing of the associated traffic light? How do we identify an appropriate maneuver at the intersection to follow the reference path, proceed straight, turn left, or turn right? How do we decide to go or stop at the intersection based on the traffic light state and timing? To realize these tasks, we need several components, such as V2X Map, V2X Signal Phase and Timing, and Traffic Light Follow Module.
First, we need a map to obtain information on the road network. Automated Driving Toolbox offers a reference example for generating V2X MAP Message from RoadRunner. We extract RoadRunner HD MAP data from the urban scene and scenario, which is then transformed into the V2X MAP Message.
Previously, we created a complex urban scene named US City Block. This scene and its associated scenario can be opened programmatically using MATLAB function named openScene and openScenario. We then get the RoadRunner HD Map for the scene. RoadRunner HD Map is a road data model for representing highs-definition map data in a RoadRunner scene. This model defines a simple data structure to represent road layout using lane, lane boundary, junctions, et cetera. We can plot this RoadRunner HD map.
Now, we transformed the RoadRunner HD map data into a V2X map format. First, we extract all nodes from the RoadRunner HD map. Node primarily represent intersections or junctions. Next, we identify the links that connect these nodes. We then determine the connection between all lanes.
To facilitate the real-time V2X communication, it is essential to encapsulate the node, links, and lane connection using the V2X MAP Message format. Adherence to the V2X standard is crucial for enabling seamless real-time communication and ensuring interoperability across various devices and systems.
For this study, we have aligned with the CSAE standard, developed in collaboration with a Chinese customer. The CSAE standard aligns closely with SAE J2735. The V2X Map Message is organized into a hierarchical structure that includes node, links, and lanes. The lane data provide additional information, like lane ID, lane widths, speed limits, geometric point, and connectivities.
I'd like to clarify the concept of the Lane Connectivity with a specific example. When a vehicle is pinpointed on the map, we localize it by identifying the relevant node, link, and lane through the V2X Map data. The lane information includes the details on connectivity, such as its association with a particular traffic signal ID and connection to the downstream node. These downstream nodes are indicative of the various maneuvers at the intersection, like turning left or move straight.
In addition to the V2X Map, the Behavioral Planner requires information about traffic signal phase and timing at the intersections. RoadRunner offers a Signal Tool to configure Junction Signalization and Signal Traffic Phases. A phase specifies the active signal and allowed maneuver. Each phase includes several intervals, typically green, yellow and red interval.
Click on the Signal tool and select the junction. This example shows a four-way protected left turn. In the first phase, the move straight maneuver is permitted, consisting of green, yellow, and red interval. The next phase is designated for the left turn maneuver. It continued to move straight and left turn. We implemented the traffic light controller using Stateflow.
The signal generated by the traffic controller are encapsulated within the V2X Signal Phase and Timing message. The SPaT messages provide detailed information about current phase and timing of the traffic signal controller at each intersection. The SPaT messages map the phase state to the corresponding lane at the intersection. The phase state provide the current signal light state and timing information.
Finally, utilizing the V2X map and SPaT message enables us to develop a Traffic Light Following System. This is Simulink Testbench model for the Traffic Light Follower. The RoadRunner Scenario interface are used to read and write the actual runtime value during the course simulation with RoadRunner Scenario.
The Road Side Unit generate V2X Map and Signal Phase and Timing Message. The Traffic Light Follower system control the vehicle speed to comply with traffic signal based on the current vehicle state, V2X map, and SPaT messages. Simultaneously, the Path Follow controller enables the vehicle to follow the reference path.
To implement the Traffic Light Follower system, we must access data from the V2X Map and SPaT messages. First, create map query object from the V2x map. When the Ego vehicle is pinpointed on the map, we localize it by identifying the relevant node, link, and lane through the V2X map query. We can also get the distance and required time to reach the stop line from the V2X Map query.
Next, we can access the lane connectivity information related to the reference path and current ego lane. In this example, the identified maneuver is a left turn at the intersection, with the traffic signal ID 2 out of the eight signals. Given this information, we can take appropriate action.
The decision at the intersection will either be to stop or go. To determine this, we need further details regarding traffic light state and its timing relative to the ego vehicle. We developed a function called getCurrentSPaT for queuing SPaT messages.
This function retrieves traffic light state and timing for a specified node ID, signal ID, and SPaT messages. Now we compare the remaining time for the current traffic light color against time required to reach the stop line. For example, if traffic light is red and the remaining time exceeds time to arrive at the stop line, then the necessary action will be to stop.
Let me show you a simulation result for the Traffic Light Follower with co-simulating the RoadRunner scenario. The ego car is approaching node 25. The relevant traffic light is red. And the time lapse on the red light is longer than the time needed to reach the stop line. Consequently, the ego car applies the brake to stop at the intersection.
It then waits for the red light to change to green. Upon turning green, the car initiated a left turn and changed lane to the right and proceeds to the next intersection where he stopped again, waiting for the light to turn green, and turn right at the green light.
Initially, we leveraged RoadRunner to construct a complex urban scene featuring intersection equipped with traffic lights. Then we used an A* planner from Navigation Toolbox to design a Path Planner aiming to find the shortest path to a specified destination. In the final phase, we developed a Behavioral Planner that complies with traffic light signal at urban intersection.
This involves the creation of several key components, including V2X Map, Signal Phase And Timing, and Traffic Light Follow module. For the development of this component, we utilize the tool, such as Automated Driving Toolbox, RoadRunner Scenario, and Simulink Stateflow. Thank you for your attention.