From 53d61b3e2d15d705cf14483a04aec80cdfb184e3 Mon Sep 17 00:00:00 2001 From: Meryem Esa Date: Thu, 28 Jan 2016 20:09:16 -0800 Subject: [PATCH] change location of Defense enum from Robot.java to Constants.java --- .../usfirst/frc/team3501/robot/Constants.java | 4 +++ src/org/usfirst/frc/team3501/robot/Robot.java | 5 +-- .../robot/commands/DefaultAutonStrategy.java | 34 +++++++++---------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index c01441f3..71c4a9a7 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -53,4 +53,8 @@ public class Constants { public static enum Direction { LEFT, RIGHT, DOWN, UP, FORWARD, BACKWARD; } + + enum Defense { + PORTCULLIS, SALLY_PORT, ROUGH_TERRAIN, LOW_BAR, CHEVAL_DE_FRISE, DRAWBRIDGE, MOAT, ROCK_WALL + } } diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index d2298119..fbed8a86 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,5 +1,6 @@ package org.usfirst.frc.team3501.robot; +import org.usfirst.frc.team3501.robot.Constants.Defense; import org.usfirst.frc.team3501.robot.Constants.DriveTrain; import org.usfirst.frc.team3501.robot.subsystems.Shooter; @@ -13,10 +14,6 @@ public class Robot extends IterativeRobot { public static DriveTrain driveTrain; public static Shooter shooter; - enum Defense { - PORTCULLIS, SALLY_PORT, ROUGH_TERRAIN, LOW_BAR, CHEVAL_DE_FRISE, DRAWBRIDGE, MOAT, ROCK_WALL - }; - // Sendable Choosers send a drop down menu to the Smart Dashboard. SendableChooser positionOneDefense; SendableChooser positionTwoDefense; diff --git a/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java b/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java index fbf2d22c..5eaab457 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java +++ b/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java @@ -3,26 +3,26 @@ package org.usfirst.frc.team3501.robot.commands; 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() { - // 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 DefaultAutonStrategy(int position, int defense) { + /* + * pass defense drive forward do what has to be done to pass the defense + * drive forward aim face tower aim shooter toward goal shoot + */ - // 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. + // based on defense pass the defense + switch (defense) { + case 1: + case 2: + case 3: + case 4: + case 5: } + + } + } -- 2.30.2