change isUsingTime to final and delete the method that toggles it in drivetrain
authorMeryem Esa <meresa14@gmail.com>
Thu, 18 Feb 2016 21:55:21 +0000 (13:55 -0800)
committerMeryem Esa <meresa14@gmail.com>
Thu, 18 Feb 2016 22:11:54 +0000 (14:11 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/commands/auton/AlignToScore.java
src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java
src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java
src/org/usfirst/frc/team3501/robot/commands/auton/PassRampart.java
src/org/usfirst/frc/team3501/robot/commands/auton/PassRockWall.java
src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java
src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java

index bbc7a3b88b420a49f786ffe9f6582cde1ec33f0d..08dda700f3b64710aa3d141a3735884be595d27c 100644 (file)
@@ -230,7 +230,7 @@ public class Constants {
     // Passing Defenses Constants
 
     public static final double DEFAULT_SPEED = 0.5;
-    public static boolean isUsingTime = true;
+    public static final boolean IS_USING_TIME = true;
 
     // dead reckoning time and speed constants for driving through defenses
     // TODO: find the times it takes to pass each defense
index 6450fa0342f6b4ffd9e26134942ed36a273556a5..e6fdf15710d4c832e6afa8fbc571e9c9bf4ea573 100644 (file)
@@ -39,7 +39,7 @@ public class AlignToScore extends CommandGroup {
   public double horizontalDistToGoal;
 
   public AlignToScore(int position) {
-    if (Constants.Auton.isUsingTime) {
+    if (Constants.Auton.IS_USING_TIME) {
       if (position == 1) {
         addSequential(new DriveForTime(Constants.Auton.POS1_DIST1_TIME,
             Constants.Auton.POS1_DRIVE_MAXSPEED));
index fe35684f9e1d38870759c9d6d68cd4fcc476f47a..3f43356e72ef349d26ff0e73bce71ceff2950a44 100644 (file)
@@ -25,7 +25,7 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
 public class PassLowBar extends CommandGroup {
 
   public PassLowBar() {
-    if (Constants.Auton.isUsingTime) {
+    if (Constants.Auton.IS_USING_TIME) {
       addSequential(new DriveForTime(Constants.Auton.PASS_LOW_BAR_TIMEpassLowBarTime,
           Constants.Auton.PASS_LOW_BAR_SPEED));
     }
index de789f75b765e71d58130e66f39cd71a22db94ef..7afc178255bf5a67757f73865208ffc022e22b54 100755 (executable)
@@ -28,7 +28,7 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
 public class PassMoat extends CommandGroup {
 
   public PassMoat() {
-    if (Constants.Auton.isUsingTime) {
+    if (Constants.Auton.IS_USING_TIME) {
       addSequential(new DriveForTime(Constants.Auton.PASS_MOAT_TIME,
           Constants.Auton.PASS_MOAT_SPEED));
     }
index acd24469a86fbacefaf859c0c39cad36726463a5..780589171246a4c9b556ee3887349adc7022cb4d 100755 (executable)
@@ -26,7 +26,7 @@ public class PassRampart extends CommandGroup {
 
   public PassRampart() {
 
-    if (Constants.Auton.isUsingTime) {
+    if (Constants.Auton.IS_USING_TIME) {
       addSequential(new DriveForTime(Constants.Auton.PASS_ROCK_WALL_TIME,
           Constants.Auton.passRockWallSpeed));
     }
index 73368d7e1793c62dfcf5ca99eee4e0c30b1b0a5b..55646b5a94254c695f5a0ebd97ad48886ba275aa 100755 (executable)
@@ -25,7 +25,7 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
 public class PassRockWall extends CommandGroup {
 
   public PassRockWall() {
-    if (Constants.Auton.isUsingTime) {
+    if (Constants.Auton.IS_USING_TIME) {
       addSequential(new DriveForTime(Constants.Auton.PASS_ROCK_WALL_TIME,
           Constants.Auton.passRockWallSpeed));
     }
index a1783de214c36c23b811dbe5133ef09ae3ff5b3d..8e3ccba55d206bf2114122aaca380e3e96764374 100644 (file)
@@ -26,7 +26,7 @@ public class PassRoughTerrain extends CommandGroup {
 
   public PassRoughTerrain() {
 
-    if (Constants.Auton.isUsingTime) {
+    if (Constants.Auton.IS_USING_TIME) {
       addSequential(new DriveForTime(Constants.Auton.PASS_ROCK_WALL_TIME,
           Constants.Auton.passRockWallSpeed));
     }
index e19b46f02643a6c24af4d7d261ae9f13fb6c74a8..7576e1b08b4bb3c721d956136db5a2b91b574ea3 100644 (file)
@@ -227,16 +227,10 @@ public class DriveTrain extends PIDSubsystem {
   }
 
   /*
-   * Checks the drive mode <<<<<<< 9728080f491e9fb09795494349dba1297f447c0f
+   * Checks the drive mode
    *
    * @return the current state of the robot in each state Average distance from
    * both sides of tank drive for Encoder Mode Angle from the gyro in GYRO_MODE
-   * =======
-   *
-   * @return the current state of the robot in each state Average distance from
-   * both sides of tank drive for Encoder Mode Angle from the gyro in GYRO_MODE
-   * >>>>>>> Move all constants in DeadReckoning to Auton class because it makes
-   * more sense
    */
   private double sensorFeedback() {
     if (DRIVE_MODE == Constants.DriveTrain.ENCODER_MODE)
@@ -367,7 +361,4 @@ public class DriveTrain extends PIDSubsystem {
     rightGearPiston.set(gear);
   }
 
-  public void toggleTimeDeadReckoning() {
-    Constants.Auton.isUsingTime = !Constants.Auton.isUsingTime;
-  }
 }