1 package org
.usfirst
.frc
.team3501
.robot
;
3 import org
.usfirst
.frc
.team3501
.robot
.commands
.driving
.TimeDrive
;
4 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Climber
;
5 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.DriveTrain
;
6 import org
.usfirst
.frc
.team3501
.robot
.subsystems
.Shooter
;
8 import edu
.wpi
.cscore
.AxisCamera
;
9 import edu
.wpi
.cscore
.UsbCamera
;
10 import edu
.wpi
.first
.wpilibj
.CameraServer
;
11 import edu
.wpi
.first
.wpilibj
.IterativeRobot
;
12 import edu
.wpi
.first
.wpilibj
.command
.Command
;
13 import edu
.wpi
.first
.wpilibj
.command
.Scheduler
;
15 public class Robot
extends IterativeRobot
{
16 private static DriveTrain driveTrain
;
18 private static Climber climber
;
19 private static Shooter shooter
;
20 private static UsbCamera camera1
;
21 private static CameraServer cameraServer2
;
22 private static AxisCamera camera2
;
25 public void robotInit() {
26 // driveTrain = DriveTrain.getDriveTrain();
28 // climber = Climber.getClimber();
29 // shooter = Shooter.getShooter();
30 camera1
= CameraServer
.getInstance().startAutomaticCapture();
31 // cameraServer2 = CameraServer.getInstance();
32 // camera2 = cameraServer2.addAxisCamera("camera2", "10.35.1.11");
35 // System.out.println("====> 1");
36 // cameraServer2.removeCamera("camera2");
38 // Joystick leftJoystick = new Joystick(0);
39 // Button button1 = new JoystickButton(leftJoystick, 1);
40 // camera2 = cameraServer2.addAxisCamera("camera2", "10.35.1.11");
41 // System.out.println("====> 2");
43 // cameraServer2.removeCamera("camera2");
45 // button1.whenPressed(new JoystickButton1Pressed());
46 // button1.whenReleased(new JoystickButton1Released());
50 public class JoystickButton1Pressed
extends Command
{
51 public JoystickButton1Pressed() {
52 // camera2.addAxisCamera("camera2", "10.35.1.11");
56 public boolean isFinished() {
61 public class JoystickButton1Released
extends Command
{
62 public JoystickButton1Released() {
63 cameraServer2
.removeCamera("camera2");
67 public boolean isFinished() {
72 public static DriveTrain
getDriveTrain() {
73 return DriveTrain
.getDriveTrain();
76 public static OI
getOI() {
80 public static Climber
getClimber() {
81 return Climber
.getClimber();
84 public static Shooter
getShooter() {
85 return Shooter
.getShooter();
89 public void autonomousInit() {
90 Scheduler
.getInstance().add(new TimeDrive(1.5, 0.4));
94 public void autonomousPeriodic() {
95 Scheduler
.getInstance().run();
100 public void teleopInit() {
104 public void teleopPeriodic() {
105 Scheduler
.getInstance().run();