Main Content

Simulation 3D UAV Vehicle

Place UAV vehicle in 3D visualization

Since R2020b

  • Simulation 3D UAV Vehicle block

Libraries:
UAV Toolbox / Simulation 3D

Description

Note

Simulating models with the Simulation 3D UAV Vehicle block requires Simulink® 3D Animation™.

The Simulation 3D UAV Vehicle block implements an unmanned aerial vehicle (UAV) in a 3D simulation environment. This environment is rendered using the Unreal Engine® from Epic Games®. The block uses the input (X, Y, Z) position and input (roll, pitch, yaw) attitude of the UAV in the simulation.

To use this block, ensure that the Simulation 3D Scene Configuration block is in your model. If you set the Sample time parameter of the Simulation 3D UAV Vehicle block to -1, the block inherits the sample time specified in the Simulation 3D Scene Configuration block.

Tip

The Simulation 3D UAV Vehicle block must execute before the Simulation 3D Scene Configuration block. That way, the Simulation 3D UAV Vehicle block 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 Configuration0

  • Simulation 3D Vehicle-1

For more information about execution order, see Block Execution Order.

Examples

Ports

Input

expand all

Translated position of the vehicle relative to the Unreal Engine scene origin.

If you disable the Use geospatial coordinates for inputs and initial values parameter, the translation vector defines the X-, Y-, and Z-positions of the UAV in the Unreal Engine world coordinate frame. Units are in meter.

If you enable the Use geospatial coordinates for inputs and initial values, the translation vector defines the latitude, longitude, and altitude of the vehicle. This block will place the UAV in the Unreal Engine world coordinate frame by evaluating the translation input relative to the scenario origin coordinate that you specify using the GeoOrigin input.

For more information on the coordinate systems, see Coordinate Systems for Unreal Engine Simulation in UAV Toolbox.

Data Types: double

Rotation of the vehicle relative to the Unreal Engine inertial reference frame.

If you disable the Use geospatial coordinates for inputs and initial values parameter, the rotation vector defines the Yaw, Pitch, and Roll values, in radians, of the vehicle rotation relative to the Unreal Engine world coordinate frame.

If you enable Use geospatial coordinates for inputs and initial values, the rotation vector defines the Yaw, Pitch, and Roll values, in radians, of the vehicles rotation relative to the local ENU frame at the current position of the UAV.

For more information on the coordinate systems, see Coordinate Systems for Unreal Engine Simulation in UAV Toolbox.

Data Types: double

Geospatial coordinates of the Unreal Engine world origin, specified in the form [latitude longitude altitude]. latitude and longitude are in degrees, and altitude is in meters.

Dependencies

To enable this port, select the Use geospatial coordinates for inputs and initial values parameter.

Data Types: double

Parameters

expand all

Vehicle Parameters

Select the type of vehicle. To obtain the dimensions of each vehicle type, see these reference pages:

Specify the path to a custom mesh file for the UAV.

To create a custom UAV mesh, see Prepare Custom UAV Vehicle Mesh for the Unreal Editor.

Example: /MathWorksSimulation/UAVs/Custom/Meshes/UAV_Custom.UAV_Custom

Dependencies

To enable this parameter, set the Type parameter to Custom.

Select the color of the vehicle.

Name of vehicle. By default, when you use the block in your model, the block sets the Name parameter to SimulinkVehicleX. The value of X depends on the number of Simulation 3D UAV Vehicle blocks that you have in your model.

The vehicle name appears as a selection in the Parent name parameter of any UAV Toolbox Simulation 3D sensor blocks within the same model as the vehicle. With the Parent name parameter, you can select the vehicle on which to mount the sensor.

Select this parameter to use geospatial coordinates for port inputs and initial values in the form.

Initial Values

Specify the initial position of your vehicle in one of these forms:

  • [X Y Z] when you clear the Use geospatial coordinates for inputs and initial values parameter. X, Y, and Z are the translation along the X-axis, Y-axis, and Z-axis, respectively, in the inertial Z-down coordinate system, in meters.

  • [latitude longitude altitude] when you enable the Use geospatial coordinates for inputs and initial values parameter. You must specify latitude and longitude in degrees, and altitude in meters.

Specify the initial georeference origin in the form [latitude longitude altitude], You must specify latitude and longitude in degrees, and altitude in meters.

Dependencies

To enable this parameter, select the Use geospatial coordinates for inputs and initial values parameter.

Specify the initial angle of rotation for your vehicle, in radians, in the form [roll pitch yaw].

Sample Time

Sample time, Ts, in seconds. 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.

Version History

Introduced in R2020b

expand all