You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{Feature} Core - Sync EyeGazeConfigurationLayout to v2
Summary:
Explanation:
Extend `EyeGazeConfigurationLayout` to v2 so `EyeGazePlayer` surfaces three additional per-stream configuration fields:
- `user_calibration_params_json`: verbatim per-user calibration parameters JSON for the ML eye-tracking source; empty for the geometric source or when the user has not been calibrated.
- `field_provenance_single`: packed uint32 (2 bits per slot, indexed by `SingleFieldId`) describing where each per-eye field comes from — direct sensor output, hardcoded constant, calculated from other fields, or not produced at all.
- `field_provenance_combined`: same idea for combined / whole-frame fields, indexed by `CombinedFieldId`.
Also closes a pre-existing gap where `algorithm_name` / `algorithm_version` were declared in the DataLayout but never copied into `EyeGazeConfiguration`, so downstream consumers could not tell which eye-tracking implementation produced the data.
New types under `projectaria::tools::datalayout`:
- `enum class FieldProvenance : uint8_t` with values `SUPPORTED (0)`, `CALCULATED (1)`, `HARDCODED (2)`, `NOT_PRODUCED (3)` — the numeric values ARE the on-disk wire format (2 bits per slot).
- `enum class SingleFieldId : uint32_t` (5 slots: `GazeOrigin`, `GazeDirection`, `EntrancePupilPosition`, `PupilDiameter`, `Blink`).
- `enum class CombinedFieldId : uint32_t` (6 slots: `GazeOriginCombined`, `GazeDirectionCombined`, `ConvergenceDistance`, `InterocularDistance`, `FoveatedGaze`, `SpatialGazePoint`).
- `constexpr` template helpers `getFieldProvenance(packed, id)` / `setFieldProvenance(packed, id, provenance)` to unpack / pack a single slot.
The `EyeGazeConfiguration` struct exposes the raw packed uint32s as `field_provenance_single` / `field_provenance_combined` and typed accessor methods `getSingleFieldProvenance(SingleFieldId)` / `getCombinedFieldProvenance(CombinedFieldId)` that return `FieldProvenance` values directly.
Backwards-compatible with recordings that pre-date these fields: VRS `DataPiece::get()` returns each field's default (empty string / 0) when the field is absent on disk. `0` decodes as `SUPPORTED` for every slot, which is the correct semantics for a source that produces every signal directly.
Python bindings under `projectaria_tools.core.sensor_data` expose the same enums (as `enum.IntEnum` in the type stubs) and the same wrapper methods, so Python callers can either read `config.field_provenance_single` as an `int` or call `config.get_single_field_provenance(SingleFieldId.GAZE_ORIGIN)` for a typed result.
Reproducibility:
Four new C++ tests in `core/data_provider/test/EyeGazePlayerTest.cpp` cover the packed-uint32 helpers (round-trip + cross-slot non-interference), the numeric wire-format contract, an end-to-end v2 config read via `EyeGazePlayer`, and a v1 back-compat read using a locally-defined stripped config layout. One new Python test in `core/python/test/corePyBindTest.py` reads the checked-in Gen2 fixture, asserts the v2 fields fall back to defaults on that (v1-era) fixture, and pins the Python-visible enum values against the wire format.
Reviewed By: PiotrBrzyski
Differential Revision: D113303274
fbshipit-source-id: 5f1233fbd651785ab8e34ddbce4c9c2b979e7ec8
0 commit comments