public static boolean inverted = false;
+ public static final double PASS_DEFENSE_TIMEOUT = 10; // find this
}
public static class Scaler {
public static class DeadReckoning {
public static final double DEFAULT_SPEED = 0.5;
+ public static boolean isDeadReckoning;
+
+ // 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;
+
}
public static class IntakeArm {
package org.usfirst.frc.team3501.robot.commands.auton;
+import org.usfirst.frc.team3501.robot.Constants;
import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
import edu.wpi.first.wpilibj.command.CommandGroup;
public class PassLowBar extends CommandGroup {
- private final double DISTANCE = 4.0;
- private final double DEFAULT_SPEED = 0.5;
-
public PassLowBar() {
- // TODO: need to add sequential for retracting the arms and shooting hood
- // once those commands are made
- addSequential(new DriveDistance(DISTANCE, DEFAULT_SPEED));
- }
-
- public PassLowBar(double speed) {
- addSequential(new DriveDistance(DISTANCE, speed));
+ if (Constants.DeadReckoning.isDeadReckoning) {
+ addSequential(new DriveForTime(Constants.DeadReckoning.passLowBarTime,
+ Constants.DeadReckoning.passLowBarSpeed));
+ }
+ else {
+ addSequential(new DriveDistance(
+ Constants.DeadReckoning.passLowBarDistance,
+ Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+ }
}
}
package org.usfirst.frc.team3501.robot.commands.auton;
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
import edu.wpi.first.wpilibj.command.CommandGroup;
public class PassMoat extends CommandGroup {
- private final double BEG_TIME = 0;
- private final double MID_TIME = 0;
- private final double END_TIME = 0;
- private final double BEG_SPEED = 0;
- private final double MID_SPEED = 0;
- private final double END_SPEED = 0;
-
public PassMoat() {
- addSequential(new DriveForTime(BEG_TIME, BEG_SPEED));
- addSequential(new DriveForTime(MID_TIME, MID_SPEED));
- addSequential(new DriveForTime(END_TIME, END_SPEED));
+ if (Constants.DeadReckoning.isDeadReckoning) {
+ addSequential(new DriveForTime(Constants.DeadReckoning.passMoatTime,
+ Constants.DeadReckoning.passMoatSpeed));
+ }
+ else {
+ addSequential(new DriveDistance(Constants.DeadReckoning.passMoatDistance,
+ Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+ }
}
}
package org.usfirst.frc.team3501.robot.commands.auton;
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
import edu.wpi.first.wpilibj.command.CommandGroup;
public PassRampart() {
- final double BEG_TIME = 0;
- final double BEG_SPEED = 0;
- final double MID_TIME = 0;
- final double MID_SPEED = 0;
- final double END_TIME = 0;
- final double END_SPEED = 0;
-
- addSequential(new DriveForTime(BEG_TIME, BEG_SPEED));
- addSequential(new DriveForTime(MID_TIME, MID_SPEED));
- addSequential(new DriveForTime(END_TIME, END_SPEED));
+ if (Constants.DeadReckoning.isDeadReckoning) {
+ addSequential(new DriveForTime(Constants.DeadReckoning.passRockWallTime,
+ Constants.DeadReckoning.passRockWallSpeed));
+ }
+ else {
+ addSequential(new DriveDistance(
+ Constants.DeadReckoning.passRampartDistance,
+ Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+ }
}
package org.usfirst.frc.team3501.robot.commands.auton;
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
import edu.wpi.first.wpilibj.command.CommandGroup;
public class PassRockWall extends CommandGroup {
- private final double time = 0, speed =0;
-
public PassRockWall() {
-
- addSequential(new DriveForTime(time, speed));
+ if (Constants.DeadReckoning.isDeadReckoning) {
+ addSequential(new DriveForTime(Constants.DeadReckoning.passRockWallTime,
+ Constants.DeadReckoning.passRockWallSpeed));
+ }
+ else {
+ addSequential(new DriveDistance(
+ Constants.DeadReckoning.passRockWallDistance,
+ Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+ }
}
}
package org.usfirst.frc.team3501.robot.commands.auton;
+import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
import edu.wpi.first.wpilibj.command.CommandGroup;
*/
public class PassRoughTerrain extends CommandGroup {
- // TODO: test for the time
- private final double BEG_TIME = 0;
- private final double MID_TIME = 0;
- private final double END_TIME = 0;
-
- private final double BEG_SPEED = 0;
- private final double MID_SPEED = 0;
- private final double END_SPEED = 0;
-
public PassRoughTerrain() {
- addSequential(new DriveForTime(BEG_TIME, BEG_SPEED));
- addSequential(new DriveForTime(MID_TIME, MID_SPEED));
- addSequential(new DriveForTime(END_TIME, BEG_SPEED));
+ if (Constants.DeadReckoning.isDeadReckoning) {
+ addSequential(new DriveForTime(Constants.DeadReckoning.passRockWallTime,
+ Constants.DeadReckoning.passRockWallSpeed));
+ }
+ else {
+ addSequential(new DriveDistance(
+ Constants.DeadReckoning.passRoughTerrainDistance,
+ Constants.DriveTrain.PASS_DEFENSE_TIMEOUT));
+ }
}
}