Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

FlightGear Glass Cockpit

From FlightGear wiki
Jump to: navigation, search
IMPORTANT: Some, and possibly most, of the features/ideas discussed here are likely to be affected, and possibly even deprecated, by the ongoing work on providing a property tree-based 2D drawing API accessible from Nasal using the new Canvas system available since FlightGear 2.80 (08/2012). Please see: FGCanvas for further information

You are advised not to start working on anything directly related to this without first discussing/coordinating your ideas with other FlightGear contributors using the FlightGear developers mailing list or the Canvas subforum This is a link to the FlightGear forum.. Anything related to Canvas Core Development should be discussed first of all with TheTom and Zakalawe. Nasal-space frameworks are being maintained by Philosopher and Hooray currently. talk page.

Canvasready.png

The FlightGear Glass Cockpit Project

I'm proud to announce the official launch of the FlightGear Glass Cockpit Project, short FGGC. The source is largely a dusted-off version of OpenGC by Damion Shelton. I'd like to thank Damion for leaving us a pretty solid, well-thought-out codebase and hope he will one day return to developing his own version of it. In this case, a re-merge is not out of question.

Where the project stands

So far, we have a dusted-off version of the latest release. I made several small design improvements and updated the interface code to match the current FG cvs code. Right now, the code compiles,runs stable, accepts input at udp port 5800 and processes it mostly correct. There is currently one working set of gauges, modelled after the Boeing 777.

Right now I'm calling the state of the project alpha, and that's not gonna change anytime soon.

The Boeing 777 PFD in action

News

  • FGGC will move entirely to it's sourceforge page effective immediately. That means, this is the last news entry here on this page. Be on the lookout for more news on the sourceforge page.
  • Alpha 3 is now available from the source forge project page
  • The garbage data segfault mentioned in issues earlier has been found and hardened against.
  • The heading indicator now correctly shows major headings by name
  • Project updates will be slow until my finals are over, I'll try not to lose touch with the codebase too much...
Eagleson's Law:
         Any code of your own that you haven't looked at for six or more
         months, might as well have been written by someone else. (Eagleson
         is an optimist, the real number is more like three weeks.)
-- From the fortunes database
  • A SourceForge project has been created
  • Resolved the remaining issues with the heading indicator

Issues

  • Due to many uninitialized variables starting up OpenGC is sometimes leading to a crash. If this happens just try again... and again... and again... suddenly it will fire up. Although there's no guaranteed stability.
  • Network socket is not starting up every time. If you are faced to "Error writing data" in FG console you can be quite sure either to set the wrong parameters or the before mentioned network socket is not available. By the way: did you check your firewall to pass UDP 5800 packets?
  • Just a few gauges are available: Boeing777PFD,NavTestGauge, Keypad,EGyroAltimeterSetting
  • Adding own gauges demands knowledge in programming C++ and recompiling the source

Roadmap

Near Term Goals

  • Get a CVS resource online
  • Improve code hardening to prevent ugly bailouts in FTGL and others
  • Get the input processor to correctly convert elevation to barometric altitude
  • Implement a command line parser to get rid of statically implemented arguments

Mid Term Goals

  • Move the configuration to XML to match FG configuration
  • Implement more gauges (everybody's invited needed to help there)
  • Port the nav interface to work with FlightGear (currently it's only implemented for MSFS)
  • Clean up and modernize the codebase
  • Further harden the code against garbage data
  • Improve codebase documentation
  • Create a proper API documentation

Long Term Goals

  • Create a working set of generic gauges
  • Implement an XML gauge constructor to get away from having to code gauges in C++
  • Integrate the code closer with fg
  • Remove the necessity to share code between FGGC and FG
  • Turn the codebase into a real library
  • Improve the input parsing code
  • Implement an upstream network interface to send input back to FG

Requirements

OpenGC 0.3-alpha3 has only been tested on LINUX operating system (Ubuntu 10.04). LINUX systems must have GCC version 4.0.0-8 or later, and graphics card with OpenGL support. Before unpacking and making the modified version of OpenGC there are five open source programs that must be installed on your computer:


On Ubuntu:

sudo aptitude install cmake libfltk1.1-dev libfreetype6-dev libftgl-dev libplib-dev


The specifics of each package is available at http://www.opengc.org/developers_building.html. Newer versions of each file have been tested, and there seems to be no backward compatibility issues, but the files above have been proven to work. Installing these programs is the most important part of having a working program. After SUCCESSFUL INSTALLATION of the programs follow the step by step guide to setup OpenGC on your system.

Getting the Source

The latest source package can now be downloaded at the downloads section of the sourceforge project at http://sourceforge.net/projects/fggc

Compiling the sources on Linux

  1. Unpack the compressed file to a convenient location
  2. Edit /path/to/your/fggc/source/FindPlib.cmake and modify line 26:(not needed building from Git repository)
    FIND_LIBRARY(Plib_SL_LIBRARY  NAMES sl plibsl
    the difference is the last word in this line. Before you edit it it says "plib sl". Remove the space.
  3. In terminal go to directory .../OpenGC/Applications/FLTKApp
    1. Create the file "opengc.ini"
    2. Edit opengc.ini and set the font and navigation path to the location of the Font and Navigation folders within the OpenGC file:
    NAV DATABASE PATH
    /path/to/your/install/fggc/navdata/
    FONT PATH
    /path/to/OpenGC/Fonts/
  4. Switch back to .../OpenGC/ and enter the command ccmake CMakeLists.txt (alternatively CMake comes with gui as "cmake-gui" or "cmake-qt-gui", depending on your linux distribution)
    1. Locate the directories marked with DIR_NOT_FOUND, these are usually Freetype, Plib, and FTGL
    2. Scan the /usr/ directory for the libraries and include directories of the files. If you cannot locate them, compare the directories in the file packages with what you have in your /usr/... directory
    3. FLTK directory should be configured manually to "/usr/include/FL"; Plib and FTGL should be modified to work correctly with insertion of "/usr/include/Plib" and "/usr/include/FTGL".
    4. If you have linked these include directories or libraries, change directories back to the package you are having trouble with and type "make -install" again. To make it easier to find the package you may want to set the build location to a familiar spot. For help doing this type "man make" inside terminal
  5. Once all the directories are set hit the 'c' key to configure the file, then the 'g' key to generate the makefiles
  6. Run "make" to build the OpenGC libraries and executable to the location specified in the ccmake script
  7. If you want to see a preview of the OpenGC application change directories to the .../OpenGC/Applications/FLTKApp and type "./OpenGC opengc.ini" after a list of instructions and a short loading period you should see the display running through a previous flight test.
  8. Creating your own data source and collecting data in real time requires a bit more work. Start off by opening the Documentation Folder from the OpenGC directory, in that file there is a ReadMe on DataSource Creation that covers how to work with telemetry data from general sources.
  9. To switch to the DataSource that is compatible with the current Data Packets being sent down from the UAV or airframe platform go to opengc.ini and switch the DATASOURCE field to EGyro.

Notice that this requires valid data being sent in via the serial port. To get this valid data requires the Autopilot program be loaded onto a processor that is actively transmitting data. In the directory /FLTKApp/ call "./OpenGC opengc.ini: and the cockpit display should appear. After completing your test data should be logged in the /FLTKApp/datalog directory under the name telemetry.txt.

Attaching to FlightGear

Start FlightGear with your favorite options and the following to your commandline:

--opengc=socket,out,24,aa.bb.cc.dd,5800,udp
  • "opengc" describes what data is sent out
  • "socket" tells FG how to present the data (here: as network socket)
  • "24" = update frequency in Hz; do not change, it's hard coded inside OpenGC
  • "aa.bb.cc.dd." = IP address where to send data to; use 127.0.0.1 if you intend to use OpenGC on the local pc
  • "5800" describes the used port; don't change, it's also hardcoded within OpenGC
  • "udp" is the used network protocol; also hard coded; don't change

Contributing

A Git repo now exists for FGGC on sourceforge.net. Here's how to clone it: First, make sure git is installed on your machine. Easiest way to do that is by typing git in a shell and see what happens. Then create a directory where you want to host the repository:

mkdir ~/gitrepos/FGGC

Then, cd in:

cd ~/gitrepos/FGGC

Then, check out:

git clone git://fggc.git.sourceforge.net/gitroot/fggc/fggc

The git repository is read-only however, so you still have to patch-mail your improvements to me. Or you might just join the project at sourceforge.net

Contact

I'm available by mail to feyn at gmx dot de, or you can catch me in the FlightGear IRC channel under my screen name of Raazeer

Links