Main Content

Fly the De Havilland Beaver with Unreal Engine Visualization

This example shows how to model the De Havilland Beaver using Simulink® and Aerospace Blockset™ software with Unreal Engine® (UE) visualization. It also shows how to use a pilot's joystick to fly the De Havilland Beaver in either the Airport or Griffiss Airport scenes.

The De Havilland Beaver model includes airframe dynamics and aerodynamics. Effects of the atmosphere are also modeled, such as wind profiles for the landing phase.

The Fly the De Havilland Beaver example interfaces with the FlightGear flight simulator. This example explores the use of UE visualization.

Explore UE Visualization

To begin the conversion, open the De Havilland Beaver Airframe > Aircraft Dynamics subsystem and add the pilot commands to ACBus so that the control surface movements can be included in the visualization.


Replace the three animation and FlightGear blocks on the right side of the model with a single subsystem called UE Visualization that takes the ACBus as input.


In the new UE Visualization subsystem, add a Simulation 3D Aircraft block first, and then the Simulation 3D Scene Configuration block. Double-click the aircraft block and clear Enable altitude sensor in the Altitude Sensor tab, then click OK.

Connect the ACBus input to a bus selector and configure it to output Xe (body location), [phi, theta, psi] (body rotation), and Pilot (actuator commands). Send that data to the translation and rotation subsystems as shown below.


The Sky Hogg aircraft type represents the De Havilland Beaver, although it is a smaller and less massive airframe than the Beaver. To properly visualize the Beaver, create a skeletal mesh for it using the General Aviation skeleton and import that FBX file imported into Unreal Editor®. For more details, see Prepare Custom Aircraft Mesh for the Unreal Editor and General Aviation.

To place the aircraft in a better location in the Airport and Griffiss Airport maps, the UE Translation Subsystem adds an offset to the body location.


The Translation and Rotation inputs to the Simulation 3D Aircraft block are sized as [11x3] as required for the Sky Hogg aircraft type. The following table shows what part of the aircraft each of these affect. Note that, other than the body, only one rotation of the six degrees of freedom is enabled for each part. SkyHoggTable_76.png

The UE Rotation Subsystem assembles the [11x3] rotation matrix using the body rotations as well as pilot actuator commands for the propeller RPM, rudder, elevator, left and right ailerons, and flaps.


Open the model.

mdl = "asbdhc2_FlyBeaverUE";


Before running the model, note that Simulation Pacing has been turned on so that the simulation clock matches the wall clock.

  • Make sure your joystick is connected.

  • Click the Run button, then allow a few seconds for the 3D visualization window to initialize.

  • Use the joystick to fly the aircraft. Make a left turn to fly towards the airport.

  • Once it is simulating, you can switch between camera views by first left-clicking inside the 3D window, then using the keys 0 through 9 to choose between ten preconfigured camera positions. For flight simulation, views 2 (behind) and 5 (cockpit) are the most useful. For more information on camera views, see the Run Simulation section in Customize Scenes Using Simulink and Unreal Editor.

Beaver_overAirportUpdated (3).png

To fly in the Griffiss Airport scene, double-click the Simulation 3D Scene Configuration block to open its mask, and set the Scene source to Unreal Editor. Enter the Project location (i.e., the location to which you save the AutoVrtlEnv.uproject file from the support package), then click the Open Unreal Editor button and close the mask. Once Unreal Editor opens, change the map to Griffiss Airport (find the folder MathWorksAerospaceContent Content > Maps and double-click GriffissAirport).

Click the Run button, and once the model has compiled and "Initializing" is displaying on the bottom bar, press the Play button in Unreal Editor. Allow a few seconds for the connection to be made and simulation to begin.


See Also


Related Topics