Package frc.robot.subsystems
Class Drivetrain
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.Drivetrain
Subsystem that controls the drivetrain.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
periodic()
void
setMotorSpeeds
(double leftPercentage, double rightPercentage) Set motor speedsTankDrive
(double leftPercentage, double rightPercentage) Set motor speeds for tank driveMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd
-
Constructor Details
-
Drivetrain
public Drivetrain()Creates a new Drivetrain.
-
-
Method Details
-
periodic
public void periodic() -
setMotorSpeeds
public void setMotorSpeeds(double leftPercentage, double rightPercentage) Set motor speeds- Parameters:
leftPercentage
- left side speed [-1,1]rightPercentage
- right side speed [-1,1]
-
TankDrive
Set motor speeds for tank drive- Parameters:
leftPercentage
- left side speed [-1,1]rightPercentage
- right side speed [-1,1]- Returns:
- Command
-