Package frc.team670.robot.subsystems
Class DriveBase
java.lang.Object
edu.wpi.first.wpilibj.command.Subsystem
frc.team670.robot.subsystems.DriveBase
public class DriveBase extends Subsystem
Represents a tank drive base.
- Author:
- lakshbhambhani, ctychen
-
Constructor Summary
Constructors Constructor Description DriveBase()
-
Method Summary
Modifier and Type Method Description void
correct()
Encoder
getLeftEncoder()
Encoder
getRightEncoder()
void
initDefaultCommand()
void
stop()
Stops the motors on the drive base (sets them to 0).void
tankDrive(double leftSpeed, double rightSpeed)
Drives the Robot using a tank drive configuration (two joysticks, or auton).void
tankDrive(double leftSpeed, double rightSpeed, boolean squaredInputs)
Drives the Robot using a tank drive configuration (two joysticks, or auton)Methods inherited from class edu.wpi.first.wpilibj.command.Subsystem
getCurrentCommand, getDefaultCommand, periodic, setDefaultCommand
-
Constructor Details
-
DriveBase
public DriveBase()
-
-
Method Details
-
tankDrive
public void tankDrive(double leftSpeed, double rightSpeed)Drives the Robot using a tank drive configuration (two joysticks, or auton). Squares inputs to linearize them.- Parameters:
leftSpeed
- Speed for left side of drive base [-1, 1]. Automatically squares this value to linearize it.rightSpeed
- Speed for right side of drive base [-1, 1]. Automatically squares this value to linearize it.- Throws:
java.lang.InterruptedException
-
correct
public void correct() -
tankDrive
public void tankDrive(double leftSpeed, double rightSpeed, boolean squaredInputs)Drives the Robot using a tank drive configuration (two joysticks, or auton)- Parameters:
leftSpeed
- Speed for left side of drive base [-1, 1]rightSpeed
- Speed for right side of drive base [-1, 1]squaredInputs
- If true, decreases sensitivity at lower inputs- Throws:
java.lang.InterruptedException
-
stop
public void stop()Stops the motors on the drive base (sets them to 0). -
initDefaultCommand
public void initDefaultCommand() -
getLeftEncoder
-
getRightEncoder
-