forked from FIRST-Tech-Challenge/FtcRobotController
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutonomousopModeBlue.java
More file actions
54 lines (43 loc) · 1.64 KB
/
AutonomousopModeBlue.java
File metadata and controls
54 lines (43 loc) · 1.64 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package org.firstinspires.ftc.teamcode;
import org.firstinspires.ftc.teamcode.assemblies.Robot;
import org.firstinspires.ftc.teamcode.libs.teamUtil;
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
import com.qualcomm.robotcore.util.RobotLog;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.util.RobotLog;
import org.firstinspires.ftc.teamcode.assemblies.TwoWheelDrive;
@Disabled
@Autonomous(name="Autonomous Blue Carousel")
public class AutonomousopModeBlue extends LinearOpMode {
public static void log(String logString) {
RobotLog.d("19743LOG:" + Thread.currentThread().getStackTrace()[3].getMethodName() + ": " + logString);
}
Robot robot;
@Override
public void runOpMode() {
teamUtil.init(this);
teamUtil.alliance = teamUtil.Alliance.BLUE;
teamUtil.telemetry.addLine("Initializing Op Mode...please wait");
teamUtil.telemetry.update();
robot = new Robot();
robot.armsCalibrated =false;
robot.init(true);
robot.detector.initialize();
robot.detector.activate();
int lastDetection = 0;
int newDetection;
while (!opModeIsActive()) {
teamUtil.pause(250);
newDetection = robot.detector.carouselDetect();
if (newDetection > 0) {
lastDetection = newDetection;
}
telemetry.addData("Detection Value: ", lastDetection);
telemetry.update();
}
waitForStart();
//code for blue alliance
robot.doAuto(lastDetection);
}
}