Interface IController
-
- All Known Implementing Classes:
TankController
public interface IControllerInterface for objects containing multiple PID controllers and other important runtime parameters.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description doublecalculateOutput(int controllerID, double setpoint, double current)Uses the specified controller to calculate the necessary percent output to acheive a value.edu.wpi.first.wpilibj.controller.PIDControllergetPIDController(int id)Returns the PIDController with the given name.
-
-
-
Method Detail
-
getPIDController
edu.wpi.first.wpilibj.controller.PIDController getPIDController(int id)
Returns the PIDController with the given name. "Index" values will be provided through implementing classes. For example, if using aTankController, possible values are LEFT_CONTROLLER and RIGHT_CONTROLLER.- Parameters:
id- The ID of the controller to use. As mentioned earlier, values will be provided as static fields by the implementing class.- Returns:
- The PIDController with the specified identity, or a "safe" PIDController (where all gains are set to 0) if there is no such controller.
-
calculateOutput
double calculateOutput(int controllerID, double setpoint, double current)Uses the specified controller to calculate the necessary percent output to acheive a value.- Parameters:
controllerID- The ID of the controller to use. For more information about IDs, seegetPIDController(int).setpoint- The desired value to acheive.current- The current value.- Returns:
- The output required to drive the "current" value to the "desired" value.
-
-