TurboWarp-Time-Space-Sync

時刻対応とカメラ配置の校正の初期雛形です。予定機能は未実装です。

実装計画と利用条件

TurboWarp-Time-Space-Sync: complete block reference

All 44 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

acknowledge that the time pattern flashes

Records that the operator was warned the full screen pattern flashes. The pattern will not be shown until this runs, and the acknowledgement lasts until the project stops.

Block type: COMMAND. Opcode: acknowledgePatternFlashing. Permanent link

This block has no arguments.

show time pattern

Covers the screen with the time coded pattern. The panel stays blank until the display refresh interval has been measured, so nothing decodable is shown from a guess.

Block type: COMMAND. Opcode: showTimePattern. Permanent link

This block has no arguments.

hide time pattern

Removes the time pattern overlay. Escape also removes it, and so does the page ceasing to be shown.

Block type: COMMAND. Opcode: hideTimePattern. Permanent link

This block has no arguments.

time pattern shown?

Reports whether the time pattern overlay is on screen.

Block type: BOOLEAN. Opcode: timePatternShown. Permanent link

This block has no arguments.

time pattern stable?

Reports whether the display refresh interval has been measured. While false the panel is blank and no camera can read a time from it.

Block type: BOOLEAN. Opcode: timePatternStable. Permanent link

This block has no arguments.

time pattern refresh us

Returns the measured display refresh interval in microseconds, or 0 before it has been measured.

Block type: REPORTER. Opcode: timePatternRefreshUs. Permanent link

This block has no arguments.

time pattern wrap us

Returns the period after which the encoded display time repeats, in microseconds.

Block type: REPORTER. Opcode: timePatternWrapUs. Permanent link

This block has no arguments.

time pattern profile id

Returns the identifier of the pattern profile in use. The decoder must be given the same profile or no reading will ever decode.

Block type: REPORTER. Opcode: timePatternProfileId. Permanent link

This block has no arguments.

use time pattern profile [PROFILE_ID]

Chooses the pattern the display draws and the decoder reads: twtss.pattern.v1 (the default) or twtss.pattern.v2, which keeps the panel's brightness constant and has lit corner cells that placement can be measured from. Run it before showing the pattern or starting the decoder; once either exists with another profile the choice is refused and nothing changes. The choice lasts until the project stops.

Block type: COMMAND. Opcode: setTimePatternProfile. Permanent link

ArgumentTypeDefault valueMenu choices
PROFILE_IDSTRINGtwtss.pattern.v2

time pattern profile error

Returns why the last profile choice was refused -- unknown-pattern-profile or pattern-profile-in-use -- or an empty string when it was accepted.

Block type: REPORTER. Opcode: timePatternProfileError. Permanent link

This block has no arguments.

start optical time decoder for camera [CAMERA_ID] reference [REFERENCE_ID] calibrating [SECONDS] seconds at [REFRESH_US] us refresh

Leases the camera, locates the pattern, learns each cell light and dark level, and refuses when readings do not decode often enough. The display refresh interval must be supplied because it sets how long each code stays on screen.

Block type: COMMAND. Opcode: startOpticalTimeDecoder. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERA_IDSTRINGdefault
REFERENCE_IDSTRINGscreen
SECONDSNUMBER8
REFRESH_USNUMBER16667

SECONDS・REFRESH_USを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

calibrate optical time decoder for [SECONDS] seconds

Runs calibration again on a running decoder, for example after the camera or the display moved.

Block type: COMMAND. Opcode: calibrateOpticalTimeDecoder. Permanent link

ArgumentTypeDefault valueMenu choices
SECONDSNUMBER8

SECONDSを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

stop optical time decoder

Stops decoding and releases the camera lease.

Block type: COMMAND. Opcode: stopOpticalTimeDecoder. Permanent link

This block has no arguments.

optical time decoder state

Returns idle, acquiring-camera, calibrating, ready, or error.

Block type: REPORTER. Opcode: opticalTimeDecoderState. Permanent link

This block has no arguments.

optical time decoder error

Returns the last decoder error code, or an empty string when there is none.

Block type: REPORTER. Opcode: opticalTimeDecoderError. Permanent link

This block has no arguments.

optical time decode rate

Returns the share of recent camera frames the decoder could read, between 0 and 1. It is governed by the camera exposure: a reading only decodes when the whole exposure falls inside one displayed code.

Block type: REPORTER. Opcode: opticalTimeDecodeRate. Permanent link

This block has no arguments.

optical time decode margin

Returns how much room the weakest cell of the last reading had to spare, in luminance units. A panel drifting out of readability shows here as a falling margin before it starts failing.

Block type: REPORTER. Opcode: opticalTimeDecodeMargin. Permanent link

This block has no arguments.

optical time observation available?

Reports whether a decoded observation is waiting to be taken.

Block type: BOOLEAN. Opcode: opticalTimeObservationAvailable. Permanent link

This block has no arguments.

optical time observation count

Returns how many observations are currently held. Observations are kept for a fixed stretch of time rather than a fixed count, so the window does not change length with the decode rate.

Block type: REPORTER. Opcode: opticalTimeObservationCount. Permanent link

This block has no arguments.

optical time dropped count

Returns how many observations were discarded for leaving the retention window or exceeding the memory cap.

Block type: REPORTER. Opcode: opticalTimeDroppedCount. Permanent link

This block has no arguments.

optical time rejected count

Returns how many readings decoded but could not follow the previous one in real time. A frozen panel and a reading that slipped past the check bits both land here.

Block type: REPORTER. Opcode: opticalTimeRejectedCount. Permanent link

This block has no arguments.

take next optical time observation

Removes the oldest observation from the queue and exposes it to the observation reporter.

Block type: COMMAND. Opcode: takeOpticalTimeObservation. Permanent link

This block has no arguments.

latest optical time observation JSON

Returns the taken observation as twtss/optical-time-observation version 1 JSON, or an empty string before one is taken.

Block type: REPORTER. Opcode: latestOpticalTimeObservationJson. Permanent link

This block has no arguments.

optical time minimum calibration seconds

Returns the shortest calibration window in which every pattern cell is guaranteed to change state at least once.

Block type: REPORTER. Opcode: opticalTimeMinimumCalibrationSeconds. Permanent link

This block has no arguments.

estimate time correspondence

Intersects the observations collected so far into one delay. A reading bounds the delay rather than measuring it, so the result is the set of delays every reading allows; when a strict majority cannot agree on any, nothing is published.

Block type: COMMAND. Opcode: estimateTimeCorrespondence. Permanent link

This block has no arguments.

time correspondence JSON

Returns the last estimate as twtss/time-correspondence version 1 JSON, or an empty string when none has been made.

Block type: REPORTER. Opcode: timeCorrespondenceJson. Permanent link

This block has no arguments.

time correspondence error

Returns why the last estimate could not be made, or an empty string when it succeeded.

Block type: REPORTER. Opcode: timeCorrespondenceError. Permanent link

This block has no arguments.

display to timestamp delay us

Returns how much later a frame is stamped than the pattern it shows was drawn, in microseconds. This is not a clock offset: an optical reading constrains only the sum of the clock offset and the two pipeline delays, and the components folded in are listed in the JSON.

Block type: REPORTER. Opcode: displayToTimestampDelayUs. Permanent link

This block has no arguments.

time correspondence uncertainty us

Returns half the width of the delays the readings agree on. It shrinks as readings accumulate and never reaches zero, because one refresh of the display is never resolved.

Block type: REPORTER. Opcode: timeCorrespondenceUncertaintyUs. Permanent link

This block has no arguments.

time correspondence current?

Reports whether the last estimate still describes the present. Every estimate expires: one measured before the camera refocused or the clock was re-estimated is not a smaller measurement but a measurement of something else.

Block type: BOOLEAN. Opcode: timeCorrespondenceCurrent. Permanent link

This block has no arguments.

define reference [REFERENCE_JSON]

Stores a twtss/placement-reference version 1 document: the measured position of each point on the reference, with how well each was measured. Corners are listed individually because an image thrown obliquely onto a wall is a general quadrilateral, and describing it by a width and a height bakes a scale error into every pose solved from it.

Block type: COMMAND. Opcode: defineReference. Permanent link

ArgumentTypeDefault valueMenu choices
REFERENCE_JSONSTRING{}

add placement observation [OBSERVATION_JSON]

Stores where one camera saw the reference points, in unmirrored source pixels. Marks are matched to the reference by name; a mark whose name is unknown is dropped rather than matched by position.

Block type: COMMAND. Opcode: addPlacementObservation. Permanent link

ArgumentTypeDefault valueMenu choices
OBSERVATION_JSONSTRING{}

set camera model for [CAMERA_ID] to [MODEL_JSON]

Supplies the intrinsics and distortion to interpret one camera pixels with, as {intrinsics, distortion} with optional intrinsicProfileId, imageWidth and imageHeight, which a solve checks each observation against. Build it with camera model JSON on the camera computer rather than scaling a calibration profile yourself: only Camera Source can tell a scaled capture from a cropped one.

Block type: COMMAND. Opcode: setCameraModel. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERA_IDSTRINGdefault
MODEL_JSONSTRING{}

camera model JSON for [CAMERA_ID]

Returns the camera model to pass to set camera model: the intrinsics Camera Source adapted to the current frame, joined with the distortion, profile id and frame size from the calibration profile it holds. Camera Source's own camera intrinsics JSON leaves the distortion out and is refused by set camera model. Empty when Camera Source publishes no calibration, has no profile for the camera, or cannot adapt it to the frame.

Block type: REPORTER. Opcode: cameraModelJson. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERA_IDSTRINGdefault

measure pattern corners for [SECONDS] seconds

Measures the four outer corners of the projected time pattern in this camera's full-resolution image and builds a twtss/placement-observation from them. Needs the optical time decoder running on twtss.pattern.v2 and a calibration profile for the camera in Camera Source. Each frame's corners are found from the two outer edges of each lit corner cell and the frames are combined by median. The corners are named in the orientation the pattern is drawn, which is only proven while the camera is rolled less than 45 degrees and not seeing the pattern mirrored. A failed measurement clears the previous observation.

Block type: COMMAND. Opcode: measurePatternCorners. Permanent link

ArgumentTypeDefault valueMenu choices
SECONDSNUMBER3

SECONDSを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

pattern corner observation JSON

Returns the last corner measurement as twtss/placement-observation version 1 JSON, with points tl, tr, br and bl in unmirrored source pixels as observed, or an empty string when there is none.

Block type: REPORTER. Opcode: patternCornerObservationJson. Permanent link

This block has no arguments.

pattern corner error

Returns why the last corner measurement failed -- for example decoder-not-running, profile-without-fiducials, intrinsic-profile-missing, too-few-corner-frames, corners-unstable or orientation-unproven -- or an empty string when it succeeded.

Block type: REPORTER. Opcode: patternCornerError. Permanent link

This block has no arguments.

pattern corner spread px

Returns how far the per-frame corners scattered around the measured ones, as an RMS distance in source pixels. Reported for a measurement refused as corners-unstable as well, so the operator can see by how much.

Block type: REPORTER. Opcode: patternCornerSpreadPx. Permanent link

This block has no arguments.

pattern reference JSON [REFERENCE_ID] corners [CORNERS] sigma [SIGMA_METERS] measured by [MEASURED_BY]

Builds the twtss/placement-reference for the projected pattern from the outer corners of its lit corner cells, measured on the wall: tlX,tlY;trX,trY;brX,brY;blX,blY in metres on the wall plane, with any right-angled axes. The rectangularity residual is the largest distance from a corner to the best-fitting rectangle. Returns an empty string when a value is not a number, the corners do not trace a convex outline in that order, or measured by is not tape, laser or nominal.

Block type: REPORTER. Opcode: patternReferenceJson. Permanent link

ArgumentTypeDefault valueMenu choices
REFERENCE_IDSTRINGwall-projection
CORNERSSTRING0,0;0.7,0;0.7,0.7;0,0.7
SIGMA_METERSNUMBER0.002
MEASURED_BYSTRINGtape

SIGMA_METERS・MEASURED_BYを固定フォームで編集します。数値は有限数値の完全なJSON表記を使用し、範囲と静的な関連入力を検証します。enumは既知候補から選択します。未変更の空白・大小文字・数値表記は原文を保持し、reporterは評価しません。対象外の入力は変更しません。MEASURED_BY=nominalの場合にはSIGMA_METERS>0が必要です。両入力は常時表示し、関連reporterは評価せず編集を拒否します。 GUIのDialogs/FixedInputsは起動時既定OFFです。有効にして再読込すると利用できます。

solve placement for rig [RIG_ID]

Places every camera that observed the reference and works out where they stand relative to each other. A camera whose view fits two poses about equally well is refused rather than placed: a small reprojection error says the pose explains the image, not that the image chose it.

Block type: COMMAND. Opcode: solvePlacement. Permanent link

ArgumentTypeDefault valueMenu choices
RIG_IDSTRINGrig

placement result JSON

Returns the last placement as twtss/placement-result version 1 JSON, or an empty string when none has been solved.

Block type: REPORTER. Opcode: placementResultJson. Permanent link

This block has no arguments.

placement error

Returns why the last placement could not be solved, or an empty string when it succeeded.

Block type: REPORTER. Opcode: placementError. Permanent link

This block has no arguments.

placement reprojection RMS for [CAMERA_ID]

Returns the reprojection error of one camera placement, in pixels.

Block type: REPORTER. Opcode: placementReprojectionRms. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERA_IDSTRINGdefault

clear placement observations

Forgets the stored reference, observations, camera models and result.

Block type: COMMAND. Opcode: clearPlacement. Permanent link

This block has no arguments.

Repository guide and examples