projects
/
3501
/
stronghold-2016
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initialize photogate in shooter subsystem
[3501/stronghold-2016]
/
src
/
org
/
usfirst
/
frc
/
team3501
/
robot
/
subsystems
/
Shooter.java
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
index d91b234192218906cb44e1847f22666af90b913b..60452a0c9080bfe4bf61beb2c129ce0be2b37717 100755
(executable)
--- 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;
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;
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 DoubleSolenoid hood, punch;
private Encoder encoder;
private Lidar lidar;
+ private Photogate photogate;
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
@@
-45,7
+47,7
@@
public class Shooter extends Subsystem {
*/
public boolean isBallInside() {
*/
public boolean isBallInside() {
- return
true
;
+ return
photogate.isBallPresent()
;
}
public void setSpeed(double speed) {
}
public void setSpeed(double speed) {
@@
-65,6
+67,11
@@
public class Shooter extends Subsystem {
return encoder.getRate();
}
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
public double getShooterSpeed() {
double distanceToGoal = lidar.getDistance();
double shooterSpeed = distanceToGoal; // Function to be determined