Viam SDK
    Preparing search index...

    Class Client

    A gRPC-web client for a Robot.

    Hierarchy

    • EventDispatcher<RobotClientDispatchEvents>
      • Client

    Implements

    Index
    • 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');
      
    • Parameters

      • OptionalserviceHost: string
      • OptionalwebrtcOptions: WebRTCOptions
      • OptionalsessionOptions: SessionOptions
      • OptionaldirectOptions: DirectOptions

      Returns Client

    listeners: Partial<{ [K in keyof Events]: Set<Callback<Events[K]>> }> = {}
    • get armService(): Client<typeof ArmService>

      Returns Client<typeof ArmService>

    • get baseService(): Client<typeof BaseService>

      Returns Client<typeof BaseService>

    • get boardService(): Client<typeof BoardService>

      Returns Client<typeof BoardService>

    • get discoveryService(): Client<typeof DiscoveryService>

      Returns Client<typeof DiscoveryService>

    • get encoderService(): Client<typeof EncoderService>

      Returns Client<typeof EncoderService>

    • get gantryService(): Client<typeof GantryService>

      Returns Client<typeof GantryService>

    • get gripperService(): Client<typeof GripperService>

      Returns Client<typeof GripperService>

    • get inputControllerService(): Client<typeof InputControllerService>

      Returns Client<typeof InputControllerService>

    • get mlModelService(): Client<typeof MLModelService>

      Returns Client<typeof MLModelService>

    • get motionService(): Client<typeof MotionService>

      Returns Client<typeof MotionService>

    • get motorService(): Client<typeof MotorService>

      Returns Client<typeof MotorService>

    • get movementSensorService(): Client<typeof MovementSensorService>

      Returns Client<typeof MovementSensorService>

    • Returns Client<typeof NavigationService>

    • get peerConnection(): RTCPeerConnection | undefined

      Returns RTCPeerConnection | undefined

    • get powerSensorService(): Client<typeof PowerSensorService>

      Returns Client<typeof PowerSensorService>

    • get robotService(): Client<typeof RobotService>

      Returns Client<typeof RobotService>

    • get servoService(): Client<typeof ServoService>

      Returns Client<typeof ServoService>

    • get sessionId(): string

      Returns string

    • get slamService(): Client<typeof SLAMService>

      Returns Client<typeof SLAMService>

    • get visionService(): Client<typeof VisionService>

      Returns Client<typeof VisionService>

    • get worldStateStoreService(): Client<typeof WorldStateStoreService>

      Returns Client<typeof WorldStateStoreService>

    • Parameters

      • __namedParameters: ConnectOptions = {}

      Returns Promise<void>

    • Type Parameters

      • T extends ServiceType

      Parameters

      • svcType: T

      Returns Client<T>

    • Returns Promise<void>

    • Returns boolean

    • Alpha

      Upload a file or directory from the robot to the cloud via the configured data manager service.

      Parameters

      • path: string

        File or folder path on the robot to upload.

      • OptionaluploadMetadata: UploadMetadata

        Optional metadata to apply to uploaded files.

      • extra: {} = {}

      Returns Promise<robotApi.UploadDataFromPathResponse>

      const result = await machine.uploadDataFromPath('/data/logs');
      
    • 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

      • 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<ArrayBufferLike>>

    • 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

      • OptionalcallOptions: CallOptions

      Returns Promise<commonApi.PoseInFrame>

    • 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.

      Returns Promise<void>

      await machine.stopAll();
      
    • Alpha

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

      Returns Promise<ModuleModel[]>

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

      Get the list of sessions currently connected to the machine.

      Returns Promise<Session[]>

      const sessions = await machine.getSessions();