Class MockedSparkClosedLoopController

java.lang.Object
org.carlmontrobotics.lib199.sim.MockedSparkClosedLoopController

public class MockedSparkClosedLoopController extends Object
  • Field Details

  • Constructor Details

    • MockedSparkClosedLoopController

      public MockedSparkClosedLoopController(MockedMotorBase motor)
  • Method Details

    • getControlType

      public SparkBase.ControlType getControlType()
      Get the selected control type used when setReference(double, SparkBase.ControlType) was last called.
    • getIAccum

      public double getIAccum()
      Get the I accumulator of the closed loop controller.
    • getMAXMotionSetpointPosition

      public double getMAXMotionSetpointPosition()
      Get the MAXMotion internal setpoint position.
    • getMAXMotionSetpointVelocity

      public double getMAXMotionSetpointVelocity()
      Get the MAXMotion internal setpoint velocity.
    • getSelectedSlot

      public ClosedLoopSlot getSelectedSlot()
      Get the selected closed loop PID slot.
    • getSetpoint

      public double getSetpoint()
      Get the internal setpoint of the closed loop controller.
    • isAtSetpoint

      public boolean isAtSetpoint()
      Determine if the setpoint has been reached.
    • setIAccum

      public REVLibError setIAccum(double iAccum)
      Set the I accumulator of the closed loop controller.
    • setReference

      @Deprecated public REVLibError setReference(double value, SparkBase.ControlType ctrl)
      Deprecated.
      Deprecated, for removal: This API element is subject to removal in a future version. Use setSetpoint(double, SparkBase.ControlType) instead
    • setReference

      @Deprecated public REVLibError setReference(double value, SparkBase.ControlType ctrl, ClosedLoopSlot pidSlot)
      Deprecated.
      Deprecated, for removal: This API element is subject to removal in a future version. Use setSetpoint(double, SparkBase.ControlType, ClosedLoopSlot) instead
    • setReference

      @Deprecated public REVLibError setReference(double value, SparkBase.ControlType ctrl, ClosedLoopSlot pidSlot, double arbFeedforward)
      Deprecated.
      Deprecated, for removal: This API element is subject to removal in a future version. Use setSetpoint(double, SparkBase.ControlType, ClosedLoopSlot, double) instead
    • setReference

      @Deprecated public REVLibError setReference(double value, SparkBase.ControlType ctrl, ClosedLoopSlot pidSlot, double arbFeedforward, SparkClosedLoopController.ArbFFUnits arbFFUnits)
      Deprecated.
      Deprecated, for removal: This API element is subject to removal in a future version. Use setSetpoint(double, SparkBase.ControlType, ClosedLoopSlot, double, ArbFFUnits) instead
    • calculate

      public double calculate(double currentDraw)
    • setDutyCycle

      public void setDutyCycle(double speed)
    • follow

      public void follow(MotorController leader, boolean invert)
    • stopFollowing

      public void stopFollowing()
    • isFollower

      public boolean isFollower()
    • getD

      public double getD()
    • getD

      public double getD(int slotID)
    • getFF

      public double getFF()
    • getFF

      public double getFF(int slotID)
    • getI

      public double getI()
    • getI

      public double getI(int slotID)
    • getIMaxAccum

      public double getIMaxAccum(int slotID)
    • getIZone

      public double getIZone()
    • getIZone

      public double getIZone(int slotID)
    • getOutputMax

      public double getOutputMax()
    • getOutputMax

      public double getOutputMax(int slotID)
    • getOutputMin

      public double getOutputMin()
    • getOutputMin

      public double getOutputMin(int slotID)
    • getPositionPIDWrappingEnabled

      public boolean getPositionPIDWrappingEnabled()
    • getPositionPIDWrappingMaxInput

      public double getPositionPIDWrappingMaxInput()
    • getPositionPIDWrappingMinInput

      public double getPositionPIDWrappingMinInput()
    • setPositionPIDWrappingEnabled

      public REVLibError setPositionPIDWrappingEnabled(boolean enable)
    • setPositionPIDWrappingMaxInput

      public REVLibError setPositionPIDWrappingMaxInput(double max)
    • setPositionPIDWrappingMinInput

      public REVLibError setPositionPIDWrappingMinInput(double min)
    • getP

      public double getP()
    • getP

      public double getP(int slotID)
    • getSmartMotionAccelStrategy

      public MAXMotionConfig.MAXMotionPositionMode getSmartMotionAccelStrategy(int slotID)
    • getSmartMotionAllowedClosedLoopError

      public double getSmartMotionAllowedClosedLoopError(int slotID)
    • getSmartMotionMaxAccel

      public double getSmartMotionMaxAccel(int slotID)
    • getSmartMotionMaxVelocity

      public double getSmartMotionMaxVelocity(int slotID)
    • getSmartMotionMinOutputVelocity

      public double getSmartMotionMinOutputVelocity(int slotID)
    • setD

      public REVLibError setD(double gain)
    • setD

      public REVLibError setD(double gain, int slotID)
    • setFeedbackDevice

      public REVLibError setFeedbackDevice(Object sensor)
    • setFF

      public REVLibError setFF(double gain)
    • setFF

      public REVLibError setFF(double gain, int slotID)
    • setI

      public REVLibError setI(double gain)
    • setI

      public REVLibError setI(double gain, int slotID)
    • setIMaxAccum

      public REVLibError setIMaxAccum(double iMaxAccum, int slotID)
    • setIZone

      public REVLibError setIZone(double IZone)
    • setIZone

      public REVLibError setIZone(double IZone, int slotID)
    • setOutputRange

      public REVLibError setOutputRange(double min, double max)
    • setOutputRange

      public REVLibError setOutputRange(double min, double max, int slotID)
    • setP

      public REVLibError setP(double gain)
    • setP

      public REVLibError setP(double gain, int slotID)
    • setSmartMotionAccelStrategy

      public REVLibError setSmartMotionAccelStrategy(MAXMotionConfig.MAXMotionPositionMode accelStrategy, int slotID)
    • setSmartMotionAllowedClosedLoopError

      public REVLibError setSmartMotionAllowedClosedLoopError(double allowedErr, int slotId)
    • setSmartMotionMaxAccel

      public REVLibError setSmartMotionMaxAccel(double maxAccel, int slotID)
    • setSmartMotionMaxVelocity

      public REVLibError setSmartMotionMaxVelocity(double maxVel, int slotID)
    • setSmartMotionMinOutputVelocity

      public REVLibError setSmartMotionMinOutputVelocity(double minVel, int slotID)
    • getSlot

      public MockedSparkClosedLoopController.Slot getSlot(int slotID)