X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FShooter.java;h=98131673509e3089bb5bf861062225cfe807423d;hb=1696ae2852279093cffd17ce49f50b2be740ed66;hp=3b91bfe03c451333cdcdd8ef2035071b71a6af3a;hpb=a2b9c4a91d47d4eb29c8ff8c2ef7899c158b8dcb;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index 3b91bfe0..98131673 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -1,8 +1,6 @@ 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.CANTalon; import edu.wpi.first.wpilibj.CounterBase.EncodingType; @@ -11,10 +9,11 @@ import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.command.Subsystem; /*** - * The Shooter consists of a platform and wheel, each controlled by separate - * motors. The piston controlling the platform pushes the ball onto the wheel. - * The wheel is controlled by a motor, which is running before the ball is - * pushed onto the wheel. The spinning wheel propels the ball. + * The Shooter consists of a platform and wheel, each controlled by + * separate motors. The piston controlling the platform pushes the ball onto the + * wheel. The wheel is controlled by a motor, which is running before the ball + * is pushed + * onto the wheel. The spinning wheel propels the ball. * * @author superuser * @@ -52,15 +51,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 +75,7 @@ public class Shooter extends Subsystem { } // Punch Commands - public void punch() { + public void extendPunch() { punch.set(Constants.Shooter.punch); }