X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;ds=sidebyside;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;fp=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FDriveTrain.java;h=2bb3c7a65422789fdacec52f957313b752a510c1;hb=89dad1e0fb923df053c895423a209d2017d3947c;hp=fd8f612278c760f5760c3ebcf9b20b04b601ea15;hpb=1884c3cf667ee1356e8ca8833f1ff28f39b85b1b;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index fd8f6122..2bb3c7a6 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -15,9 +15,9 @@ public class DriveTrain extends Subsystem { // Drivetrain specific constants that relate to the inches per pulse value for // the encoders private final static double WHEEL_DIAMETER = 6.0; // in inches - private final static double PULSES_PER_ROTATION = 256; - private final static double OUTPUT_SPROCKET_DIAMETER = 2.0; - private final static double WHEEL_SPROCKET_DIAMETER = 3.5; + private final static double PULSES_PER_ROTATION = 256; // in pulses + private final static double OUTPUT_SPROCKET_DIAMETER = 2.0; // in inches + private final static double WHEEL_SPROCKET_DIAMETER = 3.5; // in inches public final static double INCHES_PER_PULSE = (((Math.PI) * OUTPUT_SPROCKET_DIAMETER / PULSES_PER_ROTATION) / WHEEL_SPROCKET_DIAMETER) @@ -46,31 +46,28 @@ public class DriveTrain extends Subsystem { rightEncoder.reset(); } - // Returns inches per second public double getRightSpeed() { - return rightEncoder.getRate(); + return rightEncoder.getRate(); // in inches per second } public double getLeftSpeed() { - return leftEncoder.getRate(); + return leftEncoder.getRate(); // in inches per second } public double getSpeed() { - return (getLeftSpeed() + getRightSpeed()) / 2.0; + return (getLeftSpeed() + getRightSpeed()) / 2.0; // in inches per second } - // Returns distance in in public double getRightDistance() { - return rightEncoder.getDistance(); + return rightEncoder.getDistance(); // in inches } - // Returns distance in in public double getLeftDistance() { - return leftEncoder.getDistance(); + return leftEncoder.getDistance(); // in inches } public double getDistance() { - return (getRightDistance() + getLeftDistance()) / 2.0; + return (getRightDistance() + getLeftDistance()) / 2.0; // in inches } public void stop() {