Simulate Virtual Vehicle During Braking Maneuver on Highway
To build your virtual vehicle, use the Virtual Vehicle
Composer. After you build your virtual vehicle model, you can change the model
configuration to simulate standard vehicle testing maneuvers and the visualization
environment. This example shows you how to simulate a virtual vehicle model,
ConfiguredVirtualVehicleModel
, in a 3D visualization
environment during a braking maneuver on a highway.
Tip
Before you start, make sure your virtual vehicle is configured with Vehicle
dynamics set to Combined Longitudinal and Lateral
Dynamics
.
To configure your virtual vehicle for a braking maneuver, follow these steps.
Workflow Step | Description |
---|---|
After you build your virtual vehicle model, change the model configuration to simulate standard testing maneuvers like the braking test. | |
Specify the 3D visualization environment. | |
Specify the maneuver scene and vehicle starting location. In this example, specify a highway scene with vehicle at the recommended starting location. | |
On the |
Step 1: Configure Virtual Vehicle Model
After you build your virtual vehicle model, change the model configuration to simulate
standard testing maneuvers. In this example, update the Scenarios
and
Driver Commands
subsystems to specify a braking maneuver.
Scenarios
In the configured vehicle model, in Scenarios
, select the
Braking variant.
In
ConfiguredVirtualVehicleModel
, right-clickScenarios
and select Mask > Look Under Mask.Right-click Reference Generator and select Variant > Label Model Active Choice. Select the maneuver. For this example, select Braking. The model implements the Acceleration and Braking block.
Note
Your configured virtual vehicle model uses the block that corresponds to the maneuver that you select. For example, if you select Double Lane Change, the model implements the Lane Change block.
In
Scenarios
, navigate toReference Generator
>Drive Cycle
and open the Acceleration and Braking block. Click Help to learn more about the parameters. For this example, accept the parameter default values.Save
ConfiguredVirtualVehicleModel
.
Driver Commands
In the configured vehicle model, in Driver Commands
, select the
Longitudinal Driver variant.
In
ConfiguredVirtualVehicleModel
, on the Driver Commands block, right-click and select Mask > Look Under Mask.On Driver Commands, right-click and select Variant > Label Model Active Choice. Select the driver. For this example, select Longitudinal Driver. The model implements the Longitudinal Driver block.
Save
ConfiguredVirtualVehicleModel
.
Step 2: Configure 3D Visualization
Update and configure the Visualization
and
Environment
subsystems for the 3D visualization
environment.
Visualization
In the configured vehicle model, in Visualization
, select the
Engine3D variant.
In
ConfiguredVirtualVehicleModel
, right-clickVisualizations
and select Mask > Look Under Mask.On 3D Engine, right-click and select Variant > Label Model Active Choice. Select the 3D environment. For this example, select Engine3D to enable 3D visualization.
Save
ConfiguredVirtualVehicleModel
.
Environment
In the configured vehicle model, in Environment
, select the
Engine3D variant.
In
ConfiguredVirtualVehicleModel
, right-clickEnvironment
and select Mask > Look Under Mask.Right-click
Ground Feedback
and select Variant > Label Model Active Choice. For this example, select 3D Engine for 3D visualization.
Step 3: Set Scene and Vehicle Starting Location
Specify the maneuver scene and vehicle starting location. In this example, specify a highway scene with vehicle at the recommended starting location. Also specify the scene view.
In the
Visualization
>3D Engine
subsystem, open the Simulation 3D Scene Configuration block.For this example, set these Simulation 3D Scene Configuration block parameters:
Scene name to
US Highway
Scene view to
SimulinkVehicle1
Click Apply and save the model.
Open the Model Explorer.
In the Model Hierarchy pane, navigate to ConfiguredVirtualVehicleModel > External Data > VirtualVehicleTemplate.
In the list of Referenced Dictionaries, select
PassVeh
. Click Open.In the Model Hierarchy pane, select ConfiguredVirtualVehicleModel > PassVeh > Design Data.
Set the data dictionary variable value to the initial vehicle position values recommended for the scene. For this example, use these recommended values for the US Highway scene.
Data Dictionary Variable Description Recommended Value PlntVehInitLongPos
Recommended starting location - X
3592.00
PlntVehInitLatPos
Recommended starting location - Y
2617.00
PlntVehInitVertPos
Recommended starting location - Z
1.00
PlntVehInitRollAng
Recommended starting location - Roll
0
PlntVehInitPitchAng
Recommended starting location - Pitch
0
PlntVehInitYawAng
Recommended starting location - Yaw
0
In the
PassVeh
data dictionary, confirm the variable values match the recommended starting values for the scene.In the Model Explorer, save the
PassVeh
changes.
Step 4: Run Simulation
On the ConfiguredVirtualVehicleModel
model toolstrip, click
Run. As the simulation runs, view the results in the Simulation
3D Viewer. For this example, view a braking maneuver on a highway.
See Also
Virtual Vehicle Composer | Acceleration and Braking | Longitudinal Driver | US Highway