Class PrecisionModule

  • All Implemented Interfaces:
    DriveModule

    public class PrecisionModule
    extends java.lang.Object
    implements DriveModule
    A drivetrain module which will allow higher precision driving at lower speeds.
    • Constructor Summary

      Constructors 
      Constructor Description
      PrecisionModule​(double strength)
      Default constructor
    • Constructor Detail

      • PrecisionModule

        public PrecisionModule​(double strength)
        Default constructor
        Parameters:
        strength - The precision strength from 0 to 1. Higher values will result in more precision movements at low speeds (corresponds to input^(4 * strength))
    • Method Detail

      • run

        public DriveSpeed run​(DriveSpeed currentSpeed,
                              DriveSpeed desiredSpeed,
                              double deltaTime)
        Description copied from interface: DriveModule
        Run the drive module
        Specified by:
        run in interface DriveModule
        Parameters:
        currentSpeed - the current speed of the drivetrain
        desiredSpeed - the desired speed of the drivetrain
        deltaTime - the delta time since the last call in seconds
        Returns:
        the speed the drivetrain should set
      • setStrength

        public void setStrength​(double strength)