diff --git a/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/interfaces/oi/TankOI.java b/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/interfaces/oi/TankOI.java index 0a445f3d..97c6a814 100644 --- a/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/interfaces/oi/TankOI.java +++ b/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/interfaces/oi/TankOI.java @@ -13,7 +13,7 @@ public abstract class TankOI implements UnidirectionalOI { public abstract double getLeftThrottle(); /** - * Get the throttle for the right side og the drive. + * Get the throttle for the right side of the drive. * * @return percent of max speed for right motor cluster from [-1.0, 1.0] */ diff --git a/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/oi/SimpleTankOI.java b/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/oi/SimpleTankOI.java index e861065f..a3eb53ee 100644 --- a/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/oi/SimpleTankOI.java +++ b/RoboRIO/src/main/java/org/usfirst/frc/team449/robot/oi/SimpleTankOI.java @@ -49,18 +49,30 @@ public SimpleTankOI(@NotNull @JsonProperty(required = true) MappedThrottle leftT } /** - * @return throttle to the left motor cluster [-1, 1] + * Get the throttle for the left side of the drive. + * + * @return percent of max speed for left motor cluster from [-1.0, 1.0] */ @Override public double getLeftThrottle() { + //If the driver is trying to drive straight, use the average of the two sticks. + if (commandingStraight()){ + return (leftThrottle.getValue()+rightThrottle.getValue())/2.; + } return leftThrottle.getValue(); } /** - * @return throttle to the right motor cluster [-1, 1] + * Get the throttle for the right side of the drive. + * + * @return percent of max speed for right motor cluster from [-1.0, 1.0] */ @Override public double getRightThrottle() { + //If the driver is trying to drive straight, use the average of the two sticks. + if (commandingStraight()){ + return (leftThrottle.getValue()+rightThrottle.getValue())/2.; + } return rightThrottle.getValue(); }