frametop

Fake eye and hand trackers

The testbench can stand in for the eye trackers and the hand tracker at Frametop’s boundary. Everything from ft-gaze and ft-hands’ readers on then runs as with real eyes and hands: the gaze pointer, gaze calibration’s dot logic, the hand cutouts, pinch clicks and grips. No cameras are involved, and no camera images are made or stored.

./frame-testbench gaze look 10 -5             # both eyes, head-relative degrees: yaw +left, pitch +up
./frame-testbench gaze look 10 -5 --right 6 -5   # the right eye apart (YAW PITCH = the left eye)
./frame-testbench gaze eyes open lost         # each eye open, closed or lost (the tracker can't see it)
./frame-testbench gaze release

./frame-testbench hand right set --position .1 -.2 -.35 --shape pinch
./frame-testbench hand right set --position .1 -.2 -.35 --shape open    # the pinch ends: one click
./frame-testbench hand left set --position -.1 -.2 -.35 --rotation 0 0 90 --shape fist
./frame-testbench hand all release

./frame-testbench release                     # also stops the fake trackers

Real tracker output can be recorded and replayed too (see below).

How it works

The first gaze look, hand ... set or replay starts python3 -m frame_testbench.fakes as the transient user unit frame-testbench-fakes (journalctl --user -u frame-testbench-fakes for its log). It takes commands on $XDG_RUNTIME_DIR/frame-testbench-fakes.sock, a user-only socket, and writes:

A hand is built from its shape, wrist position and rotation in the head frame (+X right, +Y up, -Z forward). With no rotation the fingers point forward and the palm faces down. Shapes:

Shape Landmarks Gestures
open fingers out, thumb apart none
point index out, the rest curled none
pinch thumb tip on the index tip pinch down
fist all curled grip down

Changing a hand’s shape is how to click: pinch then open is one pinch, begun and ended. The skeleton (joint frames, bone lengths, elbow) is filled in too, so readers of version 2 work, but it’s a fixed pose per shape, not a fit.

Ending

The fakes stop, take their files back out and let the real trackers take over within a few seconds when:

On the way out it publishes no hands and ends any gesture down as lost.

Using it

Recording and replaying

Real tracker output can be recorded and played back through the same fakes, for a look or a pinch that a script can’t pose well:

./frame-testbench record look-around --seconds 20             # gaze and hands, while worn
./frame-testbench record pinches --seconds 30 --only hands
./frame-testbench replay pinches                              # once, then the fake ends
./frame-testbench replay look-around --loop --only gaze       # until released

Recording only reads: SteamVR’s /dev/shm/eye-server.mmap, our tracker’s /dev/shm/frametop-eyes-gaze, and ft-hands’ hands and gestures files. It needs someone wearing the headset with the gaze in use and ft-hands publishing, and refuses while the testbench itself is faking them. It goes in artifacts/recordings/NAME/, a new folder only this user can read, with:

No camera image is recorded. Gaze is still how someone’s eyes moved: recordings stay on this machine in the ignored artifacts/ folder, and never go into the repo, a PR, or anywhere else.

Replay keeps the recorded timing. Hands get their times shifted to now and their gesture counters carried on from where the last publisher left them, so each recorded pinch is one click. A scripted gaze look or hand ... set stops a replay of that tracker, and release stops all of it. At the end of a single run the fake ends as if released.

Limits