Video length is 4:15

How to Simulate Automated Driving Systems: Adaptive Cruise Control

Learn how to simulate data to develop and test an adaptive cruise control feature for automated driving using a reference example from Automated Driving Toolbox™.

Published: 18 Aug 2020

Hello, everyone. In this video, we will discuss the core tasks in designing automated driving systems, and we will see how these operations can be integrated for developing adaptive cruise control feature. This is a reference example of Highway Lane Following feature from the Automated Driving Toolbox. We use MATLAB to write the core algorithms and Simulink to integrate and simulate these algorithms as a model.

Developing automated driving systems typically involves creating algorithms for perception, planning and control. These algorithms are then integrated and iteratively tested in a virtual environment with synthetic scenarios for fast, safe and cost-effective development. A common simulation workflow starts with the perception of surrounding environment using sensor models.

The automated driving toolbox contains blocks for configuring parameters and acquiring data from camera, radar and LIDAR sensors. The acquired sensor data is processed using available algorithms for detecting objects, including lanes, pedestrians, vehicles and more.

In this example, the Vision Detect variant block detects lanes and vehicles from camera sensor data. These detections from multiple sensors are then combined using sensor fusion algorithms. The Forward Vehicle Sensor Fusion block combines object detections from camera and radar sensors, manages the tracks of moving objects, and eliminates false detections.

Based on the object detections, the planning algorithms calculate and alter the ego vehicle's trajectory. The vehicle control system finally enables autonomous vehicles to follow the plan trajectory by specifying literal and longitudinal decision logic. This subsystem incorporates Model Predictive Control. The controller provides optimal control actions by using an internal vehicle model to predict future behavior, based on length and vehicle detections.

Now we need a scenario to simulate the algorithms. You can either choose one of the pre-built scenes or create one yourself. The Driving Scenario Designer app can be used to create, edit, and visualize scenes which include roads, vehicles and sensors. This is a pre-built scene, and its open look simulation shows the lead vehicle slowing down and resulting into a collision.

The Simulation 3D Scenario subsystem reads the previewed scene into Simulink and configures the model for a 3D simulation.

Next, to simulate the effects of control algorithms on a vehicle, we need the dynamic equations of the vehicle. The Vehicle Dynamics block specifies the dynamics model for the eco vehicle and outputs that vehicle's post and velocity based on the controller input. The Metrics Assessment block is used to assess system level behavior.

Now let's test the integration of these algorithms in the 3D simulation environment. You can visualize multiple views with overlays during the simulation. The lane and vehicle detections are displayed on top of image frames while eco vehicle velocity and relative distance metrics can also be plotted in real time. The sensor data and metrics are logged for plotting and analysis post-simulation.

The birds-eye scope and video show that the eco vehicle successfully detects lines and vehicles. Additionally, the controller processes the detections to stay in the lane, as well as avoid accidents by slowing down when needed. Thus, existing algorithms can be readily integrated and simulated in 3D environment for developing datas and automated driving features.

You can also simulate other pre-built scenarios with this example. Here is another example which demonstrates how to automate testing the highway lane following feature once integration is complete. You can try these and other reference examples, as well as build complex algorithms on top of the examples, by installing the Automated Driving toolbox. For more details, check out the links for the Automated Driving toolbox product page and reference examples.

Related Products