Class DriveSpeed


  • public class DriveSpeed
    extends java.lang.Object
    A class representing the speed of a differential drivetrain
    • Constructor Detail

      • DriveSpeed

        public DriveSpeed​(double left,
                          double right)
        Default constructor
        Parameters:
        left - the left speed
        right - the right speed
    • Method Detail

      • fromArcade

        public static DriveSpeed fromArcade​(double forward,
                                            double turn)
        Convert arcade inputs into tank
        Parameters:
        forward - the forward speed
        turn - the turn speed
        Returns:
        the tank speed
      • getLeftSpeed

        public double getLeftSpeed()
        The left speed of the drivetrain
        Returns:
        the left speed
      • getRightSpeed

        public double getRightSpeed()
        The right speed of the drivetrain
        Returns:
        the right speed