Commit Graph
10 Commits
Author SHA1 Message Date
kinect-botandsisyphus-dev-ai 5157651cd7 fix(tracker): mirror the capture for pose inference, matching tracker-native
The in-game skeleton/cursor tracking was left/right reversed. Root cause:
tracker-native's win_main.cpp physically mirrors the captured frame
(pixel-level horizontal flip) before pose inference, but publishes the raw
unmirrored frame as the color stream, and runs its mapper with
cal_mapping_cfg.mirror=false (verified by reading win_main.cpp and
core/mapping.cpp directly). The shim's unconditional L/R joint swap
(fallback/windows-nui/src/sensor.cpp) then corrects MediaPipe's resulting
left/right mislabeling.

The Python tracker never physically mirrored the capture - it only applied a
coordinate-level flip (1-u) in joint_mapping.py, with FrameContractPublisher
defaulting mirror=True. That left joint identity already correct on its own
(no image mirror -> no MediaPipe mislabeling -> no swap needed), so the
shim's unconditional swap then flipped it backwards: the exact "tracking is
backwards" symptom.

Fix: Tracker._inference_worker now mirrors the frame (cv2.flip) before
handing it to the pose provider, exactly like win_main.cpp, while keeping
the raw frame for self._latest_frame (the published color stream).
FrameContractPublisher's mirror default changes to False to match
cal_mapping_cfg.mirror=false, so the physical flip isn't double-applied.

New regression test calls the real Tracker._inference_worker directly (not
a reimplementation) with an asymmetric synthetic frame and asserts the pose
provider receives the mirrored version while the stored/published frame
stays unmirrored. Updated test_publish_and_read_back_fake_pose to compute
its independent expectation with the publisher's actual mirror setting
instead of assuming it matches joint_mapping's own default. Full suite:
11/11 passing.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 12:36:55 -05:00
kinect-botandsisyphus-dev-ai 1cc8dc3515 feat(tracker): print startup + periodic status lines (no GUI on this path)
The Linux Python tracker is headless by design - no window, no camera
picker, no live preview; those only exist in the Windows-only
tracker-native/ GUI, which cannot run under Wine (docs/linux-wine.md). But
it also produced zero console output during a normal run, so a working
tracker and a silently stuck one looked identical - which is what prompted
"i don't see the window or picker or preview".

Added:
- a startup banner (camera source opening/opened, model loading, shm
  target + resolution + fps) so a terminal run shows the pipeline actually
  came up,
- a periodic "[tracker] frame=N fps=F player=tracked|lost seq=S" status
  line (every 2s by default, Tracker.run(status_interval=...), disableable
  for tests) so a long-running session shows live confirmation it is still
  publishing frames and whether a person is currently detected.

Verified for real: ran the CLI against both a synthetic test video (confirms
the startup banner, mediapipe loads and infers) and a paced fake source
spanning several seconds (confirms the periodic status line fires on
schedule with the right frame/fps/player fields). Full tests/test_tracker.py
suite still passes (10/10, 0.78s) - the fast unit-test runs finish well
under the 2s default interval, so no new output or timing coupling there.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 10:13:15 -05:00
kinect-botandsisyphus-dev-ai 97d287e439 fix(tracker): drop opencv-contrib-python from the resolution, fixing the Nix build
The real nix develop run surfaced a FileCollisionError: mediapipe declares a
dependency on opencv-contrib-python (its own cv2 build), which collides with
our own opencv-python-headless pin - both provide cv2/__init__.pyi with
different contents. uv2nix merges every locked wheel into one environment and
refuses on a content mismatch; a plain pip/uv venv install silently let
whichever package installed last clobber the others files instead, which is
why this never surfaced before.

tracker/pyproject.toml now excludes opencv-contrib-python from resolution
(tool.uv.exclude-dependencies) since opencv-python-headless already provides
everything the tracker and mediapipe need - verified by installing the
re-locked tracker/uv.lock into a real venv and confirming import mediapipe,
import cv2, and from mediapipe.tasks import python all succeed with only the
headless build present.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 10:06:15 -05:00
kinect-botandsisyphus-dev-ai fd1c9ad3e5 feat(build): add a Nix flake for a venv-free Linux build
flake.nix builds the whole project with Nix instead of a manual uv venv:

- the Python tracker as a pure Nix-built environment via uv2nix, from
  tracker/uv.lock (generated by uv lock against pyproject.tomls pins -
  numpy==2.5.5, opencv-python-headless==5.1.0.95, mediapipe==1.2.3, Python
  3.12), so the environment is an immutable Nix store path assembled from
  hash-pinned wheels, never a mutable venv or a pip install step. libglvnd
  replaces the manual libGLESv2.so.2 .deb-extraction workaround.
- the OS-agnostic core + CTest suite via cmake (nix run .#core-test).
- the Windows shim + native tracker cross-compiled via nixpkgs mingw-w64
  (pkgsCross.mingwW64/mingw32; nix run .#shim-build), with CXX32/CXX64/CXX_WIN
  wired to the build scripts override hooks.

nix run .#tracker runs the tracker directly; nix develop gives a shell with
everything for manual work. docs/setup-linux.md documents the Nix path as
the lead option, keeping the uv/venv path as the no-Nix fallback.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 10:00:15 -05:00
kinect-bot dafd249165 fix(tracker): copy MediaPipe segmentation mask (fixes Windows use-after-free crash)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s
2026-11-25 15:07:47 -05:00
kinect-bot 3eb8c07e4c feat(robust): graceful degradation - player-lost hold, heartbeat stall-detect, crash handling (wave 8b; todo 17 done)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python root tests (pytest, no tracker deps) (push) Canceled after 0s
ci / Python tracker (pytest, tracker/.venv) (push) Canceled after 0s
2026-11-25 05:56:51 -05:00
kinect-bot 0af22f1783 feat(calibration,contract,tracker): T-pose calibration + seqlock fix + articulated-depth wiring (wave 8a; todos 11,20,21 done)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python tracker (pytest) (push) Canceled after 0s
2026-11-25 05:47:19 -05:00
kinect-bot 4a66699d82 feat(mapping,tracker,tools): NUI mapping+smoothing, MediaPipe tracker, record/replay harness, mock NUI host (wave 3)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python tracker (pytest) (push) Canceled after 0s
2026-11-25 04:21:18 -05:00
kinect-bot e6d4e510d3 feat(contract,spikes): frozen IPC data contract + Linux/Windows spikes (wave 2)
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python tracker (pytest) (push) Canceled after 0s
2026-11-25 03:54:41 -05:00
kinect-botandsisyphus-dev-ai b38c7bcd82 chore(scaffold): project layout, cross-platform build, CI
ci / Linux C++ core (cmake + ctest) (push) Canceled after 0s
ci / Python tracker (pytest) (push) Canceled after 0s
Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-25 03:23:45 -05:00