示例#1
0
    def run_gaze():
        HOST = '127.0.0.1'
        PORT = 4242
        base_dir = os.getcwd()

        eyegaze = GazePoint(HOST, PORT, base_dir)
        eyegaze.run_gazepoint()
示例#2
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
示例#3
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
示例#4
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()