Package ftclib.motor

Class FtcServoActuator.Params

java.lang.Object
ftclib.motor.FtcServoActuator.Params
Enclosing class:
FtcServoActuator

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

    • primaryServoName

      private String primaryServoName
    • primaryServoInverted

      private boolean primaryServoInverted
    • followerServoName

      private String followerServoName
    • followerServoInverted

      private boolean followerServoInverted
    • servoParams

      private final TrcServo.Params servoParams
  • Constructor Details

    • Params

      public Params()
  • Method Details

    • toString

      @NonNull 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 FtcServoActuator.Params setPrimaryServo(String name, boolean inverted)
      This methods sets the parameters of the primary servo.
      Parameters:
      name - specifies the name of the servo.
      inverted - specifies true if the servo is inverted, false otherwise.
      Returns:
      this object for chaining.
    • setFollowerServo

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

      public FtcServoActuator.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 FtcServoActuator.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 FtcServoActuator.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 FtcServoActuator.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.