Skip to content

Commit 4b3fe78

Browse files
author
ExultantExalted
committed
fixing testauto because im better -ryan ;)
1 parent c9578f9 commit 4b3fe78

File tree

2 files changed

+36
-32
lines changed

2 files changed

+36
-32
lines changed

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/TeleOp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void runOpMode() throws InterruptedException {
2828

2929

3030
while (!isStopRequested()) {
31-
drive.update(); // MUST be calld every loop cycle so that RoadRunner calculates the pose correctly
31+
drive.update(); // MUST be called every loop cycle so that RoadRunner calculates the pose correctly
3232
// Read pose
3333
Pose2d poseEstimate = drive.getPoseEstimate();
3434

@@ -57,7 +57,6 @@ public void runOpMode() throws InterruptedException {
5757
} else {
5858
// Close pixel hand servo
5959
}
60-
6160
if (gamepad1.right_bumper && gamepad1.left_bumper && getRuntime() >= 85) { // technically endgame is 90sec, we let them launch a little early just in case
6261
// Launch the airplane
6362
}
@@ -69,4 +68,5 @@ public void runOpMode() throws InterruptedException {
6968

7069

7170
}
71+
//deus pater omnipotens domine fili unigenite jesu christe domini domine deus agnus agnus dei filius agnus dei filius patris quitolis pecca tamundi misere renobis agunus quitolis pecca tamundi misere renobis suscipe deprecationemnostram quise des ad teram patris misere misere misere renobis
7272
}

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/opmode/TestAuto.java

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.firstinspires.ftc.teamcode.opmode;
22

3+
import android.util.Log;
4+
35
import com.acmerobotics.dashboard.config.Config;
46
import com.acmerobotics.roadrunner.geometry.Pose2d;
57
import com.acmerobotics.roadrunner.geometry.Vector2d;
@@ -47,7 +49,7 @@ public void runOpMode() throws InterruptedException {
4749

4850

4951
TensorFlowDetection tensor = new TensorFlowDetection(cameras[1].webcamName);
50-
android.util.Log.i("PROGRESS", "I did this!");
52+
Log.i("PROGRESS", "I did this!");
5153
// while (!isStopRequested()) {
5254
// tensor.getPropPosition();
5355
// android.util.Log.w("LOCATION", "tensor result " + tensor.getPropPosition());
@@ -57,23 +59,23 @@ public void runOpMode() throws InterruptedException {
5759
TensorFlowDetection.PropPosition tensorPos = tensor.getPropPosition();
5860

5961
// TensorFlowDetection.PropPosition tensorPos = TensorFlowDetection.PropPosition.LEFT;
60-
android.util.Log.i("PROGRESS", "Made it here");
61-
android.util.Log.i("PROGRESS", tensorPos + "");
62-
android.util.Log.i("PROGRESS", tensor.getPropPosition() + "");
62+
Log.i("PROGRESS", "Made it here");
63+
Log.i("PROGRESS", tensorPos + "");
64+
Log.i("PROGRESS", tensor.getPropPosition() + "");
6365

6466

6567
AprilTagLocalizer aprilTag = new AprilTagLocalizer(cameras);
6668
Pose2d startPose = null;
67-
android.util.Log.i("PROGRESS", "here?");
69+
Log.i("PROGRESS", "here?");
6870
while(opModeInInit() && !isStopRequested() && startPose == null) {
69-
android.util.Log.i("PROGRESS", "before");
71+
Log.i("PROGRESS", "before");
7072
startPose = estimateWithAllCameras(cameras, aprilTag);
71-
android.util.Log.i("PROGRESS", "after");
73+
Log.i("PROGRESS", "after");
7274
}
73-
android.util.Log.i("PROGRESS", "Maybe?");
75+
Log.i("PROGRESS", "Maybe?");
7476
if (startPose == null) {
7577
// Check one more time
76-
android.util.Log.w("APRILTAG", "Did not find AprilTag in init, trying again");
78+
Log.w("APRILTAG", "Did not find AprilTag in init, trying again");
7779
startPose = estimateWithAllCameras(cameras, aprilTag);
7880
}
7981

@@ -82,11 +84,11 @@ public void runOpMode() throws InterruptedException {
8284
//startPose = new Pose2d(0, 0, 0);
8385
throw new RuntimeException("Could not find AprilTag to determine start pose");
8486
}
85-
android.util.Log.i("PROGRESS", "may as well check");
87+
Log.i("PROGRESS", "may as well check");
8688
TrajectorySequence traj = null;
8789

8890
drive.setPoseEstimate(startPose);
89-
android.util.Log.i("PROGRESS", "Im here too!");
91+
Log.i("PROGRESS", "Im here too!");
9092

9193

9294
switch (AprilTagLocalizer.whichQuadrant(startPose)) {
@@ -118,7 +120,7 @@ public void runOpMode() throws InterruptedException {
118120
.turn(Math.toRadians(-90))
119121
.addTemporalMarker(() ->{
120122
//ARM DROPS PIXEL
121-
android.util.Log.i("DROP", "drop");
123+
Log.i("DROP", "drop");
122124
})
123125
.lineTo(new Vector2d(startPose.getX(), startPose.getY()))
124126
.splineToSplineHeading(new Pose2d(3 * 12 + 5, -3 * 12, 0), 0)
@@ -130,7 +132,7 @@ public void runOpMode() throws InterruptedException {
130132
.lineTo(new Vector2d(16, -36))
131133
.addTemporalMarker(() -> {
132134
//ARM DROPS PIXEL
133-
android.util.Log.i("DROP", "drop");
135+
Log.i("DROP", "drop");
134136

135137
})
136138
.turn(Math.toRadians(90))
@@ -150,7 +152,7 @@ public void runOpMode() throws InterruptedException {
150152
.addTemporalMarker(() -> {
151153
//PIXEL DROP
152154

153-
android.util.Log.i("DROP", "drop");
155+
Log.i("DROP", "drop");
154156

155157
})
156158
.waitSeconds(1)
@@ -168,7 +170,7 @@ public void runOpMode() throws InterruptedException {
168170
.turn(Math.toRadians(-90))
169171
.addDisplacementMarker(() -> {
170172
//PIXEL DROP
171-
android.util.Log.i("DROP", "drop");
173+
Log.i("DROP", "drop");
172174
})
173175
.lineTo(new Vector2d(startPose.getX(), startPose.getY()))
174176
//.splineToSplineHeading(new Pose2d(3*12 + 5, -3*12, 0), 0)
@@ -181,7 +183,7 @@ public void runOpMode() throws InterruptedException {
181183
.lineTo(new Vector2d(startPose.getX(), -3 * 12 + 2)) // drive forward to prevent the spline from cutting through the poles
182184
.addTemporalMarker(() -> {
183185
//PIXEL DROP
184-
android.util.Log.i("DROP", "drop");
186+
Log.i("DROP", "drop");
185187
})
186188
.turn(Math.toRadians(90))
187189
//.splineToSplineHeading(new Pose2d(3*12 + 5, -3*12, 0), 0)
@@ -197,9 +199,9 @@ public void runOpMode() throws InterruptedException {
197199
traj = drive.trajectorySequenceBuilder(startPose)
198200
.lineTo(new Vector2d(startPose.getX(), 3*12-2))
199201
.turn(Math.toRadians(90))
200-
.addDisplacementMarker(()->{
202+
.addTemporalMarker(()->{
201203
//PIXEL DROP
202-
android.util.Log.i("ARM", "drop");
204+
Log.i("ARM", "drop");
203205
})
204206
.lineToSplineHeading(new Pose2d(2 * 12, 3 * 12 + 2, Math.toRadians(90)))
205207
.lineToSplineHeading(new Pose2d(3 * 12 + 5, 3 * 12 + 2, 0))
@@ -211,10 +213,11 @@ public void runOpMode() throws InterruptedException {
211213
traj = drive.trajectorySequenceBuilder(startPose)
212214
.lineTo(new Vector2d(startPose.getX(), 3*12-2))
213215
.turn(Math.toRadians(-90))
214-
.addDisplacementMarker(()->{
216+
.addTemporalMarker(()->{
215217
//PIXEL DROP
216-
android.util.Log.i("DROP", "drop");
218+
Log.i("DROP", "drop");
217219
})
220+
.lineTo(new Vector2d(startPose.getX(),startPose.getY()))
218221
.turn(Math.toRadians(180))
219222
.lineToSplineHeading(new Pose2d(2 * 12, 3 * 12 + 2, Math.toRadians(90)))
220223
.lineToSplineHeading(new Pose2d(3 * 12 + 5, 3 * 12 + 2, 0))
@@ -223,10 +226,10 @@ public void runOpMode() throws InterruptedException {
223226
case CENTER:
224227
traj = drive.trajectorySequenceBuilder(startPose)
225228
.lineTo(new Vector2d(startPose.getX(), 3*12-2))
226-
.addDisplacementMarker(()->{
229+
.addTemporalMarker(()->{
227230
//PIXEL DROP
228231
//wait(200);
229-
android.util.Log.i("DROP", "drop");
232+
Log.i("DROP", "drop");
230233
})
231234
.turn(Math.toRadians(90))
232235
.lineToSplineHeading(new Pose2d(2 * 12, 3 * 12 + 2, Math.toRadians(90)))
@@ -245,9 +248,9 @@ public void runOpMode() throws InterruptedException {
245248
traj = drive.trajectorySequenceBuilder(startPose)
246249
.lineTo(new Vector2d(startPose.getX(), 36))
247250
.turn(Math.toRadians(90))
248-
.addDisplacementMarker(()->{
251+
.addTemporalMarker(()->{
249252
//PIXEL DROP
250-
android.util.Log.i("DROP", "drop");
253+
Log.i("DROP", "drop");
251254
})
252255

253256
.splineToSplineHeading(new Pose2d(3 * 12 + 5, 3 * 12, 0), 0)
@@ -257,10 +260,11 @@ public void runOpMode() throws InterruptedException {
257260
traj = drive.trajectorySequenceBuilder(startPose)
258261
.lineTo(new Vector2d(startPose.getX(), 36))
259262
.turn(Math.toRadians(-90))
260-
.addDisplacementMarker(()->{
263+
.addTemporalMarker(()->{
261264
//PIXEL DROP
262-
android.util.Log.i("DROP", "drop");
265+
Log.i("DROP", "drop");
263266
})
267+
.lineTo(new Vector2d(startPose.getX(),startPose.getY()))
264268
.turn(Math.toRadians(180))
265269
.splineToSplineHeading(new Pose2d(3 * 12 + 5, 3 * 12, 0), 0)
266270
.build();
@@ -269,9 +273,9 @@ public void runOpMode() throws InterruptedException {
269273
traj = drive.trajectorySequenceBuilder(startPose)
270274
.lineTo(new Vector2d(startPose.getX(), 36))
271275

272-
.addDisplacementMarker(()->{
276+
.addTemporalMarker(()->{
273277
//PIXEL DROP
274-
android.util.Log.i("DROP", "drop");
278+
Log.i("DROP", "drop");
275279
})
276280
.turn(Math.toRadians(90))
277281
.splineToSplineHeading(new Pose2d(3 * 12 + 5, 3 * 12, 0), 0)
@@ -280,15 +284,15 @@ public void runOpMode() throws InterruptedException {
280284
}
281285
break;
282286
}
283-
android.util.Log.i("PROGRESS", "I got here???");
287+
Log.i("PROGRESS", "I got here???");
284288
waitForStart();
285289

286290
if (!isStopRequested())
287291
drive.followTrajectorySequence(traj);
288292

289293
//aprilTag.centerOnTag(cameras[1], drive, 5);
290294

291-
android.util.Log.i("PROGRESS", "whatttttt");
295+
Log.i("PROGRESS", "whatttttt");
292296
}
293297
}
294298

0 commit comments

Comments
 (0)