* 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 {
- // in feet
- // distance along a platform
- final double DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD = 4.0;
- // number from -1 to 1
- final double SPEED_FOR_PASSING_DEFENSE = 0.5;
+public class DefaultAutonStrategy extends CommandGroup {
public DefaultAutonStrategy(int position, Defense defense) {
case ROUGH_TERRAIN:
- addSequential(
- new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
- DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2));
+ addSequential(new PassRoughTerrain());
case LOW_BAR:
- addSequential(
- new DriveForDistance(DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD + 2,
- SPEED_FOR_PASSING_DEFENSE));
+ addSequential(new PassLowBar());
case CHEVAL_DE_FRISE:
case MOAT:
- addSequential(new DriveForDistance(
- DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+ addSequential(new PassMoat());
case ROCK_WALL:
- addSequential(new DriveForDistance(
- DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+ addSequential(new PassRockWall());
case RAMPART:
- addSequential(new DriveForDistance(
- DIST_BETWEEN_OUTER_WORKS__AND_COURTYARD, SPEED_FOR_PASSING_DEFENSE));
+ addSequential(new PassRampart());
default:
break;
* 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 portcullis
+ * the draw bridge
*
* post-condition: the robot has passed the draw bridge and is in the next zone
*
--- /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() {
+ // Use requires() here to declare subsystem dependencies
+ // eg. requires(chassis);
+ }
+
+ // Called just before this Command runs the first time
+ @Override
+ protected void initialize() {
+ }
+
+ // Called repeatedly when this Command is scheduled to run
+ @Override
+ protected void execute() {
+ }
+
+ // Make this return true when this Command no longer needs to run execute()
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ // Called once after isFinished returns true
+ @Override
+ protected void end() {
+ }
+
+ // Called when another command which requires one or more of the same
+ // subsystems is scheduled to run
+ @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() {
+ // Use requires() here to declare subsystem dependencies
+ // eg. requires(chassis);
+ }
+
+ // Called just before this Command runs the first time
+ @Override
+ protected void initialize() {
+ }
+
+ // Called repeatedly when this Command is scheduled to run
+ @Override
+ protected void execute() {
+ }
+
+ // Make this return true when this Command no longer needs to run execute()
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ // Called once after isFinished returns true
+ @Override
+ protected void end() {
+ }
+
+ // Called when another command which requires one or more of the same
+ // subsystems is scheduled to run
+ @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() {
+ // Use requires() here to declare subsystem dependencies
+ // eg. requires(chassis);
+ }
+
+ // Called just before this Command runs the first time
+ @Override
+ protected void initialize() {
+ }
+
+ // Called repeatedly when this Command is scheduled to run
+ @Override
+ protected void execute() {
+ }
+
+ // Make this return true when this Command no longer needs to run execute()
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ // Called once after isFinished returns true
+ @Override
+ protected void end() {
+ }
+
+ // Called when another command which requires one or more of the same
+ // subsystems is scheduled to run
+ @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() {
+ // Use requires() here to declare subsystem dependencies
+ // eg. requires(chassis);
+ }
+
+ // Called just before this Command runs the first time
+ @Override
+ protected void initialize() {
+ }
+
+ // Called repeatedly when this Command is scheduled to run
+ @Override
+ protected void execute() {
+ }
+
+ // Make this return true when this Command no longer needs to run execute()
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ // Called once after isFinished returns true
+ @Override
+ protected void end() {
+ }
+
+ // Called when another command which requires one or more of the same
+ // subsystems is scheduled to run
+ @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() {
+ // Use requires() here to declare subsystem dependencies
+ // eg. requires(chassis);
+ }
+
+ // Called just before this Command runs the first time
+ @Override
+ protected void initialize() {
+ }
+
+ // Called repeatedly when this Command is scheduled to run
+ @Override
+ protected void execute() {
+ }
+
+ // Make this return true when this Command no longer needs to run execute()
+ @Override
+ protected boolean isFinished() {
+ return false;
+ }
+
+ // Called once after isFinished returns true
+ @Override
+ protected void end() {
+ }
+
+ // Called when another command which requires one or more of the same
+ // subsystems is scheduled to run
+ @Override
+ protected void interrupted() {
+ }
+}