Package frclib.motor

Class FrcServoActuator.Params

java.lang.Object
frclib.motor.FrcServoActuator.Params
Enclosing class:
FrcServoActuator

public static class FrcServoActuator.Params extends Object
This class contains all the parameters for creating the servo.
  • Constructor Details

    • Params

      public Params()
  • Method Details

    • toString

      public String toString()
      This method returns the string format of the servoParams info.
      Overrides:
      toString in class Object
      Returns:
      string format of the servo param info.
    • setPrimaryServo

      public FrcServoActuator.Params setPrimaryServo(String name, int channel, boolean inverted)
      This methods sets the parameters of the primary servo.
      Parameters:
      name - specifies the name of the servo.
      channel - specifies the PWM channel for the servo.
      inverted - specifies true if the servo is inverted, false otherwise.
      Returns:
      this object for chaining.
    • setFollowerServo

      public FrcServoActuator.Params setFollowerServo(String name, int channel, boolean inverted)
      This methods sets the parameter of the follower servo.
      Parameters:
      name - specifies the name of the servo.
      channel - specifies the PWM channel for the servo.
      inverted - specifies true if the servo is inverted, false otherwise.
      Returns:
      this object for chaining.
    • setPhysicalPosRange

      public FrcServoActuator.Params setPhysicalPosRange(double minPos, double maxPos)
      This method sets the physical position range of the servo in real world physical unit.
      Parameters:
      minPos - specifies the min physical position.
      maxPos - specifies the max physical position.
      Returns:
      this object for chaining.
    • setLogicalPosRange

      public FrcServoActuator.Params setLogicalPosRange(double minPos, double maxPos)
      This method sets the logical position range of the servo in the range of 0.0 to 1.0.
      Parameters:
      minPos - specifies the min logical position.
      maxPos - specifies the max logical position.
      Returns:
      this object for chaining.
    • setMaxStepRate

      public FrcServoActuator.Params setMaxStepRate(double maxStepRate)
      This method sets the maximum stepping rate of the servo. This enables setPower to speed control the servo.
      Parameters:
      maxStepRate - specifies the maximum stepping rate (physicalPos/sec).
      Returns:
      this parameter object.
    • setPositionPresets

      public FrcServoActuator.Params setPositionPresets(double tolerance, double... posPresets)
      This method sets an array of preset positions for the servo actuator.
      Parameters:
      tolerance - specifies the preset tolerance.
      posPresets - specifies an array of preset positions in scaled unit.
      Returns:
      this object for chaining.