Groundstation

From Albatross

Jump to: navigation, search

The Ground Station software is split into a few (smaller) applications that communicate via the same UDP multicast IPC system as ur on-board software (see Protocol). The programs are:

  • Virtual Cockpit (OpenGC) - displays a very nice graphical "glass cockpit" representation of many of the aircrafts parameters, including roll, pitch, yaw, heading, speed, altitude, vertical speed, GPS status, and battery voltage.
  • Main Groundstation Application (MainWindow) - displays all the aircraft data textually, displays log messages, sets control loop gains, calibrates the sensors, enables/disables controllers, switches between auto- and manual-mode, and sends emergengy reset or override commands and other low-level commands.
  • Radio Communications Daemon (CommD) - transmits datagrams over the serial port to the radio, and re-emits received packets as datagrams. Written in C, runs in the background, also used on-board.
  • Logger Daemon (CommD) - keeps both a message log (containing time-stamped log messages), and a time-stamped packet log (raw datagrams) that can be used to "replay" a flight. Written in C, runs in the background, also used on-board.
  • Map (Not yet written) - horizontal situation indicator and waypoint/path editor application.

Main Groundstation Application

Allows the user to inspect and interact with the aircraft at a relatively low level. This will be the most important part for debugging and testing. It displays:

  • a categorized tree view of all the variables (altitude, roll angle, battery voltages, etc.)
  • a watch list for variables (highlight when data goes in or out of allowable bounds)
  • a log viewer (lists all events and accompanying data that occur both on-board and on the ground)

The Main Groundstation Application also does a few other task:

  • performs the calibration routine to zero offsets in the sensors.

displays all the aircraft data textually, displays log messages, sets control loop gains, calibrates the sensors, enables/disables controllers, switches between auto- and manual-mode, and sends emergengy reset or override commands and other low-level commands.

OpenGC

The Open Glass Cockpit project, OpenGC, was used to develop a virtual cockpit application for the visualization part of the Albatross Groundstation. Building it: Before OpenGC can be build, you need to install some extra tools and libraries:

sudo apt-get install ftgl-dev cmake libfltk1.1-dev fluid

Also needed are Plib and Glut libraries, but they should already be installed from CRRCsim. Now go into the opengc/Build directory, and run:

ccmake ../ 

Now press 'c' (configure) - at this stage it will ask you to manually enter paths to libraries if it can't find them.

  • Set FTGL_INCLUDE_DIR to /usr/include/FTGL
  • Set Plib_INCLUDE_DIR to /usr/include/plib
  • Set LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH to /.../groundstation/opengc/Build/bin (need to be full paths).
  • Set Plib_SL_LIBRARY to /usr/lib/libplibsl.so

Keep pressing 'c' (configure) until there are no errors remaining In particular it will complain about some incorrect paths. Because it insists on full paths, you may need to edit some files by hand Now press 'g' (generate). The ccmake configurator will exit. Now run:

make

You should now have a OpenGC binary in Build/bin. Go into the bin directory and edit the initialization file, opengc.ini, and change the paths near the top. Now run the program with

./OpenGC opengc.ini

Also, set SVN:ignore on the Build directory:

svn propedit svn:ignore Build/
# When nano pops up, type * then save and quit.

Map application (Not yet implemented)

The map application will display the aircraft position on some kind of geo-referenced graphics, such as a map, or an aerial photograph. There is scope for a very large amount of complexity here, but only very simple functionality is needed, and is intended to be implemented. A georeferenced raster graphic (aerial photograph or map) with aircraft position and heading will be displayed, with zoom, rotation, and panning support. Simple support for adding and editing waypoints.

Programming

  • The GUI applications (MainWindow and Map) are written in Python with the PyGTKtoolkit. Also used:
    • GnomeCanvas object for rendering the Map/HSI (supports hardware graphics acceleration).
    • matplotlib for plotting data for analysis.
  • The daemon applications (non-GUI) are quite simple and are written in C, and are also used on-board, with minor changes done with conditional compilation.
  • Might try and use the Festival Speech Synthesizer and Speechd for annunciations.
  • The glass cockpit/flight instruments were created with OpenGC, checked out from OpenGC CVS on 2 August 2005. The application is a modified version of the example FLTK application supplied with OpenGC, along with a new datasource object (ogcAlbatrossDatasource) and a modified Primary Flight Display (PFD) object.
    • The PFD is styled on the Boeing 777 Primary Flight Display, but slightly modified and simplified. I had to modify:
      • the speed display objects to correctly render speeds below 30 Knots (Boeing 777 speed gauge doesn't read below 30 Knots).
      • the heading indicator to display GPS heading-over-ground as well as yaw angle (direction the nose of the aircraft is pointed).
      • the top-level gauge object to display status information above the artificial horizon, including GPS mode (2D/3D), GPS number of satellites in view, battery voltage, and on/off status of the control loops.
    • The AlbatrossDataSource sets up a listener thread, which, on receipt of a datagram, runs a callback that sets a flag that can be read by the main render thread. Every frame rendered (i.e. 25 times per second), the flag is read, and if new data is available, it updates the internal state and redraws the graphics.

Status & To Do

Top priorities (in order) to add are (30th July):

    • Ability to change control gains remotely. DONE - fixed to send an LWD_SET_GAINS command with the STATE_D_YAW_KP...STATE_D_BANK_KD gains (15 in all).
    • Ability to restart simulation and reset StateD control integrators. DONE
    • Fix FlightVariables.newData to correctly show non-float data (e.g. GPS modes etc.). DONE - along with a complete overhaul of the data flow in the Groundstation to make it easier to add the database.
    • Fix Calibration system.
    • Inbuild data logging/database.
    • Plotting from database.
    • Ability to send set home-point command. DONE
    • Callback-ified datagram library. PARTIAL
    • Visualization graphics (OpenGC). DONE
    • Log replay support. DONE
    • Inspector and Watchlist implementation.
    • Mapping/Waypoints window. - Very low priority at the moment.
    • Integrated/Automatic startup procedure (so we don't keep forgetting to start logd) DONE

Screenshots

Old version of the Groundstation, showing MatPlotLib-based plotting.
Enlarge
Old version of the Groundstation, showing MatPlotLib-based plotting.
OpenGC-based virtual cockpit application, receiving data from CRRCsim.
Enlarge
OpenGC-based virtual cockpit application, receiving data from CRRCsim.
Personal tools