###################################################################

Low Cost High Resolution Position Sensor with Sub-micron Accuracy 

Author: Luca Favario
Supervisor: prof. Claudio Passerone

Masters's Degree Thesis 
Electronics Engineering (Embedded systems)
Politecnico di Torino
October 2021

###################################################################

C implementation of the sensor proposed in the thesis.
The program runs in Linux.
The output position is written to stdout or to UART serial.

Requirements:
	- FFTW: library used for FFT computation;
	- V4L2: capture USB and other compatible camera devices;
	- libjpeg-turbo: decompress MJPEG frames.
On Debian or Ubuntu systems install with:
# apt install libv4l-dev libfftw3-dev libjpeg-turbo8-dev

V4L2 devices and serial devices must be enabled in the kernel.

Modify the file "config.h" to select the desired upsampling factor, the camera
device and its resolution, the serial device and the output format.

It may be required to customize the CFLAGS in the Makefile for the specific
device if -march=native does not utilize SIMD.

Make targets:
	- sensor: (default) compile the sensor program;
	- debug: compile with additional messages and printing some vectors to
	  file;
	- file: compile using camera_file.h, the frames are read from fifo instead
	  of from the camera
	- bench: compile the sensor that writes the timings to file. RESX, RESY,
	  UPS and ZPUPS must be passed as command line variables
