Interface PoseTracker

Represents a generic component.

interface PoseTracker {
    getGeometries: (extra?: Struct) => Promise<commonApi.Geometry[]>;
    name: string;
    doCommand(command: Struct | Record<string, JsonValue>): Promise<JsonValue>;
}

Hierarchy (View Summary)

Implemented by

Properties

Methods

Properties

getGeometries: (extra?: Struct) => Promise<commonApi.Geometry[]>

Get the geometries of the component in their current configuration.

const generic = new VIAM.GenericComponentClient(
machine,
'my_generic_component'
);

// Get the geometries of this component
const geometries = await generic.getGeometries();
console.log('Geometries:', geometries);

For more information, see Generic API.

name: string

The name of the resource.

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct | Record<string, JsonValue>

      The command to execute. Accepts either a Struct or a plain object, which will be converted automatically.

    Returns Promise<JsonValue>

    // Plain object (recommended)
    const result = await resource.doCommand({
    myCommand: { key: 'value' },
    });

    // Struct (still supported)
    import { Struct } from '@viamrobotics/sdk';

    const result = await resource.doCommand(
    Struct.fromJson({ myCommand: { key: 'value' } })
    );