From 2031b9ca8f677cbdf0fff9e56795b29e7965d5a0 Mon Sep 17 00:00:00 2001 From: DeeJanuz <45082401+DeeJanuz@users.noreply.github.com> Date: Wed, 30 Sep 2026 08:58:30 -0600 Subject: [PATCH] Add colour cameras, pinch gestures, and depth measures - fh-camd --with-color publishes the Arcturus colour pair (luma, half size, 30 fps) to the ring, flagged FH_CAM_COLOR. fh-tracker records them, and fh-replay --cams mono|color|all tracks with them, using the module's EEPROM calibration (load_color_calibration). tools/check_color.py checks which node is left and how the crop maps. - Pinch detection per hand (trackd/pinch.h), published to $XDG_RUNTIME_DIR/frame-hands/gestures (include/fh_gestures.h). It has begin and end counters, times, the pinch point, and the begin point for drags. tools/watch_gestures.py shows it live, and fh-replay reports it. - fh-replay --depth and tools/depth_report.py measure the depth without ground truth: noise along the line of sight against across it, the one-camera guess, and a simulated camera loss. - fh-tracker --swap-sides, --ring, --keep-presence, --record-only. Co-Authored-By: Claude Opus 5.5 --- camd/README.md | 11 +- camd/camd.c | 170 +++++++++++++++++++++++--- camd/fhring.h | 4 + include/fh_gestures.h | 66 +++++++++++ tools/check_color.py | 65 ++++++++++ tools/depth_report.py | 256 ++++++++++++++++++++++++++++++++++++++++ tools/show_set.py | 47 +++++--- tools/watch_gestures.py | 85 +++++++++++++ trackd/Makefile | 8 +- trackd/README.md | 14 +++ trackd/calib.cpp | 51 ++++++++ trackd/calib.h | 8 ++ trackd/main.cpp | 49 ++++++-- trackd/pinch.cpp | 153 ++++++++++++++++++++++++ trackd/pinch.h | 71 +++++++++++ trackd/replay.cpp | 100 ++++++++++++++-- trackd/tracker.cpp | 6 +- trackd/tracker.h | 4 +- tracker/calib.py | 33 ++++++ 19 files changed, 1141 insertions(+), 60 deletions(-) create mode 100644 include/fh_gestures.h create mode 100644 tools/check_color.py create mode 100644 tools/depth_report.py create mode 100644 tools/watch_gestures.py create mode 100644 trackd/pinch.cpp create mode 100644 trackd/pinch.h diff --git a/camd/README.md b/camd/README.md index 3745b2e..63c1060 100644 --- a/camd/README.md +++ b/camd/README.md @@ -2,7 +2,7 @@ Root-side camera access for frame-hands: -- `fh-camd`: the frame broker. It publishes the four IR tracking cameras to a shared-memory ring that the unprivileged tracker reads. +- `fh-camd`: the frame broker. It publishes the four IR tracking cameras, and optionally the Arcturus color pair, to a shared-memory ring that the unprivileged tracker reads. - `fh-camprobe`: a test tool that records timestamped frames from every camera, including the Arcturus color pair, with CSV logs. ## How it gets frames @@ -33,6 +33,13 @@ Frames go to `/run/frame-hands/ir-ring`. The file is mode 0600 and owned by the - A copy torn by the camera overwriting the buffer is dropped. - Each copy takes about 0.1 ms, and a cache sync about 0.15 ms. +Options: + +- `--with-dark`: also publish the near-black frames, as extra ring cameras flagged `FH_CAM_DARK`. They show only light sources, so they're no use for hands. +- `--with-color`: also publish the two Arcturus color cameras, flagged `FH_CAM_COLOR`. Each is the luma of the 10-bit frame's valid 1972x2464 (the top 8 bits), at half size (`--color-scale 2`: 986x1232) and at most 30 fps (`--color-fps`; the cameras run at 60). Frames that carry the module's warped half-size copy are dropped. Their `capture_ns` is on the color module's clock (2.2 s off the mono cameras' on 2026-09-29), so line them up with the mono cameras by `dqbuf_ns`. Each frame costs about 0.65 ms of cache sync and 1.1 ms of decoding, so both cameras at 30 fps take about 11% of a core. +- The ring holds 8 cameras: 4 mono, plus 4 dark twins or 2 color cameras. +- `--sensor S`: only the mono cameras whose sensor name contains S. + It exits when XRService exits, or when a camera's buffers keep going stale, which means XRService has reallocated them. Start it again to re-attach. ## fh-camprobe @@ -51,6 +58,6 @@ Output goes to `~/Pictures/framecap/stereo-