comments finished
authorjessicabhalerao <jessicabhalerao@gmail.com>
Fri, 20 Jan 2017 03:34:01 +0000 (19:34 -0800)
committerjessicabhalerao <jessicabhalerao@gmail.com>
Sat, 21 Jan 2017 03:01:52 +0000 (19:01 -0800)
src/org/usfirst/frc/team3501/robot/commandgroups/AutonGearThenBaselinePegCloseToBoiler.java
src/org/usfirst/frc/team3501/robot/commandgroups/AutonGearThenBaselinePegCloseToRetrievalZone.java

index bdb97804e3c17ca142b32d7d7d0ffecfbe043a40..5466e92eb3f12bcb76f7cb148e3fa5bc26707876 100644 (file)
@@ -11,20 +11,22 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
  *
  */
 public class AutonGearThenBaselinePegCloseToBoiler extends CommandGroup {
-    private static final int MOTOR_VALUE_TURN = 60;
-    private static final int MOTOR_VALUE_FORWARD = 60;
-    private static final double DISTANCE_FROM_BOILER_WALL = 111.5676;
 
-    public AutonGearThenBaselinePegCloseToBoiler() {
-  
-      
-      requires(Robot.getDriveTrain());
-      addSequential(new DriveDistance(DISTANCE_FROM_BOILER_WALL/Math.sqrt(3)+52.4614,MOTOR_VALUE_FORWARD));
-      addSequential(new TurnForAngle(60, Direction.LEFT , MOTOR_VALUE_TURN));
-      addSequential(new DriveDistance(143.3272-2*DISTANCE_FROM_BOILER_WALL/Math.sqrt(3)-10.5,MOTOR_VALUE_FORWARD));
-      //does not include drift distance
-      
-    }
+  private static final int MOTOR_VALUE_TURN = 60;
+  private static final int MOTOR_VALUE_FORWARD = 60;
+  private static final double DISTANCE_FROM_BOILER_WALL = 111.5676;
+
+  public AutonGearThenBaselinePegCloseToBoiler() {
+
+    requires(Robot.getDriveTrain());
+    addSequential(
+        new DriveDistance(DISTANCE_FROM_BOILER_WALL / Math.sqrt(3) + 52.4614,
+            MOTOR_VALUE_FORWARD));
+    addSequential(new TurnForAngle(60, Direction.LEFT, MOTOR_VALUE_TURN));
+    addSequential(new DriveDistance(
+        143.3272 - 2 * DISTANCE_FROM_BOILER_WALL / Math.sqrt(3) - 10.5,
+        MOTOR_VALUE_FORWARD));
+    // does not include drift distance
+
+  }
 }
index 43674461f44dc479b0a19ae7344ffd80095668f8..edb7d955a6cefe2bc34d83f2f56256876540adaf 100644 (file)
@@ -1,5 +1,10 @@
 package org.usfirst.frc.team3501.robot.commandgroups;
 
+import org.usfirst.frc.team3501.robot.Constants.Direction;
+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;
 
 /**
@@ -7,22 +12,22 @@ import edu.wpi.first.wpilibj.command.CommandGroup;
  */
 public class AutonGearThenBaselinePegCloseToRetrievalZone extends CommandGroup {
 
-    public AutonGearThenBaselinePegCloseToRetrievalZone() {
-        // Add Commands here:
-        // e.g. addSequential(new Command1());
-        //      addSequential(new Command2());
-        // these will run in order.
+  private static final double DISTANCE_FROM_RETRIEVAL_ZONE_WALL = 111.5676;
+  private static final int MOTOR_VALUE_TURN = 60;
+  private static final int MOTOR_VALUE_FORWARD = 60;
+
+  public AutonGearThenBaselinePegCloseToRetrievalZone() {
 
-        // To run multiple commands at the same time,
-        // use addParallel()
-        // e.g. addParallel(new Command1());
-        //      addSequential(new Command2());
-        // Command1 and Command2 will run in parallel.
+    double x = DISTANCE_FROM_RETRIEVAL_ZONE_WALL;
+    requires(Robot.getDriveTrain());
+    addSequential(new DriveDistance(
+        DISTANCE_FROM_RETRIEVAL_ZONE_WALL / Math.sqrt(3) + 52.4614,
+        MOTOR_VALUE_FORWARD));
+    addSequential(new TurnForAngle(60, Direction.RIGHT, MOTOR_VALUE_TURN));
+    addSequential(new DriveDistance(
+        143.3272 - 2 * DISTANCE_FROM_RETRIEVAL_ZONE_WALL / Math.sqrt(3) - 10.5,
+        MOTOR_VALUE_FORWARD));
+    // does not include drift distance
 
-        // A command group will require all of the subsystems that each member
-        // would require.
-        // e.g. if Command1 requires chassis, and Command2 requires arm,
-        // a CommandGroup containing them would require both the chassis and the
-        // arm.
-    }
+  }
 }