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 {
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));
}
}
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));
}
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));
}
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));
}
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));
}