change package names
authorKevin Zhang <kevin.zhang.13499@gmail.com>
Sun, 15 Nov 2015 00:39:20 +0000 (16:39 -0800)
committerKevin Zhang <kevin.zhang.13499@gmail.com>
Sun, 15 Nov 2015 00:39:20 +0000 (16:39 -0800)
18 files changed:
src/org/usfirst/frc3501/RiceCatRobot/OI.java [deleted file]
src/org/usfirst/frc3501/RiceCatRobot/Robot.java [deleted file]
src/org/usfirst/frc3501/RiceCatRobot/RobotMap.java [deleted file]
src/org/usfirst/frc3501/RiceCatRobot/auton/MoveForwardFiveFt.java [new file with mode: 0644]
src/org/usfirst/frc3501/RiceCatRobot/commands/CloseClaw.java
src/org/usfirst/frc3501/RiceCatRobot/commands/DriveFor.java
src/org/usfirst/frc3501/RiceCatRobot/commands/MoveArmFor.java
src/org/usfirst/frc3501/RiceCatRobot/commands/MoveDistance.java
src/org/usfirst/frc3501/RiceCatRobot/commands/OpenClaw.java
src/org/usfirst/frc3501/RiceCatRobot/commands/ToggleClaw.java
src/org/usfirst/frc3501/RiceCatRobot/commands/ToggleCompressor.java
src/org/usfirst/frc3501/RiceCatRobot/commands/TurnFor.java
src/org/usfirst/frc3501/RiceCatRobot/robot/OI.java [new file with mode: 0644]
src/org/usfirst/frc3501/RiceCatRobot/robot/Robot.java [new file with mode: 0644]
src/org/usfirst/frc3501/RiceCatRobot/robot/RobotMap.java [new file with mode: 0644]
src/org/usfirst/frc3501/RiceCatRobot/subsystems/Arm.java
src/org/usfirst/frc3501/RiceCatRobot/subsystems/Claw.java
src/org/usfirst/frc3501/RiceCatRobot/subsystems/DriveTrain.java

diff --git a/src/org/usfirst/frc3501/RiceCatRobot/OI.java b/src/org/usfirst/frc3501/RiceCatRobot/OI.java
deleted file mode 100644 (file)
index bb7fbed..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.usfirst.frc3501.RiceCatRobot;
-
-import org.usfirst.frc3501.RiceCatRobot.commands.ToggleClaw;
-import org.usfirst.frc3501.RiceCatRobot.commands.ToggleCompressor;
-
-import edu.wpi.first.wpilibj.Joystick;
-import edu.wpi.first.wpilibj.buttons.JoystickButton;
-
-public class OI {
-    public static Joystick leftJoystick;
-    public static Joystick rightJoystick;
-    public static JoystickButton trigger;
-    public static JoystickButton toggleCompressor;
-    public static JoystickButton toggleClaw;
-
-    public OI() {
-        System.out.println("OI is open");
-        leftJoystick = new Joystick(RobotMap.LEFT_STICK_PORT);
-        rightJoystick = new Joystick(RobotMap.RIGHT_STICK_PORT);
-
-        trigger = new JoystickButton(rightJoystick, RobotMap.TRIGGER_PORT);
-
-        toggleClaw = new JoystickButton(rightJoystick, RobotMap.TOGGLE_PORT);
-        toggleClaw.whenPressed(new ToggleClaw());
-
-        toggleCompressor = new JoystickButton(rightJoystick,
-                RobotMap.TOGGLE_COMPRESSOR_PORT);
-        toggleCompressor.whenPressed(new ToggleCompressor());
-
-    }
-}
diff --git a/src/org/usfirst/frc3501/RiceCatRobot/Robot.java b/src/org/usfirst/frc3501/RiceCatRobot/Robot.java
deleted file mode 100644 (file)
index 7e9fabe..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.usfirst.frc3501.RiceCatRobot;
-
-import org.usfirst.frc3501.RiceCatRobot.subsystems.Arm;
-import org.usfirst.frc3501.RiceCatRobot.subsystems.Claw;
-import org.usfirst.frc3501.RiceCatRobot.subsystems.DriveTrain;
-
-import edu.wpi.first.wpilibj.Compressor;
-import edu.wpi.first.wpilibj.IterativeRobot;
-import edu.wpi.first.wpilibj.Timer;
-import edu.wpi.first.wpilibj.command.Scheduler;
-
-public class Robot extends IterativeRobot {
-    static Timer timer;
-    public static OI oi;
-    public static DriveTrain driveTrain;
-    public static Arm arm;
-    public static Claw claw;
-    public static Compressor compressor;
-
-    public void robotInit() {
-        RobotMap.init();
-        driveTrain = new DriveTrain();
-        arm = new Arm();
-        claw = new Claw();
-        oi = new OI();
-        compressor = new Compressor(RobotMap.COMPRESSOR_PORT);
-    }
-
-    public void autonomousInit() {
-    }
-
-    public void autonomousPeriodic() {
-        Scheduler.getInstance().run();
-    }
-
-    public void teleopInit() {
-        System.out.println("running teleopInit");
-    }
-
-    public void teleopPeriodic() {
-        Scheduler.getInstance().run();
-
-    }
-
-    public void operate() {
-        driveTrain.arcadeDrive(OI.rightJoystick.getY(),
-                OI.rightJoystick.getTwist());
-        claw.doTriggerAction();
-        if (OI.leftJoystick.getRawButton(8)) {
-            arm.setArmSpeeds(0.3);
-        } else if (OI.leftJoystick.getRawButton(9)) {
-            arm.setArmSpeeds(-0.3);
-        } else if (OI.leftJoystick.getRawButton(6)) {
-            arm.setLeft(0.3);
-        } else if (OI.leftJoystick.getRawButton(7)) {
-            arm.setLeft(-0.3);
-        } else if (OI.leftJoystick.getRawButton(11)) {
-            arm.setRight(-0.3);
-        } else if (OI.leftJoystick.getRawButton(10)) {
-            arm.setRight(0.3);
-        }
-        if (Math.abs(OI.leftJoystick.getY()) < 0.05) {
-            arm.setArmSpeeds(0);
-
-        } else {
-            arm.fineTuneControl(OI.leftJoystick.getY());
-        }
-    }
-}
diff --git a/src/org/usfirst/frc3501/RiceCatRobot/RobotMap.java b/src/org/usfirst/frc3501/RiceCatRobot/RobotMap.java
deleted file mode 100644 (file)
index 4bf6e4a..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.usfirst.frc3501.RiceCatRobot;
-
-import edu.wpi.first.wpilibj.DoubleSolenoid;
-import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
-
-/**
- * The RobotMap is a mapping from the ports sensors and actuators are wired into
- * to a variable name. This provides flexibility changing wiring, makes checking
- * the wiring easier and significantly reduces the number of magic numbers
- * floating around.
- */
-public class RobotMap {
-    public final static int LEFT_STICK_PORT = 0, RIGHT_STICK_PORT = 1;
-    public final static int TRIGGER_PORT = 1, TOGGLE_PORT = 2,
-            TOGGLE_COMPRESSOR_PORT = 11;
-    public static final int DRIVE_FRONT_LEFT = 4, DRIVE_FRONT_RIGHT = 5,
-            DRIVE_REAR_LEFT = 3, DRIVE_REAR_RIGHT = 6;
-    public static final int DRIVE_LEFT_A = 3, DRIVE_LEFT_B = 4,
-            DRIVE_RIGHT_A = 2, DRIVE_RIGHT_B = 1;
-
-    public static final double DISTANCE_PER_PULSE = ((3.66 / 5.14) * 6 * Math.PI) / 256;
-
-    public static final int ARM_LEFT = 2, ARM_RIGHT = 7;
-    public static final double ARM_HIGH_SPEED = 0.5, ARM_LOW_SPEED = 0.5;
-
-    // Claw
-    public static final int SOLENOID_FORWARD = 0, SOLENOID_REVERSE = 1,
-            MODULE_NUMBER = 0;
-    public final static Value open = DoubleSolenoid.Value.kForward,
-            close = DoubleSolenoid.Value.kReverse;
-    public static double DRIVE_DEAD_ZONE = 0.25;
-    // Compressor
-    public static final int COMPRESSOR_PORT = 0;
-
-    public static void init() {
-    }
-
-    public static enum Direction {
-        LEFT, RIGHT, DOWN, UP, FORWARD, BACKWARD;
-    }
-}
diff --git a/src/org/usfirst/frc3501/RiceCatRobot/auton/MoveForwardFiveFt.java b/src/org/usfirst/frc3501/RiceCatRobot/auton/MoveForwardFiveFt.java
new file mode 100644 (file)
index 0000000..3532d34
--- /dev/null
@@ -0,0 +1,17 @@
+package org.usfirst.frc3501.RiceCatRobot.auton;
+
+import org.usfirst.frc3501.RiceCatRobot.commands.MoveDistance;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.CommandGroup;
+
+public class MoveForwardFiveFt extends CommandGroup{
+       
+       public MoveForwardFiveFt (){
+               requires(Robot.driveTrain);
+               
+               addSequential(new MoveDistance(60, 0, 0.5));
+       }
+       
+       
+}
index eb0eea207bcdad0d8c11cc7fb8b779cde8f1d790..66cf89bad0600d260c4a3be20b3c231458f53b9f 100644 (file)
@@ -2,7 +2,7 @@ package org.usfirst.frc3501.RiceCatRobot.commands;
 
 import edu.wpi.first.wpilibj.command.Command;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
 
 /**
  *
index 6e61e616bd0bf16d4b09942224edef3c73908be4..bbc3dfa95052b13dbedc740dca188980a7c4a6cf 100644 (file)
@@ -1,7 +1,7 @@
 package org.usfirst.frc3501.RiceCatRobot.commands;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
-import org.usfirst.frc3501.RiceCatRobot.RobotMap.Direction;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.RobotMap.Direction;
 
 import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;
index c082b2f5ae56cb285ec04f18e74b5f21f4beab7b..0600b1dcf73b3841ca1f8c93952732d6970bbde3 100644 (file)
@@ -1,8 +1,8 @@
 package org.usfirst.frc3501.RiceCatRobot.commands;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
-import org.usfirst.frc3501.RiceCatRobot.RobotMap;
-import org.usfirst.frc3501.RiceCatRobot.RobotMap.Direction;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.RobotMap;
+import org.usfirst.frc3501.RiceCatRobot.robot.RobotMap.Direction;
 
 import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;
index 2243bc7a88e1912eebcbfb646033f4a341956988..6608c33904679f63abc05eb76ecb47b8861261d3 100644 (file)
@@ -1,6 +1,6 @@
 package org.usfirst.frc3501.RiceCatRobot.commands;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
 import org.usfirst.frc3501.RiceCatRobot.subsystems.DriveTrain;
 
 import edu.wpi.first.wpilibj.command.Command;
index bece53bcc91d110519198d792de86dd2a1990feb..320f4d0e9e56cbfc682589be0eec0c413432b84b 100644 (file)
@@ -2,7 +2,7 @@ package org.usfirst.frc3501.RiceCatRobot.commands;
 
 import edu.wpi.first.wpilibj.command.Command;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
 
 /**
  * Opens claw by reversing solenoids.
index f746056e9376d81d1c6f34e1a41f6e486fadb7c1..720ec4197cc264f14eef7385e39c7e56a16cb3b4 100644 (file)
@@ -1,6 +1,6 @@
 package org.usfirst.frc3501.RiceCatRobot.commands;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
 
 import edu.wpi.first.wpilibj.command.Command;
 
index 5f3fad191af25f623bd7a084950422dbdf3f8706..eb413542defce1109b4f129fe79921cb2c3995fc 100644 (file)
@@ -1,6 +1,6 @@
 package org.usfirst.frc3501.RiceCatRobot.commands;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
 
 import edu.wpi.first.wpilibj.command.Command;
 
index 9be37790378ebf54cbb258255eb5412b559929e2..cf716d45ab9e74cc9a28f3e93e10b48ae76b0eaa 100644 (file)
@@ -1,7 +1,7 @@
 package org.usfirst.frc3501.RiceCatRobot.commands;
 
-import org.usfirst.frc3501.RiceCatRobot.Robot;
-import org.usfirst.frc3501.RiceCatRobot.RobotMap.Direction;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.RobotMap.Direction;
 
 import edu.wpi.first.wpilibj.Timer;
 import edu.wpi.first.wpilibj.command.Command;
diff --git a/src/org/usfirst/frc3501/RiceCatRobot/robot/OI.java b/src/org/usfirst/frc3501/RiceCatRobot/robot/OI.java
new file mode 100644 (file)
index 0000000..6bebe54
--- /dev/null
@@ -0,0 +1,31 @@
+package org.usfirst.frc3501.RiceCatRobot.robot;
+
+import org.usfirst.frc3501.RiceCatRobot.commands.ToggleClaw;
+import org.usfirst.frc3501.RiceCatRobot.commands.ToggleCompressor;
+
+import edu.wpi.first.wpilibj.Joystick;
+import edu.wpi.first.wpilibj.buttons.JoystickButton;
+
+public class OI {
+    public static Joystick leftJoystick;
+    public static Joystick rightJoystick;
+    public static JoystickButton trigger;
+    public static JoystickButton toggleCompressor;
+    public static JoystickButton toggleClaw;
+
+    public OI() {
+        System.out.println("OI is open");
+        leftJoystick = new Joystick(RobotMap.LEFT_STICK_PORT);
+        rightJoystick = new Joystick(RobotMap.RIGHT_STICK_PORT);
+
+        trigger = new JoystickButton(rightJoystick, RobotMap.TRIGGER_PORT);
+
+        toggleClaw = new JoystickButton(rightJoystick, RobotMap.TOGGLE_PORT);
+        toggleClaw.whenPressed(new ToggleClaw());
+
+        toggleCompressor = new JoystickButton(rightJoystick,
+                RobotMap.TOGGLE_COMPRESSOR_PORT);
+        toggleCompressor.whenPressed(new ToggleCompressor());
+
+    }
+}
diff --git a/src/org/usfirst/frc3501/RiceCatRobot/robot/Robot.java b/src/org/usfirst/frc3501/RiceCatRobot/robot/Robot.java
new file mode 100644 (file)
index 0000000..1191d0e
--- /dev/null
@@ -0,0 +1,69 @@
+package org.usfirst.frc3501.RiceCatRobot.robot;
+
+import org.usfirst.frc3501.RiceCatRobot.subsystems.Arm;
+import org.usfirst.frc3501.RiceCatRobot.subsystems.Claw;
+import org.usfirst.frc3501.RiceCatRobot.subsystems.DriveTrain;
+
+import edu.wpi.first.wpilibj.Compressor;
+import edu.wpi.first.wpilibj.IterativeRobot;
+import edu.wpi.first.wpilibj.Timer;
+import edu.wpi.first.wpilibj.command.Scheduler;
+
+public class Robot extends IterativeRobot {
+    static Timer timer;
+    public static OI oi;
+    public static DriveTrain driveTrain;
+    public static Arm arm;
+    public static Claw claw;
+    public static Compressor compressor;
+
+    public void robotInit() {
+        RobotMap.init();
+        driveTrain = new DriveTrain();
+        arm = new Arm();
+        claw = new Claw();
+        oi = new OI();
+        compressor = new Compressor(RobotMap.COMPRESSOR_PORT);
+    }
+
+    public void autonomousInit() {
+    }
+
+    public void autonomousPeriodic() {
+        Scheduler.getInstance().run();
+    }
+
+    public void teleopInit() {
+        System.out.println("running teleopInit");
+    }
+
+    public void teleopPeriodic() {
+        Scheduler.getInstance().run();
+
+    }
+
+    public void operate() {
+        driveTrain.arcadeDrive(OI.rightJoystick.getY(),
+                OI.rightJoystick.getTwist());
+        claw.doTriggerAction();
+        if (OI.leftJoystick.getRawButton(8)) {
+            arm.setArmSpeeds(0.3);
+        } else if (OI.leftJoystick.getRawButton(9)) {
+            arm.setArmSpeeds(-0.3);
+        } else if (OI.leftJoystick.getRawButton(6)) {
+            arm.setLeft(0.3);
+        } else if (OI.leftJoystick.getRawButton(7)) {
+            arm.setLeft(-0.3);
+        } else if (OI.leftJoystick.getRawButton(11)) {
+            arm.setRight(-0.3);
+        } else if (OI.leftJoystick.getRawButton(10)) {
+            arm.setRight(0.3);
+        }
+        if (Math.abs(OI.leftJoystick.getY()) < 0.05) {
+            arm.setArmSpeeds(0);
+
+        } else {
+            arm.fineTuneControl(OI.leftJoystick.getY());
+        }
+    }
+}
diff --git a/src/org/usfirst/frc3501/RiceCatRobot/robot/RobotMap.java b/src/org/usfirst/frc3501/RiceCatRobot/robot/RobotMap.java
new file mode 100644 (file)
index 0000000..95604c3
--- /dev/null
@@ -0,0 +1,41 @@
+package org.usfirst.frc3501.RiceCatRobot.robot;
+
+import edu.wpi.first.wpilibj.DoubleSolenoid;
+import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
+
+/**
+ * The RobotMap is a mapping from the ports sensors and actuators are wired into
+ * to a variable name. This provides flexibility changing wiring, makes checking
+ * the wiring easier and significantly reduces the number of magic numbers
+ * floating around.
+ */
+public class RobotMap {
+    public final static int LEFT_STICK_PORT = 0, RIGHT_STICK_PORT = 1;
+    public final static int TRIGGER_PORT = 1, TOGGLE_PORT = 2,
+            TOGGLE_COMPRESSOR_PORT = 11;
+    public static final int DRIVE_FRONT_LEFT = 4, DRIVE_FRONT_RIGHT = 5,
+            DRIVE_REAR_LEFT = 3, DRIVE_REAR_RIGHT = 6;
+    public static final int DRIVE_LEFT_A = 3, DRIVE_LEFT_B = 4,
+            DRIVE_RIGHT_A = 2, DRIVE_RIGHT_B = 1;
+
+    public static final double DISTANCE_PER_PULSE = ((3.66 / 5.14) * 6 * Math.PI) / 256;
+
+    public static final int ARM_LEFT = 2, ARM_RIGHT = 7;
+    public static final double ARM_HIGH_SPEED = 0.5, ARM_LOW_SPEED = 0.5;
+
+    // Claw
+    public static final int SOLENOID_FORWARD = 0, SOLENOID_REVERSE = 1,
+            MODULE_NUMBER = 0;
+    public final static Value open = DoubleSolenoid.Value.kForward,
+            close = DoubleSolenoid.Value.kReverse;
+    public static double DRIVE_DEAD_ZONE = 0.25;
+    // Compressor
+    public static final int COMPRESSOR_PORT = 0;
+
+    public static void init() {
+    }
+
+    public static enum Direction {
+        LEFT, RIGHT, DOWN, UP, FORWARD, BACKWARD;
+    }
+}
index 452c5691b49359564b7d960c7d727c6954d4b7a7..be8cfa8c7ccec0e49c39ce15d97b68cf38cdc4d1 100644 (file)
@@ -1,6 +1,6 @@
 package org.usfirst.frc3501.RiceCatRobot.subsystems;
 
-import org.usfirst.frc3501.RiceCatRobot.RobotMap;
+import org.usfirst.frc3501.RiceCatRobot.robot.RobotMap;
 
 import edu.wpi.first.wpilibj.CANJaguar;
 import edu.wpi.first.wpilibj.command.Subsystem;
index 100eff493ce904261e769310bf0e94581f67a6ee..3738f592332ac0bf89d12c444e6fcc696b77b6c1 100644 (file)
@@ -1,10 +1,10 @@
 package org.usfirst.frc3501.RiceCatRobot.subsystems;
 
-import org.usfirst.frc3501.RiceCatRobot.OI;
-import org.usfirst.frc3501.RiceCatRobot.Robot;
-import org.usfirst.frc3501.RiceCatRobot.RobotMap;
 import org.usfirst.frc3501.RiceCatRobot.commands.CloseClaw;
 import org.usfirst.frc3501.RiceCatRobot.commands.OpenClaw;
+import org.usfirst.frc3501.RiceCatRobot.robot.OI;
+import org.usfirst.frc3501.RiceCatRobot.robot.Robot;
+import org.usfirst.frc3501.RiceCatRobot.robot.RobotMap;
 
 import edu.wpi.first.wpilibj.DoubleSolenoid;
 import edu.wpi.first.wpilibj.command.Subsystem;
index a8716b6ba9f472edf2e0ddd3d2bc3090e8fab7d6..dda70f85b0fc09390cbf931149d4bc066dc3c673 100644 (file)
@@ -1,6 +1,6 @@
 package org.usfirst.frc3501.RiceCatRobot.subsystems;
 
-import org.usfirst.frc3501.RiceCatRobot.RobotMap;
+import org.usfirst.frc3501.RiceCatRobot.robot.RobotMap;
 
 import edu.wpi.first.wpilibj.CANJaguar;
 import edu.wpi.first.wpilibj.Encoder;