Package trclib.motor

Class TrcServo.Params

java.lang.Object
trclib.motor.TrcServo.Params
Enclosing class:
TrcServo

public static class TrcServo.Params extends Object
  • Field Details

    • logicalMin

      public double logicalMin
    • logicalMax

      public double logicalMax
    • physicalMin

      public double physicalMin
    • physicalMax

      public double physicalMax
    • maxStepRate

      public Double maxStepRate
    • presetTolerance

      public double presetTolerance
    • posPresets

      public double[] posPresets
  • 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.
    • setLogicalPosRange

      public TrcServo.Params setLogicalPosRange(double logicalMin, double logicalMax)
      This method sets the logical range of the servo motor. This is typically used to limit the logical range of the servo to less than the 0.0 to 1.0 range. For example, one may limit the logical range to 0.2 to 0.8.
      Parameters:
      logicalMin - specifies the minimum value of the logical range.
      logicalMax - specifies the maximum value of the logical range.
      Returns:
      this object for chaining.
    • setPhysicalPosRange

      public TrcServo.Params setPhysicalPosRange(double physicalMin, double physicalMax)
      This method sets the physical range of the servo motor. This is typically used to set a 180-degree servo to have a range of 0.0 to 180.0 instead of the logical range of 0.0 to 1.0. By default physical range is set to the range of 0.0 to 1.0, same as logical range. The physical range is used for map physical position units to logical position unit between 0.0 to 1.0.
      Parameters:
      physicalMin - specifies the minimum value of the physical range.
      physicalMax - specifies the maximum value of the physical range.
      Returns:
      this object for chaining.
    • setMaxStepRate

      public TrcServo.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 object for chaining.
    • setPosPresets

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