Hauptinhalt

Prepare Custom UAV Vehicle Mesh for Unreal Engine Scenario Simulation

You can configure a custom UAV vehicle mesh for use in Unreal Engine simulations by using the UAV Toolbox Interface for Unreal Engine® Projects. To use your custom UAV vehicle mesh for Unreal Engine simulations, you must configure the mesh with the correct part names and bone hierarchy, and export the mesh to the .fbx file format.

Note

  • This topic shows you how to configure your custom UAV vehicle mesh using Blender® Version 4.5. However, you can use other 3D computer graphics software tools that can export meshes in the .fbx file format.

  • For details on how to install the UAV Toolbox Interface for Unreal Engine Projects, see Install Support Package for Customizing Scenes.

Assign Names to UAV Vehicle Mesh Parts

Import your custom UAV vehicle mesh file into Blender, and then assign these names to the UAV vehicle mesh parts.

UAV model indicating the positions of the rotor blade, motor, body, camera arm, and camera pivot point

This table indicates which UAV vehicle mesh parts require specific names, and what those names are. Note that, because the Simulation 3D UAV Vehicle block supports only up to eight motor-rotor pairs, you cannot specify names for more than eight motors and eight rotors. For any UAV vehicle mesh parts not included in this table, such as wings and control surfaces, you can specify any name.

UAV Vehicle Mesh PartName
UAV bodyUAV_body
UAV motorUAV_Motor1, UAV_Motor2, … , UAV_Motor8
UAV rotor bladeUAV_Rotor1, UAV_Rotor2, … , UAV_Rotor8
Camera pivot pointUAV_CameraPivot
Camera armUAV_CameraArm

Configure Bone Hierarchy

Configure your custom UAV vehicle mesh parts with this hierarchy:

  1. UAV_body is the parent of all other UAV objects.

  2. Each UAV_Motorn object is the parent of the corresponding UAV_Rotorn object.

  3. The UAV_CameraPivot object is the parent of the UAV_CameraArm object.

This diagram illustrates the bone hierarchy.

Bone hierarchy of UAV mesh

Note

Your custom UAV vehicle mesh does not need to contain every part, but if you include a part that is a child of another part the hierarchy must also contain the corresponding parent part. For instance, if you want to use a camera arm in your UAV, you must also create a corresponding camera pivot.

Export Mesh and Armature

Once you have configured your mesh part names and their hierarchy, export your mesh to the .fbx file format.

To export your mesh from Blender, select the entire mesh, then select File, then Export, and then FBX (.fbx). Specify these options in the corresponding pane of the export menu:

  • In the Object Types pane, select Armature and Mesh.

  • In the Transform pane, specify these values:

    • Scale1.00.

    • Apply ScalingsAll Local.

    • ForwardX Forward.

    • UpZ Up.

    • Select Apply Unit.

  • In the Geometry pane, specify these values:

    • SmoothingFace.

    • Select Apply Modifiers.

  • In the Armature pane, specify these values:

    • Primary Bone AxisX Axis.

    • Secondary Bone AxisZ Axis.

After you have specified these options, select Export FBX.

Launch Unreal Editor from Simulink

To run an Unreal Engine scenario simulation, your Simulink model must contain a Simulation 3D UAV Vehicle block, and a Simulation 3D Scene Configuration block.

To establish a connection between your Simulink model and the Unreal Editor, you must open the Unreal Editor using the Simulation 3D Scene Configuration block. Open the Simulation 3D Scene Configuration block and specify these parameters:

  • Scene sourceUnreal Editor

  • Project — Path of the AutoVrtlEnv project that comes installed with the UAV Toolbox Interface for Unreal Engine Projects

To launch Unreal editor, Click Open Unreal Editor.

Simulation 3D scene configuration block mask

Import Mesh into Unreal Editor

To import your custom mesh into Unreal Editor:

  1. In the Content Browser pane of the Unreal Editor, select Add, and then select New Folder. Create a folder for your custom mesh.

  2. Select Add again, then select Import to folder, where folder is the name of the folder you created for your custom mesh. In the window that opens, select the .fbx file that you want to import.

  3. In the FBX Import Options dialog box, select Skeletal Mesh. Open the Skeleton drop-down list, select the settings gear icon, select both Show Engine Content and Show Plugin Content, then select UAV_Skeleton.

    FBX Import Options dialog box

  4. Select Import All.

  5. In the Content Browser pane, double-click the mesh that you have imported to open the Asset Details menu.

  6. In the Material Slots pane of the Asset Details menu, specify the Slot Name of the element that corresponds to the UAV body as VehicleBody, then save your changes by clicking Save This Asset .

Configure Simulation 3D UAV Vehicle Block

To configure the Simulation 3D UAV Vehicle block to use the custom mesh that you have imported to Unreal Editor, first copy the reference to the mesh by right-clicking the mesh in the Content Browser pane and selecting Copy Reference.

Copy Reference option

Open the block mask of the Simulation 3D UAV Vehicle block. Set the Type parameter to Custom, and paste the reference to the mesh in the Path to custom mesh parameter. Click OK to save your changes.

Simulation 3D UAV Vehicle block mask.

Start Simulation

To start the simulation:

  1. In the Content Browser of Unreal Editor, navigate to the Maps folder, then double-click the scene in which you want to run the simulation.

  2. In the Simulink model that contains the Simulation 3D Scene Configuration and Simulation 3D UAV Vehicle blocks, select Run . The Simulink model remains in the Initialize state until you run the scene in Unreal Editor.

  3. In Unreal Editor, click Play to run the scene.

For an example of running an Unreal Engine scenario simulation with a custom UAV mesh, see the Visualize VTOL UAV Takeoff and Forward Transition example.

See Also

|

Topics

External Websites