core / com.acmerobotics.roadrunner.control / PIDFController

PIDFController

class PIDFController (source)

PID controller with various feedforward components.

Constructors

<init>

PID controller with various feedforward components.

PIDFController(pid: PIDCoefficients, kV: Double = 0.0, kA: Double = 0.0, kStatic: Double = 0.0, kF: (Double, Double?) -> Double = { _, _ -> 0.0 }, clock: NanoClock = NanoClock.system())

Properties

lastError

Error computed in the last call to update.

var lastError: Double

targetAcceleration

Target acceleration.

var targetAcceleration: Double

targetPosition

Target position (that is, the controller setpoint).

var targetPosition: Double

targetVelocity

Target velocity.

var targetVelocity: Double

Functions

reset

Reset the controller's integral sum.

fun reset(): Unit

setInputBounds

Sets bound on the input of the controller. The min and max values are considered modularly-equivalent (that is, the input wraps around).

fun setInputBounds(min: Double, max: Double): Unit

setOutputBounds

Sets bounds on the output of the controller.

fun setOutputBounds(min: Double, max: Double): Unit

update

Run a single iteration of the controller.

fun update(measuredPosition: Double, measuredVelocity: Double? = null): Double