Skip to content

Commit

Permalink
Cleaned up Teleop.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChloeT09 committed Oct 14, 2024
1 parent 7a78387 commit fcce852
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ public void runOpMode() {
visionPortal.resumeStreaming();
}

// Share the CPU.
sleep(20);
}

// Save more CPU resources when camera is no longer needed.
visionPortal.close();

// Share the CPU.
sleep(20);
}

} // end method runOpMode()

/**
Expand All @@ -160,7 +160,7 @@ private void initAprilTag() {
// == CAMERA CALIBRATION ==
// If you do not manually specify calibration parameters, the SDK will attempt
// to load a predefined calibration for your camera.
.setLensIntrinsics(403.13, 403.56, 607.11, 349.24)
//.setLensIntrinsics(578.272, 578.272, 402.145, 221.506)
// ... these parameters are fx, fy, cx, cy.

.build();
Expand All @@ -184,21 +184,22 @@ private void initAprilTag() {
builder.setCamera(BuiltinCameraDirection.BACK);
}

/*
Choose a camera resolution. Not all cameras support all resolutions.
builder.setCameraResolution(new Size(640, 480));
Enable the RC preview (LiveView). Set "false" to omit camera monitoring.
builder.enableLiveView(true);
Set the stream format; MJPEG uses less bandwidth than default YUY2.
builder.setStreamFormat(VisionPortal.StreamFormat.YUY2);
Choose whether or not LiveView stops if no processors are enabled.
If set "true", monitor shows solid orange screen if no processors enabled.
If set "false", monitor shows camera view without annotations.
builder.setAutoStopLiveView(false);
Set and enable the processor.
*/

builder.addProcessor(aprilTag);
// Choose a camera resolution. Not all cameras support all resolutions.
//builder.setCameraResolution(new Size(640, 480));

// Enable the RC preview (LiveView). Set "false" to omit camera monitoring.
//builder.enableLiveView(true);

// Set the stream format; MJPEG uses less bandwidth than default YUY2.
//builder.setStreamFormat(VisionPortal.StreamFormat.YUY2);

// Choose whether or not LiveView stops if no processors are enabled.
// If set "true", monitor shows solid orange screen if no processors enabled.
// If set "false", monitor shows camera view without annotations.
//builder.setAutoStopLiveView(false);

// Set and enable the processor.
builder.addProcessor(aprilTag);

// Build the Vision Portal, using the above settings.
visionPortal = builder.build();
Expand Down
Loading

0 comments on commit fcce852

Please sign in to comment.