Class CameraClient

A gRPC-web client for the Camera component.

Implements

Constructors

Properties

callOptions: CallOptions = ...
name: string

The name of the resource.

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    • callOptions: CallOptions = ...

    Returns Promise<JsonValue>

    import { Struct } from '@viamrobotics/sdk';

    const result = await resource.doCommand(
    Struct.fromJson({
    myCommand: { key: 'value' },
    })
    );
  • Get the geometries of the component in their current configuration

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<commonApi.Geometry[]>

  • Return a frame from a camera.

    Parameters

    • filterSourceNames: string[] = []

      A list of source names to filter the images by. If empty or undefined, all images will be returned.

    • extra: {} = {}

      Extra parameters to pass to the camera.

    • callOptions: CallOptions = ...

    Returns Promise<
        {
            images: { image: Uint8Array; mimeType: string; sourceName: string }[];
            metadata: ResponseMetadata;
        },
    >

    const camera = new VIAM.CameraClient(machine, 'my_camera');
    const images = await camera.getImages();

    TODO(docs): include docs link for get images TS example

  • Return a point cloud from a camera.

    Parameters

    • extra: {} = {}
    • callOptions: CallOptions = ...

    Returns Promise<Uint8Array>

    const camera = new VIAM.CameraClient(machine, 'my_camera');
    const pointCloud = await camera.getPointCloud();

    For more information, see Camera API.