update command names
authorCindy Zhang <cindyzyx9@gmail.com>
Mon, 15 Feb 2016 23:41:00 +0000 (15:41 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Tue, 16 Feb 2016 19:37:03 +0000 (11:37 -0800)
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/PassRampart.java
src/org/usfirst/frc/team3501/robot/commands/auton/PassRoughTerrain.java

index 318117233d90534d4ecbe770fe03c0b72d8febcf..918a9fca74ca5b96dfc8dae31593144fc3a0b8ca 100755 (executable)
@@ -1,6 +1,8 @@
 package org.usfirst.frc.team3501.robot.commands.auton;
 
 import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
+import org.usfirst.frc.team3501.robot.commands.driving.TurnForAngle;
 
 import edu.wpi.first.wpilibj.command.CommandGroup;
 
@@ -28,6 +30,7 @@ public class AlignToScore extends CommandGroup {
   private final static double DIST_CASTLE_WALL_TO_FRONT_GOAL = 0;
 
   private final double DEFAULT_SPEED = 0.5;
+  private final double maxTimeout = 5;
 
   // in inches
   // assuming that positive angle means turning right
@@ -72,42 +75,42 @@ public class AlignToScore extends CommandGroup {
 
       // position 1 is always the low bar
 
-      addSequential(new DriveForDistance(POS1_DIST1, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS1_TURN1));
-      addSequential(new DriveForDistance(POS1_DIST2, DEFAULT_SPEED));
+      addSequential(new DriveDistance(POS1_DIST1, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS1_TURN1, maxTimeout));
+      addSequential(new DriveDistance(POS1_DIST2, DEFAULT_SPEED));
       horizontalDistToGoal = 0;
     } else if (position == 2) {
 
-      addSequential(new DriveForDistance(POS2_DIST1, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS2_TURN1));
-      addSequential(new DriveForDistance(POS2_DIST2, DEFAULT_SPEED));
+      addSequential(new DriveDistance(POS2_DIST1, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS2_TURN1, maxTimeout));
+      addSequential(new DriveDistance(POS2_DIST2, DEFAULT_SPEED));
       horizontalDistToGoal = 0;
 
     } else if (position == 3) {
 
-      addSequential(new DriveForDistance(POS3_DIST1, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS3_TURN1));
-      addSequential(new DriveForDistance(POS3_DIST2, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS3_TURN2));
-      addSequential(new DriveForDistance(POS3_DIST3, DEFAULT_SPEED));
+      addSequential(new DriveDistance(POS3_DIST1, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS3_TURN1, maxTimeout));
+      addSequential(new DriveDistance(POS3_DIST2, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS3_TURN2, maxTimeout));
+      addSequential(new DriveDistance(POS3_DIST3, DEFAULT_SPEED));
       horizontalDistToGoal = 0;
 
     } else if (position == 4) {
 
-      addSequential(new DriveForDistance(POS4_DIST1, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS4_TURN1));
-      addSequential(new DriveForDistance(POS4_DIST2, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS4_TURN2));
-      addSequential(new DriveForDistance(POS4_DIST3, DEFAULT_SPEED));
+      addSequential(new DriveDistance(POS4_DIST1, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS4_TURN1, maxTimeout));
+      addSequential(new DriveDistance(POS4_DIST2, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS4_TURN2, maxTimeout));
+      addSequential(new DriveDistance(POS4_DIST3, DEFAULT_SPEED));
       horizontalDistToGoal = 0;
 
     } else if (position == 5) {
 
-      addSequential(new DriveForDistance(POS5_DIST1, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS5_TURN1));
-      addSequential(new DriveForDistance(POS5_DIST2, DEFAULT_SPEED));
-      addSequential(new TurnForAngle(POS5_TURN2));
-      addSequential(new DriveForDistance(POS5_DIST3, DEFAULT_SPEED));
+      addSequential(new DriveDistance(POS5_DIST1, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS5_TURN1, maxTimeout));
+      addSequential(new DriveDistance(POS5_DIST2, DEFAULT_SPEED));
+      addSequential(new TurnForAngle(POS5_TURN2, maxTimeout));
+      addSequential(new DriveDistance(POS5_DIST3, DEFAULT_SPEED));
       horizontalDistToGoal = 0;
 
     }
index c03ce143465c5b9a58ba08ece9f6cb3cfc556719..cbdaeef6fd54e36c0e46ef339cd5c41c4e5efee5 100755 (executable)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.auton;
 
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
+
 import edu.wpi.first.wpilibj.command.CommandGroup;
 
 /***
@@ -8,7 +10,7 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
  * dependency on sensors: encoders
  * dependency on subsystems: drivetrain
  * dependency on other commands: DriveForDist
- * 
+ *
  * pre-condition: robot is flush against the ramp of the outerworks in front of
  * the low bar
  *
@@ -24,11 +26,12 @@ public class PassLowBar extends CommandGroup {
   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 DriveForDistance(DISTANCE, DEFAULT_SPEED));
+    // 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 DriveForDistance(DISTANCE, speed));
+    addSequential(new DriveDistance(DISTANCE, speed));
   }
 }
index e0dfb49032205d26d5403fc903e09522fa7a043d..426063dcaa2cad2fa4df19f4d05933640e74d1c1 100755 (executable)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.auton;
 
+import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
+
 import edu.wpi.first.wpilibj.command.CommandGroup;
 
 /***
index 4fe09f4f45dbb68eb279fb93f6cbc4a70c39a786..8851edf697ac4d8b70514618222e9ddb52d6855c 100755 (executable)
@@ -1,5 +1,7 @@
 package org.usfirst.frc.team3501.robot.commands.auton;
 
+import org.usfirst.frc.team3501.robot.commands.driving.DriveForTime;
+
 import edu.wpi.first.wpilibj.command.CommandGroup;
 
 /***