Aircraft InterfaceThe Aircraft Interface is a VisualCommander interface (.vci) document that has been configured to run generic aircraft simulations. The interface provides the following two windows:
Screenshots of the 2 windows are shown below.
The "3D View" window has just one page, which includes the X52Scene display plugin. This plugin illustrates a 3D scene with a terrain and sky background, and a user-selectable CAD model for the aircraft. The default aircraft is the Globalhawk.
The "Aircraft Data" window has 6 pages. The list of pages is seen in the page pull down menu, shown below.
The "3D View" window and all of pages in the "Aircraft Data" window are described in the following sections.
The 3D View window contains the X52Scene display plugin, with a Session Manager plugin located at the bottom.
The Session Manager plugin provides a simple mechanism to pause / resume the simulation while it is running, and to reset it once it has completed. The Session Manager can be configured a variety of different ways. You can name the session, select a session type, and specify whether to start when ready or wait for a manual start. With the advanced option, you can specify the name and location of the setup file for the simulation. This is useful if you are consistently running the simulation with the same setup file. The aircraft interface will work with either the "aircraft.dss" or the "aircaft_with_joystck.dss" setup files.
The X52Scene plugin renders a 3D view of the vehicle with a terrain texture map and sky box in the background. In addition to displaying the location and orientation of the vehicle, this plugin also acts as a data source for the Saitek X52 Joystick.
A snapshot of the plugin is shown above. The red green and blue axes affixed to the aircraft are the "x", "y", and "z" axes of the Body-fixed frame, respectively. These axes are toggled on/off with the "b" key, or with the joystick "B" button. Similarly, the inertial NED (North-East-Down) frame axes can be toggled on off with the "a" key or the jostick "A" button. The green trail behind the aircraft is its past trajectory, which shows the last 60 seconds of its flight. This can be toggled on/off with the "t" key. Click-and-dragging the mouse inside the plugin window rotates the view, with the aircraft always kept at the center of the screen. Scrolling with the mouse wheel (or using the touchpad 2-finger scroll, or the +/- keys) will zoom the camera in/out. Pressing the "j", "k", "l", or ";" keys will snap the camera orientation to one of 4 preset views, and hitting the "r" key will reset the camera orientation and zoom. The snapshot below is taken after flying through a turn for about 30 seconds, hitting "k" to see the East-North ground-trace view, and then zooming out until the entire trajectory is visible.
To configure the X52Scene plugin, first drag a copy to your interface from the Tools menu. Remember you can hit CMD+R to pull up the Tools menu. With the plugin in your interface window, CNTRL+click and select "Configure". This pulls up the following window:
The pulldown menus for Terrain, Vehicle, and Skybox allow you to associate the texture map of your choice with each entity. To replicate the built-in Aircraft interface, choose "terrain", "Globalhawk" and "SkyboxT" as shown in the figure. If you are simulating an underwater vehicle, a special underwater terrain and water-box are provided.
The entries on the bottom of the figure allow you to specify which DSim variables are linked to the stick and throttle commands. The X52Scene plugin reads 3 different pilot controls: horizontal stick displacement, vertical stick displacement, and throttle setting. As the figure shows, the throttle setting is linked to: aircraft|pilot:throttle. This is the full path to the DSim variable, and can be read as the "throttle" variable in the "pilot" model for the "aircraft" session.
Note that you can write your own simulation and use the X52Scene plugin to interface stick and throttle data into your simulation. You can use whichever variable names you wish, because you can specify the unique path by configuring the instance of the X52Scene plugin in your VisualCommander interface.
The "Command" page shows plots of the 3 command signals (altitude, velocity, heading.) The plots and values are displayed on the right half of the page. Command plugins to set the values of the 3 variables are located on the left helf of the page.
Above each plot is a raw data display. Each raw data display was created by first dragging the data point from its location in the data tree. Each was then configured to have a black background, light blue text, and larger font. The name for each display was changed from the original variable name to a more descriptive text (i.e. "h" became "Altitude:"). Finally, the display was resized to span the length of the plot for visual appeal. These types of customizations are simple to perform yet can transform the appearance and clarity of your displays.
Note that in order to use these command plugins to fly the aircraft, the setup file should be changed to "aircraft.dss". The default setup file, "aircraft_with_joystick.dss", is designed to be flown with the joystick or keyboard controls. If the "aircraft.dss" setup file is used, then no joystick is needed and the command plugins on this page can be used to "fly" the aircraft.
To fly the aircraft using keyboard inputs, make sure the Session Manager loads the "aircraft_with_joystick.dss" file. To make velocity go up / down, use the "u" / "n" keys respectively. To fly left or right, use the left and right arrow keys. To fly up or down, use the up or down arrow keys.
The "Trajectory View" page shows three different 2D views of the aircraft trajectory, and one 3D plot.
The 2D views are created with the Plot display plugin. For example, the ground trace plot is created by dragging in both "x" and "y" (East and North) from the "aircraft" object in the data tree. Using the Plot configure menu, we selected the "Parametric On" option and chose "x" (East) as the variable to plotted on the horizontal axis. This left "y" (North) to be plotted on the vertical axis, giving the desired ground-trace plot.
The "States" page shows plots of 4 of the state signals (velocity, flight path angle, heading and thrust.)
The remaining states are the 3 positions, which are simply integrated from the velocity and plotted in the preceding "Trajectory View" page.
Note that the angles are plotted and displayed in units of degrees, even though they are in radians within the simulation. This is achieved by scaling the inputs (for both the plots and raw data displays) by a factor of 57.3. To do this, simply double-click the plot (or raw data display) while in edit mode, and select the "Inputs" tab. Select the input(s) you wish to scale from the list at the top of the window. In the "Value Transformation" area of the window, click "Enable". For this example, we use "deg" as the new units, and apply the expression: y=x*57.3. A screenshot is shown below as an example.
The "State Derivatives" page plots the time derivatives of the 4 above states.
Similar to the previous page, the plot and raw data display for each variable are visibly grouped together. This is done by clicking on all objects that you wish to group together, then right-click (or control-click), and select "Group" from the context menu. This creates a frame around all selected objects. You can now move the entire group of objects together. An example is shown below. The group background color has been changed to yellow.
The "Controls" page shows plots of the 3 control signals (lift, bank angle, thrust.)
The "Parameters" page provides several command plugins for the user to change the value of various simulation parameters. This includes control gains, maximum turn rate, maximum climb rate, the velocity bounds, and the engine time constant.
At the bottom right corner of each command plugin, we have placed a raw data plugin to display the current value of that parameter. This enables you to immediately verify that the value of the parameter has changed after you send the command.
Using this page, you can experiment with different control gains and rate limits, and evaluate the changing response of the aircraft. You may find that changing the gains or rates too drastically will cause the simulation to fail. In such a case you can simply reset the simulation using the Session Manager plugin, located at the bottom of the "3D View" window.