public class Drive
extends edu.wpi.first.wpilibj.command.Subsystem
Modifier and Type | Field and Description |
---|---|
private edu.wpi.first.wpilibj.RobotDrive |
m_drive |
private edu.wpi.first.wpilibj.CANTalon |
m_leftMotor |
private edu.wpi.first.wpilibj.CANTalon |
m_leftMotorB |
private PIDController |
m_LPIDController |
private edu.wpi.first.wpilibj.CANTalon |
m_rightMotor |
private edu.wpi.first.wpilibj.CANTalon |
m_rightMotorB |
private PIDController |
m_RPIDController |
(package private) com.kauailabs.navx.frc.AHRS |
navx |
(package private) edu.wpi.first.wpilibj.Solenoid |
transmissionSolenoid |
Constructor and Description |
---|
Drive()
Initialize the motors for the the robot drive.
|
Modifier and Type | Method and Description |
---|---|
void |
arcadeDrive(double moveValue,
double rotateValue)
Drive the robot with one value being the forward/backward motion and the other being the rotation value.
|
void |
controllerOrientedDrive(double xValue,
double yValue,
double angleTolerance) |
int[] |
getEncoderPosition() |
int[] |
getEncoderVelocity() |
PIDController[] |
getPID() |
void |
individualMotor(double left,
double right) |
void |
initDefaultCommand() |
void |
pidvalue(double p,
double i,
double d) |
void |
resetEncoders() |
void |
setBrake(boolean brake) |
void |
shift(java.lang.Boolean direction) |
void |
tankDrive(double leftValue,
double rightValue)
Drive the robot by providing the forward/backward value for each side of the robot.
|
void |
updateDefaultCommand(edu.wpi.first.wpilibj.command.Command command)
Updates the default command on this subsystem
|
private edu.wpi.first.wpilibj.RobotDrive m_drive
private edu.wpi.first.wpilibj.CANTalon m_leftMotor
private edu.wpi.first.wpilibj.CANTalon m_rightMotor
private edu.wpi.first.wpilibj.CANTalon m_leftMotorB
private edu.wpi.first.wpilibj.CANTalon m_rightMotorB
edu.wpi.first.wpilibj.Solenoid transmissionSolenoid
com.kauailabs.navx.frc.AHRS navx
private PIDController m_LPIDController
private PIDController m_RPIDController
public void updateDefaultCommand(edu.wpi.first.wpilibj.command.Command command)
command
- the command to run by defaultpublic void initDefaultCommand()
initDefaultCommand
in class edu.wpi.first.wpilibj.command.Subsystem
public void arcadeDrive(double moveValue, double rotateValue)
moveValue
- value for moving the robot forwardrotateValue
- value for rotating the robotpublic void tankDrive(double leftValue, double rightValue)
leftValue
- speed of the left side of the robotrightValue
- speed of the right side of the robotpublic void controllerOrientedDrive(double xValue, double yValue, double angleTolerance)
public void individualMotor(double left, double right)
public int[] getEncoderPosition()
public int[] getEncoderVelocity()
public void shift(java.lang.Boolean direction)
public void resetEncoders()
public void setBrake(boolean brake)
public void pidvalue(double p, double i, double d)
public PIDController[] getPID()