This example shows how to implement a synthetic data simulation for tracking and sensor fusion in Simulink® with the Automated Driving Toolbox™ using the 3D simulation environment. It closely follows the Sensor Fusion Using Synthetic Radar and Vision Data in Simulink example.
Automated Driving Toolbox provides tools for authoring, simulating, and visualizing virtual driving scenarios. With these scenarios, you can simulate rare and potentially dangerous events, generate synthetic radar detections from the scenarios, and use the synthetic detections to test vehicle algorithms. This example covers the entire synthetic data workflow in Simulink using the 3D simulation environment.
Prior to running this example, the roads, actors, and trajectories in the scenario were created using this procedure:
Create a road in the Driving Scenario Designer that has these extracted locations as its road center values.
Define multiple moving vehicles on the road that have trajectories similar to the ones in the scenario defined in Sensor Fusion Using Synthetic Radar and Vision Data in Simulink.
Export the trajectories from the app and load them into the MATLAB® workspace by using the
Read these trajectories into the Simulink model using From Workspace blocks.
The actor poses provided by the From Workspace blocks are used by the Simulation 3D Vehicle with Ground Following blocks to define the locations of the ego vehicle, lead vehicle, and other vehicles at each time step of the simulation.
close; if ~ispc error(['3D Simulation is supported only on Microsoft', char(174), ' Windows', char(174), '.']); end open_system('SimulateSensorsIn3DEnvironmentModel');
In this example, you simulate an ego vehicle that has six radar sensors covering the full 360 degrees field of view. The ego vehicle is equipped with a long-range radar on both the front and rear of the vehicle. Each side of the vehicle has two short-range radars, each covering 90 degrees. One radar on each side covers from the middle of the vehicle to the back. The other radar on each side covers from the middle of the vehicle forward.
The Ego Sensors subsystem contains the six Simulation 3D Probabilistic Radar blocks that model the previously described radars. The outputs of the radar blocks are concatenated using a Detection Concatenation block to create a single stream of detections to be fused by the Multi-Object Tracker block in the top-level model.
The probabilistic radars "see" not only an actor's physical dimensions (e.g., length, width, and height) but are also sensitive to an actor's electrical size. An actor's electrical size is referred to as its radar cross-section (RCS). The RCS patterns for the vehicles in the simulation are defined using the Simulation 3D Probabilistic Radar Configuration block.
Use this block to define the RCS patterns for all of the actors in the simulation. Any actors that do not have a specified RCS pattern use the default RCS value.
The detections generated by the ego vehicle's suite of radars are preprocessed using a helper Detection Clustering block before they are fused using the Multi-Object Tracker block. The multi-object tracker is configured with the same parameters used in the corresponding Simulink example, Sensor Fusion Using Synthetic Radar and Vision Data in Simulink. The output from the Multi-Object Tracker block is a list of confirmed tracks.
The Bird's-Eye Scope is a model-level visualization tool in Simulink opened from the Simulink toolstrip. After opening the scope, click Find Signals to set up the signals. Then run the simulation to display the ego actor, radar detections, and tracks. The following image shows the scope's display for this example.
When the simulation starts, a few seconds are needed to initialize the 3D simulation environment, especially when running it for the first time. Once this initialization is complete, the 3D simulation environment opens in a separate window. The following image is a snapshot of the 3D simulation window corresponding to the snapshot of the Bird's-Eye Scope shown in the previous image.
The simulated vehicles are shown in the 3D simulation window. The detections and tracks generated by the 3D simulation appear only in the Bird's-Eye Scope. The following animation shows the detections and tracks for the simulated scenario.
In this example, you learned how to extract road centers from a 3D scenario for use in the Driving Scenario Designer app. You also learned how to export the vehicle trajectories created from the road segments for use in the 3D simulation environment in Simulink. You then learned how to configure multiple probabilistic radar models in the 3D environment and how to fuse the detections from the multiple radars located around the ego vehicle's perimeter using a multi-object tracker. The confirmed tracks generated by the tracker can then be used for control algorithms such as adaptive cruise control (ACC) or forward collision warning (FCW).
Bird's-Eye Scope | Detection Concatenation | Driving Scenario Designer | Multi-Object Tracker | Simulation 3D Probabilistic Radar | Simulation 3D Probabilistic Radar Configuration | Simulation 3D Scene Configuration | Simulation 3D Vehicle with Ground Following