-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathVisionTest.java
31 lines (28 loc) · 1007 Bytes
/
VisionTest.java
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
package workspace;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.util.ElapsedTime;
@Autonomous(name="Vision Test", group="Linear OpMode")
public class VisionTest extends VuforiaOp{
@Override
public void runOpMode(){
ElapsedTime runtime = new ElapsedTime();
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();
}
}
}