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.
- }
+ }
}