Send data to Unreal Engine visualization environment
Vehicle Dynamics Blockset / Vehicle Scenarios / Sim3D / Sim3D Core
The Simulation 3D Message Set block sends data to the Unreal Engine® 3D visualization environment. In your model, ensure that the Simulation 3D Scene Configuration block is at the same level as the Simulation 3D Message Set block.
Verify that the Simulation 3D Message Set block executes before the Simulation 3D Scene Configuration block. That way, Simulation 3D Message Set prepares the signal data before the Unreal Engine 3D visualization environment receives it. To check the block execution order, right-click the blocks and select Properties. On the General tab, confirm these Priority settings:
Simulation 3D Scene Configuration —
Simulation 3D Message Set —
For more information about execution order, see Control and Display Execution Order.
To use the block, you must configure scenes in the Unreal Engine environment to receive data from the Simulink® model:
Install the Customize 3D Scenes for Vehicle Dynamics Simulations.
In the Unreal® Editor, follow these general workflows to receive data from Simulink. For detailed information, see Get Started Communicating with the Unreal Engine Visualization Environment.
Unreal Engine User
By default, the Double Lane Change scene has a
For more information about the Unreal Editor, see the Unreal Engine 4 Documentation.
WriteMsg— Data sent to scene
Data sent to the 3D visualization environment scene. In the Unreal Engine environment, you can configure the
Sim3DGet class to
receive the data from the Simulink model.
For example, in the Unreal Editor, the Double Lane Change scene has a
Sim3DGetInteger integer actor with tag name
TrafficLight1. The integer actor reads
data type from the Simulink model. You can use it to control the traffic signal light color.
table provides the scene traffic signal light color that corresponds to the
WriteMsg value in the Double Lane Change scene.
Simulation 3D Message Set Block
Signal name, SigName— Message signal name
Specifies the signal name in the 3D visualization environment. In the Unreal Engine environment, use the
Sim3Get actor class 'Tags'
property located in the 'Details' pane.
For example, you can send data to the double lane change scene that changes the
traffic signal light color to red, yellow, or green. To send data to the traffic signal
light, set this parameter to
TrafficLight1. In the double lane change
scene, the 'Tags' property value for
Sim3dGetInteger actor class is
set to TrafficLight1.
Sample time— Sample time
Sample time, in s. The graphics frame rate is the inverse of the sample time. If you set the
sample time to
-1, the block uses the sample time specified in the
Simulation 3D Scene Configuration block.