Interface Robot

interface Robot {
    on: (
        type: "connectionstatechange" | MachineConnectionEvent,
        listener: Callback,
    ) => void;
    blockForOperation(id: string): Promise<void>;
    cancelOperation(id: string): Promise<void>;
    frameSystemConfig(
        transform: commonApi.Transform[],
    ): Promise<FrameSystemConfig[]>;
    getCloudMetadata(): Promise<GetCloudMetadataResponse>;
    getMachineStatus(): Promise<GetMachineStatusResponse>;
    getModelsFromModules(): Promise<ModuleModel[]>;
    getOperations(): Promise<Operation[]>;
    getSessions(): Promise<Session[]>;
    resourceNames(): Promise<PlainMessage<commonApi.ResourceName>[]>;
    resourceRPCSubtypes(): Promise<ResourceRPCSubtype[]>;
    restartModule(moduleId?: string, moduleName?: string): Promise<void>;
    stopAll(extra?: Map<string, Struct>): Promise<void>;
    transformPCD(
        pointCloudPCD: Uint8Array,
        source: string,
        destination: string,
    ): Promise<Uint8Array>;
    transformPose(
        source: commonApi.PoseInFrame,
        destination: string,
        supplementalTransforms: commonApi.Transform[],
    ): Promise<commonApi.PoseInFrame>;
}

Implemented by

Modules

  • Alpha

    Restarts a module running on the machine with the given id or name.

    Parameters

    • OptionalmoduleId: string

      The id matching the module_id field of the registry module in your part configuration

    • OptionalmoduleName: string

      The name matching the name field of the local/registry module in your part configuration

    Returns Promise<void>

    await machine.restartModule('namespace:module:model', 'my_model_name');
    

Properties

on: (
    type: "connectionstatechange" | MachineConnectionEvent,
    listener: Callback,
) => void

Call a function when a connection event occurs.

Note that direct gRPC connections that disconnect will not emit a disconnect event. WebRTC connections that disconnect will emit a disconnect event. All connections emit events during manual calls of connect and disconnect.

Type declaration

    • (
          type: "connectionstatechange" | MachineConnectionEvent,
          listener: Callback,
      ): void
    • Parameters

      • type: "connectionstatechange" | MachineConnectionEvent

        The event MachineConnectionEvent that was triggered, or all connection events with 'connectionstatechange'.

      • listener: Callback

        The function to call

      Returns void

Methods

App/Cloud

Frame System

  • Alpha

    Transform a given source point cloud from the reference frame to a new specified destination which is a reference frame.

    Parameters

    • pointCloudPCD: Uint8Array

      The point clouds to transform. This should be in the PCD format encoded into bytes: https://pointclouds.org/documentation/tutorials/pcd_file_format.html

    • source: string

      The reference frame of the point cloud.

    • destination: string

      The reference frame into which the source data should be transformed, if unset this defaults to the "world" reference frame. Do not move the robot between the generation of the initial pointcloud and the receipt of the transformed pointcloud because that will make the transformations inaccurate.

    Returns Promise<Uint8Array>

Operations

  • Alpha

    Blocks on the specified operation on the machine. This function will only return when the specific operation has finished or has been cancelled.

    Parameters

    • id: string

      ID of operation to block on.

    Returns Promise<void>

    await machine.blockForOperation('INSERT OPERATION ID');
    
  • Alpha

    Cancels the specified operation on the machine.

    Parameters

    • id: string

      ID of operation to kill.

    Returns Promise<void>

    await machine.cancelOperation('INSERT OPERATION ID');
    
  • Alpha

    Get the list of operations currently running on the machine.

    Returns Promise<Operation[]>

    const operations = await machine.getOperations();
    
  • Alpha

    Cancel all current and outstanding operations for the robot and stop all actuators and movement.

    Parameters

    • Optionalextra: Map<string, Struct>

      Any extra parameters to pass to the components' stop methods, keyed on the component's resource name.

    Returns Promise<void>

    await machine.stopAll();
    

Resources

  • Alpha

    Get the list of models provided by modules on the machine.

    Returns Promise<ModuleModel[]>

    const models = await machine.getModelsFromModules();
    
  • Alpha

    Get a list of all resource types.

    Returns Promise<ResourceRPCSubtype[]>

    const resourceRPCSubtypes = await machine.resourceRPCSubtypes();
    

Sessions

  • Alpha

    Get the list of sessions currently connected to the machine.

    Returns Promise<Session[]>

    const sessions = await machine.getSessions();
    
MMNEPVFCICPMFPCPTTAAATR