5 Commits
Author SHA1 Message Date
kinect-botandsisyphus-dev-ai b513519b55 perf(tracker): decouple capture from inference, matching win_main.cpp
Latency bug: Tracker._inference_worker read the camera and ran pose
inference in the same synchronous loop, so a slow model frame backs up the
camera driver queue and lag grows without bound - the same bug win_main.cpp
fixed natively (dedicated capture thread, condition-variable wake, latest-
frame-wins, no fixed poll).

Added _capture_worker on its own thread, storing only the latest frame
behind a lock+condvar; _inference_worker now waits for and consumes the
newest capture, never a queued one. run()/stop() start and join both
threads. Updated the regression test to drive capture then inference
synchronously (both are plain methods, no real threading needed for a
deterministic single-frame test). Full suite: 98/98 passing.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 13:22:40 -05:00
kinect-botandsisyphus-dev-ai 46187b60a4 fix(tracker): publish the mirrored frame as color, matching the user's actual Windows experience
After the pose-mirror fix (5157651) made skeleton/depth correct, the RGB
video still looked wrong: mirrored on Linux where the user's actual Windows
reference showed a natural selfie-mirror video in-game. Checking the current
win_main.cpp + win_camera.cpp source shows no mirroring anywhere in the
publish path today - but that's inconsistent with what the user actually
observed on their working Windows setup, most likely because the deployed
exe predates a later "un-mirror for cursor accuracy" commit in this
project's history, or an earlier point in that mirror saga is what they
actually tested.

The published color buffer is fully independent of skeleton/cursor
correctness (driven only by the separate pose-inference path, verified
correct), so mirroring it carries no correctness risk. Tracker._inference_worker
now stores the same mirrored copy used for pose inference as self._latest_frame
(previously the raw capture), so the published color stream matches the
selfie-mirror video the user's Windows setup actually showed them.

Renamed/updated the regression test (now
test_inference_worker_mirrors_frame_for_pose_and_publish) to assert both the
pose-inference input and the published frame equal the mirrored copy. Full
suite: 11/11 passing.

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
2026-11-30 12:44:55 -05:00
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-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