X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FShooter.java;h=d91b234192218906cb44e1847f22666af90b913b;hb=984e903a0a4e91563d7b7766a361aaeed15a2b23;hp=4fa8f4e31ab5181f3870b1e5c41a251581f86628;hpb=69a7e144579ac7524bdcfc66fab0c3c7ec50296e;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 4fa8f4e3..d91b2341 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -1,6 +1,7 @@ package org.usfirst.frc.team3501.robot.subsystems; import org.usfirst.frc.team3501.robot.Constants; +import org.usfirst.frc.team3501.robot.Lidar; import edu.wpi.first.wpilibj.CANTalon; import edu.wpi.first.wpilibj.CounterBase.EncodingType; @@ -9,11 +10,10 @@ 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 * @@ -22,27 +22,20 @@ import edu.wpi.first.wpilibj.command.Subsystem; public class Shooter extends Subsystem { private CANTalon shooter; private CANTalon angleAdjuster; - private DoubleSolenoid punch; + private DoubleSolenoid hood, punch; private Encoder encoder; + private Lidar lidar; public Shooter() { 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); } - /*** - * - * @return current sensor position?? - */ - public double getCurrentSetPoint() { - return shooter.get(); - } - /*** * This method checks to see if the ball has successfully passed through the * intake rollers and is inside. @@ -72,10 +65,16 @@ public class Shooter extends Subsystem { return encoder.getRate(); } + 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) { - double newSpeed = getCurrentSetPoint() + change; + double newSpeed = getSpeed() + change; setSpeed(newSpeed); }