public class PIDFController
PID controller with various feedforward components.
@JvmOverloads
public PIDFController(@NotNull
PIDCoefficients pid,
double kV,
double kA,
double kStatic,
@NotNull
kotlin.jvm.functions.Function2<? super java.lang.Double,? super java.lang.Double,java.lang.Double> kF,
@NotNull
NanoClock clock)
PID controller with various feedforward components.
@JvmOverloads
public PIDFController(@NotNull
PIDCoefficients pid,
double kV,
double kA,
double kStatic,
@NotNull
kotlin.jvm.functions.Function2<? super java.lang.Double,? super java.lang.Double,java.lang.Double> kF)
PID controller with various feedforward components.
@JvmOverloads
public PIDFController(@NotNull
PIDCoefficients pid,
double kV,
double kA,
double kStatic)
PID controller with various feedforward components.
@JvmOverloads
public PIDFController(@NotNull
PIDCoefficients pid,
double kV,
double kA)
PID controller with various feedforward components.
@JvmOverloads
public PIDFController(@NotNull
PIDCoefficients pid,
double kV)
PID controller with various feedforward components.
@JvmOverloads
public PIDFController(@NotNull
PIDCoefficients pid)
PID controller with various feedforward components.
public double getTargetPosition()
Target position (that is, the controller setpoint).
public void setTargetPosition(double p)
Target position (that is, the controller setpoint).
public double getTargetVelocity()
Target velocity.
public void setTargetVelocity(double p)
Target velocity.
public double getTargetAcceleration()
Target acceleration.
public void setTargetAcceleration(double p)
Target acceleration.
public double getLastError()
Error computed in the last call to update.
updatepublic void setInputBounds(double min,
double max)
Sets bound on the input of the controller. The min and max values are considered modularly-equivalent (that is, the input wraps around).
min - minimum inputmax - maximum inputpublic void setOutputBounds(double min,
double max)
Sets bounds on the output of the controller.
min - minimum outputmax - maximum output@JvmOverloads
public double update(double measuredPosition,
@Nullable
java.lang.Double measuredVelocity)
Run a single iteration of the controller.
measuredPosition - measured position (feedback)measuredVelocity - measured velocity@JvmOverloads public double update(double measuredPosition)
Run a single iteration of the controller.
measuredPosition - measured position (feedback)public void reset()
Reset the controller's integral sum.