fixed merge conflict in Robot.java
authorniyatisriram <niyatisriram@gmail.com>
Wed, 17 Feb 2016 19:16:21 +0000 (11:16 -0800)
committerniyatisriram <niyatisriram@gmail.com>
Wed, 17 Feb 2016 19:16:21 +0000 (11:16 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/Robot.java
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java

index 7ee2d3b29e2b6e378fc0277d6d785109580794ac..4ad8a4bf0be8bb5ded68e636dd9c2ee2910a2ec2 100644 (file)
@@ -112,8 +112,8 @@ public class Constants {
     public static final int HOOD_FORWARD = 2;
     public static final int HOOD_REVERSE = 3;
 
-    public static final Value open = Value.kForward;
-    public static final Value closed = Value.kReverse;
+    public static final Value open = Value.kReverse;
+    public static final Value closed = Value.kForward;
 
     public static final Port LIDAR_I2C_PORT = I2C.Port.kMXP;
 
index 8fd099fb2999081e999638cb08d2e46b9872297f..80d786762994a72067d56a36d2d4c8ce7d1cb29e 100644 (file)
@@ -1,14 +1,12 @@
 package org.usfirst.frc.team3501.robot;
 
 import org.usfirst.frc.team3501.robot.Constants.Defense;
-import org.usfirst.frc.team3501.robot.sensors.GyroLib;
 import org.usfirst.frc.team3501.robot.subsystems.DefenseArm;
 import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
 import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
 import org.usfirst.frc.team3501.robot.subsystems.Scaler;
 import org.usfirst.frc.team3501.robot.subsystems.Shooter;
 
-import edu.wpi.first.wpilibj.I2C;
 import edu.wpi.first.wpilibj.IterativeRobot;
 import edu.wpi.first.wpilibj.command.Scheduler;
 import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
@@ -29,14 +27,10 @@ public class Robot extends IterativeRobot {
   SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense,
       positionFourDefense, positionFiveDefense;
 
-  // Gyro stuff
-  public GyroLib gyro;
-
   @Override
   public void robotInit() {
     driveTrain = new DriveTrain();
     oi = new OI();
-    gyro = new GyroLib(I2C.Port.kOnboard, false);
 
     shooter = new Shooter();
     scaler = new Scaler();
@@ -135,17 +129,11 @@ public class Robot extends IterativeRobot {
 
   @Override
   public void teleopInit() {
-
-    gyro.start();
-
   }
 
   @Override
   public void teleopPeriodic() {
     Scheduler.getInstance().run();
-
-    System.out.println("Degrees: " + gyro.getRotationZ().getAngle());
-
   }
 
 }
index 60452a0c9080bfe4bf61beb2c129ce0be2b37717..0d9187a441b6a734e4fc0e61ef3d848a7034d16f 100755 (executable)
@@ -22,15 +22,17 @@ import edu.wpi.first.wpilibj.command.Subsystem;
 
 public class Shooter extends Subsystem {
   private CANTalon shooter;
-  private CANTalon angleAdjuster;
-  private DoubleSolenoid hood, punch;
+  private DoubleSolenoid hood1, hood2, punch;
   private Encoder encoder;
   private Lidar lidar;
   private Photogate photogate;
 
   public Shooter() {
     shooter = new CANTalon(Constants.Shooter.PORT);
-    angleAdjuster = new CANTalon(Constants.Shooter.ANGLE_ADJUSTER_PORT);
+    hood1 = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD,
+        Constants.Shooter.HOOD_REVERSE);
+    hood2 = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD,
+        Constants.Shooter.HOOD_REVERSE);
     punch = new DoubleSolenoid(Constants.Shooter.PUNCH_FORWARD,
         Constants.Shooter.PUNCH_REVERSE);
 
@@ -94,6 +96,23 @@ public class Shooter extends Subsystem {
     punch.set(Constants.Shooter.retract);
   }
 
+  public void raiseHood() {
+    hood1.set(Constants.Shooter.open);
+    hood2.set(Constants.Shooter.open);
+  }
+
+  public void lowerHood() {
+    hood1.set(Constants.Shooter.closed);
+    hood2.set(Constants.Shooter.closed);
+  }
+
+  public boolean isHoodDown() {
+    if (hood1.get() == Constants.Shooter.open
+        && hood2.get() == Constants.Shooter.open)
+      return true;
+    return false;
+  }
+
   @Override
   protected void initDefaultCommand() {
   }