Package frclib.motor

Class FrcServo

All Implemented Interfaces:
TrcExclusiveSubsystem

public class FrcServo extends TrcServo
This class implements an FRC specific servo motor that connects to a specified PWM channel on the RoboRIO. This class extends TrcServo and is implementing the abstract methods required by TrcServo.
  • Constructor Details

    • FrcServo

      public FrcServo(String instanceName, int pwmChannel, TrcServo.Params params)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      pwmChannel - specifies the PWM channel the servo is connected to.
      params - specifies the parameters of the servo.
    • FrcServo

      public FrcServo(String instanceName, int pwmChannel)
      Constructor: Create an instance of the object.
      Parameters:
      instanceName - specifies the instance name.
      pwmChannel - specifies the PWM channel the servo is connected to.
  • Method Details

    • setInverted

      public void setInverted(boolean inverted)
      This method inverts the servo motor direction.
      Specified by:
      setInverted in class TrcServo
      Parameters:
      inverted - specifies true to invert the servo direction, false otherwise.
    • isInverted

      public boolean isInverted()
      This method checks if the servo motor direction is inverted.
      Specified by:
      isInverted in class TrcServo
      Returns:
      true if the servo direction is inverted, false otherwise.
    • setLogicalPosition

      public void setLogicalPosition(double position)
      This method sets the logical position of the servo motor.
      Specified by:
      setLogicalPosition in class TrcServo
      Parameters:
      position - specifies the logical position of the servo motor in the range of [0.0, 1.0].
    • getLogicalPosition

      public double getLogicalPosition()
      This method returns the logical position value set by the last setLogicalPosition call. Note that servo motors do not provide real time position feedback. Therefore, getLogicalPosition doesn't actually return the current position.
      Specified by:
      getLogicalPosition in class TrcServo
      Returns:
      motor position value set by the last setLogicalPosition call in the range of [0.0, 1.0].