package org.usfirst.frc.team3501.robot;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+
import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch;
import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous;
import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous;
import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous;
import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous;
+import org.usfirst.frc.team3501.robot.utils.ChangeCameraView;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.JoystickButton;
-public class OI {
+public class OI implements KeyListener {
private static OI oi;
public static Joystick leftJoystick;
public static Joystick rightJoystick;
oi = new OI();
return oi;
}
+
+ @Override
+ public void keyTyped(KeyEvent e) {
+
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void keyReleased(KeyEvent e) {
+ // TODO Auto-generated method stub
+
+ }
}
private static Shooter shooter;
private static OI oi;
private static Intake intake;
+ private static CameraServer server;
@Override
public void robotInit() {
oi = OI.getOI();
shooter = Shooter.getShooter();
intake = Intake.getIntake();
- CameraServer server = CameraServer.getInstance();
+ server = CameraServer.getInstance();
UsbCamera climberCam = server.startAutomaticCapture("climbercam", 0);
UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 1);
}
return Intake.getIntake();
}
+ public static void swapCameraFeed() {
+ UsbCamera climberCam = server.startAutomaticCapture("climbercam", 1);
+ UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 0);
+ }
+
// If the gear values do not match in the left and right piston, then they are
// both set to high gear
@Override
--- /dev/null
+package org.usfirst.frc.team3501.robot.utils;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+/**
+ *
+ */
+public class ChangeCameraView extends Command {
+
+ public ChangeCameraView() {
+ }
+
+ @Override
+ protected void initialize() {
+ }
+
+ @Override
+ protected void execute() {
+ Robot.swapCameraFeed();
+ }
+
+ @Override
+ protected boolean isFinished() {
+ return true;
+ }
+
+ @Override
+ protected void end() {
+ }
+
+ @Override
+ protected void interrupted() {
+ }
+}