CS 524 Project 4: Visualization of trip on the CTA Blue Line

Source code and executable for MacOsX can be found here
To run, first unzip then go to project4Final/final/build/Debug/ and click on qtevents

This visualization aims to present data pertaining to motion on the CTA blue line between the UIC-Halsted and Forest-Park stops.  This data set is of interest for anyone looking to understand the state of American transportation infrastructure.  Many of the train cars in operation are over 20 years old and sections of train lines are often in disrepair.  Outdated train cars and tracks lead to a loss of energy in movements that do not carry the car forward.  Using sensors on an iPhone and Android system we were able to collect data on the movement of train cars from the early 1990's on this stretch of the CTA transit system.  This sort of data collection, and a visualization tool such as this, could be useful for policy makers and CTA officials in directing resources toward sections of the transit system that most need to be updated. 

Data Collection:

Data was collected on the CTA Blue line by students in the class using Android and IPhone applications that recorded output of device sensors, accelerometers and gyroscopes.  Data collected on the iPhone included GPS coordinates, height, acceleration, and rotational velocity.  Data collected on the Android included GPS coordinates, height, acceleration, and orientation. 

Several trips from UIC-Halsted to the Forest-Park blue line station were necessary to ensure high quality data was collected.  Insufficient GPS coverage was a common early data collection problem, along with instability in device placement (eg. device falling to floor or jostling excessively) and device failure when attempting to save data. 

These problems were eventually addressed, producing the data set used in this visualization.

Data Processing:

Raw sensor data was processed using C++.  The code for the data processing was primarily written by student Thomas Marrinan.  In this code, time-stamps were processed to be easier to read.  In addition, missing data values were interpolated to create a structured data set, with values for all parameters given every 2 seconds.  The interpolation function used was linear for all data values.

Using CTA Visualizer:

When you open CTA-motion visualizer, you can see the entire stretch of the blue line in the window along with some basic controls. 

You can zoom toward and away from the data set using two-fingers on a track-pad, or the scroll-button on a mouse.
Clicking and dragging will rotate the shown stretch of the train line and landscape. 
Shift-click allows the user to move laterally or horizontally.
Cntrl-click allows the user to rotate the scene around the mouse-point.

The user can view the data as colored by one of several data types:
1) the magnitude of the acceleration vector
2) the magnitude of the acceleration in the X-direction
3) the magnitude of the acceleration in the Y-direction
4) the magnitude of the acceleration in the Z direction
5) the degree of 'pitch' or movement that tips the train car forward over the X-axis
6) the degree of 'roll' or movement that tips the car right or left of the y-axis.

By selecting one of these color-tables, the user can target data-values of interest, without having to look at numerical tables or other indicators of jostling or random movement.  Once one of these values is selected, the shown data points are colored according to a color-function, shown at the bottom of the screen. 

These functions are defined according to the minimum and maximum measured magnitudes for that data type. 

Selecting a new data value results in a new color-function.

The user can 'play' through the data set by moving to the West (left) to the start point of the trip, in Forest Park. From here, the user can press 'Play' to watch the entire trip, Shift-clicking and dragging to move to the next portion of the route. 

The user can also select a section of the route to inspect by clicking and dragging on the sliders at the bottom of the window.  After selecting a portion of the trip, the user can 'play' through the data between the selected points.

The visualization contains 20 images of fairly high resolution, intended to improve navigation when inspecting data-points up-close.  Initial plans for the visualization involved rotating and orienting data-cubes appropriately, which would be more comfortable for the user with high resolution imagery.  When this plan did not get enacted (see 'Challenges' section) , the need for this perspective became less important. 

Results from using the tool

A variety of interesting patterns can be observed using the tool.
Areas of high energy loss can be easy observed by looking at large and rapid changes in pitch or roll data values. For instance, in this section of the train-line, the car briefly comes to a rest between stops. This stop is marked by movement from high pitch backwards, indicated by the purple-blue values, to high pitch-forward, indicated by the yellow-orange values.  This indicates that starting and stopping involves higher potential for energy loss.  

Consistent with the high pitch values, y-Acceleration was found to be high in this section of track. 
The same stretch of track is not marked by high roll, side to side, nor high z-acceleration or x-acceleration. 

This tool is well-suited for looking at long-expenses of the train-track.  The perspective below allows the user to quickly identify areas of high acceleration, pitch and roll.

Initial assessments of small regions, may lead to false conclusions that can then be checked by looking at the data-set as a whole.  For instance, as distances between stops increases, as the train heads toward the suburbs, the train appears to pitch and roll more frequently, and with greater intensity.
However, the entire data set, looking toward downtown, indicates that these high-pitch regions occur fairly regularly.

I intended to show the pitch, roll and azimuth motion of the train car using a representational rectilinear prism rotated to the correct orientation.  I encounted difficulty performing these rotations correctly in vtk, such that the order of manipulations would lead to a result reflecting reality.  Initial attempts produced train car motion that was high erratic and not reflective of the real motion of the car. 
I then intended to show a window with a rotating cube during 'play' mode, which would show the movement of the individual car.  I ran into trouble with sizing the window to show this moving car.  This secondary window always impeded the long-distance view, which is a value that I believe this visualization provides.
The interactor supplied by vtk remains problematic.  I attempted to provide built-in navigation using buttons, and to move with the train as it goes off screen, but this inevitably conflicted with the interactor, moving the focal point or orientation in a way that made subsequent navigation impossible. 

In spite of these challenges, I believe this is a useful and interesting approach to a data-set that is a part of every CTA passenger's regular experience.