Class MotorClient

A gRPC-web client for the Motor component.

Implements

Constructors

Properties

client: MotorServiceClient
name: string
options: Options

Accessors

  • get motorService(): MotorServiceClient
  • Returns MotorServiceClient

Methods

  • Return the position of the motor relative to its zero position. Raise an error if position reporting is not supported.

    Parameters

    • extra: {} = {}

      Returns Promise<number>

    • Return the motor's properties.

      Parameters

      • extra: {} = {}

        Returns Promise<{
            positionReporting: boolean;
        }>

      • Turn the motor at a specified speed for either a specified number of revolutions or indefinitely. Raise an error if position reporting is not supported.

        Parameters

        • rpm: number

          Speed in revolutions per minute.

        • revolutions: number

          Number of revolutions relative to the motor's starting position. If this value is 0, this will run the motor at the given rpm indefinitely. If this value is nonzero, this will block until the number of revolutions has been completed or another operation comes in.

        • extra: {} = {}

          Returns Promise<void>

        • Move the motor to a specific position relative to its home position at a specified speed. Raise an error if position reporting is not supported.

          Parameters

          • rpm: number

            Speed in revolutions per minute.

          • positionRevolutions: number

            Number of revolutions relative to the motor's home position.

          • extra: {} = {}

            Returns Promise<void>

          • Return true if the motor is in motion.

            Returns Promise<boolean>

          • Return true if the motor is on.

            Parameters

            • extra: {} = {}

              Returns Promise<readonly [boolean, number]>

            • Set the current position of the motor as the new zero position, offset by a given position. Raise an error if position reporting is not supported.

              Parameters

              • offset: number

                Position from which to offset the current position.

              • extra: {} = {}

                Returns Promise<void>

              • Set the percentage of the motor's total power that should be employed.

                Parameters

                • power: number

                  A value between -1 and 1 where negative values indicate a backwards direction and positive values a forward direction.

                • extra: {} = {}

                  Returns Promise<void>

                • Turn the motor off.

                  Parameters

                  • extra: {} = {}

                    Returns Promise<void>

                  Generated using TypeDoc