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=4d4bcc688036e2dfeb20824d91b8a9972c20ecf4;p=3501%2Fstronghold-2016 fixed merge conflict in Robot.java --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 7ee2d3b2..4ad8a4bf 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -112,8 +112,8 @@ public class Constants { public static final int HOOD_FORWARD = 2; public static final int HOOD_REVERSE = 3; - public static final Value open = Value.kForward; - public static final Value closed = Value.kReverse; + public static final Value open = Value.kReverse; + public static final Value closed = Value.kForward; public static final Port LIDAR_I2C_PORT = I2C.Port.kMXP; diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index 8fd099fb..80d78676 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -1,14 +1,12 @@ package org.usfirst.frc.team3501.robot; import org.usfirst.frc.team3501.robot.Constants.Defense; -import org.usfirst.frc.team3501.robot.sensors.GyroLib; import org.usfirst.frc.team3501.robot.subsystems.DefenseArm; import org.usfirst.frc.team3501.robot.subsystems.DriveTrain; import org.usfirst.frc.team3501.robot.subsystems.IntakeArm; import org.usfirst.frc.team3501.robot.subsystems.Scaler; import org.usfirst.frc.team3501.robot.subsystems.Shooter; -import edu.wpi.first.wpilibj.I2C; import edu.wpi.first.wpilibj.IterativeRobot; import edu.wpi.first.wpilibj.command.Scheduler; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; @@ -29,14 +27,10 @@ public class Robot extends IterativeRobot { SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense, positionFourDefense, positionFiveDefense; - // Gyro stuff - public GyroLib gyro; - @Override public void robotInit() { driveTrain = new DriveTrain(); oi = new OI(); - gyro = new GyroLib(I2C.Port.kOnboard, false); shooter = new Shooter(); scaler = new Scaler(); @@ -135,17 +129,11 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { - - gyro.start(); - } @Override public void teleopPeriodic() { Scheduler.getInstance().run(); - - System.out.println("Degrees: " + gyro.getRotationZ().getAngle()); - } } diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java index 60452a0c..0d9187a4 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java @@ -22,15 +22,17 @@ import edu.wpi.first.wpilibj.command.Subsystem; public class Shooter extends Subsystem { private CANTalon shooter; - private CANTalon angleAdjuster; - private DoubleSolenoid hood, punch; + private DoubleSolenoid hood1, hood2, punch; private Encoder encoder; private Lidar lidar; private Photogate photogate; public Shooter() { shooter = new CANTalon(Constants.Shooter.PORT); - angleAdjuster = new CANTalon(Constants.Shooter.ANGLE_ADJUSTER_PORT); + hood1 = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD, + Constants.Shooter.HOOD_REVERSE); + hood2 = new DoubleSolenoid(Constants.Shooter.HOOD_FORWARD, + Constants.Shooter.HOOD_REVERSE); punch = new DoubleSolenoid(Constants.Shooter.PUNCH_FORWARD, Constants.Shooter.PUNCH_REVERSE); @@ -94,6 +96,23 @@ public class Shooter extends Subsystem { punch.set(Constants.Shooter.retract); } + public void raiseHood() { + hood1.set(Constants.Shooter.open); + hood2.set(Constants.Shooter.open); + } + + public void lowerHood() { + hood1.set(Constants.Shooter.closed); + hood2.set(Constants.Shooter.closed); + } + + public boolean isHoodDown() { + if (hood1.get() == Constants.Shooter.open + && hood2.get() == Constants.Shooter.open) + return true; + return false; + } + @Override protected void initDefaultCommand() { }