Class Servo

Direct Known Subclasses:
ServoRPCClient

public abstract class Servo extends Component
Servo represents a physical servo
  • Field Details

    • SUBTYPE

      public static final Subtype SUBTYPE
  • Constructor Details

    • Servo

      public Servo(String name)
  • Method Details

    • named

      public static Common.ResourceName named(String name)
      Get the ResourceName of the component
      Parameters:
      name - the name of the component
      Returns:
      the component's ResourceName
    • fromRobot

      public static Servo fromRobot(RobotClient robot, String name)
      Get the component with the provided name from the provided robot.
      Parameters:
      robot - the RobotClient
      name - the name of the component
      Returns:
      the component
    • move

      public abstract void move(int angle, com.google.protobuf.Struct extra)
      Move the servo to the provided angle.
      Parameters:
      angle - the desired angle of the servo in degrees
    • move

      public void move(int angle)
      Move the servo to the provided angle.
      Parameters:
      angle - the desired angle of the servo in degrees
    • getPosition

      public abstract int getPosition(com.google.protobuf.Struct extra)
      Get the current angle (degrees) of the servo.
      Returns:
      the current angle of the servo in degrees
    • getPosition

      public int getPosition()
      Get the current angle (degrees) of the servo.
      Returns:
      the current angle of the servo in degrees
    • stop

      public abstract void stop(com.google.protobuf.Struct extra)
      Stop the servo. It is assumed that the servo stops immediately.
    • stop

      public void stop()
      Stop the servo. It is assumed that the servo stops immediately.
    • isMoving

      public abstract boolean isMoving()
      Get if the servo is currently moving.
      Returns:
      whether the servo is moving