Contenuto principale

Set Up and Configure Driving Test Bench to Simulate Scenario Variants

The Automated Driving Toolbox™ Test Suite for Euro NCAP® Protocols support package enables you to set up and configure a driving simulation test bench to simulate scenario variants.

Driving Simulation Test Bench is a Simulink® model that enables you to test various automated driving applications, such as autonomous emergency braking (AEB) and lane keep assist (LKA) scenarios. The test bench model enables you to integrate the sensor and scenario interfaces with your controller and test the scenario with a high-fidelity vehicle dynamics model.

The test bench contains interfaces for integrating RoadRunner Scenario with MATLAB®, enabling you to test your custom scenarios. Additionally, the test bench supports simulation and testing of various Euro NCAP® scenarios, and enables you to generate Euro NCAP test reports.

After obtaining scenario variants, use a driving simulation test bench Simulink model to simulate the scenario variants.

Set Up and Configure Test Bench

To explore a driving simulation test bench, you must create a test bench project and set up the configuration parameters of the driving simulation test bench.

Use the startDrivingProject function to create a DrivingTest directory that contains a DrivingTest.prj project file and a TestBench folder containing the Controller.slx, DrivingTestBench.slx, and VehDyn14DOF.slx files. For example, startDrivingProject(pwd) creates the driving simulation test bench project in your current working directory.

Once you have created the project, you can use the configureDrivingTestBench object to store the configuration parameters of your driving test bench, and its setup object function to set up and initialize the test bench. For example, given the configureDrivingTestBench object drivingConfigObj, specifying setup(drivingConfigObj) sets up the driving test bench and initializes the default simulation parameters for the driving simulation test bench configuration object drivingConfigObj.

You can specify additional options for the setup object function using name-value arguments. For example, TestStartTime=3 specifies the start time of a test as 3 seconds.

  • TestStartTime — Time to start test, specified as a scalar. Units are in seconds. By default, the value is 0.

  • ObjectDetections — Source of object detection, specified as "groundtruth" or "vision-radar". By default, the value is "groundtruth".

  • Controller — Type of controller for the test scenario, specified as "TrajectoryFollowing", "AEB", or "LKA". By default, the value is "TrajectoryFollowing".

  • StepSize — Step size of the simulation, specified as a scalar. Units are in seconds. By default, the value is 0.03.

  • Vehicle — Vehicle parameters, specified as a structure. The structure contains these fields. The default field values represent the parameters of a sedan vehicle.

    • Fidelity — Fidelity of the vehicle model, specified as "3DOF" or "14DOF". By default, the value is "3DOF".

    • Mass — Mass of the vehicle, specified as a scalar. Units are in kg. By default, the value is 1575.

    • StartFromRest — Flag to determine whether to start the vehicle from rest or with a constant test speed, specified as true or false. By default, the value is true.

    • YawMomentOfInertia — Yaw moment of inertia of the vehicle, specified as a scalar. Units are in kg*m2. By default, the value is 2875.

    • FrontTireCorneringStiffness — Front tire cornering stiffness of the vehicle, specified as a scalar. Units are in N/rad. By default, the value is 19000. For more information, see the Vehicle Body 3DOF (Vehicle Dynamics Blockset) block.

    • RearTireCorneringStiffness — Rear tire cornering stiffness of the vehicle, specified as a scalar. Units are in N/rad. By default, the value is 33000. For more information, see the Vehicle Body 3DOF (Vehicle Dynamics Blockset) block.

Note: To run a driving simulation test bench, you must integrate the DrivingTestBench.slx Simulink model with a RoadRunner scenario and cosimulate in MATLAB. For more information, see MATLAB and RoadRunner Scenario Cosimulation.

To clear the bus, variables, and parameters of the driving test bench, you can use the cleanup object function of the configureDrivingTestBench object. For example, cleanup(drivingConfigObj) clears the bus, variables, and parameters of the driving test bench associated with the test bench configuration object drivingConfigObj.

Driving Simulation Test Bench

The driving simulation test bench model contains these modules:

  • Controller — Controls the steering angle and acceleration of the ego vehicle. A reference model that integrates Controller.slx into the DrivingTestBench.slx model.

  • Vehicle Dynamics — Specifies the ego vehicle dynamics. The Vehicle Dynamics subsystem consists of a variant subsystem that has two vehicle variants, 3DOF (default) and 14DOF.

  • Scenario and Environment — Specifies vehicle path, sensor blocks, and RoadRunner Scenario blocks, which configure, read from, and write to RoadRunner Scenario.

For more information, see Overview of Driving Simulation Test Bench.

Driving simulation test bench model.

For more information on the driving test bench for a Euro NCAP AEB scenario, see the AEB Test Bench for Euro NCAP Scenarios example.

After you set up, configure, and simulate your driving test bench, you can generate test reports. To generate Euro NCAP reports for test scenarios, see Generate Test Report.

See Also

Functions

Topics