cameraSummaries even when retainFrames: false,
so dataset pipelines can stream images through onFrame while still recording
camera-source provenance, dimensions, per-stream frame counts, frame ranges,
and simulation timestamps.
For named dataset streams, recordMountedCameraFrameSequence() adds a
readiness summary and requires every requested cameraKey by default. This
prevents LeRobot/Forge pipelines from silently recording a partial set of
camera streams.
Signature
CameraFrameSequenceOptions:
Usage
API Ref Path
MujocoSimAPI exposes the same sequence recorder:
Policy And Dataset Rows
onBeforeStep, onAfterStep, and onSample use object callback arguments and
receive the live MuJoCo model and data references:
- Use
onBeforeStepto run policy inference or writedata.ctrlbefore MuJoCo advances. - Use
onAfterStepfor step-level telemetry. - Use
onSampleto record the synchronized LeRobot row for the captured timestep. It runs after stepping and before the camera images are rendered for that frame.
Mounted Camera Readiness
Use the mounted-camera helpers when task camera names differ from MuJoCo resource names. The readiness object is stable metadata for UI preflight, dataset manifests, and runner handoff checks.Notes
- Use
onFramefor long sequences so you can stream frames to storage instead of keeping all images in memory. - Set
retainFrames: falsewhen streaming. The returned result will report the completedframeCount, camera keys, andcameraSummarieswithout retaining every encoded image. - Use
result.cameraSummaries[cameraKey]to persist source provenance, dimensions, recorded frame counts, first/last frame indices, and first/last simulation timestamps next to LeRobot/Forge handoff metadata. - Use
createMountedCameraFrameSequenceManifest(result)when downstream tooling needs one stable artifact with readiness, source targets, dimensions, frame coverage, first/last frame indices, and missing-frame counts per stream. - Use
result.readinessorcreateMountedCameraFrameSequenceReadiness(plan)to persist which task camera streams resolved before recording. - Pass
signalto cancel a long recording from app UI. - Use
onSamplefor synchronized state/action rows instead of deriving dataset rows from a later UI callback. - Use
onBeforeStepwhen sequence recording is also driving a policy or scripted controller. captureInitialFramedefaults totrue; set it tofalseto step before frame zero.stepsPerFramedefaults to1. Use0when you need repeated camera captures from the current simulation state without advancing physics, such as recording camera-source provenance frames.- Use
cameraNamefor MuJoCo<camera>elements, orsiteName/bodyNamefor robot-mounted camera frames. These selectors are resolved every recorded frame, so mounted cameras follow simulation state. requireMountedSourcesdefaults totrue. Sequence recording throws unless each camera provides exactly one mounted MuJoCocameraName,siteName, orbodyNameselector.- Use
resolveMountedCameraFrameSource()when dataset stream names need to map to actual MuJoCo cameras, sites, or bodies. Exact names and aliases are tried first; then normalized/prefix/suffix matches such asleft_wristtoleft_wrist_camera_optical_frameare used for imported models. recordMountedCameraFrameSequence()defaultsrequireAlltotrue; set it tofalseonly for partial-coverage tools, not train/eval dataset capture.- Each image result includes
source.kind, so dataset pipelines can require mounted MuJoCo streams and rejectexplicit-pose/fallback-cameraframes. - Use
captureCameraFrame()withposition+lookAtorquaternionfor synthetic fixed debug stills. For sequence recording, passrequireMountedSources: falseonly for local visualization experiments that will not be used as dataset or training evidence. - Camera keys are application-defined, so they can map cleanly to dataset
feature names such as
observation.images.head.