Skip to main content

WebSocket server for Tobii Eye Tracker gaze data using Tobii Stream Engine

Project description

Tobii Gaze Server

A WebSocket server for streaming Tobii Eye Tracker gaze data using the Tobii Stream Engine.

Features

  • Real-time gaze data streaming via WebSocket
  • Uses Tobii Stream Engine for calibrated gaze data
  • Easy integration with web applications

Requirements

  • Windows OS
  • Tobii Eye Tracker with Tobii EyeX software installed
  • Python 3.8+

Installation

Using Conda (Recommended)

  1. Create and activate the conda environment:
conda env create -f environment.yml
conda activate tobii-gaze-server
  1. Install the package in development mode:
pip install -e .

Using pip

pip install tobii-gaze-server

Usage

Demo: Gaze-Controlled Mouse

The included demo moves your mouse cursor to where you look. A dwell-activated exit button allows you to quit without using the keyboard.

conda activate tobii-gaze-server
python examples/demo.py

Features:

  • Mouse cursor follows your gaze
  • Red X button in the top-right corner
  • Look at the X button for 1.5 seconds to exit
  • Automatically starts the gaze server (or uses an existing one)

Options:

  • --no-server: Don't auto-start the server (use if server is already running)
  • --url ws://host:port: Connect to a different server URL

Command Line

Start the server:

tobii-gaze-server

The server will start on ws://localhost:8887 by default.

As a Library

from tobii_gaze_server import TobiiGazeServer

server = TobiiGazeServer(host="localhost", port=8887)
server.run()

Environment Variables

  • TOBII_STREAM_ENGINE_DLL: Path to the Tobii Stream Engine DLL (default: C:\Program Files\Tobii\Tobii EyeX\tobii_stream_engine.dll)

WebSocket Protocol

Messages from Server

Gaze Data

{
    "type": "gaze",
    "x": 960.5,
    "y": 540.2
}

Status

{
    "type": "status",
    "connected": true,
    "mode": "GAZE",
    "message": "Tobii Stream Engine - Calibrated gaze data"
}

Messages to Server

Set Screen Size

{
    "action": "set_screen_size",
    "width": 1920,
    "height": 1080
}

License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tobii_gaze_server-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tobii_gaze_server-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file tobii_gaze_server-0.1.0.tar.gz.

File metadata

  • Download URL: tobii_gaze_server-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for tobii_gaze_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 40f63872eb50ff03359e8a9b295c59dd5666564cc7556593e87838de2d36d5e7
MD5 fda7854c6f64a8e91eee6e55ae2dcbff
BLAKE2b-256 65fcbb4515508c1e54e91d17534d91a070b6e3297b311dfc29e8b9ca1c332f85

See more details on using hashes here.

File details

Details for the file tobii_gaze_server-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tobii_gaze_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7050d512ddec488a111a6f8c0c8e65187f01444d37b224d3beaf46e3ba80598
MD5 41ea3a2a3be7d1becd5f8039472a4465
BLAKE2b-256 ee2a608ded82f57821ed7e35bb98544998432fb34fab91b1dd7de9a02bb8a86e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page