From: niyatisriram Date: Wed, 17 Feb 2016 19:16:21 +0000 (-0800) Subject: fixed merge conflict in Robot.java X-Git-Url: http://challenge-bot.com/repos/?a=commitdiff_plain;h=c63ba9b9649deb7b4441f318a578c638cb26ebb9;hp=786a78c72aa11ff2c03ca170aaf24f5999a3feee;p=3501%2Fstronghold-2016 fixed merge conflict in Robot.java --- diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 99f66213..80d78676 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,7 +1,6 @@ package org.usfirst.frc.team3501.robot; import org.usfirst.frc.team3501.robot.Constants.Defense; -import org.usfirst.frc.team3501.robot.sensors.Photogate; import org.usfirst.frc.team3501.robot.subsystems.DefenseArm; import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; import org.usfirst.frc.team3501.robot.subsystems.IntakeArm; @@ -23,12 +22,10 @@ public class Robot extends IterativeRobot { public static IntakeArm intakeArm; public static DefenseArm defenseArm; - public static Photogate photogate; - // Sendable Choosers send a drop down menu to the Smart Dashboard. SendableChooser positionChooser; SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense, - positionFourDefense, positionFiveDefense; + positionFourDefense, positionFiveDefense; @Override public void robotInit() { diff --git a/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java b/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java index ddb52472..c9f3d642 100644 --- a/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java +++ b/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java @@ -2,9 +2,6 @@ package org.usfirst.frc.team3501.robot.sensors; import edu.wpi.first.wpilibj.AnalogInput; -// TODO: Change certain reactions based on testing, ie what value(s) return true -// and what value(s) return false. - /*** * The photogate is a pair of IR LED and phototransistor sensor that uses a * reflective method to sense the presence of the boulder within the robot's @@ -15,7 +12,7 @@ import edu.wpi.first.wpilibj.AnalogInput; */ public class Photogate extends AnalogInput { - private double threshold; + private double threshold = 1.8; /*** * The constructor inputs the channel of the transistor and the threshold @@ -35,7 +32,7 @@ public class Photogate extends AnalogInput { * @return whether the ball is present or not */ public boolean isBallPresent() { - if (this.getValue() > threshold) + if (this.getVoltage() > threshold) return true; else return false; @@ -44,7 +41,7 @@ public class Photogate extends AnalogInput { /*** * @param threshold - * (range [0, 4095] + * (range [0, 4095]) */ public void setThreshold(int threshold) { this.threshold = threshold; diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index 3633c04c..0d9187a4 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -2,6 +2,7 @@ package org.usfirst.frc.team3501.robot.subsystems; import org.usfirst.frc.team3501.robot.Constants; 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; @@ -24,6 +25,7 @@ public class Shooter extends Subsystem { private DoubleSolenoid hood1, hood2, punch; private Encoder encoder; private Lidar lidar; + private Photogate photogate; public Shooter() { shooter = new CANTalon(Constants.Shooter.PORT); @@ -47,7 +49,7 @@ public class Shooter extends Subsystem { */ public boolean isBallInside() { - return true; + return photogate.isBallPresent(); } public void setSpeed(double speed) {