X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2Fsubsystems%2FShooter.java;h=60452a0c9080bfe4bf61beb2c129ce0be2b37717;hb=4d4bcc688036e2dfeb20824d91b8a9972c20ecf4;hp=d91b234192218906cb44e1847f22666af90b913b;hpb=984e903a0a4e91563d7b7766a361aaeed15a2b23;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 d91b2341..60452a0c 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -1,7 +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.sensors.Lidar; +import org.usfirst.frc.team3501.robot.sensors.Photogate; import edu.wpi.first.wpilibj.CANTalon; import edu.wpi.first.wpilibj.CounterBase.EncodingType; @@ -25,6 +26,7 @@ public class Shooter extends Subsystem { private DoubleSolenoid hood, punch; private Encoder encoder; private Lidar lidar; + private Photogate photogate; public Shooter() { shooter = new CANTalon(Constants.Shooter.PORT); @@ -45,7 +47,7 @@ public class Shooter extends Subsystem { */ public boolean isBallInside() { - return true; + return photogate.isBallPresent(); } public void setSpeed(double speed) { @@ -65,6 +67,11 @@ 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