virtualair
contact us
Air traffic simulation and visualization platform.

Aircraft Visualization

This module provides visualization of aircraft.

../_images/py_aircraft1s.png ../_images/py_aircraft2s.png

For example:

import _ossimPlanet
import _aircraft
_aircraft.setModelPath("share/FlightGear")

globe = _ossimPlanet.ossimPlanet()
# ... globe initialization

plane = _aircraft.aircraft(globe)
plane.setICAOType("A320")
plane.setScale(10)
plane.setLandingGearPos(100);
plane.setLocation(0, -90, (1000, 'AMSL'))

while not globe.renderDone():
  globe.renderFrame()

Class aircraft

The aircraft provides aircraft visualization based on the SimGear library and using the FlightGear compatible aircraft models.

Note: To use this class you need to install FlightGear data files.

setModelPath(path)

The setModelPath() function configures path to the FlightGear data folder. This function must be called before any aircraft objects are created.

In Windows environments, the path value may be e.g. C:\Program Files\FlightGear\data.

class aircraft
The aircraft represents a single aircraft in the visualization environment.

aircraft instances have the following methods:

aircraft.setCallSign(text)
The setCallSign() method changes call sign displayed in the the aircraft label.
aircraft.setICAOType(type)

The setICAOType() method changes aircraft equipment type. This also changes the visual model of the aircraft.

The type parameter represents the ICAO-4444/ICAO-8643 identifier. The list of supported types and mapping to FlightGear models is described in the MP/aircraft_types.xml file located in the FlightGear data folder.

aircraft.setSISOType(ek, dom, cc, cat, scat, sp, ex)

The setICAOType() method changes aircraft equipment type. This also changes the visual model of the aircraft.

The parameters represent the SISO-REF-010 entity-type identifier. The list of supported types is described in the MP/aircraft_types.xml file.

aircraft.setLocation(latitude, longitude, altitude)

The setLocation() method changes the aircraft location. The latitude and longitude must be specified in geodetic coordinates.

The altitude is a 2-tuple (value, "AGL"), or (value, "AMSL") to specify the altitude Above Ground Level (AGL), or Above Medium Sea Level (AMSL). The altitude value is specified in meters.

aircraft.setOrientation(yaw, pitch, roll)
The setOrientation() method changes the aircraft attitude. The parameters represent the Tait-Bryan angles in degrees.
aircraft.setScale(scale)
The setScale() method changes the aircraft model scale. The model will be proportionally magnified for scale > 1.0.
aircraft.setColor(red, green, blue, alpha)
The setColor() method changes color of the aircraft label, path and vertical guide line. The alpha value determines transparency of the path tube.
aircraft.setTrackTubeRadius(radius)
The setPathTubeRadius() method configures the tubus drawn along the aircraft track. The radius value defines the radius of the tube (in meters). The value 0 (zero) draws a line only and the value None disables track visualization.
aircraft.showVertical(enabled)
The showVertical() method enables or disables the vertical guide line from the center (CoG) of the aircraft model towards the Earth center.
aircraft.setLandingGearPos(pos)
The setLandingGearPos() method configures position of all landing gears. The pos value may range from 0 (retracted up) to 100 (engaged down).
aircraft.setFlapsPos(pos)
The setFlapsPos() method configures position of all flaps. The pos value may range from 0 (flaps closed) to 100 (flaps open).
aircraft.setNavigationLights(enabled)
The setNavigationLights() method enables or disables the navigation lights of the aircraft model.
aircraft.setEnginesRevolutionRate(rpm)
The setEnginesRevolutionRate() method configures the revolutions per minute (RPM) rate for all engines. This method is useful for propeller aircraft only.

Configuration of Aircraft Types

The list of aircraft types and mapping between the ICAO, SISO and FlightGear identifiers for each aircraft type is described in the aircraft_types.xml file. This file is stored in the FlightGear/data/MP folder.

<AircraftTypes>
  <Type ICAO="A320" SISO="1.2.71.57.1.1.0" FlightGear="Aircraft/A320/Models/a320-fb.xml"/>
</AircraftTypes>

The following attributes are used:

ICAO
The ICAO-4444/ICAO-8643 identifier of the aircraft equipment type. This value is used by the setICAOType() method.
SISO
The SISO-REF-010 entity-type identifier of the aircraft. This value is used by the setSISOType() method.
FSX
Container title for the Microsoft Flight Simulator X (aircraft.cfg). This attribute is not used by any function of this visualization module.
FlightGear
Path to the FlightGear aircraft model configuration file (.xml). This file contains the 3D model displayed in visualization.