From 01b9b0ec6d379fdf2d18ecf73d20c1b8298d06c4 Mon Sep 17 00:00:00 2001 From: Meryem Esa Date: Thu, 18 Feb 2016 13:48:52 -0800 Subject: [PATCH] change all the pass defense constants to finals --- .../usfirst/frc/team3501/robot/Constants.java | 31 ++++++++++--------- .../robot/commands/auton/PassLowBar.java | 6 ++-- .../robot/commands/auton/PassMoat.java | 6 ++-- .../robot/commands/auton/PassRampart.java | 4 +-- .../robot/commands/auton/PassRockWall.java | 4 +-- .../commands/auton/PassRoughTerrain.java | 4 +-- 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 374c6bad..bbc7a3b8 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -233,21 +233,22 @@ public class Constants { public static boolean isUsingTime = true; // dead reckoning time and speed constants for driving through defenses - public static double passRockWallTime = 0; - public static double passRockWallSpeed = 0; - public static double passRockWallDistance = 0; - public static double passLowBarTime = 0; - public static double passLowBarSpeed = 0; - public static double passLowBarDistance = 0; - public static double passMoatTime = 0; - public static double passMoatSpeed = 0; - public static double passMoatDistance = 0; - public static double passRampartTime = 0; - public static double passRampartSpeed = 0; - public static double passRampartDistance = 0; - public static double passRoughTerrainTime = 0; - public static double passRoughTerrainSpeed = 0; - public static double passRoughTerrainDistance = 0; + // TODO: find the times it takes to pass each defense + public static final double PASS_ROCK_WALL_TIME = 0; + public static final double PASS_ROCK_WALL_SPEED = 0; + public static final double PASS_ROCK_WALL_DIST = 0; + public static final double PASS_LOW_BAR_TIME = 0; + public static final double PASS_LOW_BAR_SPEED = 0; + public static final double PASS_LOW_BAR_DIST = 0; + public static final double PASS_MOAT_TIME = 0; + public static final double PASS_MOAT_SPEED = 0; + public static final double PASS_MOAT_DIST = 0; + public static final double PASS_RAMPART_TIME = 0; + public static final double PASS_RAMPART_SPEED = 0; + public static final double PASS_RAMPART_DIST = 0; + public static final double PASS_ROUGH_TERRAIN_TIME = 0; + public static final double PASS_ROUGH_TERRAIN_SPEED = 0; + public static final double PASS_ROUGH_TERRAIN_DIST = 0; } public enum Direction { 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 9ee3e6ee..fe35684f 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassLowBar.java @@ -26,12 +26,12 @@ public class PassLowBar extends CommandGroup { public PassLowBar() { if (Constants.Auton.isUsingTime) { - addSequential(new DriveForTime(Constants.Auton.passLowBarTime, - Constants.Auton.passLowBarSpeed)); + addSequential(new DriveForTime(Constants.Auton.PASS_LOW_BAR_TIMEpassLowBarTime, + Constants.Auton.PASS_LOW_BAR_SPEED)); } else { addSequential(new DriveDistance( - Constants.Auton.passLowBarDistance, + Constants.Auton.PASS_LOW_BAR_DIST, Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); } } 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 b0f2b842..de789f75 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassMoat.java @@ -29,11 +29,11 @@ public class PassMoat extends CommandGroup { public PassMoat() { if (Constants.Auton.isUsingTime) { - addSequential(new DriveForTime(Constants.Auton.passMoatTime, - Constants.Auton.passMoatSpeed)); + addSequential(new DriveForTime(Constants.Auton.PASS_MOAT_TIME, + Constants.Auton.PASS_MOAT_SPEED)); } else { - addSequential(new DriveDistance(Constants.Auton.passMoatDistance, + addSequential(new DriveDistance(Constants.Auton.PASS_MOAT_DIST, Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); } 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 e5af033e..acd24469 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRampart.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRampart.java @@ -27,12 +27,12 @@ public class PassRampart extends CommandGroup { public PassRampart() { if (Constants.Auton.isUsingTime) { - addSequential(new DriveForTime(Constants.Auton.passRockWallTime, + addSequential(new DriveForTime(Constants.Auton.PASS_ROCK_WALL_TIME, Constants.Auton.passRockWallSpeed)); } else { addSequential(new DriveDistance( - Constants.Auton.passRampartDistance, + Constants.Auton.PASS_RAMPART_DIST, Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); } 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 dae5e038..73368d7e 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRockWall.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRockWall.java @@ -26,12 +26,12 @@ public class PassRockWall extends CommandGroup { public PassRockWall() { if (Constants.Auton.isUsingTime) { - addSequential(new DriveForTime(Constants.Auton.passRockWallTime, + addSequential(new DriveForTime(Constants.Auton.PASS_ROCK_WALL_TIME, Constants.Auton.passRockWallSpeed)); } else { addSequential(new DriveDistance( - Constants.Auton.passRockWallDistance, + Constants.Auton.PASS_ROCK_WALL_DIST, Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); } 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 f1b03726..a1783de2 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java +++ b/src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java @@ -27,12 +27,12 @@ public class PassRoughTerrain extends CommandGroup { public PassRoughTerrain() { if (Constants.Auton.isUsingTime) { - addSequential(new DriveForTime(Constants.Auton.passRockWallTime, + addSequential(new DriveForTime(Constants.Auton.PASS_ROCK_WALL_TIME, Constants.Auton.passRockWallSpeed)); } else { addSequential(new DriveDistance( - Constants.Auton.passRoughTerrainDistance, + Constants.Auton.PASS_ROUGH_TERRAIN_DIST, Constants.DriveTrain.PASS_DEFENSE_TIMEOUT)); } -- 2.30.2