Class ServoClient

A gRPC-web client for the Servo component.

Implements

Constructors

Properties

callOptions: CallOptions = ...
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";
        };
        getPosition: {
            I: typeof servoApi.GetPositionRequest;
            O: typeof servoApi.GetPositionResponse;
            kind: Unary;
            name: "GetPosition";
        };
        isMoving: {
            I: typeof servoApi.IsMovingRequest;
            O: typeof servoApi.IsMovingResponse;
            kind: Unary;
            name: "IsMoving";
        };
        move: {
            I: typeof servoApi.MoveRequest;
            O: typeof servoApi.MoveResponse;
            kind: Unary;
            name: "Move";
        };
        stop: {
            I: typeof servoApi.StopRequest;
            O: typeof servoApi.StopResponse;
            kind: Unary;
            name: "Stop";
        };
    };
    typeName: "viam.component.servo.v1.ServoService";
}>

Type declaration

name: string
options: Options

Methods

  • Send/Receive arbitrary commands to the resource.

    Parameters

    • command: Struct

      The command to execute.

    • callOptions: CallOptions = ...

    Returns Promise<JsonValue>

  • Return the current set angle of the servo in degrees.

    Parameters

    • extra: {} = {}
      • callOptions: CallOptions = ...

      Returns Promise<number>

    • Return true if the servo is in motion.

      Parameters

      • callOptions: CallOptions = ...

      Returns Promise<boolean>

    • Move the servo by a given angle in degrees.

      Parameters

      • angleDeg: number
      • extra: {} = {}
        • callOptions: CallOptions = ...

        Returns Promise<void>

      • Stop the servo.

        Parameters

        • extra: {} = {}
          • callOptions: CallOptions = ...

          Returns Promise<void>