Class BaseClient

A gRPC-web client for the Base component.

Implements

Constructors

Properties

client: PromiseClient<{
    methods: {
        doCommand: {
            I: typeof DoCommandRequest;
            O: typeof DoCommandResponse;
            kind: Unary;
            name: "DoCommand";
        };
        getGeometries: {
            I: typeof GetGeometriesRequest;
            O: typeof GetGeometriesResponse;
            kind: Unary;
            name: "GetGeometries";
        };
        getProperties: {
            I: typeof baseApi.GetPropertiesRequest;
            O: typeof baseApi.GetPropertiesResponse;
            kind: Unary;
            name: "GetProperties";
        };
        isMoving: {
            I: typeof baseApi.IsMovingRequest;
            O: typeof baseApi.IsMovingResponse;
            kind: Unary;
            name: "IsMoving";
        };
        moveStraight: {
            I: typeof MoveStraightRequest;
            O: typeof MoveStraightResponse;
            kind: Unary;
            name: "MoveStraight";
        };
        setPower: {
            I: typeof baseApi.SetPowerRequest;
            O: typeof baseApi.SetPowerResponse;
            kind: Unary;
            name: "SetPower";
        };
        setVelocity: {
            I: typeof SetVelocityRequest;
            O: typeof SetVelocityResponse;
            kind: Unary;
            name: "SetVelocity";
        };
        spin: {
            I: typeof SpinRequest;
            O: typeof SpinResponse;
            kind: Unary;
            name: "Spin";
        };
        stop: {
            I: typeof baseApi.StopRequest;
            O: typeof baseApi.StopResponse;
            kind: Unary;
            name: "Stop";
        };
    };
    typeName: "viam.component.base.v1.BaseService";
}>

Type declaration

  • Readonly methods: {
        doCommand: {
            I: typeof DoCommandRequest;
            O: typeof DoCommandResponse;
            kind: Unary;
            name: "DoCommand";
        };
        getGeometries: {
            I: typeof GetGeometriesRequest;
            O: typeof GetGeometriesResponse;
            kind: Unary;
            name: "GetGeometries";
        };
        getProperties: {
            I: typeof baseApi.GetPropertiesRequest;
            O: typeof baseApi.GetPropertiesResponse;
            kind: Unary;
            name: "GetProperties";
        };
        isMoving: {
            I: typeof baseApi.IsMovingRequest;
            O: typeof baseApi.IsMovingResponse;
            kind: Unary;
            name: "IsMoving";
        };
        moveStraight: {
            I: typeof MoveStraightRequest;
            O: typeof MoveStraightResponse;
            kind: Unary;
            name: "MoveStraight";
        };
        setPower: {
            I: typeof baseApi.SetPowerRequest;
            O: typeof baseApi.SetPowerResponse;
            kind: Unary;
            name: "SetPower";
        };
        setVelocity: {
            I: typeof SetVelocityRequest;
            O: typeof SetVelocityResponse;
            kind: Unary;
            name: "SetVelocity";
        };
        spin: {
            I: typeof SpinRequest;
            O: typeof SpinResponse;
            kind: Unary;
            name: "Spin";
        };
        stop: {
            I: typeof baseApi.StopRequest;
            O: typeof baseApi.StopResponse;
            kind: Unary;
            name: "Stop";
        };
    }
    • Readonly doCommand: {
          I: typeof DoCommandRequest;
          O: typeof DoCommandResponse;
          kind: Unary;
          name: "DoCommand";
      }

      DoCommand sends/receives arbitrary commands

      Generated

      from rpc viam.component.base.v1.BaseService.DoCommand

    • Readonly getGeometries: {
          I: typeof GetGeometriesRequest;
          O: typeof GetGeometriesResponse;
          kind: Unary;
          name: "GetGeometries";
      }

      GetGeometries returns the geometries of the component in their current configuration

      Generated

      from rpc viam.component.base.v1.BaseService.GetGeometries

    • Readonly getProperties: {
          I: typeof baseApi.GetPropertiesRequest;
          O: typeof baseApi.GetPropertiesResponse;
          kind: Unary;
          name: "GetProperties";
      }

      GetProperties returns the properties of a base in its current configuration

      Generated

      from rpc viam.component.base.v1.BaseService.GetProperties

    • Readonly isMoving: {
          I: typeof baseApi.IsMovingRequest;
          O: typeof baseApi.IsMovingResponse;
          kind: Unary;
          name: "IsMoving";
      }

      IsMoving reports if a component is in motion

      Generated

      from rpc viam.component.base.v1.BaseService.IsMoving

    • Readonly moveStraight: {
          I: typeof MoveStraightRequest;
          O: typeof MoveStraightResponse;
          kind: Unary;
          name: "MoveStraight";
      }

      MoveStraight moves a robot's base in a straight line by a given distance, expressed in millimeters and a given speed, expressed in millimeters per second This method blocks until completed or cancelled

      Generated

      from rpc viam.component.base.v1.BaseService.MoveStraight

    • Readonly setPower: {
          I: typeof baseApi.SetPowerRequest;
          O: typeof baseApi.SetPowerResponse;
          kind: Unary;
          name: "SetPower";
      }

      SetPower sets the linear and angular power of a base -1 -> 1 in terms of power for each direction

      Generated

      from rpc viam.component.base.v1.BaseService.SetPower

    • Readonly setVelocity: {
          I: typeof SetVelocityRequest;
          O: typeof SetVelocityResponse;
          kind: Unary;
          name: "SetVelocity";
      }

      SetVelocity sets the linear and angular velocity of a base

      Generated

      from rpc viam.component.base.v1.BaseService.SetVelocity

    • Readonly spin: {
          I: typeof SpinRequest;
          O: typeof SpinResponse;
          kind: Unary;
          name: "Spin";
      }

      Spin spins a robot's base by an given angle, expressed in degrees, and a given angular speed, expressed in degrees per second This method blocks until completed or cancelled

      Generated

      from rpc viam.component.base.v1.BaseService.Spin

    • Readonly stop: {
          I: typeof baseApi.StopRequest;
          O: typeof baseApi.StopResponse;
          kind: Unary;
          name: "Stop";
      }

      Stop stops a robot's base

      Generated

      from rpc viam.component.base.v1.BaseService.Stop

  • Readonly typeName: "viam.component.base.v1.BaseService"
name: string
options: Options

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    Returns Promise<JsonValue>

  • Return true if the base is in motion.

    Returns Promise<boolean>

  • Move a base in a straight line by a given distance at a given speed. This method blocks until completed or cancelled.

    Parameters

    • distanceMm: number

      Distance to move, in millimeters.

    • mmPerSec: number

      Movement speed, in millimeters per second.

    • extra: {} = {}

      Returns Promise<void>

    • Set the linear and angular power of a base from -1 to 1 in terms of power for each direction.

      Parameters

      Returns Promise<void>

    • Set the linear and angular velocity of a base.

      Parameters

      Returns Promise<void>

    • Spin a base by a given angle at a given angular speed. This method blocks until completed or cancelled.

      Parameters

      • angleDeg: number

        Degrees to spin.

      • degsPerSec: number

        Angular speed, in degrees per second.

      • extra: {} = {}

        Returns Promise<void>

      • Stop a base

        Parameters

        • extra: {} = {}

          Returns Promise<void>

        Generated using TypeDoc