Simulation 3D Custom UAV Pack

Libraries:
UAV Toolbox /
Simulation 3D
Description
The Simulation 3D Custom UAV Pack block generates translation and rotation input for the
Simulation 3D UAV
Vehicle block with Type set to Custom.
Examples
Open the tiltRotorUAVModel.slx Simulink® model.
open_system("tiltRotorUAVModel")
This model uses the Simulation 3D UAV Vehicle block to simulate a custom Hexarotor UAV in 3D environment. The Type parameter is specified to Custom, and the Path to custom mesh is specified to /MathWorksUAVContent/UAVs/HexaRotorUAV/HexaRotor.HexaRotor.

This model uses the Simulation 3D Custom UAV Pack block to generate the translation and rotation inputs. The block is configured to accept the body translation, body rotation, tilt angles for motors 1 to 6, and angular velocities of rotors 1 to 6.

The Hexarotor custom mesh is configured with the bone hierarchy that is shown in the following image. For more details on how to configure custom UAV mesh for simulation in Unreal Engine, visit Prepare Custom UAV Vehicle Mesh for Unreal Engine Scenario Simulation.

In this example, the Hexarotor UAV is configured with the following input:
UAV_Body rotation angle — 0 radian of roll, pitch, and yaw angles.
UAV_Motor1 tilt angle — 0 radian.
UAV_Rotor1 angular velocity — 250 RPM, clockwise.
UAV_Motor2 tilt angle — pi/2 radian, oscillating at a rate of 1 rad/s.
UAV_Rotor2 angular velocity — 60 RPM, clockwise.
UAV_Motor3 tilt angle — 0 radian.
UAV_Rotor3 angular velocity — 250 RPM, counter-clockwise.
UAV_Motor4 tilt angle — 0 radian.
UAV_Rotor4 angular velocity — 250 RPM, counter-clockwise.
UAV_Motor5 tilt angle — pi/2 radian, oscillating at a rate of 1 rad/s.
UAV_Rotor5 angular velocity — 60 RPM, counter-clockwise.
UAV_Motor6 tilt angle — 0 radian.
UAV_Rotor6 angular velocity — 250 RPM, clockwise.
Run the tiltRotorUAVModel.slx Simulink model to start the simulation.

You can also run this example with an Octarotor UAV mesh by specifying the Path to custom mesh parameter of the Simulation 3D UAV Vehicle block as /MathWorksUAVContent/UAVs/OctaRotorUAV/OctaRotor.OctaRotor and running the model again.

Ports
Input
UAV Body translation, specified as a 1-by-3 vector.
The translation frame of reference depends on the value of the Use geospatial coordinates for inputs and initial values parameter of the associated Simulation 3D UAV Vehicle block.
off — The elements of the vector represent the x-, y-, and z-positions of the UAV in the Unreal Engine® world coordinate frame. Units are in meters.
on — The elements of the vector represent the latitude, longitude, and altitude of the UAV in meters.
For more information on the coordinate systems, see Coordinate Systems for Unreal Engine Simulation in UAV Toolbox.
Data Types: double
UAV body rotation, specified as a 1-by-3 vector. Units are in radians.
The frame of reference depends on the value of the Use geospatial coordinates for inputs and initial values parameter of the associated Simulation 3D UAV Vehicle block:
off — The rotation input is relative to the Unreal Engine world coordinate frame.
on — The rotation input is relative to the local ENU frame at the current position of the UAV.
Data Types: double
Pitch angle of the Nth motor around its y-axis in radians, specified as a scalar.
Dependencies
To enable a Motor N Tilt port, select the corresponding Motor N Tilt parameter. For example, to enable the Motor 3 Tilt port, select the Motor 3 Tilt parameter.
Data Types: double
Angular velocity of the Nth rotor in revolutions per minute (RPM), specified as a scalar.
Dependencies
To enable a Rotor N RPM port, select the corresponding Rotor N RPM parameter. For example, to enable the Rotor 3 RPM, select the Rotor 3 RPM parameter.
Data Types: double
Output
Translated position of the UAV, returned as a 1-by-3 vector.
Data Types: double
Rotation of the UAV, returned as a 17-by-3 matrix. This table summarizes the rows of the rotation matrix.
The first row of the matrix contains the rotation angles for the
UAV_Bodymesh part, as specified to the Body Rotation portEach angular velocity row contains the angular velocities around the x-, y-, and z-axes of the corresponding
UAV_Rotornmesh part that you set up when exporting the mesh to Unreal Engine. Units are in RPM.For each Rotor N RPM parameter you have not selected, the block assigns a value of
[0 0 250]to the corresponding angular velocity row.Each rotation angles row contains the yaw, pitch, and roll angles of the corresponding
UAV_Motornmesh part, in radians.For each Motor N Tilt parameter you have not selected, the block assigns a value of
[0 0 0]to the corresponding rotation angles row.
| Matrix Row | UAV Mesh Part and Value |
|---|---|
| 1 | UAV_Body rotation angles |
| 2 | UAV_Motor1 rotation angles |
| 3 | UAV_Rotor1 angular velocities |
| 4 | UAV_Motor2 rotation angles |
| 5 | UAV_Rotor2 angular velocities |
| 6 | UAV_Motor3 rotation angles |
| 7 | UAV_Rotor3 angular velocities |
| 8 | UAV_Motor4 rotation angles |
| 9 | UAV_Rotor4 angular velocities |
| 10 | UAV_Motor5 rotation angles |
| 11 | UAV_Rotor5 angular velocities |
| 12 | UAV_Motor6 rotation angles |
| 13 | UAV_Rotor6 angular velocities |
| 14 | UAV_Motor7 rotation angles |
| 15 | UAV_Rotor7 angular velocities |
| 16 | UAV_Motor8 rotation angles |
| 17 | UAV_Rotor8 angular velocities |
For more details on custom UAV meshes, see Prepare Custom UAV Vehicle Mesh for Unreal Engine Scenario Simulation.
Data Types: double
Parameters
Select a Motor N Tilt parameter to enable the corresponding Motor N Tilt input port. For example, selecting the Motor 3 Tilt parameter enables the Motor 3 Tilt input port.
Select a Rotor N RPM parameter to enable the corresponding Rotor N RPM input port. For example, selecting the Rotor 3 RPM parameter enables the Rotor 3 RPM input port.
Version History
Introduced in R2026a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)