Michael Otte, MIT, 2013

--------------- Description -----------------------------------------------
Both a C and Java version of code that can read events from iniLabs DVS128 
retina sensor (otteDVSreader.c and otteDVSreader.java, respectively). There 
is also a minimal openGL visualization for the C code.

This opens a connection through USB, then reads packets from the sensor and 
parses them into x,y location, timestamp, and polarity flag. That is it. It
does not do any other communication with the device (e.g., setting biases).
Note that if setting biases is needed, this can be accomplished with the 
GUI software provided with the device from iniLabs (you can set biases, shut 
off the GUI, and as long as the device remains connected, those biases will
remain in place while otteDVSreader (or any other program) is being used. 
You will also need to install the driver in "driverRetinaLinux"---see below


-------------- Driver installation ----------------------------------------
Installation Notes regarding installing the iniLabs Driver, included in 
the folder "driverRetinaLinux":

Included is the linux retina driver from the jAER project on sourceforge 
**  with the exception that a check for older operating systems has  ** 
**  been commented out in retina.c (necessary for us to get it to work **
The original (unmodified code) was downloaded on October 2, 2013, from:
http://sourceforge.net/projects/jaer/
And then modified as stated above.
The original makefile documentation for the driver says that it can be 
installed using the command "make && sudo make install" HOWEVER THIS 
DID NOT WORK FOR US. Instead, we found that we had to run:

make
sudo insmod retina.ko

Notes:
 - the path to the make file cannot contain any spaces in it
 - make sometimes failed 1/2 way through, but nonetheless generated 
   the required file retina.ko

Next, add the following lines to /etc/udev/rules.d/62-fx2.rules
so that your system will associate the device with a device file:

SUBSYSTEM=="usb", ATTR{idVendor}=="152a", ATTR{idProduct}=="840?", TAG+="uaccess"
KERNEL=="retina[0-9]", NAME="retina%n", SYMLINK+="usbdevices/%k", MODE="0666", OWNER="root"

Notes:
 - This can be added to some other file in rules.d if you wish.

-------------- If you still have problems ------------------------------

The following may also be required to build the driver (we did this but 
it may not have been necessary:

apt-get --reinstall install linux-headers-`uname -r`
sudo apt-get install linux-source
cd /usr/src
sudo tar -xvjf linux-source-$YOUR_VERSION_HERE.tar.bz2

-------------- C Code compilation ---------------------------------------

Compile the C viewer using:

gcc retina_viewer.c -o retina_viewer -lglut -lGL -lGLU -lGLEW

you may need to change the locations of Glut packages etc. in retina_viewer.h


-------------- Java Code compilation ------------------------------------

Compile the Java code as follows:

javac otteDVSReader.java


