}
public static class DriveTrain {
- // Drivetrain specific ports
+ // Drivetrain Motor Related Ports
public static final int FRONT_LEFT = 0;
public static final int FRONT_RIGHT = 0;
public static final int REAR_LEFT = 0;
public static final int REAR_RIGHT = 0;
- // Encoder Specific Ports
+ // Encoder related ports
public final static int ENCODER_LEFT_A = 3;
public final static int ENCODER_LEFT_B = 4;
public final static int ENCODER_RIGHT_A = 2;
import edu.wpi.first.wpilibj.command.Subsystem;
public class DriveTrain extends Subsystem {
- // Drivetrain Related Objects
- private CANTalon frontLeft, frontRight, rearLeft, rearRight;
+ // Drivetrain related objects
private Encoder leftEncoder, rightEncoder;
+ private CANTalon frontLeft, frontRight, rearLeft, rearRight;
- // Drivetrain Specific Constants that relate to the Inches per Pulse value of
+ // 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; // in pulses
}
public void setMotorSpeeds(double leftSpeed, double rightSpeed) {
- // Right motors receive negative values because they turn in the opposite
- // direction
+ // speed passed to right motor is negative because right motor rotates in
+ // opposite direction
this.frontLeft.set(leftSpeed);
this.frontRight.set(-rightSpeed);
this.rearLeft.set(leftSpeed);