You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/BasicOpMode_Iterative.java
Copy file name to clipboardExpand all lines: FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptAprilTag.java
+57-59Lines changed: 57 additions & 59 deletions
Original file line number
Diff line number
Diff line change
@@ -1,33 +1,33 @@
1
-
/* Copyright (c) 2023 FIRST. All rights reserved.
2
-
*
3
-
* Redistribution and use in source and binary forms, with or without modification,
4
-
* are permitted (subject to the limitations in the disclaimer below) provided that
5
-
* the following conditions are met:
6
-
*
7
-
* Redistributions of source code must retain the above copyright notice, this list
8
-
* of conditions and the following disclaimer.
9
-
*
10
-
* Redistributions in binary form must reproduce the above copyright notice, this
11
-
* list of conditions and the following disclaimer in the documentation and/or
12
-
* other materials provided with the distribution.
13
-
*
14
-
* Neither the name of FIRST nor the names of its contributors may be used to endorse or
15
-
* promote products derived from this software without specific prior written permission.
16
-
*
17
-
* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS
18
-
* LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
20
-
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copy file name to clipboardExpand all lines: FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptAprilTagEasy.java
+14-16Lines changed: 14 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -88,24 +88,22 @@ public void runOpMode() {
88
88
telemetry.update();
89
89
waitForStart();
90
90
91
-
if (opModeIsActive()) {
92
-
while (opModeIsActive()) {
91
+
while (opModeIsActive()) {
93
92
94
-
telemetryAprilTag();
93
+
telemetryAprilTag();
95
94
96
-
// Push telemetry to the Driver Station.
97
-
telemetry.update();
95
+
// Push telemetry to the Driver Station.
96
+
telemetry.update();
98
97
99
-
// Save CPU resources; can resume streaming when needed.
100
-
if (gamepad1.dpad_down) {
101
-
visionPortal.stopStreaming();
102
-
} elseif (gamepad1.dpad_up) {
103
-
visionPortal.resumeStreaming();
104
-
}
105
-
106
-
// Share the CPU.
107
-
sleep(20);
98
+
// Save CPU resources; can resume streaming when needed.
99
+
if (gamepad1.dpad_down) {
100
+
visionPortal.stopStreaming();
101
+
} elseif (gamepad1.dpad_up) {
102
+
visionPortal.resumeStreaming();
108
103
}
104
+
105
+
// Share the CPU.
106
+
sleep(20);
109
107
}
110
108
111
109
// Save more CPU resources when camera is no longer needed.
Copy file name to clipboardExpand all lines: FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptAprilTagSwitchableCameras.java
+18-20Lines changed: 18 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -81,27 +81,25 @@ public void runOpMode() {
81
81
telemetry.update();
82
82
waitForStart();
83
83
84
-
if (opModeIsActive()) {
85
-
while (opModeIsActive()) {
84
+
while (opModeIsActive()) {
86
85
87
-
telemetryCameraSwitching();
88
-
telemetryAprilTag();
86
+
telemetryCameraSwitching();
87
+
telemetryAprilTag();
89
88
90
-
// Push telemetry to the Driver Station.
91
-
telemetry.update();
89
+
// Push telemetry to the Driver Station.
90
+
telemetry.update();
92
91
93
-
// Save CPU resources; can resume streaming when needed.
94
-
if (gamepad1.dpad_down) {
95
-
visionPortal.stopStreaming();
96
-
} elseif (gamepad1.dpad_up) {
97
-
visionPortal.resumeStreaming();
98
-
}
92
+
// Save CPU resources; can resume streaming when needed.
93
+
if (gamepad1.dpad_down) {
94
+
visionPortal.stopStreaming();
95
+
} elseif (gamepad1.dpad_up) {
96
+
visionPortal.resumeStreaming();
97
+
}
99
98
100
-
doCameraSwitching();
99
+
doCameraSwitching();
101
100
102
-
// Share the CPU.
103
-
sleep(20);
104
-
}
101
+
// Share the CPU.
102
+
sleep(20);
105
103
}
106
104
107
105
// Save more CPU resources when camera is no longer needed.
Copy file name to clipboardExpand all lines: FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptGamepadEdgeDetection.java
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,22 @@ public void telemetryButtonData() {
83
83
telemetry.addData("Gamepad 1 Right Bumper Released", gamepad1.rightBumperWasReleased());
84
84
telemetry.addData("Gamepad 1 Right Bumper Status", gamepad1.right_bumper);
85
85
86
+
// Add an empty line to separate the buttons in telemetry
87
+
telemetry.addLine();
88
+
89
+
// Add the status of the Gamepad 1 Left trigger
90
+
telemetry.addData("Gamepad 1 Left Trigger Pressed", gamepad1.leftBumperWasPressed());
91
+
telemetry.addData("Gamepad 1 Left Trigger Released", gamepad1.leftBumperWasReleased());
92
+
telemetry.addData("Gamepad 1 Left Trigger Status", gamepad1.left_trigger);
93
+
94
+
// Add an empty line to separate the buttons in telemetry
95
+
telemetry.addLine();
96
+
97
+
// Add the status of the Gamepad 1 Right trigger
98
+
telemetry.addData("Gamepad 1 Right Trigger Pressed", gamepad1.rightBumperWasPressed());
99
+
telemetry.addData("Gamepad 1 Right Trigger Released", gamepad1.rightBumperWasReleased());
100
+
telemetry.addData("Gamepad 1 Right Trigger Status", gamepad1.right_trigger);
101
+
86
102
// Add a note that the telemetry is only updated every 2 seconds
87
103
telemetry.addLine("\nTelemetry is updated every 2 seconds.");
Copy file name to clipboardExpand all lines: FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptLEDStick.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ public void loop() {
87
87
telemetry.addLine("Hold the B button to turn red");
88
88
telemetry.addLine("Hold the left bumper to turn off");
89
89
telemetry.addLine("Use DPAD Up/Down to change brightness");
0 commit comments