From 0c8055a8f0600b9bb5686ac4914ac22d8d160049 Mon Sep 17 00:00:00 2001 From: eyedav <88885346+eyedav@users.noreply.github.com> Date: Wed, 15 Mar 2023 17:27:09 +0100 Subject: Keep the entire content of the Eyeware Beam SDK zip file --- .../API/python/eyeware/client.cp36-win_amd64.pyd | Bin 0 -> 697856 bytes eyeware-beam-sdk/API/python/eyeware/libsodium.dll | Bin 0 -> 293376 bytes eyeware-beam-sdk/API/python/tracker_sample.py | 56 +++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 eyeware-beam-sdk/API/python/eyeware/client.cp36-win_amd64.pyd create mode 100644 eyeware-beam-sdk/API/python/eyeware/libsodium.dll create mode 100644 eyeware-beam-sdk/API/python/tracker_sample.py (limited to 'eyeware-beam-sdk/API/python') diff --git a/eyeware-beam-sdk/API/python/eyeware/client.cp36-win_amd64.pyd b/eyeware-beam-sdk/API/python/eyeware/client.cp36-win_amd64.pyd new file mode 100644 index 0000000..a1a2bb8 Binary files /dev/null and b/eyeware-beam-sdk/API/python/eyeware/client.cp36-win_amd64.pyd differ diff --git a/eyeware-beam-sdk/API/python/eyeware/libsodium.dll b/eyeware-beam-sdk/API/python/eyeware/libsodium.dll new file mode 100644 index 0000000..20dae06 Binary files /dev/null and b/eyeware-beam-sdk/API/python/eyeware/libsodium.dll differ diff --git a/eyeware-beam-sdk/API/python/tracker_sample.py b/eyeware-beam-sdk/API/python/tracker_sample.py new file mode 100644 index 0000000..4291b3b --- /dev/null +++ b/eyeware-beam-sdk/API/python/tracker_sample.py @@ -0,0 +1,56 @@ +""" + Copyright (c) 2021 Eyeware Tech SA http://www.eyeware.tech + + This file provides an example on how to receive head and eye tracking data + from Beam SDK. + + Dependencies: + - Python 3.6 + - NumPy +""" + +from eyeware.client import TrackerClient +import time +import numpy as np + +# Build tracker client, to establish a communication with the tracker server (an Eyeware application). +# +# Constructing the tracker client object without arguments sets a default server hostname and port which +# work fine in many configurations. +# However, it is possible to set a specific hostname and port, depending on your setup and network. +# See the TrackerClient API reference for further information. +tracker = TrackerClient() + +# Run forever, until we press ctrl+c +while True: + # Make sure that the connection with the tracker server (Eyeware application) is up and running. + if tracker.connected: + + print(" * Head Pose:") + head_pose = tracker.get_head_pose_info() + head_is_lost = head_pose.is_lost + print(" - Lost track: ", head_is_lost) + if not head_is_lost: + print(" - Session ID: ", head_pose.track_session_uid) + rot = head_pose.transform.rotation + print(" - Rotation: |%5.3f %5.3f %5.3f|" % (rot[0, 0], rot[0, 1], rot[0, 2])) + print(" |%5.3f %5.3f %5.3f|" % (rot[1, 0], rot[1, 1], rot[1, 2])) + print(" |%5.3f %5.3f %5.3f|" % (rot[2, 0], rot[2, 1], rot[2, 2])) + tr = head_pose.transform.translation + print(" - Translation: " % (tr[0], tr[1], tr[2])) + + print(" * Gaze on Screen:") + screen_gaze = tracker.get_screen_gaze_info() + screen_gaze_is_lost = screen_gaze.is_lost + print(" - Lost track: ", screen_gaze_is_lost) + if not screen_gaze_is_lost: + print(" - Screen ID: ", screen_gaze.screen_id) + print(" - Coordinates: " % (screen_gaze.x, screen_gaze.y)) + print(" - Confidence: ", screen_gaze.confidence) + + time.sleep(1 / 30) # We expect tracking data at 30 Hz + else: + # Print a message every MESSAGE_PERIOD_IN_SECONDS seconds + MESSAGE_PERIOD_IN_SECONDS = 2 + time.sleep(MESSAGE_PERIOD_IN_SECONDS - time.monotonic() % MESSAGE_PERIOD_IN_SECONDS) + print("No connection with tracker server") -- cgit v1.2.3