Package com.stuypulse.stuylib.control
Class ControllerGroup
java.lang.Object
com.stuypulse.stuylib.control.Controller
com.stuypulse.stuylib.control.ControllerGroup
Controllers can be grouped together in a "controller group" if they have the same setpoint and
measurement.
This allows different controller implementations that are controlling the same variable to be concisely composed together.
-
Constructor Summary
ConstructorDescriptionControllerGroup
(Controller controller, Controller... controllers) Create a controller group -
Method Summary
Modifier and TypeMethodDescriptionprotected double
calculate
(double setpoint, double measurement) Updates the internal controllers with the setpoint and measurement and returns their combined output.Methods inherited from class com.stuypulse.stuylib.control.Controller
add, getError, getMeasurement, getOutput, getSetpoint, isDone, setMeasurementFilter, setOutputFilter, setSetpointFilter, update
-
Constructor Details
-
ControllerGroup
Create a controller group
-
-
Method Details
-
calculate
protected double calculate(double setpoint, double measurement) Updates the internal controllers with the setpoint and measurement and returns their combined output.- Specified by:
calculate
in classController
- Parameters:
setpoint
- setpointmeasurement
- measurement- Returns:
- summed output of the interal controllers
-