Skip to content

Commit

Permalink
Update for new actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrott committed Jan 2, 2023
1 parent 2d9c57a commit d0b06e2
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 564 deletions.
261 changes: 0 additions & 261 deletions TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Action.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.firstinspires.ftc.teamcode;

import com.acmerobotics.dashboard.FtcDashboard;
import com.acmerobotics.dashboard.canvas.Canvas;
import com.acmerobotics.dashboard.telemetry.TelemetryPacket;
import com.acmerobotics.roadrunner.Action;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

public abstract class ActionOpMode extends LinearOpMode {
private final FtcDashboard dash = FtcDashboard.getInstance();

protected void runBlocking(Action a) {
Canvas c = new Canvas();
a.preview(c);

boolean b = true;
while (b && !isStopRequested()) {
TelemetryPacket p = new TelemetryPacket();
p.fieldOverlay().getOperations().addAll(c.getOperations());

b = a.run(p);

dash.sendTelemetryPacket(p);
}
}
}
Loading

0 comments on commit d0b06e2

Please sign in to comment.