Package org.carlmontrobotics.lib199.sim
Class MockedSparkClosedLoopController
java.lang.Object
org.carlmontrobotics.lib199.sim.MockedSparkClosedLoopController
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfacestatic class -
Field Summary
FieldsModifier and TypeFieldDescriptiondoublebooleanfinal MockedMotorBasebooleandoubledoubledouble -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculate(double currentDraw) voidfollow(MotorController leader, boolean invert) Get the selected control type used when setReference(double, SparkBase.ControlType) was last called.doublegetD()doublegetD(int slotID) doublegetFF()doublegetFF(int slotID) doublegetI()doublegetI(int slotID) doubleGet the I accumulator of the closed loop controller.doublegetIMaxAccum(int slotID) doublegetIZone()doublegetIZone(int slotID) doubleGet the MAXMotion internal setpoint position.doubleGet the MAXMotion internal setpoint velocity.doubledoublegetOutputMax(int slotID) doubledoublegetOutputMin(int slotID) doublegetP()doublegetP(int slotID) booleandoubledoubleGet the selected closed loop PID slot.doubleGet the internal setpoint of the closed loop controller.getSlot(int slotID) getSmartMotionAccelStrategy(int slotID) doublegetSmartMotionAllowedClosedLoopError(int slotID) doublegetSmartMotionMaxAccel(int slotID) doublegetSmartMotionMaxVelocity(int slotID) doublegetSmartMotionMinOutputVelocity(int slotID) booleanDetermine if the setpoint has been reached.booleansetD(double gain) setD(double gain, int slotID) voidsetDutyCycle(double speed) setFeedbackDevice(Object sensor) setFF(double gain) setFF(double gain, int slotID) setI(double gain) setI(double gain, int slotID) setIAccum(double iAccum) Set the I accumulator of the closed loop controller.setIMaxAccum(double iMaxAccum, int slotID) setIZone(double IZone) setIZone(double IZone, int slotID) setOutputRange(double min, double max) setOutputRange(double min, double max, int slotID) setP(double gain) setP(double gain, int slotID) setPositionPIDWrappingEnabled(boolean enable) setPositionPIDWrappingMaxInput(double max) setPositionPIDWrappingMinInput(double min) setReference(double value, SparkBase.ControlType ctrl) Deprecated.setReference(double value, SparkBase.ControlType ctrl, ClosedLoopSlot pidSlot) Deprecated.setReference(double value, SparkBase.ControlType ctrl, ClosedLoopSlot pidSlot, double arbFeedforward) Deprecated.setReference(double value, SparkBase.ControlType ctrl, ClosedLoopSlot pidSlot, double arbFeedforward, SparkClosedLoopController.ArbFFUnits arbFFUnits) Deprecated.setSmartMotionAccelStrategy(MAXMotionConfig.MAXMotionPositionMode accelStrategy, int slotID) setSmartMotionAllowedClosedLoopError(double allowedErr, int slotId) setSmartMotionMaxAccel(double maxAccel, int slotID) setSmartMotionMaxVelocity(double maxVel, int slotID) setSmartMotionMinOutputVelocity(double minVel, int slotID) void
-
Field Details
-
slots
-
motor
-
activeSlot
-
activeClosedLoopSlot
-
controlType
-
leader
-
invertLeader
public boolean invertLeader -
setpoint
public double setpoint -
arbFF
public double arbFF -
feedbackDevice
-
positionPIDWrappingEnabled
public boolean positionPIDWrappingEnabled -
positionPIDWrappingMinInput
public double positionPIDWrappingMinInput -
positionPIDWrappingMaxInput
public double positionPIDWrappingMaxInput
-
-
Constructor Details
-
MockedSparkClosedLoopController
-
-
Method Details
-
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
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
Set the I accumulator of the closed loop controller. -
setReference
Deprecated.Deprecated, for removal: This API element is subject to removal in a future version. UsesetSetpoint(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. UsesetSetpoint(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. UsesetSetpoint(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. UsesetSetpoint(double, SparkBase.ControlType, ClosedLoopSlot, double, ArbFFUnits)instead -
calculate
public double calculate(double currentDraw) -
setDutyCycle
public void setDutyCycle(double speed) -
follow
-
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
-
setPositionPIDWrappingMaxInput
-
setPositionPIDWrappingMinInput
-
getP
public double getP() -
getP
public double getP(int slotID) -
getSmartMotionAccelStrategy
-
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
-
setD
-
setFeedbackDevice
-
setFF
-
setFF
-
setI
-
setI
-
setIMaxAccum
-
setIZone
-
setIZone
-
setOutputRange
-
setOutputRange
-
setP
-
setP
-
setSmartMotionAccelStrategy
public REVLibError setSmartMotionAccelStrategy(MAXMotionConfig.MAXMotionPositionMode accelStrategy, int slotID) -
setSmartMotionAllowedClosedLoopError
-
setSmartMotionMaxAccel
-
setSmartMotionMaxVelocity
-
setSmartMotionMinOutputVelocity
-
getSlot
-