Coder Social home page Coder Social logo

rezreal / tobii-eyex-web-socket-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sradevski/tobii-eyex-websocket-server

4.0 0.0 0.0 5.04 MB

Tobii EyeX SDK Web Socket Server

License: MIT License

C# 100.00%
tobii-eye-tracker tobii-eye-tracker-4c

tobii-eyex-web-socket-server's Introduction

Synopsis

Tobii Web Socket Server is a Web Socket Server that wraps the Tobii Interaction SDK and transmits the data through web sockets. It is a fork of the archived and discontinued https://github.com/sradevski/Tobii-EyeX-Web-Socket-Server.

Some new features:

  • Reporting the state of the tracker
  • Supports HeadPose and EyePosition API
  • Supports multiple clients, subscribing to different APIs

Usage

You can download an executable if you don't want to compile the project by yourself. To do that, simply download a published Release to a location of your choice. In order to run the server, open the terminal, navigate to the location where the Release folder is located, and run TobiiSocketServer.exe, which will start the server on the default port (8887). You can optionally pass a custom port number like TobiiSocketServer.exe 8886. Note that the Tobii EyeX Server must be running before using the Tobii Web Socket Server.

If you wish, you could also build the project by yourself. The project is built using Visual Studio 2019 Community.

WS-API

From your web application call:

const ws = new WebSocket("ws://localhost:8886", ["Tobii.Interaction"]);
ws.onmessage = (m) => console.log(JSON.parse(m.data));

ws.send('state');
// yields as message: 
msg = {"type":"state","data":{"userPresence":"Present","userProfileName":"rezreal","eyeTrackingDeviceStatus":"Tracking","gazeTracking":"GazeTracked","screenBounds":{"X":0,"Y":0,"Width":1920,"Height":1080},"displaySize":{"Height":286.875,"Width":509.99999999999994}}}
// updates to one of these properties will yield a message of the same structure.

// subscribes to GazePoint events
ws.send('startGazePoint');
// unsubscribes to GazePoint events
// ws.send('stopGazePoint');

// subscribes to EyePosition events
ws.send('startEyePosition');
// unsubscribes to EyePosition events
// ws.send('stopEyePosition');

// subscribes to HeadPose events
ws.send('startHeadPose');
// unsubscribes to HeadPose events
// ws.send('stopHeadPose');

All other events are directly mapped from their C# API equivalent. See https://developer.tobii.com/consumer-eye-trackers-interaction-library-api-reference/ for reference (GazePointData, HeadPoseData, EyePositionData).

License

This project is under the MIT Licence

tobii-eyex-web-socket-server's People

Contributors

sradevski avatar rezreal avatar

Stargazers

 avatar  avatar Mohamed Al Elew avatar Wei En Tsai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.