Exemple #1
0
class Oracle(object):
    def __init__(self):

        # Connect to the Gazepoint tracker.
        self.gp = GazePoint()

        # Establish an event bus.
        self.events = Events()

        # Set up the watchdog...
        try:
            os.remove('request.oracle')
        except:
            pass
        target_files = ['request.oracle']
        self.watchdog = Watchdog(target_files)
        self.watchdog.events.on_change += self.scan

    def scan(self, target_file):

        # Load oracle request.
        scan = Vessel(target_file).scan

        # Start the scan.
        scan = self.gp.collect(scan)
        os.remove('request.oracle')
        try:
            db.update(scan)
        except:
            print('Cannot save to database.')

    def kill():
        self.watchdog.kill()
        self.gp.kill()
Exemple #2
0
    def run_gaze():
        HOST = '127.0.0.1'
        PORT = 4242
        base_dir = os.getcwd()

        eyegaze = GazePoint(HOST, PORT, base_dir)
        eyegaze.run_gazepoint()
Exemple #3
0
    def __init__(self):

        # Connect to the Gazepoint tracker.
        self.gp = GazePoint()

        # Establish an event bus.
        self.events = Events()

        # Set up the watchdog...
        try:
            os.remove('request.oracle')
        except:
            pass
        target_files = ['request.oracle']
        self.watchdog = Watchdog(target_files)
        self.watchdog.events.on_change += self.scan
Exemple #4
0
from flask import Flask, request, jsonify, Response
from flask_restful import Resource, Api
from flask_cors import CORS
from sixer import sixer
from solid_db import *
from gazepoint import GazePoint
from generate_summaries import generate_summaries


'''RESTFUL API for Johnny Seven'''
PORT = 5100
app = Flask(__name__)
CORS(app)
api = Api(app)
db = SolidDB('data/db.json')
gazepoint = GazePoint()


class Patients(Resource):

    def get(self):
        # Index
        patients = db.all('patients')
        return patients

    def post(self):
        # Create
        patient = {}
        patient['hid'] = sixer()
        patient['gender'] = 'male'
        patient['age'] = 35
Exemple #5
0
    import sys

    for m in leachy.motors:
        m.compliant = False
        m.moving_speed = 0

    goto_rest(2)

    myo.init('../../myo-sdk-win-0.9.0/bin')

    listener = Listener()
    listener.emg = numpy.array([numpy.nan])

    hub = myo.Hub()
    hub.run(50, listener)

    from gazepoint import GazePoint

    tracker = GazePoint()

    try:
        while True:
            input('press enter')
            if True:
                #if listener.emg.mean() > 10:
                x, y = tracker.gaze_position
                goto_2d(x, y, 1)
    except KeyboardInterrupt:
        tracker.stop()
        hub.shutdown()
Exemple #6
0
from gazepoint import GazePoint
import sys
sys.path.append('../../mathtools')
from mathtools.utils import Vessel


if __name__ == '__main__':
    
    scan = {'_id': '12342134'}
    gazepoint = GazePoint()
    data = gazepoint.collect(scan)
    gazepoint.kill()