Skip to content

Instantly share code, notes, and snippets.

@alexanderswerdlow
Created February 26, 2019 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderswerdlow/842c86bb2e59976cf321453964d71d6c to your computer and use it in GitHub Desktop.
Save alexanderswerdlow/842c86bb2e59976cf321453964d71d6c to your computer and use it in GitHub Desktop.
Vision.java Constructor
private MjpegServer server;
private HttpCamera LLFeed;
private UsbCamera cargoCam;
private int cameraStream = 0;
private Vision() {
ShuffleboardTab dashboardTab = Shuffleboard.getTab("Dash");
LLFeed = new HttpCamera("limelight", "http://limelight.local:5800/stream.mjpg");
cargoCam = CameraServer.getInstance().startAutomaticCapture(0);
cargoCam.setConnectVerbose(0);
server = CameraServer.getInstance().addSwitchedCamera("Toggle Cam");
server.setSource(LLFeed);
dashboardTab.add(server.getSource()).withWidget(BuiltInWidgets.kCameraStream).withPosition(1, 1).withSize(5, 4)
.withProperties(Map.of("Show Crosshair", true, "Show Controls", false));// specify widget properties here
Shuffleboard.selectTab("Dash");
ShuffleboardTab mVisionTab = Shuffleboard.getTab("Vision");
mLLX = mVisionTab.add("Limelight X", 0.0).getEntry();
mDist = mVisionTab.add("Limelight Dist", 0.0).getEntry();
mArea = mVisionTab.add("Area", 0.0).getEntry();
mLimeLight = new LimeLight();
configLimelightVision();
mPixy = new MkPixy();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment