From: Rayan Hirech Date: Fri, 10 Feb 2017 02:18:34 +0000 (-0800) Subject: Fix merge conflicts. X-Git-Url: http://challenge-bot.com/repos/?a=commitdiff_plain;h=93d8373fe56e8036848f7d092855cb0819702b50;hp=9ea6a533269dd1a8f9f684b3bbd90ae4b17478db;p=3501%2F2017steamworks Fix merge conflicts. --- diff --git a/src/org/usfirst/frc/team3501/robot/CameraFeeds.java b/src/org/usfirst/frc/team3501/robot/CameraFeeds.java index ac72556..9450156 100755 --- a/src/org/usfirst/frc/team3501/robot/CameraFeeds.java +++ b/src/org/usfirst/frc/team3501/robot/CameraFeeds.java @@ -19,13 +19,15 @@ public class CameraFeeds { @SuppressWarnings("deprecation") private CameraFeeds(/* Joystick Button */) { + usbCamName = intakeCam.getName(); + axisCamName = climberCam.getName(); server = CameraServer.getInstance(); - climberCam = server.addAxisCamera("axisCamera", "10.35.1.11"); + climberCam = server.addAxisCamera(axisCamName, "10.35.1.11"); intakeCam = server.startAutomaticCapture(); + curCam = intakeCam; curCam = climberCam; usbCamName = intakeCam.getName(); axisCamName = climberCam.getName(); - } public static CameraFeeds getCameraFeeds() { @@ -43,18 +45,15 @@ public class CameraFeeds { public void toggleCamera() { System.out.println("enter toggleCamer"); if (curCam.equals(intakeCam)) { - changeCam(climberCam); + // changeCam(climberCam); curCam = climberCam; - System.out.println("Switching to climber camera."); - return; - } - - if (curCam.equals(climberCam)) { - changeCam(intakeCam); + // System.out.println("Switching to climber camera."); + } else if (curCam.equals(climberCam)) { + // changeCam(intakeCam); curCam = intakeCam; - System.out.println("Switching to intake camera."); - return; + // System.out.println("Switching to intake camera."); } + changeCam(curCam); } /** @@ -64,6 +63,19 @@ public class CameraFeeds { * newId for camera */ public void changeCam(VideoSource cam) { + server.removeCamera(curCam.getName()); + if (curCam.equals(intakeCam)) { + server.addCamera(intakeCam); + System.out.println("Switching to climber camera."); + return; + } + + if (curCam.equals(climberCam)) { + server.addAxisCamera(axisCamName, "10.35.1.11"); + // server.addCamera(climberCam); + System.out.println("Switching to intake camera."); + return; + } System.out.println("change camera"); server.removeCamera(curCam.getName()); server.addCamera(cam); diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index 5082911..42a0136 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -1,7 +1,6 @@ package org.usfirst.frc.team3501.robot; import org.usfirst.frc.team3501.robot.commands.accessories.ToggleCameraFeed; -import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.buttons.Button; @@ -23,17 +22,16 @@ public class OI { public OI() { leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); - /*toggleWinch = new JoystickButton(leftJoystick, - Constants.OI.TOGGLE_WINCH_PORT); - toggleIndexWheel = new JoystickButton(leftJoystick, - Constants.OI.TOGGLE_INDEXWHEEL_PORT); - toggleFlyWheel = new JoystickButton(leftJoystick, - Constants.OI.TOGGLE_FLYWHEEL_PORT); - - toggleGear = new JoystickButton(leftJoystick, - Constants.OI.TOGGLE_GEAR_PORT); - toggleGear.whenPressed(new ToggleGear()); - */ + /* + * toggleWinch = new JoystickButton(leftJoystick, + * Constants.OI.TOGGLE_WINCH_PORT); toggleIndexWheel = new + * JoystickButton(leftJoystick, Constants.OI.TOGGLE_INDEXWHEEL_PORT); + * toggleFlyWheel = new JoystickButton(leftJoystick, + * Constants.OI.TOGGLE_FLYWHEEL_PORT); + * + * toggleGear = new JoystickButton(leftJoystick, + * Constants.OI.TOGGLE_GEAR_PORT); toggleGear.whenPressed(new ToggleGear()); + */ toggleCameraFeeds = new JoystickButton(leftJoystick, Constants.OI.TOGGLE_CAMERA_FEEDS); diff --git a/src/org/usfirst/frc/team3501/robot/Robot.java b/src/org/usfirst/frc/team3501/robot/Robot.java index d467182..e7c5e5b 100644 --- a/src/org/usfirst/frc/team3501/robot/Robot.java +++ b/src/org/usfirst/frc/team3501/robot/Robot.java @@ -25,7 +25,9 @@ public class Robot extends IterativeRobot { oi = OI.getOI(); shooter = Shooter.getShooter(); intake = Intake.getIntake(); - + cameraServer2 = CameraServer.getInstance(); + axisCamera = cameraServer2.addAxisCamera("axisCamera", "10.35.1.11"); + cameraFeeds = new CameraFeeds(); cameraFeeds = CameraFeeds.getCameraFeeds(); // usbCamera = CameraServer.getInstance().startAutomaticCapture(); @@ -42,7 +44,6 @@ public class Robot extends IterativeRobot { // axisCamera = cameraServer2.addAxisCamera("axisCamera", "10.35.1.11"); // cameraFeeds = new CameraFeeds(); - } public static DriveTrain getDriveTrain() { @@ -80,12 +81,10 @@ public class Robot extends IterativeRobot { @Override public void teleopInit() { - } @Override public void teleopPeriodic() { Scheduler.getInstance().run(); - } }