Skip to content

Commit

Permalink
Better spline test
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrott committed Dec 24, 2023
1 parent a890105 commit a01ac85
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,26 @@
public final class SplineTest extends LinearOpMode {
@Override
public void runOpMode() throws InterruptedException {
Pose2d beginPose = new Pose2d(0, 0, 0);
if (TuningOpModes.DRIVE_CLASS.equals(MecanumDrive.class)) {
MecanumDrive drive = new MecanumDrive(hardwareMap, new Pose2d(0, 0, 0));
MecanumDrive drive = new MecanumDrive(hardwareMap, beginPose);

waitForStart();

Actions.runBlocking(
drive.actionBuilder(drive.pose)
drive.actionBuilder(beginPose)
.splineTo(new Vector2d(30, 30), Math.PI / 2)
.splineTo(new Vector2d(60, 0), Math.PI)
.splineTo(new Vector2d(0, 60), Math.PI)
.build());
} else if (TuningOpModes.DRIVE_CLASS.equals(TankDrive.class)) {
TankDrive drive = new TankDrive(hardwareMap, new Pose2d(0, 0, 0));
TankDrive drive = new TankDrive(hardwareMap, beginPose);

waitForStart();

Actions.runBlocking(
drive.actionBuilder(drive.pose)
drive.actionBuilder(beginPose)
.splineTo(new Vector2d(30, 30), Math.PI / 2)
.splineTo(new Vector2d(60, 0), Math.PI)
.splineTo(new Vector2d(0, 60), Math.PI)
.build());
} else {
throw new RuntimeException();
Expand Down

0 comments on commit a01ac85

Please sign in to comment.