aero.flightgearanimation objects -凯发k8网页登录

main content

aero.flightgearanimation objects

the aerospace toolbox interface to the flightgear flight simulator enables you to visualize flight data in a three-dimensional environment. the third-party flightgear simulator is an open source software package available through a gnu® general public license (gpl). this section describes how to obtain and install the third-party flightgear flight simulator. it also describes how to play back 3-d flight data by using a flightgear example, provided with your aerospace toolbox software. for an example of the aerospace toolbox interface to the flightgear flight simulator, see create a flight animation from trajectory data.

about the flightgear interface

the flightgear flight simulator interface included with the aerospace toolbox product is a unidirectional transmission link from the matlab® software to flightgear. it uses flightgear's published net_fdm binary data exchange protocol. data is transmitted via udp network packets to a running instance of flightgear. the toolbox supports multiple standard binary distributions of flightgear. for interface details, see flight simulator interface example following.

flightgear is a separate software entity that is not created, owned, or maintained by mathworks.

  • to report bugs in or request enhancements to the aerospace toolbox flightgear interface, contact mathworks technical support at .

  • to report bugs or request enhancements to flightgear itself, go to and use the contact page.

supported flightgear versions

the aerospace toolbox product supports flightgear versions starting from v2.6.

obtaining flightgear software

you can obtain flightgear software from in the download area or by ordering cds from flightgear. the download area contains extensive documentation for installation and configuration. because flightgear is an open source project, source downloads are also available for customization and porting to custom environments.

configuring your computer for flightgear

you must have a high-performance graphics card with stable drivers to use flightgear. for more information, see the flightgear cd distribution or the hardware requirements and documentation areas of the flightgear website, .

setup on linux, mac os x, and other platforms

flightgear distributions are available for linux®, mac os x, and other unix® platforms from the flightgear website, . installation on these platforms, like windows®, requires careful configuration of graphics cards and drivers. consult the documentation and hardware requirements sections at the flightgear website.

flightgear and video cards in windows systems

your computer built-in video card, such as nvidia® cards, can have issues working with flightgear shaders. consider this workaround:

  • disable the flightgear shaders by specifying the disableshaders property of the aero.flightgearanimation object to the method.

install and start flightgear

the extensive flightgear documentation guides you through the installation. for complete installation instructions, consult the documentation section of the flightgear website .

note:

  • generous central processor speed, system and video ram, and virtual memory are essential for good flight simulator performance.

    for more information, see .

  • have sufficient disk space for the flightgear download and installation.

  • before you install flightgear, configure your computer graphics card. see the preceding section, configuring your computer for flightgear.

  • before installing flightgear, shut down all running applications (including the matlab software).

  • install flightgear in a folder path name composed of ascii characters.

  • the operational stability of flightgear is especially sensitive during startup. it is best to not move, resize, mouse over, overlap, or cover up the flightgear window until the initial simulation scene appears after the startup splash screen fades out.

  • the current releases of flightgear are optimized for flight visualization at altitudes below 100,000 feet. flightgear does not work well or at all with very high altitude and orbital views.

the aerospace toolbox product supports flightgear on a number of platforms (). the following table lists the properties to be aware of before you start using flightgear.

flightgear propertyfolder descriptionplatformstypical location

flightgearbasedirectory

flightgear installation folder.

windows

c:\program files\flightgear
(default)

linux

directory into which you installed flightgear

mac

/applications
(folder into which you dragged the flightgear icon)

geometrymodelname

model geometry folder

windows

c:\program files\flightgear\data\aircraft\hl20
(default)

linux

$flightgearbasedirectory/data/aircraft/hl20

mac

$flightgearbasedirectory/flightgear.app/contents/resources/data/aircraft/hl20

installing additional flightgear scenery

when you install the flightgear software, the installation provides a basic level of scenery files. the flightgear documentation guides you through installing scenery as part the general flightgear installation.

if you need to install more flightgear scenery files, see the instructions at . those instructions describe how to install the additional scenery in a default location.

if you install additional scenery in a non-standard location, you may need to update the fg_scenery environment variable in the script output from the function to include the new path. for a description of the fg_scenery variable, see the documentation at .

if you do not download scenery in advance, you can direct flightgear to download it automatically during simulation using the installscenery property of the aero.flightgearanimation object for the method.

for windows systems, you may encounter an error message while launching flightgear with the installscenery option enabled:

error creating directory: no such file or directory

this error likely indicates that your default flightgear download folder is not writeable, the path cannot be resolved, or the path contains unc path names. to work around the issue, edit the runfg.bat file to specify a new folder path to store the scenery data:

  1. edit runfg.bat.

  2. to the list of command options, append --download-dir= and specify a folder to which to download the scenery data. for example:

    --download-dir=c:\users\user1\documents\flightgear

    all data downloaded during this flightgear session is saved to the specified directory. to avoid downloading duplicate scenery data, use the same directory in succeeding flightgear sessions

  3. to open flightgear, run runfg.bat.

note

each time that you run the function, it creates a new script. it overwrites any edits that you have added.

flight simulator interface example

the aerospace toolbox product provides an example named displaying flight trajectory data. this example shows you how you can visualize flight trajectories with flightgear animation object. the example is intended to be modified depending on the particulars of your flightgear installation. use this example to play back your own 3-d flight data with flightgear.

before attempting to simulate this model, you must have flightgear installed and configured. see about the flightgear interface.

to run the example:

  • import the aircraft geometry into flightgear.

  • run the example. the example performs the following steps:

    • loads recorded trajectory data.

    • creates a time series object from trajectory data.

    • creates a flightgearanimation object.

  • modify the animation object properties, if needed.

  • create a run script for launching the flightgear flight simulator.

  • start the flightgear flight simulator.

  • play back the flight trajectory.

import the aircraft geometry into flightgear

before running the example, copy the aircraft geometry model into flightgear. from the following procedures, choose the one appropriate for your platform. this section assumes that you have read install and start flightgear.

if your platform is windows:

  1. go to your installed flightgear folder. open the data folder, and then the aircraft folder: flightgear\data\aircraft\.

  2. if you have previously run the aerospace blockset™ nasa hl-20 with flightgear interface example, you might already have an hl20 subfolder there. if that is the case, you do not have to do anything, because you can use the existing geometry model.

    otherwise, copy the hl20 folder from the matlabroot\toolbox\aero\animation folder to the flightgear\data\aircraft folder. this folder contains the preconfigured geometries for the hl-20 simulation and hl20-set.xml. the file hl20.xml defines the geometry.

if your platform is linux:

  1. go to your installed flightgear folder. open the data folder, then the aircraft folder: $flightgearbasedirectory/data/aircraft/.

  2. if you have previously run the aerospace blockset nasa hl-20 with flightgear interface example, you might already have an hl20 subfolder there. if that is the case, you do not have to do anything, because you can use the existing geometry model.

    otherwise, copy the hl20 folder from the matlabroot/toolbox/aero/animation folder to the $flightgearbasedirectory/data/aircraft/ folder. this folder contains the preconfigured geometries for the hl-20 simulation and hl20-set.xml. the file hl20.xml defines the geometry.

if your platform is mac:

  1. open a terminal.

  2. list the contents of the aircraft folder. for example, type:

    ls $flightgearbasedirectory/data/aircraft/
  3. if you have previously run the aerospace blockset nasa hl-20 with flightgear interface example, you might already have an hl20 subfolder there. if that is the case, you do not have to do anything, because you can use the existing geometry model.

    otherwise, copy the hl20 folder from the matlabroot/toolbox/aero/animation folder to the $flightgearbasedirectory/flightgear.app/contents/resources/data/aircraft/ folder. this folder contains the preconfigured geometries for the hl-20 simulation and hl20-set.xml. the file hl20.xml defines the geometry.

see also

related topics

网站地图