#!/usr/bin/env python3 """pose_probe -- offline chase render of the articulated mech in a fifodump. py pose_probe.py [updir] Frames the camera on the LAST-articulated root (board.anim_abs), a chase offset away, and renders one frame. The proof harness for any "is the mech posed/assembled right?" question -- offline, against a copy of the live dump, zero interference with a running pod. UP SENSE (updir, default +1): the wire's model/scene data is Y-UP -- proven three ways on 2026-07-29: MAD.SKL offsets are anatomically coherent only with +Y up (hip +5.29 above ground, knees/ankles descending), the BGF vertex extents agree (foot meshes extend -1.0 below their ankle joint, torso +3.8 above shakey), and the SHIPPED pod's wire carries the same signs (hip +6.2, knees negative, yaw-only vehicle root -- no flip anywhere on the wire). So a scene-space render wants screen-up = +Y, which is updir=+1 here. The LIVE bridge world is the other way around -- "-y is up here" -- because the calibrated live path (fp_cam / the mirrored det -1 root-basis family, FP_RIGHT_SIGN, COCKPIT-CAGE-NOTES.md) maps the wire into Dave's GL presentation. The first version of this harness copied the aerial camera's up hint from that world and rendered the mech hanging from its own shadow; the operator caught it. updir=-1 reproduces that view if you ever need it. """ import sys, os, struct sys.path.insert(0, r'C:\VWE\TeslaRel410\dpl3-revive\patha') os.environ.setdefault('SDL_VIDEODRIVER', 'dummy') import numpy as np from vrboard import VirtualBoard, Msg from vrview import Renderer cap = sys.argv[1] out = sys.argv[2] if len(sys.argv) > 2 else "pose_probe.png" updir = float(sys.argv[3]) if len(sys.argv) > 3 else 1.0 data = open(cap, "rb").read() board = VirtualBoard() off = 0 while off + 8 <= len(data): if data[off:off+4] != b'VPXM': off += 1; continue ln = struct.unpack_from('= 4: a = struct.unpack_from('= 56: struct.pack_into('