package org.usfirst.frc.team3501.robot;
-import org.usfirst.frc.team3501.robot.commands.ChangeShooterSpeed;
-import org.usfirst.frc.team3501.robot.commands.SetShooterSpeed;
+import org.usfirst.frc.team3501.robot.commands.shooter.ChangeShooterSpeed;
+import org.usfirst.frc.team3501.robot.commands.shooter.SetShooterSpeed;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class AimAndAlign extends Command {
-
- public AimAndAlign() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will continually roll the rollers of the intake arm in the
- * outwards direction and stop the rollers once the command is canceled.
- *
- * pre-condition: This command must be called by a button with the method
- * .whileHeld() in OI
- *
- * @author Lauren and Niyati
- *
- */
-
-public class BallRollerExpelContinuous extends Command {
-
- public BallRollerExpelContinuous() {
- requires(Robot.intakeArm);
- }
-
- @Override
- protected void initialize() {
- Robot.intakeArm.outputBall();
- }
-
- @Override
- protected void execute() {
-
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- Robot.intakeArm.stopRollers();
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will continually roll the rollers of the intake arm in the
- * inwards direction and stop the rollers once the command is canceled.
- *
- * pre-condition: This command must be called by a button with the method
- * .whileHeld() in OI
- *
- * @author Lauren and Niyati
- *
- */
-
-public class BallRollerIntakeContinuous extends Command {
-
- public BallRollerIntakeContinuous() {
- requires(Robot.intakeArm);
- }
-
- @Override
- protected void initialize() {
- Robot.intakeArm.intakeBall();
- }
-
- @Override
- protected void execute() {
-
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- Robot.intakeArm.stopRollers();
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class ChangeShooterSpeed extends Command {
- double change = 0;
-
- public ChangeShooterSpeed(double change) {
- this.change = change;
- }
-
- @Override
- protected void initialize() {
- Robot.shooter.changeSpeed(change);
- }
-
- @Override
- protected void execute() {
-
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
-
- }
-
- @Override
- protected void interrupted() {
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class ClampBar extends Command {
- private double secondsToClamp = 2.0; // seconds for the winch to run in order
- // for it to clamp(requires testing)
- private double winchSpeed = 0.5; // requires testing
-
- public ClampBar() {
- }
-
- @Override
- protected void initialize() {
- setTimeout(secondsToClamp);
- Robot.scaler.runWinch(winchSpeed);
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return isTimedOut();
- }
-
- @Override
- protected void end() {
- Robot.scaler.runWinch(0);
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Constants.Defense;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/**
- * The default autonomous strategy involves passing the defense that is in front
- * of it, aiming the robot/ shooter towards the goal, and shooting.
- */
-
-public class DefaultAutonStrategy extends CommandGroup {
-
- public DefaultAutonStrategy(int position, Defense defense) {
-
- switch (defense) {
-
- case PORTCULLIS:
-
- addSequential(new LiftPortcullis());
-
- case SALLY_PORT:
-
- addSequential(new PassSallyPort());
-
- case ROUGH_TERRAIN:
-
- addSequential(new PassRoughTerrain());
-
- case LOW_BAR:
-
- addSequential(new PassLowBar());
-
- case CHEVAL_DE_FRISE:
-
- addSequential(new PassChevalDeFrise());
-
- case DRAWBRIDGE:
-
- addSequential(new PassDrawBridge());
-
- case MOAT:
-
- addSequential(new PassMoat());
-
- case ROCK_WALL:
-
- addSequential(new PassRockWall());
-
- case RAMPART:
-
- addSequential(new PassRampart());
-
- default:
- break;
- }
-
- addSequential(new AimAndAlign());
- addSequential(new Shoot());
-
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class Detect extends Command {
-
- public Detect() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class Drive extends Command {
-
- public Drive() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will move the robot at the specified speed for the specified
- * distance.
- *
- * post-condition: has driven for the distance and speed specified
- *
- * @author Meryem and Avi
- *
- */
-public class DriveForDistance extends Command {
-
- public DriveForDistance(double distance, double speed) {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will expel a boulder from the robot, if it is even present to
- * begin with.
- *
- * pre-condition: Intake arm is at correct height and a boulder is present
- * inside the robot.
- *
- * post-condition: A boulder is expelled from inside the robot to the field
- * outside of the robot.
- *
- * @author Lauren and Niyati
- *
- */
-
-public class ExpelBall extends Command {
- private final int TIMEOUT_AMOUNT = 5;
-
- public ExpelBall() {
- requires(Robot.intakeArm);
- }
-
- @Override
- protected void initialize() {
- this.setTimeout(TIMEOUT_AMOUNT);
- if (Robot.photogate.isBallPresent())
- Robot.intakeArm.outputBall();
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return (this.isTimedOut() || !Robot.photogate.isBallPresent());
- }
-
- @Override
- protected void end() {
- Robot.intakeArm.stopRollers();
- }
-
- @Override
- protected void interrupted() {
-
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class ExtendLift extends Command {
-
- public ExtendLift() {
- }
-
- @Override
- protected void initialize() {
- Robot.scaler.liftScissorLift();
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class Intake extends Command {
-
- public Intake() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will take a boulder into the robot if there is not a boulder
- * present inside already.
- *
- * pre-condition: Intake arm must be at correct height and a boulder is not
- * present inside the robot.
- *
- * post-condition: A boulder is taken in from the field outside of the robot
- * into the robot.
- *
- * @author Lauren and Niyati
- *
- */
-
-public class IntakeBall extends Command {
- private final int TIMEOUT_AMOUNT = 5;
-
- public IntakeBall() {
- requires(Robot.intakeArm);
- }
-
- @Override
- protected void initialize() {
- this.setTimeout(TIMEOUT_AMOUNT);
- if (!Robot.photogate.isBallPresent())
- Robot.intakeArm.intakeBall();
-
- }
-
- @Override
- protected void execute() {
-
- }
-
- @Override
- protected boolean isFinished() {
- return (this.isTimedOut() || Robot.photogate.isBallPresent());
- }
-
- @Override
- protected void end() {
- Robot.intakeArm.stopRollers();
-
- }
-
- @Override
- protected void interrupted() {
-
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will move the robot forward while lifting the defense arm up.
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the portcullis
- *
- * This command has to drive forward at the same time because that's how the
- * robot opens the portcullis
- *
- * post-condition: the robot has passed the portcullis and is in the next zone
- *
- * @author Meryem and Avi
- *
- */
-
-public class LiftPortcullis extends Command {
-
- public LiftPortcullis() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class LiftRobot extends Command {
-
- public LiftRobot() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command is intended to be run from OI using button.whileHeld(...).
- * It lowers the defenseArm continually while the button is being held down.
- *
- * @author shaina
- *
- */
-public class LowerDefenseArmContinuous extends Command {
-
- private double speed;
-
- public LowerDefenseArmContinuous(double speed) {
- requires(Robot.defenseArm);
- this.speed = -speed;
- }
-
- @Override
- protected void initialize() {
- Robot.defenseArm.setArmSpeed(speed);
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- Robot.defenseArm.setArmSpeed(0);
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command is intended to be run from OI using button.whileHeld(...).
- * It lowers the defenseWrist continually while the button is being held down.
- *
- * @author shaina
- *
- */
-public class LowerDefenseWristContinuous extends Command {
-
- private double speed;
-
- public LowerDefenseWristContinuous(double speed) {
- requires(Robot.defenseArm);
- this.speed = -speed;
- }
-
- @Override
- protected void initialize() {
- Robot.defenseArm.setHandSpeed(speed);
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- Robot.defenseArm.setHandSpeed(0);
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class MoveIntakeArmToAngle extends Command {
- private double currentAngle;
- private double targetAngle;
- private double targetSpeed;
- private double SENSITIVITY_THRESHOLD = 0.1;
- private boolean isDecreasing = false;
-
- public MoveIntakeArmToAngle(double angle, double speed) {
- requires(Robot.intakeArm);
- targetAngle = angle;
- targetSpeed = speed;
-
- }
-
- @Override
- protected void initialize() {
- currentAngle = Robot.intakeArm.getArmAngle();
- double difference = targetAngle - currentAngle;
- if (difference > 0) {
- Robot.intakeArm.setArmSpeed(targetSpeed);
- isDecreasing = true;
- } else {
- Robot.intakeArm.setArmSpeed(-targetSpeed);
- isDecreasing = false;
- }
- }
-
- @Override
- protected void execute() {
-
- }
-
- @Override
- protected boolean isFinished() {
- currentAngle = Robot.intakeArm.getArmAngle();
-
- if (isDecreasing == true) {
- return (currentAngle <= targetAngle + SENSITIVITY_THRESHOLD);
- } else {
- return (currentAngle >= targetAngle + SENSITIVITY_THRESHOLD);
- }
- }
-
- @Override
- protected void end() {
- Robot.intakeArm.stop();
- }
-
- @Override
- protected void interrupted() {
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-public class MoveIntakeArmToBallIntakeHeight {
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class MoveIntakeArmUp extends Command {
-
- public MoveIntakeArmUp() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will move the intake arm downwards using a motor to lower the
- * cheval de frise and drive over it.
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the cheval de frise
- *
- * post-condition: the robot has passed the cheval de frise and is in the next
- * zone
- *
- * @author Meryem and Avi
- *
- */
-public class PassChevalDeFrise extends Command {
-
- public PassChevalDeFrise() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will lower the draw bridge and go through it
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the draw bridge
- *
- * post-condition: the robot has passed the draw bridge and is in the next zone
- *
- * @author Meryem and Avi
- *
- */
-public class PassDrawBridge extends Command {
-
- public PassDrawBridge() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will drive the robot through the low bar.
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the low bar
- *
- * post-condition: the robot has passed the low bar and is in the next zone
- *
- * @author Meryem and Avi
- *
- */
-public class PassLowBar extends Command {
-
- public PassLowBar() {
-
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will drive the robot through the moat.
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the moat
- *
- * post-condition: the robot has passed the moat and is in the next zone
- *
- * @author Meryem and Avi
- *
- */
-public class PassMoat extends Command {
-
- public PassMoat() {
-
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will drive the robot through the rampart.
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the rampart
- *
- * post-condition: the robot has passed the rampart and is in the next zone
- *
- * @author Meryem and Avi
- *
- */
-public class PassRampart extends Command {
-
- public PassRampart() {
-
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will drive the robot through the rock wall.
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the rock wall
- *
- * post-condition: the robot has passed the rock wall and is in the next zone
- *
- * @author Meryem and Avi
- *
- */
-public class PassRockWall extends Command {
-
- public PassRockWall() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command will drive the robot through the rough terrain.
- *
- * pre-condition: robot is flush against the ramp of the outerworks in front of
- * the rough terrain
- *
- * post-condition: the robot has passed the rough terrain and is in the next
- * zone
- *
- * @author Meryem and Avi
- *
- */
-public class PassRoughTerrain extends Command {
-
- public PassRoughTerrain() {
-
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class PassSallyPort extends Command {
- /***
- * This command will only open the sally port pass through it. It will do this
- * by hooking onto the port and driving backwards while rotating then driving
- * backwards through the sally port.
- *
- * pre-condition: robot is in the neutral zone, flush against the ramp of the
- * outerworks in front of the portcullis
- *
- * post-condition: the robot has passed the sally port and is in a courtyard
- *
- * note: to go from the courtyard to neutral zone, the driver just has to
- * drive through the port
- *
- * @author Meryem and Avi
- *
- */
-
- public PassSallyPort() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class Position extends Command {
-
- public Position() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command is intended to be run from OI using button.whileHeld(...).
- * It raises the defenseArm continually while the button is being held down.
- *
- * @author shaina
- */
-public class RaiseDefenseArmContinuous extends Command {
-
- private double speed;
-
- public RaiseDefenseArmContinuous(double speed) {
- requires(Robot.defenseArm);
- this.speed = speed;
- }
-
- @Override
- protected void initialize() {
- Robot.defenseArm.setArmSpeed(speed);
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- Robot.defenseArm.setArmSpeed(0);
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command is intended to be run from OI using button.whileHeld(...).
- * It raises the defenseWrist continually while the button is being held down.
- *
- * @author shaina
- *
- */
-public class RaiseDefenseWristContinuous extends Command {
-
- private double speed;
-
- public RaiseDefenseWristContinuous(double speed) {
- requires(Robot.defenseArm);
- this.speed = speed;
- }
-
- @Override
- protected void initialize() {
- Robot.defenseArm.setHandSpeed(speed);
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- Robot.defenseArm.setHandSpeed(0);
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.CommandGroup;
-
-/***
- * This command group simultaneously move arm and hand to retracted position.
- *
- * @author shaina
- *
- */
-public class RetractDefenseArm extends CommandGroup {
- static final double ARM_FULLY_RETRACTED_ANGLE = 0; // change value once tested
- static final double HAND_FULLY_RETRACTED_ANGLE = 0; // change value once
- // tested
-
- public RetractDefenseArm(double speed) {
- requires(Robot.defenseArm);
-
- addParallel(new SetArmToAngle(speed, ARM_FULLY_RETRACTED_ANGLE));
- addParallel(new SetHandToAngle(speed, HAND_FULLY_RETRACTED_ANGLE));
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class RetractLift extends Command {
-
- public RetractLift() {
- }
-
- @Override
- protected void initialize() {
- Robot.scaler.lowerScissorLift();
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command moves the defense arm to a input angle position.
- * Requires input of a targetPosition and a speed.
- *
- * @author shaina
- *
- */
-public class SetArmToAngle extends Command {
- private static final double THRESHOLD = 0.1;
- private double speed;
- private double targetPosition;
- private double currentPosition;
- private boolean isDecreasing = false;
-
- public SetArmToAngle(double speed, double targetPosition) {
- requires(Robot.defenseArm);
-
- this.speed = speed;
- this.targetPosition = targetPosition;
- }
-
- @Override
- public void initialize() {
- currentPosition = Robot.defenseArm.getArmPotAngle();
-
- if (currentPosition > targetPosition) {
- Robot.defenseArm.setArmSpeed(-speed);
- isDecreasing = true;
- } else {
- Robot.defenseArm.setArmSpeed(speed);
- isDecreasing = false;
- }
- }
-
- @Override
- public void execute() {
-
- }
-
- @Override
- public boolean isFinished() {
- currentPosition = Robot.defenseArm.getArmPotAngle();
-
- if (isDecreasing == true) {
- return (currentPosition <= targetPosition + THRESHOLD);
- } else {
- return (currentPosition >= targetPosition - THRESHOLD);
- }
- }
-
- @Override
- public void end() {
- Robot.defenseArm.setArmSpeed(0);
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/***
- * This command moves the defense arm to a input angle position.
- * Requires input of a targetPosition and a speed.
- *
- * @author shaina
- *
- */
-public class SetHandToAngle extends Command {
- private static final double THRESHOLD = 0.1;
- private double speed;
- private double targetPosition;
- private double currentPosition;
- private boolean isDecreasing = false;
-
- public SetHandToAngle(double speed, double targetPosition) {
- requires(Robot.defenseArm);
-
- this.speed = speed;
- this.targetPosition = targetPosition;
- }
-
- @Override
- public void initialize() {
- currentPosition = Robot.defenseArm.getHandPotAngle();
-
- if (currentPosition > targetPosition) {
- Robot.defenseArm.setArmSpeed(-speed);
- isDecreasing = true;
- } else {
- Robot.defenseArm.setArmSpeed(speed);
- isDecreasing = false;
- }
- }
-
- @Override
- public void execute() {
-
- }
-
- @Override
- public boolean isFinished() {
- currentPosition = Robot.defenseArm.getHandPotAngle();
-
- if (isDecreasing == true) {
- return (currentPosition <= targetPosition + THRESHOLD);
- } else {
- return (currentPosition >= targetPosition - THRESHOLD);
- }
- }
-
- @Override
- public void end() {
- Robot.defenseArm.setArmSpeed(0);
- }
-
- @Override
- protected void interrupted() {
- end();
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class SetShooterSpeed extends Command {
- double speed = 0.0;
-
- public SetShooterSpeed(double speed) {
- this.speed = speed;
- }
-
- @Override
- protected void initialize() {
- Robot.shooter.setSpeed(speed);
- }
-
- @Override
- protected void execute() {
-
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
-
- }
-
- @Override
- protected void interrupted() {
-
- }
-
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class Shoot extends Command {
-
- public Shoot() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class Stop extends Command {
-
- public Stop() {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class TurnForAngle extends Command {
-
- public TurnForAngle(double degrees) {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-public class TurnForTime extends Command {
-
- public TurnForTime(double seconds) {
- }
-
- @Override
- protected void initialize() {
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return false;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class AimAndAlign extends Command {
+
+ public AimAndAlign() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import org.usfirst.frc.team3501.robot.Constants.Defense;
+import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+/**
+ * The default autonomous strategy involves passing the defense that is in front
+ * of it, aiming the robot/ shooter towards the goal, and shooting.
+ */
+
+public class DefaultAutonStrategy extends CommandGroup {
+
+ public DefaultAutonStrategy(int position, Defense defense) {
+
+ switch (defense) {
+
+ case PORTCULLIS:
+
+ addSequential(new LiftPortcullis());
+
+ case SALLY_PORT:
+
+ addSequential(new PassSallyPort());
+
+ case ROUGH_TERRAIN:
+
+ addSequential(new PassRoughTerrain());
+
+ case LOW_BAR:
+
+ addSequential(new PassLowBar());
+
+ case CHEVAL_DE_FRISE:
+
+ addSequential(new PassChevalDeFrise());
+
+ case DRAWBRIDGE:
+
+ addSequential(new PassDrawBridge());
+
+ case MOAT:
+
+ addSequential(new PassMoat());
+
+ case ROCK_WALL:
+
+ addSequential(new PassRockWall());
+
+ case RAMPART:
+
+ addSequential(new PassRampart());
+
+ default:
+ break;
+ }
+
+ addSequential(new AimAndAlign());
+ addSequential(new Shoot());
+
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will move the robot forward while lifting the defense arm up.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the portcullis
+ *
+ * This command has to drive forward at the same time because that's how the
+ * robot opens the portcullis
+ *
+ * post-condition: the robot has passed the portcullis and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+
+public class LiftPortcullis extends Command {
+
+ public LiftPortcullis() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class LiftRobot extends Command {
+
+ public LiftRobot() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will move the intake arm downwards using a motor to lower the
+ * cheval de frise and drive over it.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the cheval de frise
+ *
+ * post-condition: the robot has passed the cheval de frise and is in the next
+ * zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassChevalDeFrise extends Command {
+
+ public PassChevalDeFrise() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will lower the draw bridge and go through it
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the draw bridge
+ *
+ * post-condition: the robot has passed the draw bridge and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassDrawBridge extends Command {
+
+ public PassDrawBridge() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the low bar.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the low bar
+ *
+ * post-condition: the robot has passed the low bar and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassLowBar extends Command {
+
+ public PassLowBar() {
+
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the moat.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the moat
+ *
+ * post-condition: the robot has passed the moat and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassMoat extends Command {
+
+ public PassMoat() {
+
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the rampart.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the rampart
+ *
+ * post-condition: the robot has passed the rampart and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassRampart extends Command {
+
+ public PassRampart() {
+
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the rock wall.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the rock wall
+ *
+ * post-condition: the robot has passed the rock wall and is in the next zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassRockWall extends Command {
+
+ public PassRockWall() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will drive the robot through the rough terrain.
+ *
+ * pre-condition: robot is flush against the ramp of the outerworks in front of
+ * the rough terrain
+ *
+ * post-condition: the robot has passed the rough terrain and is in the next
+ * zone
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class PassRoughTerrain extends Command {
+
+ public PassRoughTerrain() {
+
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.auton;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class PassSallyPort extends Command {
+ /***
+ * This command will only open the sally port pass through it. It will do this
+ * by hooking onto the port and driving backwards while rotating then driving
+ * backwards through the sally port.
+ *
+ * pre-condition: robot is in the neutral zone, flush against the ramp of the
+ * outerworks in front of the portcullis
+ *
+ * post-condition: the robot has passed the sally port and is in a courtyard
+ *
+ * note: to go from the courtyard to neutral zone, the driver just has to
+ * drive through the port
+ *
+ * @author Meryem and Avi
+ *
+ */
+
+ public PassSallyPort() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.defensearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command is intended to be run from OI using button.whileHeld(...).
+ * It lowers the defenseArm continually while the button is being held down.
+ *
+ * @author shaina
+ *
+ */
+public class LowerDefenseArmContinuous extends Command {
+
+ private double speed;
+
+ public LowerDefenseArmContinuous(double speed) {
+ requires(Robot.defenseArm);
+ this.speed = -speed;
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.defenseArm.setArmSpeed(speed);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ Robot.defenseArm.setArmSpeed(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.defensearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command is intended to be run from OI using button.whileHeld(...).
+ * It lowers the defenseWrist continually while the button is being held down.
+ *
+ * @author shaina
+ *
+ */
+public class LowerDefenseWristContinuous extends Command {
+
+ private double speed;
+
+ public LowerDefenseWristContinuous(double speed) {
+ requires(Robot.defenseArm);
+ this.speed = -speed;
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.defenseArm.setHandSpeed(speed);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ Robot.defenseArm.setHandSpeed(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.defensearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command is intended to be run from OI using button.whileHeld(...).
+ * It raises the defenseArm continually while the button is being held down.
+ *
+ * @author shaina
+ */
+public class RaiseDefenseArmContinuous extends Command {
+
+ private double speed;
+
+ public RaiseDefenseArmContinuous(double speed) {
+ requires(Robot.defenseArm);
+ this.speed = speed;
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.defenseArm.setArmSpeed(speed);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ Robot.defenseArm.setArmSpeed(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.defensearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command is intended to be run from OI using button.whileHeld(...).
+ * It raises the defenseWrist continually while the button is being held down.
+ *
+ * @author shaina
+ *
+ */
+public class RaiseDefenseWristContinuous extends Command {
+
+ private double speed;
+
+ public RaiseDefenseWristContinuous(double speed) {
+ requires(Robot.defenseArm);
+ this.speed = speed;
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.defenseArm.setHandSpeed(speed);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ Robot.defenseArm.setHandSpeed(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.defensearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+/***
+ * This command group simultaneously move arm and hand to retracted position.
+ *
+ * @author shaina
+ *
+ */
+public class RetractDefenseArm extends CommandGroup {
+ static final double ARM_FULLY_RETRACTED_ANGLE = 0; // change value once tested
+ static final double HAND_FULLY_RETRACTED_ANGLE = 0; // change value once
+ // tested
+
+ public RetractDefenseArm(double speed) {
+ requires(Robot.defenseArm);
+
+ addParallel(new SetArmToAngle(speed, ARM_FULLY_RETRACTED_ANGLE));
+ addParallel(new SetHandToAngle(speed, HAND_FULLY_RETRACTED_ANGLE));
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.defensearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command moves the defense arm to a input angle position.
+ * Requires input of a targetPosition and a speed.
+ *
+ * @author shaina
+ *
+ */
+public class SetArmToAngle extends Command {
+ private static final double THRESHOLD = 0.1;
+ private double speed;
+ private double targetPosition;
+ private double currentPosition;
+ private boolean isDecreasing = false;
+
+ public SetArmToAngle(double speed, double targetPosition) {
+ requires(Robot.defenseArm);
+
+ this.speed = speed;
+ this.targetPosition = targetPosition;
+ }
+
+ @Override
+ public void initialize() {
+ currentPosition = Robot.defenseArm.getArmPotAngle();
+
+ if (currentPosition > targetPosition) {
+ Robot.defenseArm.setArmSpeed(-speed);
+ isDecreasing = true;
+ } else {
+ Robot.defenseArm.setArmSpeed(speed);
+ isDecreasing = false;
+ }
+ }
+
+ @Override
+ public void execute() {
+
+ }
+
+ @Override
+ public boolean isFinished() {
+ currentPosition = Robot.defenseArm.getArmPotAngle();
+
+ if (isDecreasing == true) {
+ return (currentPosition <= targetPosition + THRESHOLD);
+ } else {
+ return (currentPosition >= targetPosition - THRESHOLD);
+ }
+ }
+
+ @Override
+ public void end() {
+ Robot.defenseArm.setArmSpeed(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.defensearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command moves the defense arm to a input angle position.
+ * Requires input of a targetPosition and a speed.
+ *
+ * @author shaina
+ *
+ */
+public class SetHandToAngle extends Command {
+ private static final double THRESHOLD = 0.1;
+ private double speed;
+ private double targetPosition;
+ private double currentPosition;
+ private boolean isDecreasing = false;
+
+ public SetHandToAngle(double speed, double targetPosition) {
+ requires(Robot.defenseArm);
+
+ this.speed = speed;
+ this.targetPosition = targetPosition;
+ }
+
+ @Override
+ public void initialize() {
+ currentPosition = Robot.defenseArm.getHandPotAngle();
+
+ if (currentPosition > targetPosition) {
+ Robot.defenseArm.setArmSpeed(-speed);
+ isDecreasing = true;
+ } else {
+ Robot.defenseArm.setArmSpeed(speed);
+ isDecreasing = false;
+ }
+ }
+
+ @Override
+ public void execute() {
+
+ }
+
+ @Override
+ public boolean isFinished() {
+ currentPosition = Robot.defenseArm.getHandPotAngle();
+
+ if (isDecreasing == true) {
+ return (currentPosition <= targetPosition + THRESHOLD);
+ } else {
+ return (currentPosition >= targetPosition - THRESHOLD);
+ }
+ }
+
+ @Override
+ public void end() {
+ Robot.defenseArm.setArmSpeed(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.driving;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will move the robot at the specified speed for the specified
+ * distance.
+ *
+ * post-condition: has driven for the distance and speed specified
+ *
+ * @author Meryem and Avi
+ *
+ */
+public class DriveForDistance extends Command {
+
+ public DriveForDistance(double distance, double speed) {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.driving;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class Stop extends Command {
+
+ public Stop() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.driving;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class TurnForAngle extends Command {
+
+ public TurnForAngle(double degrees) {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.driving;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class TurnForTime extends Command {
+
+ public TurnForTime(double seconds) {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will continually roll the rollers of the intake arm in the
+ * outwards direction and stop the rollers once the command is canceled.
+ *
+ * pre-condition: This command must be called by a button with the method
+ * .whileHeld() in OI
+ *
+ * @author Lauren and Niyati
+ *
+ */
+
+public class BallRollerExpelContinuous extends Command {
+
+ public BallRollerExpelContinuous() {
+ requires(Robot.intakeArm);
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.intakeArm.outputBall();
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ Robot.intakeArm.stopRollers();
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will continually roll the rollers of the intake arm in the
+ * inwards direction and stop the rollers once the command is canceled.
+ *
+ * pre-condition: This command must be called by a button with the method
+ * .whileHeld() in OI
+ *
+ * @author Lauren and Niyati
+ *
+ */
+
+public class BallRollerIntakeContinuous extends Command {
+
+ public BallRollerIntakeContinuous() {
+ requires(Robot.intakeArm);
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.intakeArm.intakeBall();
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ Robot.intakeArm.stopRollers();
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will expel a boulder from the robot, if it is even present to
+ * begin with.
+ *
+ * pre-condition: Intake arm is at correct height and a boulder is present
+ * inside the robot.
+ *
+ * post-condition: A boulder is expelled from inside the robot to the field
+ * outside of the robot.
+ *
+ * @author Lauren and Niyati
+ *
+ */
+
+public class ExpelBall extends Command {
+ private final int TIMEOUT_AMOUNT = 5;
+
+ public ExpelBall() {
+ requires(Robot.intakeArm);
+ }
+
+ @Override
+ protected void initialize() {
+ this.setTimeout(TIMEOUT_AMOUNT);
+ if (Robot.photogate.isBallPresent())
+ Robot.intakeArm.outputBall();
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return (this.isTimedOut() || !Robot.photogate.isBallPresent());
+ }
+
+ @Override
+ protected void end() {
+ Robot.intakeArm.stopRollers();
+ }
+
+ @Override
+ protected void interrupted() {
+
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/***
+ * This command will take a boulder into the robot if there is not a boulder
+ * present inside already.
+ *
+ * pre-condition: Intake arm must be at correct height and a boulder is not
+ * present inside the robot.
+ *
+ * post-condition: A boulder is taken in from the field outside of the robot
+ * into the robot.
+ *
+ * @author Lauren and Niyati
+ *
+ */
+
+public class IntakeBall extends Command {
+ private final int TIMEOUT_AMOUNT = 5;
+
+ public IntakeBall() {
+ requires(Robot.intakeArm);
+ }
+
+ @Override
+ protected void initialize() {
+ this.setTimeout(TIMEOUT_AMOUNT);
+ if (!Robot.photogate.isBallPresent())
+ Robot.intakeArm.intakeBall();
+
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return (this.isTimedOut() || Robot.photogate.isBallPresent());
+ }
+
+ @Override
+ protected void end() {
+ Robot.intakeArm.stopRollers();
+
+ }
+
+ @Override
+ protected void interrupted() {
+
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class MoveIntakeArmToAngle extends Command {
+ private double currentAngle;
+ private double targetAngle;
+ private double targetSpeed;
+ private double SENSITIVITY_THRESHOLD = 0.1;
+ private boolean isDecreasing = false;
+
+ public MoveIntakeArmToAngle(double angle, double speed) {
+ requires(Robot.intakeArm);
+ targetAngle = angle;
+ targetSpeed = speed;
+
+ }
+
+ @Override
+ protected void initialize() {
+ currentAngle = Robot.intakeArm.getArmAngle();
+ double difference = targetAngle - currentAngle;
+ if (difference > 0) {
+ Robot.intakeArm.setArmSpeed(targetSpeed);
+ isDecreasing = true;
+ } else {
+ Robot.intakeArm.setArmSpeed(-targetSpeed);
+ isDecreasing = false;
+ }
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ currentAngle = Robot.intakeArm.getArmAngle();
+
+ if (isDecreasing == true) {
+ return (currentAngle <= targetAngle + SENSITIVITY_THRESHOLD);
+ } else {
+ return (currentAngle >= targetAngle + SENSITIVITY_THRESHOLD);
+ }
+ }
+
+ @Override
+ protected void end() {
+ Robot.intakeArm.stop();
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+public class MoveIntakeArmToBallIntakeHeight {
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.intakearm;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class MoveIntakeArmUp extends Command {
+
+ public MoveIntakeArmUp() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
+++ /dev/null
-package org.usfirst.frc.team3501.robot.commands;
-
-import org.usfirst.frc.team3501.robot.Robot;
-
-import edu.wpi.first.wpilibj.command.Command;
-
-/**
- *
- */
-public class runShooter extends Command {
-
- public runShooter() {
-
- }
-
- @Override
- protected void initialize() {
- Robot.shooter.setSpeed(0.5);
- }
-
- @Override
- protected void execute() {
- }
-
- @Override
- protected boolean isFinished() {
- return true;
- }
-
- @Override
- protected void end() {
- }
-
- @Override
- protected void interrupted() {
- }
-}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.scaler;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class ClampBar extends Command {
+ private double secondsToClamp = 2.0; // seconds for the winch to run in order
+ // for it to clamp(requires testing)
+ private double winchSpeed = 0.5; // requires testing
+
+ public ClampBar() {
+ }
+
+ @Override
+ protected void initialize() {
+ setTimeout(secondsToClamp);
+ Robot.scaler.runWinch(winchSpeed);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return isTimedOut();
+ }
+
+ @Override
+ protected void end() {
+ Robot.scaler.runWinch(0);
+ }
+
+ @Override
+ protected void interrupted() {
+ end();
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.scaler;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class ExtendLift extends Command {
+
+ public ExtendLift() {
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.scaler.liftScissorLift();
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.scaler;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class RetractLift extends Command {
+
+ public RetractLift() {
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.scaler.lowerScissorLift();
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.shooter;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class ChangeShooterSpeed extends Command {
+ double change = 0;
+
+ public ChangeShooterSpeed(double change) {
+ this.change = change;
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.shooter.changeSpeed(change);
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.shooter;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class SetShooterSpeed extends Command {
+ double speed = 0.0;
+
+ public SetShooterSpeed(double speed) {
+ this.speed = speed;
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.shooter.setSpeed(speed);
+ }
+
+ @Override
+ protected void execute() {
+
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+
+ }
+
+ @Override
+ protected void interrupted() {
+
+ }
+
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.shooter;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class Shoot extends Command {
+
+ public Shoot() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}
--- /dev/null
+package org.usfirst.frc.team3501.robot.commands.shooter;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ *
+ */
+public class runShooter extends Command {
+
+ public runShooter() {
+
+ }
+
+ @Override
+ protected void initialize() {
+ Robot.shooter.setSpeed(0.5);
+ }
+
+ @Override
+ protected void execute() {
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}