Skip to content

egocap: calibration library, command line, and a launcher that starts the bridge with a rectification table - #1635

Open
NVshawnhwang wants to merge 2 commits into
nvShawnHwang/egocap_rectify_bridgefrom
nvShawnHwang/egocap_calibration_library
Open

NVshawnhwang wants to merge 2 commits into
nvShawnHwang/egocap_rectify_bridgefrom
nvShawnHwang/egocap_calibration_library

Conversation

@NVshawnhwang

Copy link
Copy Markdown
Collaborator

Summary

Second of four stacked pull requests (on top of the bridge's rectify step). It adds the station-side
calibration code for the Ego Capture example, with no page and no backend routes yet:

  • a calibration library under recording/egocap/calibration/;
  • a command line, recording/tools/calibrate_station.py;
  • the launcher (tools/start_system.py) builds each camera's remap table from the station's plan at start and
    starts the camera bridge with it;
  • the time-aligner subtracts the camera lag that calibration measured.

What it does

Camera calibration (camera subcommand; camera_pipeline.py, intrinsics.py, extrinsics.py,
grading.py, guidance.py, board.py, take.py)

  • Lens calibration from a ChArUco board take, under a pinhole or a fisheye model (OpenCV's four-coefficient
    fisheye model), with outlier passes and a grade (excellent, acceptable, bad) that decides what may be installed.
  • The head camera's position on the headset (hand-eye), with a search for the camera's lag against tracking.
  • Head tracking that fails during the take is detected from the head track itself: where the position stops
    following the head's turning the samples are left out, and where the position leaps the take is split and the
    longest sound stretch is solved. The record and the log state what the take read.
  • A live guide (guidance.py) that a caller feeds pictures and head poses: views, coverage, head motion and
    head-tracking health, each with the amount it asks for.

Controller-to-glove offsets (wrist_offset.py, hand_view.py): the least-squares fit and the projection
the labelling tool draws.

Rectification (rectify.py, rectify_take.py, rectification_files.py; rectify and table subcommands)

  • An explicit-geometry planner: output size, balance, field-of-view scale, or a stated output camera matrix;
    optional oversampling. No automatic crop search and no silent fallback: a plan that would leave pixels without
    a source is refused unless borders are allowed.
  • Writes the remap table file the bridge's rectify step loads, and an offline rectified copy of a take.
  • The launcher reads <calibration dir>/rectification/plan.json, writes one table per planned stream, starts
    the bridge with --gpu-step <stream>:rectify=<table>, and records what it applied in streams_state.json.
    --no-rectify starts without correction.

Station files (files.py, station_store.py): one home for file names and readers, atomic installs with an
archive of what was replaced and a ledger of who installed what. In a session recorded with correction, each
camera's intrinsics file describes the recorded (corrected) picture and the lens calibration is kept beside it
under its own name.

Aligner (camera_lag.py, alignment.py, aligned_writer.py): camera times are moved by the measured lag
before aligning, and the aligned episode records what was taken off.

How it was tested

  • tests/recording at 100% line and branch coverage for recording/egocap (the tree's gate), tests/tools.
  • The planner's maps were compared with a hand-written fisheye model, and the table file was read back by the
    bridge's C++ reader; the bridge's host reference produced byte-identical output to an independent NumPy
    implementation on planner-written tables.
  • The tracking-loss handling was studied on simulated takes (150 per case): a position carried by the turning
    alone is found in every take; a sound take that reads low loses frames, not its grade.
  • Synthetic data only. No binary fixtures.

Not yet verified on hardware

  • Real board captures: detection reach at the edge of a wide lens, the fisheye solve on real pictures.
  • The head-tracking limits were taken from measurements on a headset of this kind but on another pose stream.
    The solve logs the take's lowest and median reading (millimetres of position per degree of turning), so the
    first real take shows whether a sound sweep reads above the limit here.
  • Real gloves: joint order and the offset convention.
  • The launcher's bridge start with a table (needs the CUDA host of the first pull request).

🤖 Generated with Claude Code

…t launch

Add the station-side calibration code of the Ego Capture example: a
library under recording/egocap/calibration, a command line
(recording/tools/calibrate_station.py), and a launcher that starts the
camera bridge with a rectification table.

Camera calibration
- Lens calibration from a ChArUco board take under a pinhole or a
  fisheye model, graded excellent, acceptable or bad; the grade decides
  what may be installed.
- The head camera's position on the headset (hand-eye), with a search
  for the camera's lag against tracking.
- Head tracking that fails during the take is told from the head track:
  where the position stops following the head's turning its samples are
  left out, and where the position leaps the take is split and the
  longest sound stretch is solved. The record and the log state what the
  take read.
- A live guide a caller feeds pictures and head poses: views, coverage,
  head motion and head-tracking health, each with what it asks for.

Controller-to-glove offsets
- The least-squares fit and the projection a labelling tool draws.

Rectification
- A planner with explicit geometry: output size, balance, field-of-view
  scale or a stated output camera matrix, and optional oversampling. A
  plan that would leave pixels without a source is refused unless
  borders are allowed.
- It writes the remap table the bridge's rectify step loads, and an
  offline rectified copy of a take.
- tools/start_system.py reads the station's plan, writes a table per
  planned stream, starts the bridge with it and records what it applied.
  --no-rectify starts without correction.

Station files
- One home for file names and readers; installs are atomic, archive
  what they replace and are logged with who installed them. In a session
  recorded with correction each camera's intrinsics file describes the
  recorded picture, and the lens calibration is kept beside it.

Aligner
- Camera times are moved by the lag calibration measured before
  aligning, and the aligned episode records what was taken off.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Shawn Hwang <shhwang@nvidia.com>
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@gareth-morgan-nv

Copy link
Copy Markdown
Contributor

🤖 Agent-generated (Claude Code · claude-sonnet-5-5)

@NVshawnhwang the controller-to-glove offset in this stack overlaps with #1625 (@Yunjuliii), which also adds a controller-to-Manus-wrist offset calibration. They reach the same kind of result by different routes, and the two should be compared before both land.

Could you break the controller-to-glove offset out into its own pull request or short stack, independent of the rest of the calibration work? It currently spreads over:

The per-operator glove calibration files in #1640 are the SDK's own glove calibration and are a separate feature, so they do not need to move.

Yunju is being asked to split #1625 the same way, so that the sensor recording and the offset solvers are separate. We will compare the two offset implementations (output format, convention, where the result is stored and read, how it is run) and agree one design before either merges. Yunju is now a reviewer on #1635, #1636 and #1637, and you are a reviewer on #1625.

@gareth-morgan-nv

Copy link
Copy Markdown
Contributor

🤖 Agent-generated (Claude Code · claude-sonnet-5-5)

Summary

This adds the station calibration library (lens intrinsics, head-camera hand-eye, grading, live guide, controller-to-glove offsets, rectification planner, station store), the calibrate_station.py command line, per-stream rectification tables in start_system.py, and the camera-lag subtraction in the time aligner. I read all the non-test source and checked the maths against the existing recording path's calibration conventions. The core maths is sound: the OpenXR to forward-left-up conversion, the wrist_in_controller / export pair, the fisheye and pinhole projection and inversion, the hand-eye usage (calibrateHandEye with world-from-head and camera-from-board gives T_headset_camera), and the sign of the camera lag. I confirmed numerically that frames.py and wrist_offset.py reproduce the existing path's chain T_world_controller @ inv([R|t]) @ R_corr for its installed left and right offsets, and round-trip the exported rotation and translation to 1e-9. The aligner change is a strict no-op for a session that carries no lag (times are x - 0.0, bit-identical), and the launcher change leaves a station with no rectification plan on the same bridge arguments and published size as before. The concerns are: one explicit repo-rule conflict in what the aligned episode records, an assumption that one lag holds for every camera, install thresholds that have only been tried on synthetic data, and the size and scope of the PR (about 9k lines of source, several separable features, much of it without a caller in this PR). I did not run the test suite (the project's lock file needs a plugin path outside the tree); I ran small numeric checks of frames.py and wrist_offset.py only.

Legend: 🚫 Blocker · 💡 Suggestion · 🔍 Nit

Finding
🚫 aligned_writer.py _camera_lag_record / CAMERA_LAG_ATTR — the aligned episode gains a camera_lag attribute holding taken_off_s, cameras, source, camera_latency_s, tracking_latency_s and take_tracking_latency_s. The repo rules (root AGENTS.md, learning loop) say that when matching a reference recording format, timestamp fixes must not add provenance fields to arrays, attributes, metadata or sidecars, and must keep the persisted alignment contract. The existing recording path already keeps per-source latencies in the episode's latency attribute; if the lag that was applied must be recorded, that is the place for it, as a number and nothing else, and the provenance (which extrinsics file, which latency it was solved under) belongs in the log or beside the dataset. Please confirm with the owner of the format before this lands.
💡 aligned_writer.py write_aligned_episode — one lag, measured for the head camera, is subtracted from every camera, including both wrist cameras (the comment says it is "taken to hold" for them). The wrist cameras go through a different sensor and conversion path, so their stamp-to-exposure delay is not obviously the same, and the existing recording path keeps a latency per camera. The assumption is untested and silently moves the wrist pairing. Either record a lag per camera (the head camera's only when that is all that was measured) or restrict the subtraction to the camera the lag was solved for.
💡 grading.py _grade_intrinsics_record / INTRINSICS_RMS_PX and the evidence limits — every threshold (RMS 0.5/1.0 px, view counts, coverage, tilt spread, reach 0.85/0.75, uncertainty limits) is derived from synthetic takes, as the PR says. Intrinsics install only when excellent (RMS under 0.5 px, plus all the evidence limits), so a real wide fisheye that lands at 0.6-0.9 px, or a tilt spread of 0.015 on a board held at 1-2 m (which the comments say is already refused), will never install, and the operator's only recourse is to keep recording. The existing calibration tooling refuses at 0.6 px (at a quarter of the sensor resolution) with one outlier pass, so this is also stricter than what stations have been installing. Please state which limits are expected to bind on real captures, and consider shipping the evidence limits as advisory (feedback, not refusal) until a first real take has been graded.
💡 files.py intrinsics_from_record and the written intrinsics file — a fisheye solve is written to head_camera_intrinsics.json with dist_coeffs of four numbers and a new model: "fisheye" key. Readers of that file in the existing path read K and dist_coeffs only and project through the radial-tangential model, so for an uncorrected session they would silently apply four fisheye coefficients as k1,k2,p1,p2: a plausible wrong answer, which is exactly the failure camera_model.py warns about. The corrected-session layout (lens file beside the file for the corrected picture) avoids it, but a session recorded without rectification does not. Please state how existing readers are meant to cope, or write the fisheye file under a name they do not read.
💡 extrinsics.py HeadTrackReader, head_motion_per_degree, _find_jumps, _read_windows (about 300 lines) — streaming detection of head-tracking loss by comparing position path to turning path over sliding windows, with limits taken from "a headset of this kind, on another pose stream"; the file itself says a sound sweep's reading on this stream is not measured, and the log is meant to settle it after the first real take. The solve already drops views whose implied board position disagrees (_consistent_views) and refuses a take where fewer than half agree. I would land the hand-eye without this reader, then add it once a real take shows the drop-outs _consistent_views misses. As it stands, a threshold that is wrong in either direction either discards good frames or lets a bad stretch through, with no hardware data to tell which.
💡 PR scope — the PR is the library, the CLI, the rectification planner and table file, the station store (history archive, ledger, per-operator names, directory locking), the launcher change and the aligner change. They share little. wrist_offset.py, hand_view.py and guidance.py have no caller in this PR (the page is a later PR), so their frame and unit handling cannot be reviewed in use. I suggest at least: (1) aligner plus camera_lag.py plus the minimal file readers, (2) the camera calibration library and CLI, (3) rectification planner plus launcher, (4) wrist offsets and hand view with the page that draws them.
💡 station_store.py _one_line, operator_name, _shown_entry, _stored_ledger — a large amount of handling for hand-edited ledgers (control characters, lone surrogates, per-kind regexes, directory flock with a fallback) around what is a small record of who calibrated when. This is the largest block of code in the PR with the least consequence to the recorded data; I would defer the ledger and archive until a station asks for them.
💡 Comments across extrinsics.py (limits block), intrinsics.py (MIN_VIEWS, _FISHEYE_OFF_LINE, _OUTLIER_ROUNDS, the two solver-start blocks, _focal_uncertainty), grading.py (INTRINSICS_*) and rectify.py — many comments run 8-12 lines and recite measurement tables ("of 150 sound takes 6 lost a view", "on 84 synthetic takes ... 25 ... 9 ... 3", "1536 takes ... 0.3% ... 6% ... 23%"). AGENTS.md asks for a few lines, the fact and not the argument, and no counts that drift; these numbers are a study, not a fixed fact about the world, and they go stale the first time a limit is changed. Keep the limit and one clause of reason; move the evidence into a short design note or the PR description.
💡 hand_view.py scale_K — scales fx, cx, fy, cy by the plain size ratio, while rectify.py _before_box_filter correctly moves the principal point by (d - 1) / 2 for the bridge's box filter. The two conventions in one library differ by up to a quarter pixel at the bridge's 2x shrink; harmless for hand-clicked fingertips, but one authority (the box-filter form, since that is what the bridge does to every stream it shrinks) would remove the inconsistency.
💡 wrist_offset.py offsets_from_record — the file's corr_left_deg / corr_right_deg are ignored ("the correction applied is this module's own"). A file whose stored correction is not the fixed (0, -90, 0) would be read with the wrong rotation, with nothing said. Raise CalibrationFileError when the stored values differ from CORR_DEG.
💡 wrist_offset.py TRANSLATION_BOUND_M = 0.20 is measured from the controller origin, where the existing offset solve bounds the shift (0.15 m) around the installed offset. Two consequences: a fit started at the installed offset has less room than a zero-started one would, and the bound is on the absolute offset rather than on the change. This is a defensible choice (and the fit reports at_translation_limit), but it should be stated in the docstring with the installed offsets' magnitude (about 0.1 m) as the reason.
💡 start_system.py top-level imports — the launcher previously imported nothing from egocap; it now imports egocap.calibration.* (and so OpenCV, SciPy and zarr) at start for every run, including --mock and runs with no rectification. It works under uv run (the project installs egocap), but a launcher run with another interpreter now fails at import. Please say in the module docstring that it must run in the project environment, or import lazily inside the rectification path.
💡 start_system.py main — a station with no plan behaves as before (same --stream string, same published size, no --gpu-step), but three things are new for it: streams_state.json is always written, EGOCAP_CALIBRATION_DIR and the streams-state variable are always passed to the backend, and report_pose_sources prints a WARNING on every start for any existing head_camera_extrinsics.json or wrist_calibration_offsets.json that lacks the new pose_source stamp (which every file made by existing tooling does). That is noise on every start of an already-calibrated station; consider logging it once at info level, or only when a tool would act on the file.
💡 start_system.py BridgedStream, stream_roles, plan_rectifications, published_cameras — all written for several streams, but main bridges exactly one (bridged = [stream]), so --stream-role with a second stream is refused as "not bridged". Either bridge more than one stream here, or keep the single-stream shape until a rig needs it; as written it is generality with no consumer.
💡 aligned_writer.py imports — the recording package now imports egocap.calibration.files, take and camera_lag, while those import egocap.recording.episode_layout and egocap.recording.alignment. It works, but the two packages now depend on each other. files.py could take fsync_dir from a small shared module, and the lag reading (CalibrationTake.tracking_latency_s) could live under recording.
🔍 hand_view.py _inside — treats a pixel as inside when 0 <= u < width; with pixel centres at integers the interval is -0.5 <= u < width - 0.5. Immaterial at the 200 px margin, but the half-pixel convention is otherwise stated carefully in rectify.py.
🔍 rectify.py _fitted_matrix docstring — a sentence is wrapped mid-line ("The\n view is fitted\n for a picture ..."); reflow.
🔍 camera_lag.py — CameraLagError is defined and exported but aligned_writer.py catches CalibrationError; use the specific class, or drop it.
🔍 aligned_writer.py _session_camera_lag — a damaged extrinsics file only logs a warning and aligns unshifted. That is reasonable for a recorded session, but the aligned episode then carries no sign of it (no attribute, by the first finding), so a re-alignment after the file is repaired produces a differently timed episode with nothing to tell them apart. Worth a sentence in the README.

Verified without finding

  • frames.py: R_FLU_FROM_OPENXR equals the existing path's headset-to-world remap, and openxr_poses_to_flu equals its conjugation of poses; the body and world conversions are consistent with T_headset_camera being forward-left-up.
  • wrist_offset.py: wrist_in_controller, export_offset, offset_from_export reproduce inv([R|t]) @ R_corr for the installed left and right offsets and round-trip exactly; SKELETON_IN_WRIST matches the existing Rz(+-90) then Ry(180) joint frame; the fit uses the same bounds on rotation, soft-L1 loss with 50 px scale and 400 evaluations as the existing click tool.
  • hand_view.py: build_samples indexes the take at the right rows (subset rows for poses, original frames for glove arrays), _axes_px offsets the origin along the columns of the rotation, and the projection chain T_camera_world @ controller @ wrist_in_controller is consistent.
  • camera_lag.py and aligned_writer.py: the sign (positive lag comes off the camera's times, matching how the hand-eye search places frames) and the adjustment stored + (recorded_under - solved_under) follow from stamp, tracking-latency and lag definitions. A session with no extrinsics file, a damaged one, one without the OpenXR stamp, or one without a lag aligns exactly as before.
  • start_system.py: with no plan, bridge_stream_arguments yields the same --stream NAME=TRACK:2 string and published_size the same half-size as before.

Questions for Shawn

  • Is the aligned episode's camera_lag attribute required by something that reads it? If the existing latency attribute can carry the number, the provenance can stay out of the dataset.
  • Do the wrist cameras share the head camera's stamp-to-exposure delay? If not, what should the aligner do for them?
  • What does the launcher do for a station whose calibration files were all made by existing tools and so carry no pose_source? As written the aligner and wrist tools treat them as foreign ("calibrate again"); is that intended for stations with existing calibrations?
  • Which of the grading limits do you expect to be the binding one on the first real fisheye take?

Actionables (for bots — copy-paste-ready for AI)

Agent-generated suggestions, not human-vetted obligations. Skip anything wrong, already addressed, or not worth the churn.

  • aligned_writer.py — drop _camera_lag_record's provenance keys (source, camera_latency_s, tracking_latency_s, take_tracking_latency_s, cameras); if the applied lag must be stored, write the number to the episode's existing latency attribute convention, and log the provenance instead.
  • aligned_writer.py write_aligned_episode — apply the lag only to the camera it was measured for, or accept a per-camera lag.
  • wrist_offset.py offsets_from_record — raise CalibrationFileError when corr_left_deg / corr_right_deg are present and differ from CORR_DEG.
  • hand_view.py scale_K — use the same principal-point convention as rectify._before_box_filter.
  • aligned_writer.py — catch CameraLagError instead of CalibrationError, or remove the unused class.
  • start_system.py report_pose_sources — print once at info level, or only when a tool would use the file.
  • extrinsics.py, intrinsics.py, grading.py, rectify.py — cut limit comments to the limit and one clause of reason; move the measurement narrative out of the source.

@NVshawnhwang
NVshawnhwang requested a review from NVdejung December 1, 2026 20:25
…gocap_calibration_library

Signed-off-by: Shawn Hwang <shhwang@nvidia.com>

@NVdejung NVdejung left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Automated first-pass review (Claude, for Dejun) — I'll follow up personally where needed.

Summary — Adds the station calibration library (ChArUco intrinsics under pinhole or fisheye, head-camera hand-eye with a lag search and tracking-loss handling, grading, a live guide, glove offsets, the rectification planner and remap tables, the station store), a calibrate_station.py command line, per-stream rectification in the launcher, and camera-lag subtraction in the aligner. The library is careful and very thoroughly tested. The blocking problem is where the pieces join: at this head the launcher can correct video that the backend does not yet record as corrected.

Must fix

  1. tools/start_system.py:1091 — Rectification is applied but not recorded. The launcher corrects every stream whose role rectification/plan.json switches on. Nothing at this head records that in the session:

    So a corrected session gets the lens intrinsics as head_camera_intrinsics.json, with no lens file and no rectification.json. This PR's own recorded_rectification() then reads those takes as recorded as received. calibrate_station.py camera would solve a lens from corrected video, and rectify would correct it a second time. That is the silent, irreversible case the library exists to refuse.

    The README (:87, :196) and the PR description both state the backend behaviour as fact. Nothing in this PR writes a plan, so the problem is latent for now. It goes live once any PR that saves a plan (likely #1636) reaches main ahead of the backend change that records it.

    Fix: land the backend's session assets with or before the first PR that can write a plan, or have the launcher refuse an enabled plan until then. Either way, make the README describe this head. If the whole stack lands on main as one unit, say so in the description and this shrinks to the README fix.

Suggestions

  • recording/tools/calibrate_station.py:675 — camera --install writes intrinsics stamped only with camera and calibrated_at (camera_pipeline.py:852), with no stream divisor. A lens solved on the default half-size stream is therefore refused by the launcher's planner (rectify.py:354); test_start_system.py:1443 pins exactly that. Give camera a divisor/source-size option, as table has --calibration-divisor, or say in its help that its output cannot drive a plan.
  • recording/README.md:53 — four links to ../CALIBRATION_TOOLS.md, which is not in this PR. Operator messages also name tools that arrive later: "the Rectification tool" (start_system.py:134, grading.py:310) and "the Headset calibration tool" (calibrate_station.py:10).
  • calibration/files.py:273 — any file without pose_source is reported as "made with another tracking source or another tool". On existing stations this prints at every launch, and the aligner drops their lag; the discussion found the existing offsets numerically compatible. Reword it to "does not state its pose source", and check which installed files are affected.
  • calibration/hand_view.py:52 — scale_K scales cx/cy without the (s−1)/2 pixel-centre term that rectify._before_box_filter applies: 0.25 px off at a 2× downscale. It also accepts any scale that keeps the aspect ratio, while the planner accepts only an exact integer divisor. The error is small, but it feeds the wrist-offset fit; one shared helper would keep the two rules in step.
  • recording/aligned_writer.py:40 — egocap.recording now imports egocap.calibration (board, take, camera_lag), and egocap.calibration already imports egocap.recording. That makes a two-way package dependency, and it brings the ChArUco and take readers into the aligner for one exception class and one constant. Moving those (or the lag rule) into a small module would keep the dependency one-way.

Not repeated here, and still open in the discussion: the aligned-episode format point, the one-lag-for-every-camera assumption, install limits tried only on synthetic data, the PR's size, and the request to split out the glove offset.

Conflicts

  • With nvShawnHwang/egocap_rectify_bridge (#1634's branch): no conflicts in the 3-way merge, 0 commits behind, no rebase needed. The launcher's --stream NAME=TRACK:DIV and --gpu-step NAME:rectify=PATH arguments and the 48-byte ICRMAP01 table header match #1634's parser and reader.
  • Stack children #1636–#1646 (same author): no textual conflicts. #1646 replaces this PR's one-stream launcher wiring.
  • #1606 (Yunjuliii, draft, based on main) — semantic conflict: it adds a three-camera rig to start_system.py, while this PR assumes one bridged stream (:1081; the ego default in stream_roles applies only when there is one stream). Agree with #1646 which design wins before either lands.
  • #1625 (Yunjuliii, draft) — semantic conflict: it also edits alignment.py, where this PR adds camera_lag_s to align_episode, and it has its own controller-to-wrist offset. The comparison asked for in the discussion is still open.
  • #1566, #1571, #1586, #1670 (gareth-morgan-nv) and #1587 (fvaloppi-nv) touch the same launcher, test or README files from other bases, so conflicts were not computed. The likely clash is the bridge-start block (start_system.py:1244). For #1571, note that the launcher now imports egocap.calibration when it loads, so it must run in the egocap environment. Whichever lands second rebases; expect this stack to rebase when #1634 retargets main.

Not verified: I ran no tests (no shell here). intrinsics.py, extrinsics.py, guidance.py and the roughly 20k lines of tests were skimmed, not read line by line.

Change-by-change (49 files)
File / area What changed Makes sense?
recording/README.md Documents the calibration package, corrected sessions, lens files in the session tree, camera-lag alignment ⚠️ describes backend behaviour and a CALIBRATION_TOOLS.md not in this PR (must-fix 1, suggestion 2)
calibration/__init__.py Package docstring ✅
calibration/board.py ChArUco spec validation, detector that settles on the legacy or current layout, sharpness measure ✅
calibration/camera_model.py Projection and inversion per lens model, field limit, board pose ✅
calibration/frames.py OpenXR ↔ forward-left-up helpers ✅
calibration/files.py File names, role maps, atomic JSON write, intrinsics reader, camera-stamp and pose-source checks ✅ (wording, suggestion 3)
calibration/take.py Read-only episode reader: frames, poses, tracking latency ✅
calibration/intrinsics.py Pinhole/fisheye solve with outlier rounds and evidence keys ✅ skimmed
calibration/extrinsics.py Hand-eye solve, head-track loss and leap detection, lag search ✅ skimmed; the maths was checked numerically in the discussion
calibration/grading.py Grades and install gates ✅ intrinsics gate agrees with the planner's 0.5 px limit
calibration/guidance.py Live guide for recording a take ❓ no caller until the page PRs (skimmed)
calibration/camera_pipeline.py Pick frames, solve, grade; review folder kept out of the session ✅ (no stream stamp, suggestion 1)
calibration/camera_lag.py One rule for applying a stored lag ✅
calibration/wrist_offset.py, hand_view.py Controller-to-glove fit, frame picking, overlay ❓ split requested in the discussion; no caller here (suggestion 4)
calibration/rectify.py Explicit-geometry planner, gates, preview, table writer and reader, vectorised FNV-1a ✅ header matches #1634's reader
calibration/rectification_files.py Plan file, streams state, a take's rectification record ⚠️ write_plan and read_streams_state have no production caller at this head (must-fix 1)
calibration/rectify_take.py Offline corrected copy ✅ output refused inside or around the session; staged, then renamed into place
calibration/station_store.py Locked atomic install, archive, ledger ✅
recording/aligned_writer.py, alignment.py, tools/align_episode.py Subtract a stated camera lag, camera_lag attribute, lens files as sidecars ✅ no-op without a stated lag (suggestion 5)
recording/tools/calibrate_station.py camera, rectify, table subcommands ⚠️ suggestion 1
tools/start_system.py Plan → tables → --gpu-step; streams state; --stream-role, --no-rectify; pose-source warnings; table cleanup ⚠️ must-fix 1; unchanged bridge arguments for a station without a plan
Tests: 3 helpers + 20 tests/recording/unit/test_*, tests/tools/test_calibrate_station.py, test_start_system.py Synthetic-data coverage of all of the above; launcher tests isolate the calibration directory ✅ skimmed, not run

Reviewed at 3135505 · 49 files · 2026-12-01 12:52 PST

This branch was successfully deployed

1 active deployment
dev — 572523e2 Deployed Dec 2, 2026 by NVshawnhwang via publish-wheel #7713
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants