Manages the tank drive base. More...
Public Member Functions | |
| TankDrive (int leftTalonPort, int leftVictorPort, int rightTalonPort, int rightVictorPort) | |
| Constructor for TankDrive Class. | |
| void | drive (double leftAnalogX, double leftAnalogY, double rightAnalogX, double rightAnalogY) |
| Drive the robot tank base from controller input. | |
| void | turnOnStopMode () |
| should be overridden for actual functionality because depends on drive base specifc speeds (for tank drive, there is a left and right speed, whereas for mecanum there are 4) | |
| void | updateRobotVelocity () |
| void | getPosition () |
| void | updatePosition () |
| void | printControlsOfCurrentMode () |
| Prints the controls of the current driving mode. | |
| void | AButtonPressed () |
| void | BButtonPressed () |
| void | XButtonPressed () |
| void | YButtonPressed () |
| void | leftBumperPressed () |
| void | rightBumperPressed () |
| void | printActiveMotorDebugMode () |
| void | cycleMotor () |
| Needs to be implemented in sub classes becuase there might be different numbers of motors. | |
| void | incrementPIDConstant () |
| PID Tuning Mode: Increments the selected PID constant. | |
| void | cyclePIDConstant () |
| PID Tuning Mode: Cycles between the PID constants. | |
| void | toggleDecreasingPIDIncrement () |
| void | printPIDConstants () |
| void | resetPosition () |
| void | printPosition () |
Public Member Functions inherited from frc.robot.subsystems.DriveBase | |
| void | drive (double leftAnalogX, double leftAnalogY, double rightAnalogX, double rightAnalogY) |
| Drive the robot with controller input. | |
| void | drive (double leftAnalogX, double leftAnalogY, double rightAnalogX) |
| abstract void | printControlsOfCurrentMode () |
| Prints the controls of the current driving mode. | |
| void | increaseSpeedBracket () |
| The speed bracket controls the multiplier for al the speeds So when you change it, lets say, to 1/2 speed, all movement will be at 1/2 speed. | |
| void | decreaseSpeedBracket () |
| void | turnOnDefaultMode () |
| void | turnOnDebugMode () |
| void | turnOnStopMode () |
| should be overridden for actual functionality because depends on drive base specifc speeds (for tank drive, there is a left and right speed, whereas for mecanum there are 4) | |
| void | turnONPIDTuningMode () |
| abstract void | cycleMotor () |
| Needs to be implemented in sub classes becuase there might be different numbers of motors. | |
| void | AButtonPressed () |
| void | BButtonPressed () |
| void | XButtonPressed () |
| void | YButtonPressed () |
| void | leftBumperPressed () |
| void | rightBumperPressed () |
| Mode | getCurrentMode () |
| void | setCurrentMode (Mode currentMode) |
| int | getDebugEnabledMotor () |
| void | setDebugEnabledMotor (int debugEnabledMotor) |
| Trajectory | getCurrentTrajectory () |
| void | setCurrentTrajectory (Trajectory currentTrajectory) |
| TrajectoryConfig | getTrajectoryConfig () |
| RamseteController | getChassisController () |
| double | getCurrentTrajectoryTime () |
| void | resetCurrentTrajectoryTime () |
| void | incrementCurrentTrajectoryTime () |
Private Member Functions | |
| double | slowDown (double inputVelocity) |
| This will return a value lower than the input, and it is used to slow down the motors during stop mode. | |
Additional Inherited Members | |
Protected Attributes inherited from frc.robot.subsystems.DriveBase | |
| TrajectoryConfig | trajectoryConfig |
Manages the tank drive base.
Definition at line 27 of file TankDrive.java.
| frc.robot.subsystems.TankDrive.TankDrive | ( | int | leftTalonPort, |
| int | leftVictorPort, | ||
| int | rightTalonPort, | ||
| int | rightVictorPort | ||
| ) |
Constructor for TankDrive Class.
| leftMotorPort | |
| rightMotorPort |
Definition at line 79 of file TankDrive.java.
References frc.robot.Constants.ENCODER_CPR, and frc.robot.subsystems.TankDrive.resetPosition().
| void frc.robot.subsystems.TankDrive.AButtonPressed | ( | ) |
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 331 of file TankDrive.java.
References frc.robot.subsystems.TankDrive.cycleMotor(), frc.robot.subsystems.TankDrive.incrementPIDConstant(), and frc.robot.subsystems.TankDrive.printPosition().
| void frc.robot.subsystems.TankDrive.BButtonPressed | ( | ) |
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 348 of file TankDrive.java.
References frc.robot.subsystems.TankDrive.cyclePIDConstant(), frc.robot.subsystems.TankDrive.printActiveMotorDebugMode(), and frc.robot.subsystems.TankDrive.resetPosition().
| void frc.robot.subsystems.TankDrive.cycleMotor | ( | ) |
Needs to be implemented in sub classes becuase there might be different numbers of motors.
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 401 of file TankDrive.java.
Referenced by frc.robot.subsystems.TankDrive.AButtonPressed().
| void frc.robot.subsystems.TankDrive.cyclePIDConstant | ( | ) |
PID Tuning Mode: Cycles between the PID constants.
Definition at line 440 of file TankDrive.java.
Referenced by frc.robot.subsystems.TankDrive.BButtonPressed().
| void frc.robot.subsystems.TankDrive.drive | ( | double | leftAnalogX, |
| double | leftAnalogY, | ||
| double | rightAnalogX, | ||
| double | rightAnalogY | ||
| ) |
Drive the robot tank base from controller input.
These are doubles on the interval [-1,1], and come from the controller's analog sticks (circle spinny things)
| leftAnalogX | |
| leftAnalogY | |
| rightAnalogX | |
| rightAnalogY |
we only care about left Y and right X left Y is average velocity right X is velocity difference between wheels
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 115 of file TankDrive.java.
References frc.robot.Constants.ANALOG_DEAD_ZONE, frc.robot.subsystems.TankDrive.slowDown(), frc.robot.Constants.SPARK_MAX_CONVERSION_FACTOR, frc.robot.Constants.TALON_CONVERSION_FACTOR, and frc.robot.subsystems.TankDrive.updatePosition().
| void frc.robot.subsystems.TankDrive.getPosition | ( | ) |
Definition at line 280 of file TankDrive.java.
| void frc.robot.subsystems.TankDrive.incrementPIDConstant | ( | ) |
PID Tuning Mode: Increments the selected PID constant.
Definition at line 411 of file TankDrive.java.
Referenced by frc.robot.subsystems.TankDrive.AButtonPressed().
| void frc.robot.subsystems.TankDrive.leftBumperPressed | ( | ) |
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 387 of file TankDrive.java.
References frc.robot.subsystems.DriveBase.decreaseSpeedBracket().
| void frc.robot.subsystems.TankDrive.printActiveMotorDebugMode | ( | ) |
Definition at line 397 of file TankDrive.java.
Referenced by frc.robot.subsystems.TankDrive.BButtonPressed().
| void frc.robot.subsystems.TankDrive.printControlsOfCurrentMode | ( | ) |
Prints the controls of the current driving mode.
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 300 of file TankDrive.java.
| void frc.robot.subsystems.TankDrive.printPIDConstants | ( | ) |
Definition at line 467 of file TankDrive.java.
Referenced by frc.robot.subsystems.TankDrive.YButtonPressed().
| void frc.robot.subsystems.TankDrive.printPosition | ( | ) |
Definition at line 481 of file TankDrive.java.
References frc.robot.Constants.ENCODER_CPR, and frc.robot.Constants.TANK_WHEEL_RADIUS.
Referenced by frc.robot.subsystems.TankDrive.AButtonPressed().
| void frc.robot.subsystems.TankDrive.resetPosition | ( | ) |
Definition at line 471 of file TankDrive.java.
Referenced by frc.robot.subsystems.TankDrive.BButtonPressed(), and frc.robot.subsystems.TankDrive.TankDrive().
| void frc.robot.subsystems.TankDrive.rightBumperPressed | ( | ) |
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 392 of file TankDrive.java.
References frc.robot.subsystems.DriveBase.increaseSpeedBracket().
|
private |
This will return a value lower than the input, and it is used to slow down the motors during stop mode.
| inputVelocity | between -1 and 1 (double) |
Definition at line 240 of file TankDrive.java.
References frc.robot.Constants.SLOW_DOWN_CUTOFF, and frc.robot.Constants.SLOW_DOWN_FACTOR.
Referenced by frc.robot.subsystems.TankDrive.drive().
| void frc.robot.subsystems.TankDrive.toggleDecreasingPIDIncrement | ( | ) |
Definition at line 457 of file TankDrive.java.
Referenced by frc.robot.subsystems.TankDrive.XButtonPressed().
| void frc.robot.subsystems.TankDrive.turnOnStopMode | ( | ) |
should be overridden for actual functionality because depends on drive base specifc speeds (for tank drive, there is a left and right speed, whereas for mecanum there are 4)
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 254 of file TankDrive.java.
| void frc.robot.subsystems.TankDrive.updatePosition | ( | ) |
Definition at line 285 of file TankDrive.java.
References frc.robot.Constants.TANK_WHEEL_RADIUS.
Referenced by frc.robot.subsystems.TankDrive.drive().
| void frc.robot.subsystems.TankDrive.updateRobotVelocity | ( | ) |
Definition at line 264 of file TankDrive.java.
| void frc.robot.subsystems.TankDrive.XButtonPressed | ( | ) |
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 365 of file TankDrive.java.
References frc.robot.subsystems.TankDrive.toggleDecreasingPIDIncrement().
| void frc.robot.subsystems.TankDrive.YButtonPressed | ( | ) |
Reimplemented from frc.robot.subsystems.DriveBase.
Definition at line 376 of file TankDrive.java.
References frc.robot.subsystems.TankDrive.printPIDConstants().