mujoco-react 10.3.0 → 10.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -137
- package/dist/{chunk-6AZEFI6A.js → chunk-KHZ5U36J.js} +157 -16
- package/dist/chunk-KHZ5U36J.js.map +1 -0
- package/dist/index.d.ts +180 -49
- package/dist/index.js +627 -19
- package/dist/index.js.map +1 -1
- package/dist/onnx.d.ts +65 -0
- package/dist/onnx.js +58 -0
- package/dist/onnx.js.map +1 -0
- package/dist/spark.d.ts +1 -1
- package/dist/spark.js +1 -1
- package/dist/{types-BOhNDICK.d.ts → types-CViUme8D.d.ts} +157 -1
- package/package.json +14 -3
- package/src/components/CameraView.tsx +245 -0
- package/src/components/Debug.tsx +174 -3
- package/src/core/GenericIK.ts +16 -4
- package/src/core/MujocoSimProvider.tsx +37 -1
- package/src/core/SceneLoader.ts +3 -2
- package/src/hooks/useCameraStream.ts +115 -0
- package/src/hooks/useControlGroup.ts +0 -0
- package/src/hooks/useIkController.ts +3 -0
- package/src/hooks/usePolicyCameraTensors.ts +215 -0
- package/src/index.ts +45 -0
- package/src/onnx.ts +126 -0
- package/src/policyImageTensors.ts +150 -0
- package/src/rendering/cameraFrameCapture.ts +112 -15
- package/src/types.ts +45 -0
- package/dist/chunk-6AZEFI6A.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { M as MujocoContextValue, a as MujocoCanvasProps, b as MujocoSimAPI, S as SceneConfig, R as ReadyCallbackInput, c as StepCallbackInput, d as SelectionCallbackInput, e as MujocoModule, f as MujocoRenderOptions, P as PhysicsStepCallback, g as MujocoModel, h as MujocoData, C as ControlGroupInfo, A as ActuatedJointInfo, i as ControlGroupSelector, O as ObservationConfig, j as ObservationResult, I as IkConfig, k as IkContextValue, B as BodyProps, l as IkGizmoProps, D as DragInteractionProps, m as SceneLightsProps, n as ScenarioLightingProps, o as SplatEnvironmentProps, V as VisualScenarioEffectsProps, p as VisualScenarioConfig, q as SplatRendererKind, r as PairedSplatEnvironmentConfig, s as SplatFormat, t as SplatCollisionProxyConfig, u as SplatEnvironmentReadiness, v as SplatCollisionPrimitive, w as SplatEnvironmentReadinessStatus, x as SplatSceneConfigInput, y as SplatSceneConfigState, z as VisualScenarioExecutionContextInput, E as VisualScenarioExecutionContext, F as ScenarioLightingPreset, G as SplatEnvironmentMetadataInput, H as SplatEnvironmentMetadata, J as SplatSceneInput, K as
|
|
3
|
-
export { aI as BodyInfo, aJ as
|
|
2
|
+
import { M as MujocoContextValue, a as MujocoCanvasProps, b as MujocoSimAPI, S as SceneConfig, R as ReadyCallbackInput, c as StepCallbackInput, d as SelectionCallbackInput, e as MujocoModule, f as MujocoRenderOptions, P as PhysicsStepCallback, g as MujocoModel, h as MujocoData, C as ControlGroupInfo, A as ActuatedJointInfo, i as ControlGroupSelector, O as ObservationConfig, j as ObservationResult, I as IkConfig, k as IkContextValue, B as BodyProps, l as IkGizmoProps, D as DragInteractionProps, m as SceneLightsProps, n as ScenarioLightingProps, o as SplatEnvironmentProps, V as VisualScenarioEffectsProps, p as VisualScenarioConfig, q as SplatRendererKind, r as PairedSplatEnvironmentConfig, s as SplatFormat, t as SplatCollisionProxyConfig, u as SplatEnvironmentReadiness, v as SplatCollisionPrimitive, w as SplatEnvironmentReadinessStatus, x as SplatSceneConfigInput, y as SplatSceneConfigState, z as VisualScenarioExecutionContextInput, E as VisualScenarioExecutionContext, F as ScenarioLightingPreset, G as SplatEnvironmentMetadataInput, H as SplatEnvironmentMetadata, J as SplatSceneInput, K as CameraFrameCaptureOptions, L as DebugProps, N as GeomInfo, Q as ContactListenerProps, T as TrajectoryPlayerProps, U as ActuatorInfo, W as Sites, X as SitePositionResult, Y as Sensors, Z as SensorHandle, _ as SensorInfo, $ as Joints, a0 as ScalarJointStateResult, a1 as ArrayJointStateResult, a2 as JointStateOptions, a3 as JointStateResult, a4 as Bodies, a5 as BodyStateResult, a6 as Geoms, a7 as Actuators, a8 as CtrlHandle, a9 as ContactInfo, aa as KeyboardTeleopConfig, ab as KeyboardIkTargetConfig, ac as PolicyConfig, ad as PolicyAPI, ae as RemotePolicyConfig, af as RemotePolicyAPI, ag as ObservationHandle, ah as ObservationOutput, ai as TrajectoryInput, aj as TrajectoryStateChangeInput, ak as PlaybackState, al as TrajectoryFrame, am as FrameCaptureOptions, an as FrameCaptureResult, ao as FrameCaptureBlobResult, ap as FrameCaptureAPI, aq as CameraFrameCaptureAPI, ar as Cameras, as as CameraFrameSequenceCamera, at as CameraFrameCaptureSource, au as CameraFrameSequenceOptions, av as CameraFrameSequenceResult, aw as PolicyCameraFrameStream, ax as PolicyCameraFrameCaptureOptions, ay as PolicyCameraFrameCaptureResult, az as FrameCaptureStatus, aA as PolicyCameraFrameCaptureAPI, aB as CameraFrameCaptureTensorOptions, aC as CameraFrameTensorResult, aD as CameraFrameSequenceRecorderAPI, aE as ImagePointCoordinateSpace, aF as ImagePointProjectionOptions, aG as ImagePointProjectionResult, aH as PolicyVector } from './types-CViUme8D.js';
|
|
3
|
+
export { aI as BodyInfo, aJ as CAMERA_FRAME_CAPTURE_PRE_RENDER_USER_DATA_KEY, aK as CAMERA_FRAME_CAPTURE_RENDER_USER_DATA_KEY, aL as CAPTURE_EXCLUDE_KEY, aM as CameraFrameCaptureBlobResult, aN as CameraFrameCaptureQuaternion, aO as CameraFrameCaptureResult, aP as CameraFrameCaptureSession, aQ as CameraFrameCaptureVector3, aR as CameraFramePixelsResult, aS as CameraFrameSequenceCameraSummary, aT as CameraFrameSequenceFrame, aU as CameraFrameSequenceSampleInput, aV as CameraFrameSequenceStepInput, aW as CameraInfo, aX as ControlJointInfo, aY as DebugVirtualCamera, aZ as FrameCaptureTarget, a_ as FrameCaptureTargetRef, a$ as IKSolveFn, b0 as IkGizmoDragInput, b1 as IkSolveInput, b2 as JointInfo, b3 as JointStateKind, b4 as KeyBinding, b5 as KeyboardIkTargetAction, b6 as KeyboardIkTargetBinding, b7 as Keyframes, b8 as ModelActuators, b9 as ModelBodies, ba as ModelCameras, bb as ModelGeoms, bc as ModelJoints, bd as ModelKeyframes, be as ModelOptions, bf as ModelResource, bg as ModelResources, bh as ModelSensors, bi as ModelSites, bj as Models, bk as MujocoContact, bl as MujocoContactArray, bm as MujocoFrameCaptureOptions, bn as ObservationLayoutItem, bo as PhysicsConfig, bp as PhysicsStepInput, bq as PolicyActionChunk, br as PolicyActionInput, bs as PolicyImageTensorLayout, bt as PolicyImageTensorOptions, bu as PolicyImageTensorPixelOptions, bv as PolicyImageTensorRange, bw as PolicyImageTensorResult, bx as PolicyImageTensorSourceOrigin, by as PolicyInferenceInput, bz as PolicyInferenceOutput, bA as PolicyInferenceResult, bB as PolicyObservationInput, bC as RayHit, bD as Register, bE as RegisteredModelMap, bF as RemotePolicyRequestInfo, bG as RemotePolicyRequestInput, bH as RemotePolicyResponseInfo, bI as RemotePolicyStatus, bJ as ResetCallbackInput, bK as ResolvedScenarioCameraConfig, bL as ResolvedScenarioMaterialConfig, bM as ResourceSelector, bN as ScenarioCameraConfig, bO as ScenarioMaterialConfig, bP as SceneMarker, bQ as SceneObject, bR as SensorResult, bS as SiteInfo, bT as SplatAssetConfig, bU as SplatScenarioConfig, bV as StateSnapshot, bW as TrajectoryData, bX as TrajectoryFrameCallbackInput, bY as VisualScenarioMaterialFilterInput, bZ as XmlPatch, b_ as captureCameraFrame, b$ as captureCameraFrameBlob, c0 as captureCameraFrameTensor, c1 as createCameraFrameCaptureSession, c2 as dataUrlToPolicyImageTensor, c3 as getContact, c4 as imageDataToPolicyImageTensor, c5 as pixelsToPolicyImageTensor, c6 as registerModelResources, c7 as renderCameraFrameToCanvas } from './types-CViUme8D.js';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
|
-
import { RefObject } from 'react';
|
|
6
|
-
import { ThreeElements } from '@react-three/fiber';
|
|
5
|
+
import { CSSProperties, RefObject } from 'react';
|
|
7
6
|
import * as THREE from 'three';
|
|
7
|
+
import { ThreeElements } from '@react-three/fiber';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Hook to access the MuJoCo WASM module.
|
|
@@ -298,6 +298,43 @@ declare function createControllerHook<TConfig, TValue>(options: ControllerOption
|
|
|
298
298
|
|
|
299
299
|
declare const useIkController: (config: IkConfig | null) => IkContextValue | null;
|
|
300
300
|
|
|
301
|
+
/**
|
|
302
|
+
* @license
|
|
303
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
304
|
+
*/
|
|
305
|
+
|
|
306
|
+
interface GenericIKOptions {
|
|
307
|
+
maxIterations: number;
|
|
308
|
+
damping: number;
|
|
309
|
+
tolerance: number;
|
|
310
|
+
epsilon: number;
|
|
311
|
+
posWeight: number;
|
|
312
|
+
rotWeight: number;
|
|
313
|
+
jointLimits?: ReadonlyArray<readonly [number, number] | null | undefined>;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Generic Damped Least-Squares IK solver.
|
|
317
|
+
* Uses finite-difference Jacobian via MuJoCo's mj_forward.
|
|
318
|
+
* Works for any MuJoCo model — no robot-specific parameters.
|
|
319
|
+
*/
|
|
320
|
+
declare class GenericIK {
|
|
321
|
+
private mujoco;
|
|
322
|
+
constructor(mujoco: MujocoModule);
|
|
323
|
+
/**
|
|
324
|
+
* Solve IK for a target 6-DOF pose.
|
|
325
|
+
* @param model MuJoCo model
|
|
326
|
+
* @param data MuJoCo data (qpos will be temporarily modified, then restored)
|
|
327
|
+
* @param siteId Index of the end-effector site to control
|
|
328
|
+
* @param qposAdr qpos addresses for scalar joints in solve order
|
|
329
|
+
* @param targetPos Target position in world frame
|
|
330
|
+
* @param targetQuat Target orientation in world frame
|
|
331
|
+
* @param currentQ Current joint angles matching qposAdr order
|
|
332
|
+
* @param opts Optional solver parameters
|
|
333
|
+
* @returns Joint angles array, or null if solver diverged
|
|
334
|
+
*/
|
|
335
|
+
solve(model: MujocoModel, data: MujocoData, siteId: number, qposAdr: ArrayLike<number>, targetPos: THREE.Vector3, targetQuat: THREE.Quaternion, currentQ: ArrayLike<number>, opts?: Partial<GenericIKOptions>): number[] | null;
|
|
336
|
+
}
|
|
337
|
+
|
|
301
338
|
/**
|
|
302
339
|
* Declarative physics body component. Registers a body definition in the
|
|
303
340
|
* provider-level registry so it gets injected into the MJCF XML at load time.
|
|
@@ -487,11 +524,62 @@ declare function fetchSplatCollisionProxyXml(xmlPath: string): Promise<string>;
|
|
|
487
524
|
declare function canFetchSplatCollisionProxyXml(xmlPath: string): boolean;
|
|
488
525
|
declare function parseSplatCollisionProxyGeoms(xmlText: string): SplatCollisionProxyGeomPreview[];
|
|
489
526
|
|
|
527
|
+
/** Camera selection + pose options for a live viewport. */
|
|
528
|
+
type CameraViewportOptions = Pick<CameraFrameCaptureOptions, 'camera' | 'cameraName' | 'siteName' | 'bodyName' | 'position' | 'quaternion' | 'lookAt' | 'up' | 'positionOffset' | 'quaternionOffset' | 'fov' | 'near' | 'far' | 'projectionMatrix' | 'mujocoCameraCompatibility'>;
|
|
529
|
+
/**
|
|
530
|
+
* Render the live MuJoCo scene from a named camera into the region covered by
|
|
531
|
+
* `elementRef`'s DOM element. Call this inside `<MujocoCanvas>` with a ref to a
|
|
532
|
+
* DOM element you position anywhere (it does not need to be in the R3F tree).
|
|
533
|
+
*/
|
|
534
|
+
declare function useCameraViewport<T extends HTMLElement = HTMLElement>(elementRef: RefObject<T | null>, options: CameraViewportOptions): void;
|
|
535
|
+
interface CameraViewProps extends CameraViewportOptions {
|
|
536
|
+
className?: string;
|
|
537
|
+
style?: CSSProperties;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Drop-in live camera pane. Renders an absolutely-positioned overlay `<div>`
|
|
541
|
+
* over the canvas showing the selected MuJoCo camera. Position it with
|
|
542
|
+
* `style`/`className` (the canvas's parent should be positioned).
|
|
543
|
+
*/
|
|
544
|
+
declare function CameraView({ className, style, ...options }: CameraViewProps): null;
|
|
545
|
+
|
|
546
|
+
/**
|
|
547
|
+
* @license
|
|
548
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
549
|
+
*
|
|
550
|
+
* Stream a live MuJoCo camera into a DOM `<canvas>`. Each frame the scene is
|
|
551
|
+
* rendered offscreen from the selected camera and blitted into the canvas, so
|
|
552
|
+
* it composites normally in the DOM (works inside opaque panels) and does NOT
|
|
553
|
+
* take over the render loop. Prefer this over `useCameraViewport` for camera
|
|
554
|
+
* tiles embedded in HTML UI; use `useCameraViewport` for transparent overlays
|
|
555
|
+
* on a full-bleed canvas.
|
|
556
|
+
*
|
|
557
|
+
* Uses the async capture path so Gaussian-splat environments render through
|
|
558
|
+
* their dedicated capture renderer — streaming a splat scene at full rate does
|
|
559
|
+
* not disturb the main view's splat sort.
|
|
560
|
+
*/
|
|
561
|
+
|
|
562
|
+
interface CameraStreamOptions extends CameraFrameCaptureOptions {
|
|
563
|
+
/**
|
|
564
|
+
* Optional cap on updates per second. Omit to stream as fast as captures
|
|
565
|
+
* complete (one capture is in flight at a time regardless).
|
|
566
|
+
*/
|
|
567
|
+
fps?: number;
|
|
568
|
+
/** Pause updates without unmounting. */
|
|
569
|
+
paused?: boolean;
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Render the live scene from a MuJoCo camera/site/body into `canvasRef`'s
|
|
573
|
+
* `<canvas>` every frame (throttled to `fps`). Call inside `<MujocoCanvas>`;
|
|
574
|
+
* the canvas itself can live anywhere in the DOM.
|
|
575
|
+
*/
|
|
576
|
+
declare function useCameraStream(canvasRef: RefObject<HTMLCanvasElement | null>, options: CameraStreamOptions): void;
|
|
577
|
+
|
|
490
578
|
/**
|
|
491
579
|
* Declarative debug visualization component.
|
|
492
580
|
* Renders wireframe geoms, site markers, joint axes, contact forces, COM markers, etc.
|
|
493
581
|
*/
|
|
494
|
-
declare function Debug({ showGeoms, showSites, showJoints, showCameras, showContacts, showCOM, showInertia, showTendons, ...groupProps }: DebugProps & Omit<ThreeElements['group'], 'ref'>): react_jsx_runtime.JSX.Element | null;
|
|
582
|
+
declare function Debug({ showGeoms, showSites, showJoints, showCameras, virtualCameras, showContacts, showCOM, showInertia, showTendons, ...groupProps }: DebugProps & Omit<ThreeElements['group'], 'ref'>): react_jsx_runtime.JSX.Element | null;
|
|
495
583
|
|
|
496
584
|
declare function TendonRenderer(props: Omit<ThreeElements['group'], 'ref'>): react_jsx_runtime.JSX.Element | null;
|
|
497
585
|
|
|
@@ -698,6 +786,52 @@ interface ControlWriterHandle {
|
|
|
698
786
|
}
|
|
699
787
|
declare function useControlWriter(options: ControlWriterOptions): ControlWriterHandle;
|
|
700
788
|
|
|
789
|
+
/**
|
|
790
|
+
* @license
|
|
791
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
792
|
+
*
|
|
793
|
+
* Typed, named control groups. Define the group once (like a zod schema or a
|
|
794
|
+
* tanstack route), then read/set actuators by name with inferred keys — no
|
|
795
|
+
* positional arrays, no `as const`, no owner bookkeeping.
|
|
796
|
+
*/
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* A typed description of a set of actuators, keyed by name. Create it once with
|
|
800
|
+
* {@link controlGroup} and reuse it across controllers and scripts; the key
|
|
801
|
+
* union flows through to {@link useControlGroup}.
|
|
802
|
+
*/
|
|
803
|
+
interface ControlGroup<K extends Actuators = Actuators> {
|
|
804
|
+
readonly keys: readonly K[];
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Declare a named control group. With the Vite plugin / codegen active, names
|
|
808
|
+
* are constrained to the model's registered actuators (a wrong or stale name is
|
|
809
|
+
* a compile error). Without it, the literal names you pass are still inferred —
|
|
810
|
+
* no `as const` required (the `const` type parameter captures them).
|
|
811
|
+
*/
|
|
812
|
+
declare function controlGroup<const T extends readonly Actuators[]>(names: T): ControlGroup<T[number]>;
|
|
813
|
+
interface ControlGroupSetOptions {
|
|
814
|
+
/** Write even when another control writer owns one of these actuators. */
|
|
815
|
+
force?: boolean;
|
|
816
|
+
}
|
|
817
|
+
interface ControlGroupHandle<K extends string> {
|
|
818
|
+
/** The cooperative-ownership identity used for conflict detection. */
|
|
819
|
+
owner: string;
|
|
820
|
+
/** Set one or more actuators by name. Returns false if blocked by a conflict. */
|
|
821
|
+
set(values: Partial<Record<K, number>>, options?: ControlGroupSetOptions): boolean;
|
|
822
|
+
/** Read the current control value of every actuator in the group, by name. */
|
|
823
|
+
read(): Record<K, number>;
|
|
824
|
+
/** Whether this group can currently write (no unresolved conflicts). */
|
|
825
|
+
canWrite(): boolean;
|
|
826
|
+
/** Release this group's actuator ownership. */
|
|
827
|
+
release(): void;
|
|
828
|
+
}
|
|
829
|
+
type UseControlGroupOptions = Omit<ControlWriterOptions, 'owner' | 'selector'> & {
|
|
830
|
+
/** Override the auto-generated owner id (useful for readable conflict logs). */
|
|
831
|
+
owner?: string;
|
|
832
|
+
};
|
|
833
|
+
declare function useControlGroup<K extends Actuators>(group: ControlGroup<K>, options?: UseControlGroupOptions): ControlGroupHandle<K>;
|
|
834
|
+
|
|
701
835
|
/**
|
|
702
836
|
* @license
|
|
703
837
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -1244,6 +1378,46 @@ interface MountedPolicyCameraFrameCaptureAPI {
|
|
|
1244
1378
|
declare function usePolicyCameraFrames(defaultOptions: PolicyCameraFrameCaptureOptions): PolicyCameraFrameCaptureAPI;
|
|
1245
1379
|
declare function usePolicyCameraFramesFromMountedStreams(defaultOptions: MountedPolicyCameraFrameCaptureOptions): MountedPolicyCameraFrameCaptureAPI;
|
|
1246
1380
|
|
|
1381
|
+
/**
|
|
1382
|
+
* @license
|
|
1383
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
1384
|
+
*
|
|
1385
|
+
* Capture policy observation tensors directly from Three/MuJoCo cameras,
|
|
1386
|
+
* skipping the data-URL/PNG round-trip. Sessions are created once per camera
|
|
1387
|
+
* and reused every step, so live inference and dataset recording read straight
|
|
1388
|
+
* from the GPU into Float32 tensors.
|
|
1389
|
+
*/
|
|
1390
|
+
|
|
1391
|
+
interface PolicyCameraTensorStream extends CameraFrameCaptureTensorOptions {
|
|
1392
|
+
/** Payload key this stream's tensor is stored under. */
|
|
1393
|
+
key: string;
|
|
1394
|
+
/** Additional payload keys that should reference the same tensor. */
|
|
1395
|
+
aliases?: readonly string[];
|
|
1396
|
+
}
|
|
1397
|
+
interface PolicyCameraTensorsOptions {
|
|
1398
|
+
streams: PolicyCameraTensorStream[];
|
|
1399
|
+
/** Also expose tensors under `observation.images.<key>` aliases. Defaults to `false`. */
|
|
1400
|
+
includeObservationImageAliases?: boolean;
|
|
1401
|
+
}
|
|
1402
|
+
interface PolicyCameraTensorsResult {
|
|
1403
|
+
tensors: Record<string, CameraFrameTensorResult>;
|
|
1404
|
+
sourceSummary: string;
|
|
1405
|
+
capturedAt: number;
|
|
1406
|
+
}
|
|
1407
|
+
interface PolicyCameraTensorsAPI {
|
|
1408
|
+
status: FrameCaptureStatus;
|
|
1409
|
+
error: Error | null;
|
|
1410
|
+
isCapturing: boolean;
|
|
1411
|
+
/** Synchronously render and convert every stream into a policy image tensor. */
|
|
1412
|
+
capture: () => PolicyCameraTensorsResult;
|
|
1413
|
+
reset: () => void;
|
|
1414
|
+
}
|
|
1415
|
+
type MountedPolicyCameraTensorOptions = MountedPolicyCameraFrameCaptureOptions & {
|
|
1416
|
+
tensor?: Pick<CameraFrameCaptureTensorOptions, 'width' | 'height' | 'channels' | 'layout' | 'range'>;
|
|
1417
|
+
};
|
|
1418
|
+
declare function usePolicyCameraTensors(options: PolicyCameraTensorsOptions): PolicyCameraTensorsAPI;
|
|
1419
|
+
declare function usePolicyCameraTensorsFromMountedStreams(options: MountedPolicyCameraTensorOptions): PolicyCameraTensorsAPI;
|
|
1420
|
+
|
|
1247
1421
|
/**
|
|
1248
1422
|
* @license
|
|
1249
1423
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -1274,49 +1448,6 @@ interface MountedCameraSequenceRecorderAPI extends Omit<CameraFrameSequenceRecor
|
|
|
1274
1448
|
}
|
|
1275
1449
|
declare function useMountedCameraSequenceRecorder(defaultOptions?: MountedCameraSequencePlanOptions): MountedCameraSequenceRecorderAPI;
|
|
1276
1450
|
|
|
1277
|
-
/**
|
|
1278
|
-
* @license
|
|
1279
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
1280
|
-
*
|
|
1281
|
-
* Offscreen camera-frame capture for R3F/MuJoCo scenes.
|
|
1282
|
-
*/
|
|
1283
|
-
|
|
1284
|
-
interface CameraFrameCaptureSession {
|
|
1285
|
-
readonly width: number;
|
|
1286
|
-
readonly height: number;
|
|
1287
|
-
capture(options?: CameraFrameCaptureOptions): {
|
|
1288
|
-
canvas: HTMLCanvasElement;
|
|
1289
|
-
camera: THREE.Camera;
|
|
1290
|
-
width: number;
|
|
1291
|
-
height: number;
|
|
1292
|
-
source: CameraFrameCaptureSource;
|
|
1293
|
-
};
|
|
1294
|
-
captureAsync(options?: CameraFrameCaptureOptions): Promise<{
|
|
1295
|
-
canvas: HTMLCanvasElement;
|
|
1296
|
-
camera: THREE.Camera;
|
|
1297
|
-
width: number;
|
|
1298
|
-
height: number;
|
|
1299
|
-
source: CameraFrameCaptureSource;
|
|
1300
|
-
}>;
|
|
1301
|
-
captureDataUrl(options?: CameraFrameCaptureOptions): CameraFrameCaptureResult;
|
|
1302
|
-
captureDataUrlAsync(options?: CameraFrameCaptureOptions): Promise<CameraFrameCaptureResult>;
|
|
1303
|
-
captureBlob(options?: CameraFrameCaptureOptions): Promise<CameraFrameCaptureBlobResult>;
|
|
1304
|
-
dispose(): void;
|
|
1305
|
-
}
|
|
1306
|
-
declare const CAMERA_FRAME_CAPTURE_RENDER_USER_DATA_KEY = "mujocoReactCameraFrameCaptureRender";
|
|
1307
|
-
declare const CAMERA_FRAME_CAPTURE_PRE_RENDER_USER_DATA_KEY = "mujocoReactCameraFrameCapturePreRender";
|
|
1308
|
-
declare const CAPTURE_EXCLUDE_KEY = "mujoco.capture.exclude";
|
|
1309
|
-
declare function createCameraFrameCaptureSession(renderer: THREE.WebGLRenderer, scene: THREE.Scene, fallbackCamera: THREE.Camera, options?: CameraFrameCaptureOptions): CameraFrameCaptureSession;
|
|
1310
|
-
declare function renderCameraFrameToCanvas(renderer: THREE.WebGLRenderer, scene: THREE.Scene, fallbackCamera: THREE.Camera, options?: CameraFrameCaptureOptions): {
|
|
1311
|
-
canvas: HTMLCanvasElement;
|
|
1312
|
-
camera: THREE.Camera;
|
|
1313
|
-
width: number;
|
|
1314
|
-
height: number;
|
|
1315
|
-
source: CameraFrameCaptureSource;
|
|
1316
|
-
};
|
|
1317
|
-
declare function captureCameraFrame(renderer: THREE.WebGLRenderer, scene: THREE.Scene, fallbackCamera: THREE.Camera, options?: CameraFrameCaptureOptions): Promise<CameraFrameCaptureResult>;
|
|
1318
|
-
declare function captureCameraFrameBlob(renderer: THREE.WebGLRenderer, scene: THREE.Scene, fallbackCamera: THREE.Camera, options?: CameraFrameCaptureOptions): Promise<CameraFrameCaptureBlobResult>;
|
|
1319
|
-
|
|
1320
1451
|
/**
|
|
1321
1452
|
* @license
|
|
1322
1453
|
* SPDX-License-Identifier: Apache-2.0
|
|
@@ -1464,4 +1595,4 @@ interface CameraAnimationAPI {
|
|
|
1464
1595
|
*/
|
|
1465
1596
|
declare function useCameraAnimation(): CameraAnimationAPI;
|
|
1466
1597
|
|
|
1467
|
-
export { ActuatedJointInfo, ActuatorInfo, Actuators, type ApplyPolicyActionToControlsOptions, type ApplyPolicyActionToControlsResult, ArrayJointStateResult, Bodies, Body, BodyProps, BodyStateResult,
|
|
1598
|
+
export { ActuatedJointInfo, ActuatorInfo, Actuators, type ApplyPolicyActionToControlsOptions, type ApplyPolicyActionToControlsResult, ArrayJointStateResult, Bodies, Body, BodyProps, BodyStateResult, type CameraAnimationAPI, CameraFrameCaptureAPI, CameraFrameCaptureOptions, CameraFrameCaptureSource, CameraFrameCaptureTensorOptions, type CameraFrameMountSelector, CameraFrameSequenceCamera, CameraFrameSequenceOptions, CameraFrameSequenceRecorderAPI, CameraFrameSequenceResult, CameraFrameTensorResult, type CameraStreamOptions, CameraView, type CameraViewProps, type CameraViewportOptions, Cameras, type ContactHistoryEntry, type ContactHistoryHandle, type ContactHistoryOptions, ContactInfo, ContactListener, ContactListenerProps, ContactMarkers, type ControlGroup, type ControlGroupHandle, ControlGroupInfo, ControlGroupSelector, type ControlGroupSetOptions, type ControlWriterConflict, type ControlWriterHandle, type ControlWriterOptions, type ControlWriterWriteOptions, type ControllerComponent, type ControllerOptions, type CreateMountedCameraFrameSequenceManifestOptions, type CreateMountedCameraFrameSequencePlanOptions, type CreatePolicyCameraFrameCapturePlanOptions, CtrlHandle, Debug, DebugProps, DragInteraction, DragInteractionProps, FlexRenderer, FrameCaptureAPI, FrameCaptureBlobResult, FrameCaptureOptions, FrameCaptureResult, FrameCaptureStatus, GenericIK, type GenericIKOptions, GeomInfo, Geoms, IkConfig, IkContextValue, IkGizmo, IkGizmoProps, ImagePointCoordinateSpace, ImagePointProjectionOptions, ImagePointProjectionResult, InstancedGeomRenderer, JointStateOptions, JointStateResult, Joints, KeyboardIkTargetConfig, KeyboardTeleopConfig, type MountedCameraFrameCaptureSource, type MountedCameraFrameSequenceCameraOptions, type MountedCameraFrameSequenceDefaults, type MountedCameraFrameSequenceManifest, MountedCameraFrameSequenceManifestStatus, type MountedCameraFrameSequencePlan, type MountedCameraFrameSequencePlanOptions, type MountedCameraFrameSequenceReadiness, MountedCameraFrameSequenceReadinessStatus, type MountedCameraFrameSequenceRecordOptions, type MountedCameraFrameSequenceRecordResult, type MountedCameraFrameSequenceRecorderTarget, type MountedCameraFrameSequenceSourceReadiness, type MountedCameraFrameSequenceStreamSummary, type MountedCameraFrameSourceSuggestion, MountedCameraFrameSourceSuggestionMatch, type MountedCameraSequencePlanOptions, type MountedCameraSequenceReadiness, type MountedCameraSequenceRecordOptions, type MountedCameraSequenceRecordResult, type MountedCameraSequenceRecorderAPI, type MountedPolicyCameraFrameCaptureAPI, type MountedPolicyCameraFrameCaptureOptions, type MountedPolicyCameraTensorOptions, MujocoCanvas, MujocoCanvasProps, MujocoContextValue, MujocoData, type MujocoLoader, type MujocoLoaderOptions, MujocoModel, MujocoModule, MujocoPhysics, type MujocoPhysicsProps, MujocoProvider, type MujocoProviderProps, MujocoSimAPI, MujocoSimProvider, type MujocoWasmVariant, type NamedCameraFrameResource, type NamedObservationField, type NamedObservationHandle, type NamedObservationInput, type NamedObservationLayoutItem, type NamedObservationMissing, type NamedObservationOptions, type NamedObservationResult, ObservationConfig, ObservationHandle, ObservationOutput, ObservationResult, PairedSplatEnvironmentConfig, PhysicsStepCallback, PlaybackState, PolicyAPI, PolicyCameraFrameCaptureAPI, PolicyCameraFrameCaptureOptions, type PolicyCameraFrameCapturePlan, PolicyCameraFrameCaptureResult, type PolicyCameraFrameCaptureTarget, type PolicyCameraFramePlanTarget, PolicyCameraFrameStream, type PolicyCameraFrameStreamOptions, type PolicyCameraTensorStream, type PolicyCameraTensorsAPI, type PolicyCameraTensorsOptions, type PolicyCameraTensorsResult, PolicyConfig, PolicyVector, type PoseReadout, type PoseResourceKind, ReadyCallbackInput, RemotePolicyAPI, RemotePolicyConfig, type ResolveMountedCameraFrameSourceOptions, type ResolvedMountedCameraFrameSource, ScalarJointStateResult, ScenarioLighting, ScenarioLightingPreset, ScenarioLightingProps, SceneConfig, SceneLights, SceneLightsProps, SelectionCallbackInput, SensorHandle, SensorInfo, Sensors, SitePositionResult, Sites, SplatCollisionPrimitive, SplatCollisionProxyConfig, type SplatCollisionProxyGeomPreview, type SplatCollisionProxyGeomsState, SplatCollisionProxyPreview, type SplatCollisionProxyPreviewProps, type SplatCollisionProxyPreviewStatus, type SplatCollisionProxyPreviewVector3, SplatEnvironment, SplatEnvironmentMetadata, SplatEnvironmentMetadataInput, SplatEnvironmentProps, SplatEnvironmentReadiness, SplatEnvironmentReadinessStatus, SplatFormat, SplatRendererKind, SplatSceneConfigInput, SplatSceneConfigState, SplatSceneInput, StepCallbackInput, TendonRenderer, TrajectoryFrame, TrajectoryInput, TrajectoryPlayer, TrajectoryPlayerProps, TrajectoryStateChangeInput, type UseControlGroupOptions, type UseSplatCollisionProxyGeomsOptions, VisualScenarioConfig, VisualScenarioEffects, VisualScenarioEffectsProps, VisualScenarioExecutionContext, VisualScenarioExecutionContextInput, applyPolicyActionToControls, bodyPositionField, buildObservation, canFetchSplatCollisionProxyXml, captureFrame, captureFrameBlob, capturePolicyCameraFrames, capturePolicyCameraFramesFromMountedStreams, clampPolicyActionValue, controlGroup, createContiguousControlGroup, createController, createControllerHook, createMountedCameraFrameSequenceManifest, createMountedCameraFrameSequencePlan, createMountedCameraFrameSequencePlanFromApi, createMountedCameraFrameSequenceReadiness, createMountedCameraFrameSourceSuggestions, createNamedObservationBuilder, createPairedSplatEnvironment, createPolicyCameraFrameCapturePlan, createPolicyCameraFrameCapturePlanFromApi, createSparkSplatViewerUrl, createSplatEnvironmentUserData, createSplatSceneConfig, createVisualScenarioExecutionContext, ctrlField, fetchSplatCollisionProxyXml, findActuatorByName, findBodyByName, findGeomByName, findJointByName, findKeyframeByName, findSensorByName, findSiteByName, findTendonByName, geomPositionField, getActuatedJoints, getCameraFrameCaptureSourceTarget, getControlMap, getMountedCameraFrameCaptureSource, getName, getScenarioBackground, getScenarioCameraPosition, getSplatEnvironmentReadiness, imagePointToNdc, isMountedCameraFrameCaptureSource, loadScene, parseSplatCollisionProxyGeoms, projectImagePointTo3D, qposField, qvelField, readNamedObservation, recordMountedCameraFrameSequence, resolveControlGroup, resolveMountedCameraFrameSource, sitePositionField, useActuators, useAfterPhysicsStep, useBeforePhysicsStep, useBodyMeshes, useBodyPose, useBodyState, useCameraAnimation, useCameraFrameCapture, useCameraSequenceRecorder, useCameraStream, useCameraViewport, useContactEvents, useContactHistory, useContacts, useControlGroup, useControlWriter, useCtrl, useCtrlNoise, useFrameCapture, useGamepad, useGeomPose, useGravityCompensation, useIkController, useJointState, useKeyboardIkTarget, useKeyboardTeleop, useMountedCameraSequenceRecorder, useMujoco, useMujocoWasm, useNamedObservation, useObservation, usePolicy, usePolicyCameraFrames, usePolicyCameraFramesFromMountedStreams, usePolicyCameraTensors, usePolicyCameraTensorsFromMountedStreams, useRemotePolicy, useSceneLights, useSelectionHighlight, useSensor, useSensors, useSitePose, useSitePosition, useSplatCollisionProxyGeoms, useSplatEnvironment, useSplatSceneConfig, useTrajectoryPlayer, useTrajectoryRecorder, useVideoRecorder, useVisualScenarioEffects, useVisualScenarioExecutionContext, withSplatEnvironment };
|