diff --git a/build/jars/NetworkTables.jar b/build/jars/NetworkTables.jar index 5aa88c7..4ee4784 100644 Binary files a/build/jars/NetworkTables.jar and b/build/jars/NetworkTables.jar differ diff --git a/build/jars/WPILib.jar b/build/jars/WPILib.jar index 3dad909..743ef8b 100644 Binary files a/build/jars/WPILib.jar and b/build/jars/WPILib.jar differ diff --git a/build/jars/cscore.jar b/build/jars/cscore.jar index c7dab5c..854cdf7 100644 Binary files a/build/jars/cscore.jar and b/build/jars/cscore.jar differ diff --git a/build/org/usfirst/frc/team708/robot/OI.class b/build/org/usfirst/frc/team708/robot/OI.class index 9e1520e..f0aaa60 100644 Binary files a/build/org/usfirst/frc/team708/robot/OI.class and b/build/org/usfirst/frc/team708/robot/OI.class differ diff --git a/build/org/usfirst/frc/team708/robot/Robot.class b/build/org/usfirst/frc/team708/robot/Robot.class index 7556f9d..7bc4fe2 100644 Binary files a/build/org/usfirst/frc/team708/robot/Robot.class and b/build/org/usfirst/frc/team708/robot/Robot.class differ diff --git a/build/org/usfirst/frc/team708/robot/commands/intake/IntakeIn.class b/build/org/usfirst/frc/team708/robot/commands/intake/IntakeIn.class new file mode 100644 index 0000000..3c97465 Binary files /dev/null and b/build/org/usfirst/frc/team708/robot/commands/intake/IntakeIn.class differ diff --git a/build/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_In.class b/build/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_In.class new file mode 100644 index 0000000..1b0c4f6 Binary files /dev/null and b/build/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_In.class differ diff --git a/build/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_Out.class b/build/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_Out.class new file mode 100644 index 0000000..86f6871 Binary files /dev/null and b/build/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_Out.class differ diff --git a/build/org/usfirst/frc/team708/robot/commands/intake_ball/ManualIntake_Ball.class b/build/org/usfirst/frc/team708/robot/commands/intake_ball/ManualIntake_Ball.class new file mode 100644 index 0000000..21e6209 Binary files /dev/null and b/build/org/usfirst/frc/team708/robot/commands/intake_ball/ManualIntake_Ball.class differ diff --git a/build/org/usfirst/frc/team708/robot/subsystems/Intake.class b/build/org/usfirst/frc/team708/robot/subsystems/Intake.class deleted file mode 100644 index e83828b..0000000 Binary files a/build/org/usfirst/frc/team708/robot/subsystems/Intake.class and /dev/null differ diff --git a/build/org/usfirst/frc/team708/robot/subsystems/Intake_Ball.class b/build/org/usfirst/frc/team708/robot/subsystems/Intake_Ball.class new file mode 100644 index 0000000..e96b61a Binary files /dev/null and b/build/org/usfirst/frc/team708/robot/subsystems/Intake_Ball.class differ diff --git a/dist/FRCUserProgram.jar b/dist/FRCUserProgram.jar index f307fa5..2aaed16 100644 Binary files a/dist/FRCUserProgram.jar and b/dist/FRCUserProgram.jar differ diff --git a/src/org/usfirst/frc/team708/robot/OI.java b/src/org/usfirst/frc/team708/robot/OI.java index 20b0b86..f601468 100644 --- a/src/org/usfirst/frc/team708/robot/OI.java +++ b/src/org/usfirst/frc/team708/robot/OI.java @@ -6,11 +6,10 @@ import edu.wpi.first.wpilibj.buttons.*; import org.usfirst.frc.team708.robot.commands.drivetrain.*; +import org.usfirst.frc.team708.robot.commands.intake_ball.*; import org.usfirst.frc.team708.robot.commands.shooter.*; import org.usfirst.frc.team708.robot.commands.loader.*; -//import org.team708.robot.commands.intake.*; - import org.usfirst.frc.team708.robot.commands.visionProcessor.*; import org.usfirst.frc.team708.robot.util.Gamepad; @@ -89,9 +88,9 @@ public OI() { * Driver Commands to be called by button */ // intakeGearIn.whileHeld(new IntakeGearIn()); -// intakeBallIn.whileHeld(new IntakeBallIn()); + intakeBallIn.whileHeld(new Intake_Ball_In()); // intakeGearOut.whileActive(new IntakeGearOut()); -// intakeBallOut.whileActive(new IntakeBallOut()); + intakeBallOut.whileActive(new Intake_Ball_Out()); // sonarOverride.whenPressed(new SonarOverride()); // diff --git a/src/org/usfirst/frc/team708/robot/Robot.java b/src/org/usfirst/frc/team708/robot/Robot.java index 69d50ee..085c6b0 100644 --- a/src/org/usfirst/frc/team708/robot/Robot.java +++ b/src/org/usfirst/frc/team708/robot/Robot.java @@ -18,15 +18,17 @@ import org.usfirst.frc.team708.robot.subsystems.Drivetrain; import org.usfirst.frc.team708.robot.subsystems.Shooter; import org.usfirst.frc.team708.robot.subsystems.Loader; -import org.usfirst.frc.team.708.robot.subsystems.Intake_Ball; -import org.usfirst.frc.team.708.robot.subsystems.Intake_Gear; -import org.usfirst.frc.team.708.robot.subsystems.Climber; +import org.usfirst.frc.team708.robot.subsystems.Intake_Ball; +//import org.usfirst.frc.team.708.robot.subsystems.Intake_Gear; +//import org.usfirst.frc.team.708.robot.subsystems.Climber; import org.usfirst.frc.team708.robot.OI; import org.usfirst.frc.team708.robot.subsystems.VisionProcessor; import org.usfirst.frc.team708.robot.commands.drivetrain.*; import org.usfirst.frc.team708.robot.commands.loader.*; +import org.usfirst.frc.team708.robot.commands.intake_ball.*; + import org.usfirst.frc.team708.robot.commands.autonomous.*; //sue's comment @@ -46,9 +48,9 @@ public class Robot extends IterativeRobot { public static Drivetrain drivetrain; public static Shooter shooter; public static Loader loader; - public static Intake_Ball Intake_Ball; - public static Intake_Gear Intake_Gear; - public static Climber Climber; + public static Intake_Ball intake_ball; + // public static Intake_Gear intake_gear; + // public static Climber Climber; public static VisionProcessor visionProcessor; @@ -76,9 +78,9 @@ public void robotInit() { drivetrain = new Drivetrain(); shooter = new Shooter(); loader = new Loader(); - Intake_Gear = new Intake_Gear(); - Intake_Ball = new Intake_Ball(); - Climber = new Climber(); + // Intake_Gear = new Intake_Gear(); + intake_ball = new Intake_Ball(); + // Climber = new Climber(); oi = new OI(); // Initializes the OI. // This MUST BE LAST or a NullPointerException will be thrown @@ -166,9 +168,9 @@ private void sendStatistics() { drivetrain.sendToDashboard(); loader.sendToDashboard(); shooter.sendToDashboard(); - Intake_Ball.sendToDashboard(); - Intake_Gear.sendToDashboard(); - Climber.sendToDashbaord(); + intake_ball.sendToDashboard(); + // Intake_Gear.sendToDashboard(); + // Climber.sendToDashbaord(); // visionProcessor.sendToDashboard(); } @@ -194,9 +196,9 @@ private void sendDashboardSubsystems() { SmartDashboard.putData(shooter); SmartDashboard.putData(loader); SmartDashboard.putData(drivetrain); - SmartDashboard.putData(Intake_Ball); - SmartDashboard.putData(Intake_Gear); - SmartDashboard.putData(Climber); + SmartDashboard.putData(intake_ball); + //SmartDashboard.putData(Intake_Gear); + //SmartDashboard.putData(Climber); } } diff --git a/src/org/usfirst/frc/team708/robot/commands/intake/IntakeIn.java b/src/org/usfirst/frc/team708/robot/commands/intake/IntakeIn.java new file mode 100644 index 0000000..26e1dc6 --- /dev/null +++ b/src/org/usfirst/frc/team708/robot/commands/intake/IntakeIn.java @@ -0,0 +1,5 @@ +package org.usfirst.frc.team708.robot.commands.intake; + +public class IntakeIn { + +} diff --git a/src/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_In.java b/src/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_In.java new file mode 100644 index 0000000..9c9a6f1 --- /dev/null +++ b/src/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_In.java @@ -0,0 +1,42 @@ +package org.usfirst.frc.team708.robot.commands.intake_ball; + +import org.usfirst.frc.team708.robot.Constants; +import org.usfirst.frc.team708.robot.Robot; + +import edu.wpi.first.wpilibj.command.Command; + +public class Intake_Ball_In extends Command { + + public Intake_Ball_In() { + + requires(Robot.intake_ball); + } + + protected void initialize() { + + } + + protected void execute() { + + Robot.intake_ball.moveMotor(Constants.INTAKE_FORWARD); + } + + + protected boolean isFinished() { + + return(false); + } + + protected void end() { + + Robot.intake_ball.stop(); + + } + + protected void interrupted() { + + end(); + } + +} + \ No newline at end of file diff --git a/src/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_Out.java b/src/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_Out.java new file mode 100644 index 0000000..86e0b17 --- /dev/null +++ b/src/org/usfirst/frc/team708/robot/commands/intake_ball/Intake_Ball_Out.java @@ -0,0 +1,40 @@ +package org.usfirst.frc.team708.robot.commands.intake_ball; + +import org.usfirst.frc.team708.robot.Constants; +import org.usfirst.frc.team708.robot.Robot; +import edu.wpi.first.wpilibj.command.Command; + +public class Intake_Ball_Out extends Command { + +public Intake_Ball_Out() { + + requires(Robot.intake_ball); +} + +protected void initialize() { + +} + +protected void execute() { + + Robot.intake_ball.moveMotor(Constants.INTAKE_REVERSE); +} + + +protected boolean isFinished() { + + return(false); +} + +protected void end() { + + Robot.intake_ball.stop(); + +} + +protected void interrupted() { + + end(); +} + +} diff --git a/src/org/usfirst/frc/team708/robot/commands/intake_ball/ManualIntake_Ball.java b/src/org/usfirst/frc/team708/robot/commands/intake_ball/ManualIntake_Ball.java new file mode 100644 index 0000000..9e913cd --- /dev/null +++ b/src/org/usfirst/frc/team708/robot/commands/intake_ball/ManualIntake_Ball.java @@ -0,0 +1,59 @@ +package org.usfirst.frc.team708.robot.commands.intake_ball; + +import org.usfirst.frc.team708.robot.Constants; +import org.usfirst.frc.team708.robot.OI; +import org.usfirst.frc.team708.robot.Robot; +import org.usfirst.frc.team708.robot.util.Gamepad; +import edu.wpi.first.wpilibj.command.Command; + + +public class ManualIntake_Ball extends Command { + + public ManualIntake_Ball() { + requires(Robot.loader); + } + + + // Called just before this Command runs the first time + protected void initialize() { + + } + + // Called repeatedly when this Command is scheduled to run + protected void execute() { + + boolean R_Shoulderpressed = OI.operatorGamepad.getButton(Gamepad.button_R_Shoulder); + boolean AxisRightpressed = OI.operatorGamepad.getButton(Gamepad.shoulderAxisRight); + + // LOADER_IN_BUTTON = Gamepad.Button_R_Shoulder; + // LOADER_OUT_BUTTON = Gamepad.shoulderAxisRight; + + if (R_Shoulderpressed == true){ + Robot.intake_ball.moveMotor(Constants.INTAKE_FORWARD); + } + else + if (AxisRightpressed == true){ + Robot.intake_ball.moveMotor(Constants.INTAKE_REVERSE); + } + else { + Robot.intake_ball.moveMotor(Constants.INTAKE_OFF); + } + + } + + // Make this return true when this Command no longer needs to run execute() + protected boolean isFinished() { + return(false); + } + + // Called once after isFinished returns true + protected void end() { + Robot.intake_ball.stop(); + } + + // Called when another command which requires one or more of the same + // subsystems are scheduled to run + protected void interrupted() { + end(); + } +} diff --git a/src/org/usfirst/frc/team708/robot/subsystems/Intake.java b/src/org/usfirst/frc/team708/robot/subsystems/Intake_Ball.java similarity index 56% rename from src/org/usfirst/frc/team708/robot/subsystems/Intake.java rename to src/org/usfirst/frc/team708/robot/subsystems/Intake_Ball.java index 487e76e..8f63fe3 100644 --- a/src/org/usfirst/frc/team708/robot/subsystems/Intake.java +++ b/src/org/usfirst/frc/team708/robot/subsystems/Intake_Ball.java @@ -1,39 +1,48 @@ package org.usfirst.frc.team708.robot.subsystems; import org.usfirst.frc.team708.robot.Constants; +import org.usfirst.frc.team708.robot.RobotMap; + +import com.ctre.CANTalon; + //import org.usfirst.frc.team708.robot.RobotMap; //import edu.wpi.first.wpilibj.Relay; //import edu.wpi.first.wpilibj.Relay.Value; //import edu.wpi.first.wpilibj.Talon; import edu.wpi.first.wpilibj.command.Subsystem; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; /** * Subsystem that intakes balls - * @author James_Makovics - * @author Michael_Steinberg - * @author Thomas Zhao - * @author Alex Tysak + * @author Madison + * @author Nick */ -public class Intake extends Subsystem { - - /** - * Constructor - */ - public Intake() { +public class Intake_Ball extends Subsystem { + private CANTalon intakeMotor; + + //I'm trying to link the right motor to the intake code here + public Intake_Ball() { + + intakeMotor = new CANTalon (RobotMap.intakeMotorBall); + } public void initDefaultCommand() { } + //I believe this sets the speed of the motor public void moveMotor(double speed) { + intakeMotor.set(speed); } - + //I believe this stops the motor public void stop(){ + intakeMotor.set(Constants.INTAKE_OFF); + } /**