From 86e1c4ccf81d555213e6cac80d488a32e90a1cc8 Mon Sep 17 00:00:00 2001 From: Meryem Esa Date: Sat, 30 Jan 2016 12:34:02 -0800 Subject: [PATCH] change OpenSallyPort to PassSallyPort and add pre and post condition comments to it --- .../robot/commands/DefaultAutonStrategy.java | 4 +- .../robot/commands/OpenSallyPort.java | 30 ------------ .../robot/commands/PassSallyPort.java | 46 +++++++++++++++++++ 3 files changed, 47 insertions(+), 33 deletions(-) delete mode 100755 src/org/usfirst/frc/team3501/robot/commands/OpenSallyPort.java create mode 100755 src/org/usfirst/frc/team3501/robot/commands/PassSallyPort.java diff --git a/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java b/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java index 04d12235..546d5e69 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java +++ b/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java @@ -97,9 +97,7 @@ public class DefaultAutonStrategy extends CommandGroup { case SALLY_PORT: - addSequential( - new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2, - DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2)); + addSequential(new PassSallyPort()); case ROUGH_TERRAIN: diff --git a/src/org/usfirst/frc/team3501/robot/commands/OpenSallyPort.java b/src/org/usfirst/frc/team3501/robot/commands/OpenSallyPort.java deleted file mode 100755 index b3a1b3e8..00000000 --- a/src/org/usfirst/frc/team3501/robot/commands/OpenSallyPort.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.usfirst.frc.team3501.robot.commands; - -import edu.wpi.first.wpilibj.command.Command; - -public class OpenSallyPort extends Command { - - public OpenSallyPort() { - } - - @Override - protected void initialize() { - } - - @Override - protected void execute() { - } - - @Override - protected boolean isFinished() { - return false; - } - - @Override - protected void end() { - } - - @Override - protected void interrupted() { - } -} diff --git a/src/org/usfirst/frc/team3501/robot/commands/PassSallyPort.java b/src/org/usfirst/frc/team3501/robot/commands/PassSallyPort.java new file mode 100755 index 00000000..b2734acf --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/PassSallyPort.java @@ -0,0 +1,46 @@ +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() { + } +} -- 2.30.2