Skip to content

Commit af3205a

Browse files
committed
fix the robot comicsain
1 parent 9a33acf commit af3205a

37 files changed

Lines changed: 488 additions & 485 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 203c2d373765f0c66d121e3ec1cc3a18835f6534

FtcRobotController/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ android {
1717
buildFeatures {
1818
buildConfig = true
1919
}
20-
compileSdk 34
21-
//noinspection GradleDependency
20+
21+
compileSdkVersion 30
2222

2323
compileOptions {
2424
sourceCompatibility JavaVersion.VERSION_1_8

FtcRobotController/src/main/AndroidManifest.xml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
android:versionCode="60"
5-
android:versionName="11.0">
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:versionCode="61"
5+
android:versionName="11.1">
66

77
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
88

99
<application
10-
android:allowBackup="true"
11-
android:largeHeap="true"
12-
android:icon="@drawable/ic_launcher"
13-
android:label="@string/app_name"
14-
android:theme="@style/AppThemeRedRC"
15-
android:usesCleartextTraffic="true">
10+
android:allowBackup="true"
11+
android:largeHeap="true"
12+
android:icon="@drawable/ic_launcher"
13+
android:label="@string/app_name"
14+
android:theme="@style/AppThemeRedRC"
15+
android:usesCleartextTraffic="true">
1616

1717
<!-- Indicates to the ControlHubUpdater what the latest version of the Control Hub is that this app supports -->
1818
<meta-data
@@ -21,10 +21,10 @@
2121

2222
<!-- The main robot controller activity -->
2323
<activity android:name="org.firstinspires.ftc.robotcontroller.internal.PermissionValidatorWrapper"
24-
android:screenOrientation="fullUser"
25-
android:configChanges="orientation|screenSize"
26-
android:label="@string/app_name"
27-
android:launchMode="singleTask" >
24+
android:screenOrientation="fullUser"
25+
android:configChanges="orientation|screenSize"
26+
android:label="@string/app_name"
27+
android:launchMode="singleTask" >
2828

2929
<intent-filter>
3030
<category android:name="android.intent.category.LAUNCHER" />
@@ -34,19 +34,19 @@
3434
</activity>
3535

3636
<activity
37-
android:name="org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity"
38-
android:screenOrientation="fullUser"
39-
android:configChanges="orientation|screenSize"
40-
android:label="@string/app_name"
41-
android:launchMode="singleTask" >
37+
android:name="org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity"
38+
android:screenOrientation="fullUser"
39+
android:configChanges="orientation|screenSize"
40+
android:label="@string/app_name"
41+
android:launchMode="singleTask" >
4242

4343
<intent-filter>
4444
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
4545
</intent-filter>
4646

4747
<meta-data
48-
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
49-
android:resource="@xml/device_filter" />
48+
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
49+
android:resource="@xml/device_filter" />
5050

5151
<!--org.firstinspires.main.entry indicates that this app is compatible with the Dragonboard Control Hub-->
5252
<meta-data
@@ -56,16 +56,16 @@
5656

5757
<!-- The robot controller service in which most of the robot functionality is managed -->
5858
<service
59-
android:name="com.qualcomm.ftccommon.FtcRobotControllerService"
60-
android:enabled="true" />
59+
android:name="com.qualcomm.ftccommon.FtcRobotControllerService"
60+
android:enabled="true" />
6161

6262

6363
<!-- Assistant that autostarts the robot controller on android boot (if it's supposed to) -->
6464
<receiver
65-
android:enabled="true"
66-
android:exported="true"
67-
android:name="org.firstinspires.ftc.ftccommon.internal.RunOnBoot"
68-
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
65+
android:enabled="true"
66+
android:exported="true"
67+
android:name="org.firstinspires.ftc.ftccommon.internal.RunOnBoot"
68+
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
6969

7070
<intent-filter>
7171
<category android:name="android.intent.category.DEFAULT" />

FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/BasicOpMode_Iterative.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,4 @@ public void stop() {
138138
}
139139

140140
}
141+

FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptAprilTag.java

Lines changed: 57 additions & 59 deletions
Original file line numberDiff line numberDiff 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.
28-
*/
29-
30-
package org.firstinspires.ftc.robotcontroller.external.samples;
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.
28+
*/
29+
30+
package org.firstinspires.ftc.robotcontroller.external.samples;
3131

3232
import android.util.Size;
3333
import com.qualcomm.robotcore.eventloop.opmode.Disabled;
@@ -92,24 +92,22 @@ public void runOpMode() {
9292
telemetry.update();
9393
waitForStart();
9494

95-
if (opModeIsActive()) {
96-
while (opModeIsActive()) {
95+
while (opModeIsActive()) {
9796

98-
telemetryAprilTag();
97+
telemetryAprilTag();
9998

100-
// Push telemetry to the Driver Station.
101-
telemetry.update();
99+
// Push telemetry to the Driver Station.
100+
telemetry.update();
102101

103-
// Save CPU resources; can resume streaming when needed.
104-
if (gamepad1.dpad_down) {
105-
visionPortal.stopStreaming();
106-
} else if (gamepad1.dpad_up) {
107-
visionPortal.resumeStreaming();
108-
}
109-
110-
// Share the CPU.
111-
sleep(20);
102+
// Save CPU resources; can resume streaming when needed.
103+
if (gamepad1.dpad_down) {
104+
visionPortal.stopStreaming();
105+
} else if (gamepad1.dpad_up) {
106+
visionPortal.resumeStreaming();
112107
}
108+
109+
// Share the CPU.
110+
sleep(20);
113111
}
114112

115113
// Save more CPU resources when camera is no longer needed.
@@ -125,21 +123,21 @@ private void initAprilTag() {
125123
// Create the AprilTag processor.
126124
aprilTag = new AprilTagProcessor.Builder()
127125

128-
// The following default settings are available to un-comment and edit as needed.
129-
//.setDrawAxes(false)
130-
//.setDrawCubeProjection(false)
131-
//.setDrawTagOutline(true)
132-
//.setTagFamily(AprilTagProcessor.TagFamily.TAG_36h11)
133-
//.setTagLibrary(AprilTagGameDatabase.getCenterStageTagLibrary())
134-
//.setOutputUnits(DistanceUnit.INCH, AngleUnit.DEGREES)
135-
136-
// == CAMERA CALIBRATION ==
137-
// If you do not manually specify calibration parameters, the SDK will attempt
138-
// to load a predefined calibration for your camera.
139-
//.setLensIntrinsics(578.272, 578.272, 402.145, 221.506)
140-
// ... these parameters are fx, fy, cx, cy.
141-
142-
.build();
126+
// The following default settings are available to un-comment and edit as needed.
127+
//.setDrawAxes(false)
128+
//.setDrawCubeProjection(false)
129+
//.setDrawTagOutline(true)
130+
//.setTagFamily(AprilTagProcessor.TagFamily.TAG_36h11)
131+
//.setTagLibrary(AprilTagGameDatabase.getCenterStageTagLibrary())
132+
//.setOutputUnits(DistanceUnit.INCH, AngleUnit.DEGREES)
133+
134+
// == CAMERA CALIBRATION ==
135+
// If you do not manually specify calibration parameters, the SDK will attempt
136+
// to load a predefined calibration for your camera.
137+
//.setLensIntrinsics(578.272, 578.272, 402.145, 221.506)
138+
// ... these parameters are fx, fy, cx, cy.
139+
140+
.build();
143141

144142
// Adjust Image Decimation to trade-off detection-range for detection-rate.
145143
// eg: Some typical detection data using a Logitech C920 WebCam

FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptAprilTagEasy.java

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,22 @@ public void runOpMode() {
8888
telemetry.update();
8989
waitForStart();
9090

91-
if (opModeIsActive()) {
92-
while (opModeIsActive()) {
91+
while (opModeIsActive()) {
9392

94-
telemetryAprilTag();
93+
telemetryAprilTag();
9594

96-
// Push telemetry to the Driver Station.
97-
telemetry.update();
95+
// Push telemetry to the Driver Station.
96+
telemetry.update();
9897

99-
// Save CPU resources; can resume streaming when needed.
100-
if (gamepad1.dpad_down) {
101-
visionPortal.stopStreaming();
102-
} else if (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+
} else if (gamepad1.dpad_up) {
102+
visionPortal.resumeStreaming();
108103
}
104+
105+
// Share the CPU.
106+
sleep(20);
109107
}
110108

111109
// Save more CPU resources when camera is no longer needed.
@@ -124,10 +122,10 @@ private void initAprilTag() {
124122
// Create the vision portal the easy way.
125123
if (USE_WEBCAM) {
126124
visionPortal = VisionPortal.easyCreateWithDefaults(
127-
hardwareMap.get(WebcamName.class, "Webcam 1"), aprilTag);
125+
hardwareMap.get(WebcamName.class, "Webcam 1"), aprilTag);
128126
} else {
129127
visionPortal = VisionPortal.easyCreateWithDefaults(
130-
BuiltinCameraDirection.BACK, aprilTag);
128+
BuiltinCameraDirection.BACK, aprilTag);
131129
}
132130

133131
} // end method initAprilTag()

FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptAprilTagSwitchableCameras.java

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,27 +81,25 @@ public void runOpMode() {
8181
telemetry.update();
8282
waitForStart();
8383

84-
if (opModeIsActive()) {
85-
while (opModeIsActive()) {
84+
while (opModeIsActive()) {
8685

87-
telemetryCameraSwitching();
88-
telemetryAprilTag();
86+
telemetryCameraSwitching();
87+
telemetryAprilTag();
8988

90-
// Push telemetry to the Driver Station.
91-
telemetry.update();
89+
// Push telemetry to the Driver Station.
90+
telemetry.update();
9291

93-
// Save CPU resources; can resume streaming when needed.
94-
if (gamepad1.dpad_down) {
95-
visionPortal.stopStreaming();
96-
} else if (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+
} else if (gamepad1.dpad_up) {
96+
visionPortal.resumeStreaming();
97+
}
9998

100-
doCameraSwitching();
99+
doCameraSwitching();
101100

102-
// Share the CPU.
103-
sleep(20);
104-
}
101+
// Share the CPU.
102+
sleep(20);
105103
}
106104

107105
// Save more CPU resources when camera is no longer needed.
@@ -120,13 +118,13 @@ private void initAprilTag() {
120118
webcam1 = hardwareMap.get(WebcamName.class, "Webcam 1");
121119
webcam2 = hardwareMap.get(WebcamName.class, "Webcam 2");
122120
CameraName switchableCamera = ClassFactory.getInstance()
123-
.getCameraManager().nameForSwitchableCamera(webcam1, webcam2);
121+
.getCameraManager().nameForSwitchableCamera(webcam1, webcam2);
124122

125123
// Create the vision portal by using a builder.
126124
visionPortal = new VisionPortal.Builder()
127-
.setCamera(switchableCamera)
128-
.addProcessor(aprilTag)
129-
.build();
125+
.setCamera(switchableCamera)
126+
.addProcessor(aprilTag)
127+
.build();
130128

131129
} // end method initAprilTag()
132130

FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptGamepadEdgeDetection.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,22 @@ public void telemetryButtonData() {
8383
telemetry.addData("Gamepad 1 Right Bumper Released", gamepad1.rightBumperWasReleased());
8484
telemetry.addData("Gamepad 1 Right Bumper Status", gamepad1.right_bumper);
8585

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+
86102
// Add a note that the telemetry is only updated every 2 seconds
87103
telemetry.addLine("\nTelemetry is updated every 2 seconds.");
88104

FtcRobotController/src/main/java/org/firstinspires/ftc/robotcontroller/external/samples/ConceptLEDStick.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public void loop() {
8787
telemetry.addLine("Hold the B button to turn red");
8888
telemetry.addLine("Hold the left bumper to turn off");
8989
telemetry.addLine("Use DPAD Up/Down to change brightness");
90-
90+
9191
if (getRuntime() > END_GAME_TIME) {
9292
int[] ledColors = {Color.RED, Color.YELLOW, Color.RED, Color.YELLOW, Color.RED,
9393
Color.YELLOW, Color.RED, Color.YELLOW, Color.RED, Color.YELLOW};

0 commit comments

Comments
 (0)