Servelec Group - PI in the Sky


Flight Crew -  Alexander Dixon, Gregor Emslie, Michael Nelson, James Todd

 

Good morning Ladies and Gentlemen, this is your Captain speaking. We hope you enjoy your flight with us today   Our Hackathon concept was to visualise the real-time flight data of commercial aircraft and helicopters in the (almost never) sunny skies above North East Scotland.

 


PI in the Sky in full flight

 

 

 

Data Collection

Data is collected from two sources.  Firstly for the helicopters, we have a PowerShell script that just after midnight, makes a connection to the Bristow's helicopter 'flight schedule. From there it parses the data looking for flights from our chosen Oil and Gas operator. For each flight it creates an Event Frame of the template type "flight".  The flight Event Frames contain attributes to allow the flight to be tracked e.g. speed altitude, longitude, latitude etc.:

 

Example flight Event Frame

 

For commercial flights - a RaspberryPi furnished with a flight aware(http://flightaware.com/adsb/piaware/build) USB receiver was used to collect real-time flight data using the dump1090 open source system (https://github.com/antirez/dump1090 ). The data is provided in a json file which is made available to the PI Server via the web.

 

A second PowerShell script reads the aircraft.json file created above. Using it's known list of aircraft of interest (from the Event Frames created in the first step), the script looks in the aircraft.json file for data of interest. If data is found it is appended to the Event Frame. Once the flight is no longer seen the flight data is set to 0.

 

Two PI Vision extensions were created to visualise this dataset.

 

FlightMap Extension
The FlightMap extension was created to visualise the flights using the Javascript mapping tool,  Leaflet.js (http://leafletjs.com/). This open source mapping tool allows data collected within Event Frames to be visualised within PI Vision. The PI WebAPI was utilised to bring this data in using streamset calls to the relevant Event Frames.  Static 'landing points' (e.g offshore platforms and airports) were created and co-ordinates and information pulled in from an AF table to show offshore platforms and landing zones loaded as static markers on the map . Aircraft were also created as markers using the PI Web API to pull in the flight data from the Event Frames - these were updated every 30 seconds to update the location, direction of travel etc.of the aircraft on the map. Custom icons were created for each type of marker: Landing zones, offshore oil platforms, planes and helicopters. Clicking on any of the markers shows a pop-up with more details about the flight/landing zone, again pulled in from the Event Frame using PI WebAPI.

 

EFTable Extension
The EFTable extension was created to visualise, in tabular form, each flight that was currently 'active' in the sky.  As above, flight data collected from the Event Frames via the PIWebAPI and written to an angular table within PI Vision, updating every 30 seconds.

 

PI in the Sky Data Flow

 

 

IMG_9129.JPG

Clockwise from bottom left: Alexander, Michael, Gregor and James

 

 

 

 

  The videos below provide some engrossing in-flight entertainment:

 

 

https://youtu.be/wfW7OMTmLMo

 

 

https://youtu.be/F5koqJCUxUE

 

Link to our GitHub repository: https://github.com/james9005/SC1_Hackathon