<commit_before># pupil_ros

How to install

Install pupil capture
https://docs.pupil-labs.com/ 

Install pip
>sudo apt-get install python-pip
>sudo pip install --upgrade pip

Install zmq 
> sudo pip install pyzmq

Install sox
> sudo apt-get install sox

Place the folder pupil_ros to your catkin workspace, and build the ROS package.
> cd Path/To/catkin_ws
> catkin_make
> source devel/setup.bash


This will build six custom ROS messages: pupil, pupil_positions, gaze, gaze_positions, surface_position, accu

How to run
1. Make pupil_zmq_ros_pub.py executable:
> cd catkin_ws/src/pupil_ros/scripts
> chmod +x pupil_zmq_ros_pub.py main_run_v4.py audio_output.py start_pupil.py
2. Launch ROS package:
> roslaunch pupil_ros pupil_ros.launch
3. Load plugin Pupil_Remote and Frame_Publisher
4. set localhost to 50010 in pupil remote
5. set frame publisher to bgr

How to subtract accuracy data
1. Setup rosbag record 
> rosbag record matcher/gaze_accu
2. Quit recording when ready
3. Make csv file with custom BAGFILE_NAME and LOGFILE_NAME (or logfile.txt)
> rostopic echo -b BAGFILE_NAME.bag -p /matcher/gaze_accu > LOGFILE_NAME.csv



<commit_msg>Edited readme<commit_after># Pupil ROS
This ROS package maps user's gaze data from the [Pupil Labs eye tracker](https://pupil-labs.com/), onto a different video feed, using markers and feature matching.

## Requirements
1. Ubuntu 16.04
2. ROS Kinetic installation. Older versions may work but are not tested.

## Installation
1. **Install Pupil Remove**
    Download Pupil Remote [here](https://docs.pupil-labs.com/)
2. **Install pip**
    >sudo apt-get install python-pip
    >sudo pip install --upgrade pip
3. **Install zmq**
    >sudo pip install pyzmq
4. **Install sox**
    >sudo apt-get install sox
5. **Place the folder pupil_ros to your catkin workspace, and build the ROS package.**
    >cd Path/To/catkin_ws
    >catkin_make
    >source devel/setup.bash

    This will build six custom ROS messages: pupil, pupil_positions, gaze, gaze_positions, surface_position, accu
6. **Print markers**
    Print the QR-code like trackers. They can be found inside the **markers/** folder

## Using the package
1. **Make pupil_zmq_ros_pub.py executable**
    cd to the installed pupil_ros package in your catkin workspace:
    >cd ~/catkin_ws/src/pupil_ros/scripts
    >chmod +x pupil_zmq_ros_pub.py main_run_v4.py audio_output.py start_pupil.py
2. **Set correct settings in Pupil Remote:**
* Load plugin **Pupil_Remote** and **Frame_Publisher**
* Set localhost to 50010
* Set Frame Publisher to bgr
3. **Calibrate Pupil Remote**
    Calibrate the eye tracker using a calibration method of your choice. 
4. **Launch ROS package:**
    >roslaunch pupil_ros pupil_ros.launch

## How to grab the accuracy data
1. Setup rosbag record 
    >rosbag record matcher/gaze_accu
2. Quit recording when ready
3. Make csv file with custom BAGFILE_NAME and LOGFILE_NAME (or logfile.txt)
    >rostopic echo -b BAGFILE_NAME.bag -p /matcher/gaze_accu > LOGFILE_NAME.csv

{'fraction_non_alphanumeric': 0.08013355592654424, 'fraction_numerical': 0.01302170283806344, 'mean_word_length': 4.13013698630137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1705529', 'n_tokens_mistral': 1067, 'n_tokens_neox': 978, 'n_words': 370}