Class CompoundController
java.lang.Object
com.cdarobotics.cdalib.controllers.Controller
com.cdarobotics.cdalib.controllers.CompoundController
A
Controller that combines several sub-controllers, summing their outputs each loop.
Typically used to add a feedforward term to a PID feedback term (e.g.
PIDController plus FFController).
Note that each sub-controller keeps its own Controller.target; setting the target on this
compound controller does not propagate to the sub-controllers.
-
Field Summary
Fields inherited from class com.cdarobotics.cdalib.controllers.Controller
target -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleupdate(double current, double dt) Computes the control output for this loop.Methods inherited from class com.cdarobotics.cdalib.controllers.Controller
getTarget, setTarget
-
Constructor Details
-
CompoundController
- Parameters:
target- the initial setpoint of the compound controller itselfcontrollers- the sub-controllers whose outputs are summed each update
-
-
Method Details
-
update
public double update(double current, double dt) Description copied from class:ControllerComputes the control output for this loop.- Specified by:
updatein classController- Parameters:
current- the current measured valuedt- the time elapsed since the previous update, in seconds- Returns:
- the control output to apply
-