forked from IsaacRatliff/FTC-Code
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisionTest.java
More file actions
Latest commit
31 lines (28 loc) · 1007 Bytes
/
Copy pathVisionTest.java
File metadata and controls
31 lines (28 loc) · 1007 Bytes
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
packageworkspace;
importcom.qualcomm.robotcore.eventloop.opmode.Autonomous;
importcom.qualcomm.robotcore.util.ElapsedTime;
@Autonomous(name="Vision Test", group="Linear OpMode")
publicclassVisionTestextendsVuforiaOp{
@Override
publicvoidrunOpMode(){
ElapsedTimeruntime = newElapsedTime();
initVision(hardwareMap);
initialize(hardwareMap, telemetry);
activateVision();
telemetry.addData("Status", "waiting");
waitForStart();
runtime.reset();
while(opModeIsActive()){
calcOffset();
if(raw_offset == null){
telemetry.addData("Reading", "(%.2f S) null", runtime.seconds());
strafeLeftSpd(0.1);
}
else{
telemetry.addData("Reading", "(%.2f S) x: %.0f, y: %.0f, z: %.0f", runtime.seconds(), red_off, blue_off, green_off);
strafeRightSpd(red_off/1000);
}
telemetry.update();
}
}
}