This companion app will listen for commands input from eye tracker hardware via serial port and execute its commands accordingly.
Currently there are 3 types of commands:
- A pair of coordinates between
(0,0)
and(SCREEN_WIDTH, SCREEN_HEIGHT)
- move the mouse cursor to the specified coordinates calibration_required
- show a red calibration square on center of screencalibration_done
- hide the calibration square if present
Note that all commands MUST ends with \n
to be valid.
This app is designed for demo purpose on Windows platform. It should run on MacOS and Linux as well but untested.
To simulate coordinates data from COM port on a Windows desktop, follow these steps:
-
Download from https://freevirtualserialports.com/ and install virtual serial port device.
-
Run the above application, create a
Local Bridge
with default options (first port name isCOM1
and second port name isCOM2
) -
Download Coordinates_Serial_Generator and run it. You should see log output like below:
Sent to COM2: calibration_done Now sleeping for 1.31 seconds Sent to COM2: (1522, 226) Now sleeping for 0.53 seconds Sent to COM2: calibration_done Now sleeping for 1.73 seconds Sent to COM2: calibration_required Now sleeping for 0.91 seconds
-
Finally download this app (Eye Tracker App) and run it. Select Serial Port
COM1
and clickConnect to Serial (Hit Esc to Disconnect)
. You should see the mouse cursor moving around, triggered by data sent via serial port from the Coordinates_Serial_Generator. Note that on Linux you may need to runxhost +
before running this app to give permission to Window system.
Note that Python version should >= 3.8
sudo apt-get update # On debian-based linux
sudo apt-get install -y scrot python3-tk python3-dev binutils python3 python3-pip python3-venv # On debian-based linux
rm -rf venv # Change this to "del venv" on Windows
python3 -m venv venv
source ./venv/bin/activate # Change this command to "source ./venv/Scripts/activate" on Windows
python3 -m pip install -e .
python3 -m pip install -e .[development]
xhost + # This may be needed on Linux to get permission to connect to Window system
python3 run.py # to run app
pytest # to run tests
pyinstaller -y --windowed --add-data translations:translations run.py # to create app release in dist folder