FlightGear

 

An Open-Source Flight Simulator Project

 

http://www.flightgear.org

 

http://sourceforge.net/projects/flightgear

 

Overview

 

Flightgear is based on the University of Illinois at Urbana-Champaign's

LaRCsim project, which was originally created to test inflight icing solutions.

http://www.aae.uiuc.edu/m-selig/apasim/Aircraft-uiuc.html

 

In 1997 Curt Olsen began adapting the UIUC code to begin the FlightGear

project. The project's version history is online at:

http://www.flightgear.org/news.html

 

The project is open-source and under the GNU General Public License.

http://www.gnu.org/copyleft/gpl.html#SEC1

 

The project is cross-platform and has been running on Linux, FreeBSD,

Solaris, MacOS, IRIX, Cygwin and Win32 platforms (and maybe others).

 

The simulator application has hundreds of available command line switches,

and the aircraft aerodynamics, cockpits and 3D models are all defined in

XML-based text files. You can chose between three Flight Dynamics Models:

LaRCsim, JSBSim and Yasim

 

 

Project Architecture

 

OpenGL

 

The underlying layer is OpenGL, an open source, high performance graphics

library, created by Silicon Graphics and based on their IRIS GL API. It is similar

to DirectX®. To run FlightGear, or even compile it, you need an OpenGL-

compatible video card and associated drivers. Right now, nVIDIA has the best-supported high-end video cards for linux users.

 

OpenGL: http://www.opengl.org/

nVIDIA: http://www.nvidia.com/

 

There are two usual ways to get OpenGL. Commonly, linux distributions use Mesa,

a free implementation of OpenGL. NVIDIA supplies its own version of the

OpenGL libraries for use with their hardware. Caution: If you have more than

one version of the OpenGL libs installed, make sure your symlinks point to the

ones made for your video card!

 

 

 

GLUT

 

GLUT is the OpenGL Utility Kit. It is a platform-independent API which provides

simplified windowing system routines. GLUT can be installed from source (not for

the faint-of-heart as it requires tinkering with the makefiles), or from the RPM

package MesaDemos.

 

ZLIB

 

ZLIB is a "massively spiffy yet delicately unobtrusive compression library". You

probably already have it. If not, try rpmfind or http://www.gzip.org/zlib .

 

Metakit

 

Metakit is an "efficient embedded database library with a small footprint", and free. Get it at rpmfind or at http://www.equi4.com/metakit.

 

PLIB

 

PLIB is "Steve's Portable Games Library", a gaming API. It includes routines for

sound effects, music, 3D drawing, fonts, GUI, networking and assorted math and

utility routines for gaming. You should download the latest source from

http://plib.sourceforge.net and build it. This is your first chance to see how well your OpenGL library installation went.

 

SimGear

 

SimGear has been developed in conjunction with FlightGear, and supplies the

libraries which are basic to all real-time, real-world, 3D simulation. It contains math routines, XML input/output, a property-tree system of maintaining global data, serial and network I/O, magnetic variation models, atmospheric models, scenery and

vehicle rendering. SimGear is under active development, so it's best to download

and build the latest CVS source. http://www.simgear.org/

 

FlightGear

 

Finally we get to FlightGear. It's also under active development, so download and

build the bleeding-edge source. http://www.flightgear.org/Downloads/

 

It's recommended that FlightGear be installed in usr/local/FlightGear.

That's fine, but keep in mind that all the XML configuration files live in root space,

so you'll need to be root every time you edit them, which will be often. Being a

KDE guy, I have two desktop icons, one of which points to

kdesu "konqueror file:/" and one which points to kdesu kedit .

 

The base package

 

The base package contains data files, including many megabytes of graphics files,

called textures, configuration files, and navigational data.

 

 

 

Joysticks in Linux

 

Not much I can say except "good luck!" The information is out there, but it's

cleverly hidden at:

http://www.linux-usb.org/USB-guide/x194.html

http://atrey.karlin.mff.cuni.cz/~vojtech/input/

http://eo.yifan.net/users/g/jniehof/linuxjoy.html

http://www.freelink.cx/joystick.html

 

Once you think you have the joystick set up right, run the FlightGear utility

called /usr/local/FlightGear/bin/fgjs to check it out.

 

 

 

Running FlightGear

 

fgfs

 

The main application is /usr/local/FlightGear/bin/fgfs. When fgfs starts,

it looks in your home directory for a configuration dot-file called .fgfsrc .

This is the place to keep your command line arguments. This file is edited so often

that you should consider keeping an icon on your desktop which points to

kedit /home/<your home dir>/.fgfsrc .

 

I recommend running fgfs from a console at first, and also if you do a lot of editing of configuration files. It provides a lot of feedback to stdout, which you'll need when

your changes don't parse right!

 

Here's a sample .fgfsrc file:

 

--fg-root=/usr/local/FlightGear

--aircraft=737

--prop:/engines/engine/running=true

--prop:/engines/engine[1]/running=true

--enable-hud

--disable-clouds

--start-date-gmt=2003:01:20:16:00:00

 

 

A useful list of arguments can be found at: http://www.flightgear.org/Docs/InstallGuide/

getstartch4.html#x9-330004.4

As you can see, just about everything in the simulator can be turned on or off,

and you can start flying anyplace on earth, at any altitude, at any time of day, in

any weather.

 

 

 

 

 

 

 

XML configuration files

 

Note the argument --aircraft=737 in the above dot-file. This instructs fgfs to

look for a file called /usr/local/FlightGear/Aircraft/737-set.xml .

This is the top-level configuration file for the 737 model. In it is defined the flight

dynamics model (FDM) to use, the path to the aerodynamics model, and the paths

to other XML files which configure sound, heads-up display, cockpit instrumentation, autopilot, 3D model, etc.

 

In the case of the 737 the FDM used is JSBSim. The aerodynamics model is

defined at /usr/local/FlightGear/Aircraft/737/737.xml . This file defines

the airplane's metrics, control system, aerodynamic coefficients, and the pathname of the engine file (in this case /usr/local/FlightGear/Engine/CFM56_sim.xml).

 

The sound configuration file, /usr/local/FlightGear/Aircraft/

737/737-sound.xml, associates various sounds with control movements and

flight events.

 

The HUD configuration file, /usr/local/FlightGear/Huds/737/default.xml,

offers excellent control over the heads-up display.

 

The instrument panel configuration file, /usr/local/FlightGear/Aircraft/

737/Panels/737-trans-mini-panel.xml in this case, defines the layout of

the panel and the pathnames to the various instruments themselves. For instance,

the first instrument, asi-450-knot.xml, is a standard Boeing 450-knot airspeed

indicator. The file defines which graphics layers are used to draw the instrument,

and how the needles are supposed to move. If you are handy with the Gimp, you

can create your own instruments. The graphics are in Silicon Graphics' RGB

format, also known as SGI format.

 

 

Helping out

 

Just by installing and using FlightGear you can help by reporting any configuration

problems, porting problems, compiler problems, hardware problems, etc. You can

also create your own aircraft and get them added to the base package. I suggest

lurking on the mailing lists first: see http://www.flightgear.org/mail.html .

 

To make your own 3D models you'll need an editor like Blender (http://www.blender3d.com/) or PPE (the Pretty Poly Editor, http://prettypoly.sourceforge.net/) .

 

Projects in the works include adding better turbine engine support, improving terrain and sky rendering, multiplayer support, expanded networking support, possibly replacing Plib with another gaming library, adding new airplanes, and of course, documentation. To contribute code you'll have to install and learn how to use CVS.