Interface Robot

interface Robot {
    on: ((type, listener) => void);
    blockForOperation(id): Promise<void>;
    cancelOperation(id): Promise<void>;
    discoverComponents(queries): Promise<Discovery[]>;
    frameSystemConfig(transform): Promise<FrameSystemConfig[]>;
    getCloudMetadata(): Promise<GetCloudMetadataResponse>;
    getOperations(): Promise<Operation[]>;
    getSessions(): Promise<Session[]>;
    getStatus(resourceNames?): Promise<robotApi.Status[]>;
    resourceNames(): Promise<PlainMessage<commonApi.ResourceName>[]>;
    resourceRPCSubtypes(): Promise<ResourceRPCSubtype[]>;
    restartModule(moduleId?, moduleName?): Promise<void>;
    stopAll(extra?): Promise<void>;
    streamStatus(resourceNames?, durationMs?): AsyncIterable<robotApi.Status[]>;
    transformPCD(pointCloudPCD, source, destination): Promise<Uint8Array>;
    transformPose(source, destination, supplementalTransforms): Promise<commonApi.PoseInFrame>;
}

Implemented by

Modules

  • Alpha

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

    Parameters

    • Optional moduleId: string

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

    • Optional moduleName: string

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

    Returns Promise<void>

Properties

on: ((type, listener) => 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, listener): 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

App/Cloud

Discovery

  • Alpha

    Get the list of discovered component configurations.

    Parameters

    Returns Promise<Discovery[]>

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>

  • Alpha

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

    Parameters

    • source: commonApi.PoseInFrame
    • destination: string

      The name of the reference frame to transform the given

    • supplementalTransforms: commonApi.Transform[]

      Pose information on any additional reference frames that are needed to perform the transform

    Returns Promise<commonApi.PoseInFrame>

Operations

  • Alpha

    Blocks on the specified operation on the robot. 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>

  • Alpha

    Cancels the specified operation on the robot.

    Parameters

    • id: string

      ID of operation to kill.

    Returns Promise<void>

  • Alpha

    Get the list of operations currently running on the robot.

    Returns Promise<Operation[]>

  • Alpha

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

    Parameters

    • Optional extra: Map<string, Struct>

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

    Returns Promise<void>

Resources

Sessions

  • Alpha

    Get the list of sessions currently connected to the robot.

    Returns Promise<Session[]>

Status

  • Alpha

    Periodically receive the status of all statuses requested. An empty request signifies all resources.

    Parameters

    Returns AsyncIterable<robotApi.Status[]>

Generated using TypeDoc