X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FShooter.java;h=a9e8d6e8463f8ad341d96e7c1511acf1a45bdb42;hb=29697d89931827a9f5cbdb50c6bee3513ef4ebba;hp=22239e49ee945c5bd0a9a163d9a9da7160233db2;hpb=3b2038bb486d94a21613223c1b00b59fc29032eb;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 22239e49..a9e8d6e8 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -2,9 +2,7 @@ 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; @@ -29,12 +27,10 @@ public class Shooter extends Subsystem { private Lidar lidar; public Shooter() { - leftLidar = new AnalogPotentiometer(0); - rightLidar = new AnalogPotentiometer(0); shooter = new CANTalon(Constants.Shooter.PORT); angleAdjuster = new CANTalon(Constants.Shooter.ANGLE_ADJUSTER_PORT); - punch = new DoubleSolenoid(Constants.Shooter.PUNCH_FORWARD_PORT, - Constants.Shooter.PUNCH_REVERSE_PORT); + punch = new DoubleSolenoid(Constants.Shooter.PUNCH_FORWARD, + Constants.Shooter.PUNCH_REVERSE); encoder = new Encoder(Constants.Shooter.ENCODER_PORT_A, Constants.Shooter.ENCODER_PORT_B, false, EncodingType.k4X); @@ -69,6 +65,17 @@ public class Shooter extends Subsystem { return encoder.getRate(); } + /* + * We are going to map a lidar distance to a shooter speed that will be set to + * the shooter. This function does not yet exist so we will just use y=x but + * when testing commences we shall create the function + */ + public double getShooterSpeed() { + double distanceToGoal = lidar.getDistance(); + double shooterSpeed = distanceToGoal; // Function to be determined + return shooterSpeed; + } + // Use negative # for decrement. Positive for increment. public void changeSpeed(double change) { @@ -88,13 +95,4 @@ public class Shooter extends Subsystem { @Override protected void initDefaultCommand() { } - - public double getLeftDistanceToTower() { - // TODO: find the method that actually gets distance - return leftLidar.get(); - } - - public double getRightDistanceToTower() { - return rightLidar.get(); - } }