import org.usfirst.frc.team3501.robot.subsystems.Intake;
import org.usfirst.frc.team3501.robot.subsystems.Shooter;
+import edu.wpi.cscore.UsbCamera;
+import edu.wpi.first.wpilibj.CameraServer;
+import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Scheduler;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
public class Robot extends IterativeRobot {
private static DriveTrain driveTrain;
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();
-
+ server = CameraServer.getInstance();
+ UsbCamera climberCam = server.startAutomaticCapture("climbercam", 0);
+ UsbCamera intakeCam = server.startAutomaticCapture("intakecam", 1);
}
public static DriveTrain getDriveTrain() {
+
return DriveTrain.getDriveTrain();
}
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
public void autonomousInit() {
- driveTrain.setHighGear();
+ driveTrain.setHighGear(driveTrain.getRightPiston());
+ driveTrain.setHighGear(driveTrain.getLeftPiston());
}
@Override
public void autonomousPeriodic() {
Scheduler.getInstance().run();
-
}
@Override
public void teleopInit() {
-
}
@Override
public void teleopPeriodic() {
Scheduler.getInstance().run();
+ updateSmartDashboard();
+ }
+ public void updateSmartDashboard() {
+ SmartDashboard.putNumber("angle", driveTrain.getAngle());
+ SmartDashboard.putNumber("voltage",
+ DriverStation.getInstance().getBatteryVoltage());
+ SmartDashboard.putNumber("rpm", shooter.getShooterRPM());
+ SmartDashboard.putNumber("motor value", shooter.getCurrentShootingSpeed());
}
}