Controller
A feedback-based controller. Controllers function by receiving some form of input and returning some form of output.
Most simply, a controller has a couple of components. Firstly, a controller has a target value. Secondly, a controller has a stream of input values. For each of these input values, the controller will output a value that it "thinks" will bring the next input value closer to the target value.
Like many other interfaces in this library, there's an abstract class that's probably more convenient to work with than simply using the interface. Go take a look at the AbstractController.
Methods
getMin()
Returns the controller's minimum output value.
setMin(double min)
Sets the controller's minimum output value. Any output below this value will automatically be set to this value.
getMax()
Returns the controller's maximum output value.
setMax(double max)
Sets the controller's maximum output value. Any output above this value will automatically be set to this value.
getMinMagnitude()
Returns the controller's minimum magnitude.
setMinMagnitude(double minMagnitude)
Sets the controller's minimum magnitude.
getMaxMagnitude()
Returns the controller's maximum magnitude.
setMaxMagnitude(double maxMagnitude)
Sets the controller's maximum magnitude.
reset()
Resets the controller. Some controllers have no use for this method, but it's there anyways because my code sucks and I'm too lazy to change it.
getTarget()
Returns the controller's target value.
setTarget(double target)
Sets the controller's target value.
calculate(double value)
Uses an input reading to determine an output.
calculate(double value, double target)
Uses an input reading to determine an output. Also, set the target point.