add comments that explain what these commandgroups do
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / MoveDefenseArmVertical.java
index 71abaab1bd5fd88382b43b6570fac38da1690a4a..61edfcfbdfd9c0d9fb2401b625272034c9d56873 100644 (file)
@@ -1,28 +1,22 @@
 package org.usfirst.frc.team3501.robot.commands;
 
+import org.usfirst.frc.team3501.robot.Robot;
+
 import edu.wpi.first.wpilibj.command.CommandGroup;
 
 /**
- *
+ * Given input verticalDisplacement, which represents how far (and in what
+ * direction, depending on the sign) the user wants the arm to be moved linearly
+ * & vertically, this commandGroup calls the MoveDefenseArm command, which
+ * will then move the tip of the arm to the target position based on input
+ * verticalDisplacement
  */
 public class MoveDefenseArmVertical extends CommandGroup {
-    
-    public  MoveDefenseArmVertical() {
-        // Add Commands here:
-        // e.g. addSequential(new Command1());
-        //      addSequential(new Command2());
-        // these will run in order.
 
-        // 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.
+  public MoveDefenseArmVertical(double verticalDisplacement) {
+    double x = Robot.defenseArm.getArmHorizontalDisplacement();
+    double y = Robot.defenseArm.getArmVerticalDisplacement();
+    addSequential(new MoveDefenseArm(x, y + verticalDisplacement));
 
-        // 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.
-    }
+  }
 }