Class TrcDifferentialServoWrist.Params

java.lang.Object
trclib.subsystem.TrcDifferentialServoWrist.Params
Enclosing class:
TrcDifferentialServoWrist

public static class TrcDifferentialServoWrist.Params extends Object
This class contains all the parameters of the Differential Servo Wrist.
  • Field Details

    • servo1

      private TrcServo servo1
    • servo2

      private TrcServo servo2
    • logicalMin

      private double logicalMin
    • logicalMax

      private double logicalMax
    • physicalPosRange

      private double physicalPosRange
    • tiltPosOffset

      private double tiltPosOffset
    • rotatePosOffset

      private double rotatePosOffset
    • maxStepRate

      private double maxStepRate
    • tiltPosLowLimit

      private double tiltPosLowLimit
    • tiltPosHighLimit

      private double tiltPosHighLimit
    • rotatePosLowLimit

      private double rotatePosLowLimit
    • rotatePosHighLimit

      private double rotatePosHighLimit
    • presetTolerance

      private double presetTolerance
    • tiltPosPresets

      private double[] tiltPosPresets
    • rotatePosPresets

      private double[] rotatePosPresets
  • Constructor Details

    • Params

      public Params()
  • Method Details

    • toString

      public String toString()
      This method returns the string format of the Params info.
      Overrides:
      toString in class Object
      Returns:
      string format of the params info.
    • setServos

      public TrcDifferentialServoWrist.Params setServos(TrcServo servo1, TrcServo servo2)
      This methods sets the parameters of servo 1.
      Parameters:
      servo1 - specifies the servo1 object.
      servo2 - specifies the servo2 object.
      Returns:
      this object for chaining.
    • setPosRange

      public TrcDifferentialServoWrist.Params setPosRange(double logicalMin, double logicalMax, double physicalRange, double tiltOffset, double rotateOffset)
      This method sets the physical tilt and rotate position range of the wrist. Because of the nature of differential wrist, tilt position range must be the same as rotate range.
      Parameters:
      logicalMin - specifies the logical minimum value of the servos. Typically 0.0.
      logicalMax - specifies the logical maximum value of the servos. Typically 1.0.
      physicalRange - specifies the physical position range, typically the servo movement range in degrees. For example, for 180-degree servo, physicalPosRange will be 180.0.
      tiltOffset - specifies the tilt position offset. This is the offset from physical zero position to the tilt range center position. For example, if the tilt range center is 45 degrees below physical zero position, tiltPosOffset will be -45.0.
      rotateOffset - specifies the rotate position offset. This is the offset from physical zero position to the rotate range center position. For example, if the rotate range center is exactly physical zero position, rotatePosOffset will be 0.0.
      Returns:
      this object for chaining.
    • setMaxStepRate

      public TrcDifferentialServoWrist.Params setMaxStepRate(double maxStepRate)
      This method sets the maximum speed of the servo.
      Parameters:
      maxStepRate - specifies the maximum speed of the servo in degrees per second.
      Returns:
      this object for chaining.
    • setPositionLimits

      public TrcDifferentialServoWrist.Params setPositionLimits(double tiltPosLowLimit, double tiltPosHighLimit, double rotatePosLowLimit, double rotatePosHighLimit)
      This method sets the tilt and rotate position limits.
      Parameters:
      tiltPosLowLimit - specifies the tilt position low limit in physical unit.
      tiltPosHighLimit - specifies the tilt position high limit in physical unit.
      rotatePosLowLimit - specifies the rotate position low limit in physical unit.
      rotatePosHighLimit - specifies the rotate position high limit in physical unit.
      Returns:
      this object for chaining.
    • setPosPresets

      public TrcDifferentialServoWrist.Params setPosPresets(double presetTolerance, double[] tiltPosPresets, double[] rotatePosPresets)
      This method sets the position preset parameters for both tilt and rotate.
      Parameters:
      presetTolerance - specifies the preset tolerance.
      tiltPosPresets - specifies the tilt position preset array.
      rotatePosPresets - specifies the rotate position preset array.
      Returns:
      this object for chaining.