Compare commits
2 commits
6d1582c26a
...
7bb091571c
Author | SHA1 | Date | |
---|---|---|---|
Yash Karandikar | 7bb091571c | ||
Yash Karandikar | 88138e43ff |
|
@ -56,7 +56,7 @@ public class AutoCameraRight extends LinearOpMode {
|
||||||
|
|
||||||
ArrayList<AprilTagDetection> currentDetections = aprilTagDetectionPipeline.getLatestDetections();
|
ArrayList<AprilTagDetection> currentDetections = aprilTagDetectionPipeline.getLatestDetections();
|
||||||
if (currentDetections.size() != 0) {
|
if (currentDetections.size() != 0) {
|
||||||
detected_id = currentDetections.get(currentDetections.size() - 1).id;
|
detected_id = currentDetections.get(0).id;
|
||||||
telemetry.addData("Tag found", String.valueOf(detected_id));
|
telemetry.addData("Tag found", String.valueOf(detected_id));
|
||||||
telemetry.update();
|
telemetry.update();
|
||||||
}
|
}
|
||||||
|
@ -64,23 +64,23 @@ public class AutoCameraRight extends LinearOpMode {
|
||||||
switch (detected_id) {
|
switch (detected_id) {
|
||||||
case 1:
|
case 1:
|
||||||
movementAPI.move(90, 0.7);
|
movementAPI.move(90, 0.7);
|
||||||
api.pause(1);
|
api.pause(0.85);
|
||||||
movementAPI.move(0, 0.5);
|
movementAPI.move(0, 0.5);
|
||||||
api.pause(0.7);
|
api.pause(1.4);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
movementAPI.move(0, 0.5);
|
movementAPI.move(0, 0.5);
|
||||||
api.pause(0.7);
|
api.pause(1.4);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
movementAPI.move(-90, 0.7);
|
movementAPI.move(-90, 0.7);
|
||||||
api.pause(1);
|
api.pause(1.5);
|
||||||
movementAPI.move(0, 0.5);
|
movementAPI.move(0, 0.5);
|
||||||
api.pause(0.7);
|
api.pause(1.4);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
movementAPI.move(90, 0.5);
|
movementAPI.move(90, 0.5);
|
||||||
api.pause(0.75);
|
api.pause(1.5);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,11 @@ public class MovementAPI {
|
||||||
bl = api.opMode.hardwareMap.get(DcMotor.class, "rearLeft");
|
bl = api.opMode.hardwareMap.get(DcMotor.class, "rearLeft");
|
||||||
br = api.opMode.hardwareMap.get(DcMotor.class, "rearRight");
|
br = api.opMode.hardwareMap.get(DcMotor.class, "rearRight");
|
||||||
|
|
||||||
|
fl.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||||
|
fr.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||||
|
bl.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||||
|
br.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
|
||||||
|
|
||||||
fl.setDirection(DcMotor.Direction.REVERSE);
|
fl.setDirection(DcMotor.Direction.REVERSE);
|
||||||
bl.setDirection(DcMotor.Direction.REVERSE);
|
bl.setDirection(DcMotor.Direction.REVERSE);
|
||||||
fr.setDirection(DcMotor.Direction.FORWARD);
|
fr.setDirection(DcMotor.Direction.FORWARD);
|
||||||
|
|
Loading…
Reference in a new issue