The scene interrogation with camera and ray tracing reference application provides the Simulink® interface with the 3D visualization environment. For the minimum hardware required to run the reference application, see 3D Visualization Engine Requirements and Limitations.
The scene interrogation with camera and ray tracing reference application contains:
One passenger vehicle with a simple driveline and a 3DOF vehicle dynamics model.
One camera mounted on the passenger vehicle rearview mirror.
Steering, acceleration, and braking control dials.
3D visualization environment configured for the Virtual Mcity scene.
Create and open a working copy of the camera and ray tracing reference application project.
When you run the simulation, the reference application provides this vehicle and scene information.
Window | Description | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AutoVrtlEnv | Video output of the Unreal Engine® 3D visualization environment image feedback. By
default, the display shows the view from the Simulation 3D
Scene Configuration block Scene
view parameter
To smoothly change the camera views, use these key commands.
For additional camera controls, use these key commands.
| ||||||||||||||||||||||||||||||||||
SDL Video Display | Video image output of Simulation 3D Camera Get block. By default, the display shows the view specified by these parameter settings:
|
This table summarizes the parts of the reference application.
Name | Description |
---|---|
Controls | Dials and gauges that control the vehicle steering, gear, acceleration, and braking. |
Sensors | The Simulation 3D Actor Transform Get block returns the translation, rotation, and scale for the vehicle passenger vehicle and four wheels from the 3D visualization environment. The Simulation 3D Camera Get block returns the camera image from the 3D visualization environment. By default, the block returns image data for a camera location specified by these parameter settings:
|
Dynamics and Controls | Interfaces with Simulink to calculate the dynamic response of the vehicle plant and controller. By default, the subsystem contains a simple driveline and the Vehicle 3DOF Dual Track block vehicle dynamics model. |
Displays | The Simulation 3D Vehicle with Ground Following block implements a passenger vehicle in the 3D visualization environment. The block uses the vehicle position to adjust the vehicle elevation, roll, and pitch so that the vehicle follows the ground terrain. By default, the block has these parameter settings:
The Simulation 3D Scene Configuration block configures the Unreal Engine 3D visualization environment. By default, the block has these parameter settings:
The TransformDisplay
subsystem displays the translation, rotation, and scale of the
The ImageDisplay subsystem displays the video image output of Simulation 3D Camera Get block in the SDL Video Display window. |
In the TransformDisplay subsystem, the Display block provides the translation, rotation, and scale of the vehicle body and four wheels. Use the Constant block value to control the display.
1
— Translation
2
— Rotation
3
— Scale
For example, to display translation information, set the value to
1
.
The display indicates that the:
Vehicle body is at -212.5
m,
65.66
m, and 0.0112
m along
the world X-, Y-, and
Z- axes, respectively.
Wheels are at their initial positions along the world X-, Y-, and Z- axes, respectively.
The Display block provides an array of the vehicle and wheel locations.
Vehicle translation and rotation are along the world coordinate system axes.
Wheel translations and rotations are with respect to their initial positions, along the world coordinate system axes.
In the ImageDisplay subsystem, the Level-2 MATLAB S-Function block
uses the VideoDisplayMSfcnWin
function to display the video image
output of Simulation 3D Camera Get block.
Simulation 3D Actor Transform Get | Simulation 3D Camera Get | Simulation 3D Scene Configuration | Simulation 3D Vehicle with Ground Following | Virtual Mcity