From c688e9da1214ed9257214a0b265a1c1b7eeb1506 Mon Sep 17 00:00:00 2001 From: Meryem Esa Date: Thu, 18 Feb 2016 13:55:21 -0800 Subject: [PATCH] change isUsingTime to final and delete the method that toggles it in drivetrain --- src/org/usfirst/frc/team3501/robot/Constants.java | 2 +- .../team3501/robot/commands/auton/AlignToScore.java | 2 +- .../frc/team3501/robot/commands/auton/PassLowBar.java | 2 +- .../frc/team3501/robot/commands/auton/PassMoat.java | 2 +- .../team3501/robot/commands/auton/PassRampart.java | 2 +- .../team3501/robot/commands/auton/PassRockWall.java | 2 +- .../robot/commands/auton/PassRoughTerrain.java | 2 +- .../frc/team3501/robot/subsystems/DriveTrain.java | 11 +---------- 8 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index bbc7a3b8..08dda700 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -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 diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/AlignToScore.java b/src/org/usfirst/frc/team3501/robot/commands/auton/AlignToScore.java index 6450fa03..e6fdf157 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/AlignToScore.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/AlignToScore.java @@ -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)); diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java b/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java index fe35684f..3f43356e 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java @@ -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)); } diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java b/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java index de789f75..7afc1782 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java @@ -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)); } diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRampart.java b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRampart.java index acd24469..78058917 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRampart.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRampart.java @@ -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)); } diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRockWall.java b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRockWall.java index 73368d7e..55646b5a 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRockWall.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRockWall.java @@ -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)); } diff --git a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java index a1783de2..8e3ccba5 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java @@ -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)); } diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java index e19b46f0..7576e1b0 100644 --- a/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/DriveTrain.java @@ -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; - } } -- 2.30.2