forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCameraTest.java
More file actions
36 lines (28 loc) · 1.28 KB
/
CameraTest.java
File metadata and controls
36 lines (28 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import org.firstinspires.ftc.vision.VisionProcessor;
import org.firstinspires.ftc.robotcore.internal.camera.calibration.CameraCalibration;
import org.firstinspires.ftc.robotcore.external.hardware.camera.WebcamName;
import android.util.Size;
import org.firstinspires.ftc.teamcode.FirstPipelineRevised;
import org.firstinspires.ftc.vision.VisionPortal;
@Autonomous(name="Vision Test")
public class CameraTest extends LinearOpMode {
private FirstPipelineRevised firstPipelineRevised; //Create an object of the VisionProcessor Class
private VisionPortal portal;
@Override
public void runOpMode() throws InterruptedException {
firstPipelineRevised = new FirstPipelineRevised();
portal = new VisionPortal.Builder()
.setCamera(hardwareMap.get(WebcamName.class, "Webcam 1"))
.addProcessor(firstPipelineRevised)
.setCameraResolution(new Size(1280, 720))
.build();
waitForStart();
while (opModeIsActive()) {
telemetry.addLine(String.valueOf(firstPipelineRevised.getSelection()));
telemetry.update();
}
}
}