diff options
author | eyedav <88885346+eyedav@users.noreply.github.com> | 2023-03-15 17:27:09 +0100 |
---|---|---|
committer | eyedav <88885346+eyedav@users.noreply.github.com> | 2023-03-15 17:27:09 +0100 |
commit | 0c8055a8f0600b9bb5686ac4914ac22d8d160049 (patch) | |
tree | e7c31ca3be5e60c2e6edd04826496677512bd653 /eyeware-beam-sdk/API/python | |
parent | 29f7b5e27c833fe4fbd5b568dbfdc503f10811aa (diff) |
Keep the entire content of the Eyeware Beam SDK zip file
Diffstat (limited to 'eyeware-beam-sdk/API/python')
-rw-r--r-- | eyeware-beam-sdk/API/python/eyeware/client.cp36-win_amd64.pyd | bin | 0 -> 697856 bytes | |||
-rw-r--r-- | eyeware-beam-sdk/API/python/eyeware/libsodium.dll | bin | 0 -> 293376 bytes | |||
-rw-r--r-- | eyeware-beam-sdk/API/python/tracker_sample.py | 56 |
3 files changed, 56 insertions, 0 deletions
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 Binary files differnew file mode 100644 index 0000000..a1a2bb8 --- /dev/null +++ b/eyeware-beam-sdk/API/python/eyeware/client.cp36-win_amd64.pyd diff --git a/eyeware-beam-sdk/API/python/eyeware/libsodium.dll b/eyeware-beam-sdk/API/python/eyeware/libsodium.dll Binary files differnew file mode 100644 index 0000000..20dae06 --- /dev/null +++ b/eyeware-beam-sdk/API/python/eyeware/libsodium.dll 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: <x=%5.3f m, y=%5.3f m, z=%5.3f m>" % (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: <x=%5.3f px, y=%5.3f px>" % (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")
|