Permalink
Browse files

nit

  • Loading branch information...
Linnea
Linnea committed Dec 7, 2018
1 parent c7fb22e commit f50980be93d4a68220f7c434f1050e30baa8b7e1
@@ -17,13 +17,13 @@
*/
public class RobotMap {
//left side of the drivetrain
public static TalonSRX leftFirstDrive = new TalonSRX(1);
public static TalonSRX leftFirstDrive = new TalonSRX(3);
public static TalonSRX leftSecondDrive = new TalonSRX(2);
public static TalonSRX leftThirdDrive = new TalonSRX(3);
public static TalonSRX leftThirdDrive = new TalonSRX(4);

//right side of the drivetrain
public static TalonSRX rightFirstDrive = new TalonSRX(4);
public static TalonSRX rightSecondDrive = new TalonSRX(5);
public static TalonSRX rightFirstDrive = new TalonSRX(5);
public static TalonSRX rightSecondDrive = new TalonSRX(7);
public static TalonSRX rightThirdDrive = new TalonSRX(6);

//NAVX
@@ -17,6 +17,7 @@
private static double wheelCircumference = 4 * Math.PI; //in inches
private static double numTicks = 4096; //double-check this value!!
public static final double inchesPerTick = wheelCircumference / numTicks;
public static final double ticksPerInch = 1/inchesPerTick;

// MOTORS AND SENSORS : UPDATE BASED ON WHAT'S ON THE PRACTICE DRIVETRAIN
TalonSRX L1 = RobotMap.leftFirstDrive;
@@ -30,13 +31,13 @@ public DriveSubsystem() {
}

//Intakes the speeds of joysticks and updates motor speeds
public void driveTank(double leftPercentOutput, double rightPercentOutput) {
L1.set(ControlMode.PercentOutput, -leftPercentOutput);
L2.set(ControlMode.PercentOutput, -leftPercentOutput);
L3.set(ControlMode.PercentOutput, -leftPercentOutput);
R1.set(ControlMode.PercentOutput, rightPercentOutput);
R2.set(ControlMode.PercentOutput, rightPercentOutput);
R3.set(ControlMode.PercentOutput, rightPercentOutput);
public void driveTank(double leftSpeed, double rightSpeed) {
L1.set(ControlMode.Velocity, -leftSpeed*ticksPerInch);
L2.set(ControlMode.Velocity, -leftSpeed*ticksPerInch);
L3.set(ControlMode.Velocity, -leftSpeed*ticksPerInch);
R1.set(ControlMode.Velocity, rightSpeed*ticksPerInch);
R2.set(ControlMode.Velocity, rightSpeed*ticksPerInch);
R3.set(ControlMode.Velocity, rightSpeed*ticksPerInch);
}

//Velocity
@@ -92,7 +93,11 @@ public boolean isMoving()
}

public void resetEncoders(){
//add function
L2.setSelectedSensorPosition(0, 0, 10);
L2.getSensorCollection().setQuadraturePosition(0, 10);
R2.setSelectedSensorPosition(0, 0, 10);
R2.getSensorCollection().setQuadraturePosition(0, 10);

}

}

0 comments on commit f50980b

Please sign in to comment.