Package frc.robot.subsystems
Class DriveTrain
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
frc.robot.subsystems.DriveTrain
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
,edu.wpi.first.wpilibj2.command.Subsystem
public class DriveTrain
extends edu.wpi.first.wpilibj2.command.SubsystemBase
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DriveTrain
double
Gets the position of the mid-right motor.void
periodic()
Runs constantly, checks for the mid right motorvoid
tankDrive
(double x, double z, double speed) Takes in three doubles: whether the robot is going forward or backward, the turning rate and direction, and the speed.Methods 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
-
Field Details
-
m_bL
public com.revrobotics.CANSparkMax m_bL -
m_mL
public com.revrobotics.CANSparkMax m_mL -
m_fL
public com.revrobotics.CANSparkMax m_fL -
m_bR
public com.revrobotics.CANSparkMax m_bR -
m_mR
public com.revrobotics.CANSparkMax m_mR -
m_fR
public com.revrobotics.CANSparkMax m_fR -
limiter
public edu.wpi.first.math.filter.SlewRateLimiter limiter
-
-
Constructor Details
-
DriveTrain
public DriveTrain()
-
-
Method Details
-
getInstance
-
tankDrive
public void tankDrive(double x, double z, double speed) Takes in three doubles: whether the robot is going forward or backward, the turning rate and direction, and the speed.- Parameters:
x
-z
-speed
-
-
getRightEncoder
public double getRightEncoder()Gets the position of the mid-right motor.- Returns:
-
periodic
public void periodic()Runs constantly, checks for the mid right motor
-