Class TankController

  • All Implemented Interfaces:
    IController

    public class TankController
    extends java.lang.Object
    implements IController
    Controller for tank-style robot.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double calculateOutput​(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.PIDController getPIDController​(int id)
      Returns the PIDController with the given name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TankController

        public TankController​(IEmulateParams parameters)
    • Method Detail

      • getPIDController

        public edu.wpi.first.wpilibj.controller.PIDController getPIDController​(int id)
        Description copied from interface: IController
        Returns the PIDController with the given name. "Index" values will be provided through implementing classes. For example, if using a TankController, possible values are LEFT_CONTROLLER and RIGHT_CONTROLLER.
        Specified by:
        getPIDController in interface IController
        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

        public double calculateOutput​(int controllerID,
                                      double setpoint,
                                      double current)
        Description copied from interface: IController
        Uses the specified controller to calculate the necessary percent output to acheive a value.
        Specified by:
        calculateOutput in interface IController
        Parameters:
        controllerID - The ID of the controller to use. For more information about IDs, see IController.getPIDController(int).
        setpoint - The desired value to acheive.
        current - The current value.
        Returns:
        The output required to drive the "current" value to the "desired" value.