get rid of lidar variables and code that conflicted with lidar variables already...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.java
index 3b91bfe03c451333cdcdd8ef2035071b71a6af3a..40a227ce1cb205bd192d4e4731e546e2cda17bfa 100755 (executable)
@@ -1,9 +1,8 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
 import org.usfirst.frc.team3501.robot.Constants;
-import org.usfirst.frc.team3501.robot.Lidar;
-import org.usfirst.frc.team3501.robot.MathLib;
 
+import edu.wpi.first.wpilibj.AnalogPotentiometer;
 import edu.wpi.first.wpilibj.CANTalon;
 import edu.wpi.first.wpilibj.CounterBase.EncodingType;
 import edu.wpi.first.wpilibj.DoubleSolenoid;
@@ -27,6 +26,8 @@ public class Shooter extends Subsystem {
   private Lidar lidar;
 
   public Shooter() {
+    leftLidar = new AnalogPotentiometer(0);
+    rightLidar = new AnalogPotentiometer(0);
     shooter = new CANTalon(Constants.Shooter.PORT);
     hood = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD,
         Constants.Shooter.HOOD_REVERSE);
@@ -52,15 +53,12 @@ public class Shooter extends Subsystem {
   }
 
   public void setSpeed(double speed) {
-    speed = MathLib.constrain(speed, -1, 1);
-    shooter.set(speed);
-  }
-
-  // This getDistance() will return the distance using the lidar from the
-  // desired target during match. This distance is returned in units of
-  // CENTIMETERS.
-  public double getDistance() {
-    return lidar.getDistance();
+    if (speed > 1.0)
+      shooter.set(1.0);
+    else if (speed < -1.0)
+      shooter.set(-1.0);
+    else
+      shooter.set(speed);
   }
 
   public void stop() {
@@ -79,7 +77,7 @@ public class Shooter extends Subsystem {
   }
 
   // Punch Commands
-  public void punch() {
+  public void extendPunch() {
     punch.set(Constants.Shooter.punch);
   }
 
@@ -87,8 +85,8 @@ public class Shooter extends Subsystem {
     punch.set(Constants.Shooter.retract);
   }
 
-  public boolean isHoodOpen() {
-    return hood.get() == Constants.Shooter.open;
+  @Override
+  protected void initDefaultCommand() {
   }
 
   public void openHood() {